Implement TextureClient recycle for MediaDecoder

RESOLVED DUPLICATE of bug 1135935

Status

()

defect
RESOLVED DUPLICATE of bug 1135935
5 years ago
4 years ago

People

(Reporter: sotaro, Assigned: sotaro)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

VideoData::Create() almost always allocates new TextureClient via PlanarYCbCrImage class except OMXCodec case in b2g gonk. It is expensive operation. It seem better to recycle TextureClient than creating new TextureClient.

Like bug 985772, TextureClient's recycling mechanism is going to be used other places. It might be better to use same mechanism.
cpearce, nical, is there already some recycle implementation?
Flags: needinfo?(nical.bugzilla)
Flags: needinfo?(cpearce)
Depends on: 988954
(In reply to Sotaro Ikeda [:sotaro] from comment #1)
> cpearce, nical, is there already some recycle implementation?

There is TextureClientPool here: http://dxr.mozilla.org/mozilla-central/source/gfx/layers/client/TextureClientPool.h#21

We have a pool per surface format in each LayerManagerComposite. At the moment it's always used on the main thread so if you reuse it you may have to make it thread-safe (if it is not).
Flags: needinfo?(nical.bugzilla)
Flags: needinfo?(cpearce)
(In reply to Nicolas Silva [:nical] from comment #2)
> 
> We have a pool per surface format in each LayerManagerComposite. At the
> moment it's always used on the main thread so if you reuse it you may have
> to make it thread-safe (if it is not).

Is there a reason why using pools per surface format? For MediaDecoder, it seems not necessary.
Flags: needinfo?(nical.bugzilla)
(In reply to Sotaro Ikeda [:sotaro] from comment #3)
> (In reply to Nicolas Silva [:nical] from comment #2)
> > 
> > We have a pool per surface format in each LayerManagerComposite. At the
> > moment it's always used on the main thread so if you reuse it you may have
> > to make it thread-safe (if it is not).
> 
> Is there a reason why using pools per surface format? For MediaDecoder, it
> seems not necessary.

ClientLayerManager has a pool per surface format because it has to deal with several formats, but if you want to use a TextureClientPool with MediaDecoder, nothing forces you to have a pool per format. The TextureClientPool itself just stores its format to make sure we don't mix formats in a given pool, but it doesn't force you to have several pool. Or maybe I misunderstood the question.
Flags: needinfo?(nical.bugzilla)
Depends on: 984434
No longer depends on: 988954
Assignee: nobody → sotaro.ikeda.g
Component: Audio/Video → Graphics
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1135935
You need to log in before you can comment on or make changes to this bug.