Closed Bug 1213764 Opened 9 years ago Closed 8 years ago

Hide internal thread model of MediaDecoderReader from its client code

Categories

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

defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jwwang, Unassigned)

References

Details

MediaDecoderReader::OwnerThread() should be made protected or private so that the client code doesn't know too much about its internal thread model.
IIRC, there are methods in the PDMs that uses MediaDecoderReader::OwnerThread() in order to get access to a non-flushable task queue (as you can't use promises with flushable task queues). I believe that the main reason for this is because you can't create a MozTaskQueue outside of the main thread ; and that's only because the MozTaskQueue constructor access a preference to find out the default number of threads to use.
Can you point me to the code?
We can make DecoderCallback a friend of MediaFormatReader because they are tightly coupled. So OnTaskQueue() doesn't need to be exposed from MediaDecoderReader.
Btw, I just found out: MediaCodecReader::AsyncReadMetadata -> MediaCodecReader::ReallocateExtractorResources -> MediaCodecReader::CreateTaskQueues -> CreateMediaDecodeTaskQueue -> GetMediaThreadPool would access pref off the main thread. However, B2G allows you to access pref off the main thread. This inconsistency is bad and obscure the code.
Depends on: 1214073
Depends on: 1214074
Priority: -- → P2
Depends on: 1214498
Depends on: 1215003
Depends on: 1215439
Depends on: 1216029
Depends on: 1216034
Depends on: 1216850
This is already done by MediaDecoderReaderWrapper.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.