Closed Bug 959440 Opened 6 years ago Closed 6 years ago

MP4Reader cleanup


(Core :: Audio/Video, defect)

Not set





(Reporter: cpearce, Assigned: cpearce)



(2 files)

I want to cleanup MP4Reader a bit to make code more usable, before we start implementing lots of PlatformDecoderModules for it.
Attached patch PatchSplinter Review
* Change PlatformDecoderModule::Create*Decoder() to take an mp4_demuxer::{Audio,Video}DecoderConfig parameter, instead of enumerating all parameters. This means the platform decoders can have more data if need be, like the AACAudioConfig.
* Change MediaDataDecoder::Input() to take an nsAutoPtr<MP4Sample>&. The sample will be deleted by the caller (MP4Reader) if Input() returns DECODE_STATUS_OK, but if the MediaDataDecoder wants to assume responsibility of the lifecycle of the sample (say to enqueue it), it can forget() on the nsAutoPtr& passed in and assume responsibility.
* Call PlatformDecoderModule::Create() on the decode thread. This is a step towards making these classes decode-thread only.
* Add PlatformDecoderModule::Init(), which caches the pref's we need, since PlatformDecoderModule::Create() is no longer called on the main thread, we can no longer access them in there.
* Add Init() method to MediaDataDecoder interface. This is so that we can call MediaDataDecoder::Shutdown() to unblock the initialization of a decoder, if that init needs to block.
* Pass LayersBackend type to WMFVideoDecoder, so it knows whether to init DXVA.
Attachment #8359556 - Flags: review?(kinetik)
The previous patch changed the PlatformDecoderModule interface, so the WMF implementation must be updated to match.
Attachment #8359562 - Flags: review?(padenot)
Attachment #8359562 - Flags: review?(padenot) → review+
Attachment #8359556 - Flags: review?(kinetik) → review+
Backed out in because b2g had this error:

   Creating library xul.lib and object xul.exp

MP4Reader.obj : error LNK2019: unresolved external symbol "public: bool __thiscall mp4_demuxer::MP4Demuxer::Demux(class nsAutoPtr<class mp4_demuxer::MP4Sample> *,bool *)" (?Demux@MP4Demuxer@mp4_demuxer@@QAE_NPAV?$nsAutoPtr@VMP4Sample@mp4_demuxer@@@@PA_N@Z) referenced in function "private: struct mp4_demuxer::MP4Sample * __thiscall mozilla::MP4Reader::PopSample(enum mp4_demuxer::TrackType)" (?PopSample@MP4Reader@mozilla@@AAEPAUMP4Sample@mp4_demuxer@@W4TrackType@4@@Z)

xul.dll : fatal error LNK1120: 1 unresolved externals
Oops, I predeclared mp4_demuxer::MP4Sample as a class in PlatformDecoderModule.h, but it's a struct so the name mangling meant it was trying to call a function that didn't exist. D'oh!
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.