Bug 1329386 - Fallback to WMF decoding if the OOP decoder fails. r=jya, a=jcristau
authorMatt Woodrow <mwoodrow@mozilla.com>
Thu, 19 Jan 2017 12:52:49 +1300
changeset 366585 d626dac2573064ab9723b23ddbe7dfb74feb7beb
parent 366584 89e4f1010091f089eeeaa6a591c0d67fcf7cf4d4
child 366586 9c822f8fbd6528a2e566a8c678d5540ed793c512
push id6805
push userryanvm@gmail.com
push dateTue, 24 Jan 2017 05:52:45 +0000
treeherdermozilla-beta@1522cb56a651 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya, jcristau
bugs1329386
milestone52.0
Bug 1329386 - Fallback to WMF decoding if the OOP decoder fails. r=jya, a=jcristau
dom/media/ipc/RemoteVideoDecoder.cpp
dom/media/platforms/PlatformDecoderModule.h
--- a/dom/media/ipc/RemoteVideoDecoder.cpp
+++ b/dom/media/ipc/RemoteVideoDecoder.cpp
@@ -150,17 +150,17 @@ RemoteDecoderModule::DecoderNeedsConvers
 }
 
 already_AddRefed<MediaDataDecoder>
 RemoteDecoderModule::CreateVideoDecoder(const CreateDecoderParams& aParams)
 {
   if (!MediaPrefs::PDMUseGPUDecoder() ||
       !aParams.mKnowsCompositor ||
       aParams.mKnowsCompositor->GetTextureFactoryIdentifier().mParentProcessType != GeckoProcessType_GPU) {
-    return nullptr;
+    return mWrapped->CreateVideoDecoder(aParams);
   }
 
   MediaDataDecoderCallback* callback = aParams.mCallback;
   MOZ_ASSERT(callback->OnReaderTaskQueue());
   RefPtr<RemoteVideoDecoder> object = new RemoteVideoDecoder(callback);
 
   VideoInfo info = aParams.VideoConfig();
 
--- a/dom/media/platforms/PlatformDecoderModule.h
+++ b/dom/media/platforms/PlatformDecoderModule.h
@@ -24,16 +24,20 @@ class AudioInfo;
 class VideoInfo;
 class MediaRawData;
 class DecoderDoctorDiagnostics;
 
 namespace layers {
 class ImageContainer;
 } // namespace layers
 
+namespace dom {
+class RemoteDecoderModule;
+}
+
 class MediaDataDecoder;
 class MediaDataDecoderCallback;
 class TaskQueue;
 class CDMProxy;
 
 static LazyLogModule sPDMLog("PlatformDecoderModule");
 
 struct MOZ_STACK_CLASS CreateDecoderParams final {
@@ -140,16 +144,17 @@ public:
   virtual ConversionRequired DecoderNeedsConversion(const TrackInfo& aConfig) const = 0;
 
 protected:
   PlatformDecoderModule() {}
   virtual ~PlatformDecoderModule() {}
 
   friend class H264Converter;
   friend class PDMFactory;
+  friend class dom::RemoteDecoderModule;
 
   // Creates a Video decoder. The layers backend is passed in so that
   // decoders can determine whether hardware accelerated decoding can be used.
   // Asynchronous decoding of video should be done in runnables dispatched
   // to aVideoTaskQueue. If the task queue isn't needed, the decoder should
   // not hold a reference to it.
   // Output and errors should be returned to the reader via aCallback.
   // On Windows the task queue's threads in have MSCOM initialized with