Closed Bug 1484242 Opened Last year Closed Last year

Limit the number of simultaneously active decoders when using MediaCapabilities

Categories

(Core :: Audio/Video: Playback, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: jya, Assigned: jya)

References

Details

Attachments

(3 files, 1 obsolete file)

Each request to MediaCapabilities.decodingInfo will potentially create a decoder in order to determine if the video is hardware accelerated or not.

On Android, where the device could have a set number of decoders active, it may cause some problems.

We should limit the number of active decoders, potentially serialising all the request.
We extract the GlobalAllocationPolicy and the MediaDataDecoder wrapper from MediaFormatReader.

They will be used to create a new wrapping class that will serialize allocation and initalization of decoders if the platform requires it.
We also makes mTaskQueue and mImageContainer members a RefPtr to prevent invalid use where those members could be destroyed before they were used.

Depends on D3676
This method will allocate a decoder according to the GlobalAllocPolicy. On Android API 18 and lower, there can only be a single decoder created at a time. The promise returned by CreateDecoder will only be resolved once the allocation policy permits a new decoder to be created.

Depends on D3677
This ensures on platform that requires it, that only a single decoder at a time are used, in effect serialising all the MediaCapabilities.decodingInfo requests.

Depends on D3678
Attachment #9002149 - Attachment is obsolete: true
Attachment #9002150 - Attachment description: Bug 1484242 - P3. Add AllocationWrapper::CreateDecoder convenience method. r?bryce → Bug 1484242 - P2. Add AllocationWrapper::CreateDecoder convenience method. r?bryce
Attachment #9002151 - Attachment description: Bug 1484242 - P4. Have MediaCapablities use GlobalAllocPolicy for creating decoders. r?bryce → Bug 1484242 - P3. Have MediaCapablities use GlobalAllocPolicy for creating decoders. r?bryce
Comment on attachment 9002148 [details]
Bug 1484242 - P1. Add AllocationPolicy objects. r?bryce

Bryce Seager van Dyk (:bryce) has approved the revision.
Attachment #9002148 - Flags: review+
Comment on attachment 9002150 [details]
Bug 1484242 - P2. Add AllocationWrapper::CreateDecoder convenience method. r?bryce

Bryce Seager van Dyk (:bryce) has approved the revision.
Attachment #9002150 - Flags: review+
Comment on attachment 9002151 [details]
Bug 1484242 - P3. Have MediaCapablities use GlobalAllocPolicy for creating decoders. r?bryce

Bryce Seager van Dyk (:bryce) has approved the revision.
Attachment #9002151 - Flags: review+
Rank: 10
Priority: -- → P2
Pushed by jyavenard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/80e04deb3282
P1. Add AllocationPolicy objects. r=bryce
https://hg.mozilla.org/integration/mozilla-inbound/rev/114dacc6e603
P2. Add AllocationWrapper::CreateDecoder convenience method. r=bryce
https://hg.mozilla.org/integration/mozilla-inbound/rev/5b802b94d59f
P3. Have MediaCapablities use GlobalAllocPolicy for creating decoders. r=bryce
Depends on: 1485362
No longer depends on: 1485362
You need to log in before you can comment on or make changes to this bug.