Bug 1515497 - pt 1 - eliminate fall back to av1 decoding on content process when RDD enabled. r=bryce a=pascalc
authorMichael Froman <mfroman@mozilla.com>
Fri, 19 Apr 2019 21:11:25 +0000
changeset 526393 6e4ff735f7bf96ef0c0a5150a8f650a500c79625
parent 526392 8bd43644d6c5cd72149534691893fb6896cc090c
child 526394 82662d1130d18f74646dcc3fcc3fba902e443ddc
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbryce, pascalc
bugs1515497
milestone67.0
Bug 1515497 - pt 1 - eliminate fall back to av1 decoding on content process when RDD enabled. r=bryce a=pascalc If the RDD process is enabled and fails to start properly for some reason, make sure we cannot accidentally fall back to decoding AV1 on the content process. Differential Revision: https://phabricator.services.mozilla.com/D28204
dom/media/platforms/agnostic/AgnosticDecoderModule.cpp
--- a/dom/media/platforms/agnostic/AgnosticDecoderModule.cpp
+++ b/dom/media/platforms/agnostic/AgnosticDecoderModule.cpp
@@ -25,17 +25,21 @@ bool AgnosticDecoderModule::SupportsMime
   bool supports =
       VPXDecoder::IsVPX(aMimeType) || OpusDataDecoder::IsOpus(aMimeType) ||
       WaveDataDecoder::IsWave(aMimeType) || TheoraDecoder::IsTheora(aMimeType);
   if (!StaticPrefs::MediaRddVorbisEnabled() ||
       !StaticPrefs::MediaRddProcessEnabled()) {
     supports |= VorbisDataDecoder::IsVorbis(aMimeType);
   }
 #ifdef MOZ_AV1
-  if (StaticPrefs::MediaAv1Enabled()) {
+  // We remove support for decoding AV1 here if RDD is enabled so that
+  // decoding on the content process doesn't accidentally happen in case
+  // something goes wrong with launching the RDD process.
+  if (StaticPrefs::MediaAv1Enabled() &&
+      !StaticPrefs::MediaRddProcessEnabled()) {
     supports |= AOMDecoder::IsAV1(aMimeType);
   }
 #endif
   MOZ_LOG(sPDMLog, LogLevel::Debug,
           ("Agnostic decoder %s requested type",
            supports ? "supports" : "rejects"));
   return supports;
 }
@@ -43,17 +47,19 @@ bool AgnosticDecoderModule::SupportsMime
 already_AddRefed<MediaDataDecoder> AgnosticDecoderModule::CreateVideoDecoder(
     const CreateDecoderParams& aParams) {
   RefPtr<MediaDataDecoder> m;
 
   if (VPXDecoder::IsVPX(aParams.mConfig.mMimeType)) {
     m = new VPXDecoder(aParams);
   }
 #ifdef MOZ_AV1
+  // see comment above about AV1 and the RDD process
   else if (AOMDecoder::IsAV1(aParams.mConfig.mMimeType) &&
+           !StaticPrefs::MediaRddProcessEnabled() &&
            StaticPrefs::MediaAv1Enabled()) {
     if (StaticPrefs::MediaAv1UseDav1d()) {
       m = new DAV1DDecoder(aParams);
     } else {
       m = new AOMDecoder(aParams);
     }
   }
 #endif