Don't use out-of-process video decoding with software compositors. (bug 1356448, r=mattwoodrow)
authorDavid Anderson <danderson@mozilla.com>
Wed, 17 May 2017 00:40:56 -0700
changeset 358812 dc9185b73e07845edddb739aee16996e0de49d99
parent 358811 2c4621d09ea9fbf7fc8174876ada1498ae2447b0
child 358813 87e95e385f235f49e634dd6fb0db295ac80fa3a6
push id31839
push userkwierso@gmail.com
push dateWed, 17 May 2017 21:55:52 +0000
treeherdermozilla-central@2c783a7b6d05 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1356448
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Don't use out-of-process video decoding with software compositors. (bug 1356448, r=mattwoodrow)
dom/media/ipc/RemoteVideoDecoder.cpp
--- a/dom/media/ipc/RemoteVideoDecoder.cpp
+++ b/dom/media/ipc/RemoteVideoDecoder.cpp
@@ -133,22 +133,31 @@ RemoteDecoderModule::SupportsMimeType(co
 
 bool
 RemoteDecoderModule::Supports(const TrackInfo& aTrackInfo,
                               DecoderDoctorDiagnostics* aDiagnostics) const
 {
   return mWrapped->Supports(aTrackInfo, aDiagnostics);
 }
 
+static inline bool
+IsRemoteAcceleratedCompositor(KnowsCompositor* aKnows)
+{
+  TextureFactoryIdentifier ident = aKnows->GetTextureFactoryIdentifier();
+  return ident.mParentBackend != LayersBackend::LAYERS_BASIC &&
+         ident.mParentProcessType == GeckoProcessType_GPU;
+}
+
 already_AddRefed<MediaDataDecoder>
 RemoteDecoderModule::CreateVideoDecoder(const CreateDecoderParams& aParams)
 {
   if (!MediaPrefs::PDMUseGPUDecoder() ||
       !aParams.mKnowsCompositor ||
-      aParams.mKnowsCompositor->GetTextureFactoryIdentifier().mParentProcessType != GeckoProcessType_GPU) {
+      !IsRemoteAcceleratedCompositor(aParams.mKnowsCompositor))
+  {
     return mWrapped->CreateVideoDecoder(aParams);
   }
 
   RefPtr<RemoteVideoDecoder> object = new RemoteVideoDecoder();
 
   SynchronousTask task("InitIPDL");
   bool success;
   VideoDecoderManagerChild::GetManagerThread()->Dispatch(NS_NewRunnableFunction([&]() {