Bug 1505284 - P4. Split preferences to enable WebRTC with MediaDataDecoder. r=padenot
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 22 Nov 2018 16:31:16 +0000
changeset 504158 7f62a35b41717abda4a30f20ecc7a8fd649304f2
parent 504157 99321f96fd0c043d5a72a26bd0ff6e49759af698
child 504159 95d5bb21c934f96482a96579102b3dd853542723
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1505284
milestone65.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
Bug 1505284 - P4. Split preferences to enable WebRTC with MediaDataDecoder. r=padenot So that we can disable just the H264 decoders while allowing VP8 or VP9. Differential Revision: https://phabricator.services.mozilla.com/D12539
media/webrtc/signaling/src/media-conduit/MediaDataDecoderCodec.cpp
modules/libpref/init/StaticPrefList.h
--- a/media/webrtc/signaling/src/media-conduit/MediaDataDecoderCodec.cpp
+++ b/media/webrtc/signaling/src/media-conduit/MediaDataDecoderCodec.cpp
@@ -14,29 +14,27 @@ MediaDataDecoderCodec::CreateEncoder(
 {
   return nullptr;
 }
 
 /* static */ WebrtcVideoDecoder*
 MediaDataDecoderCodec::CreateDecoder(
   webrtc::VideoCodecType aCodecType)
 {
-  if (!StaticPrefs::MediaNavigatorMediadatadecoderEnabled() &&
-      !StaticPrefs::MediaNavigatorMediadatadecoderH264Enabled()) {
-    return nullptr;
-  }
-
   switch (aCodecType) {
     case webrtc::VideoCodecType::kVideoCodecVP8:
     case webrtc::VideoCodecType::kVideoCodecVP9:
-      if (!StaticPrefs::MediaNavigatorMediadatadecoderEnabled()) {
+      if (!StaticPrefs::MediaNavigatorMediadatadecoderVPXEnabled()) {
         return nullptr;
       }
-      MOZ_FALLTHROUGH;
+      break;
     case webrtc::VideoCodecType::kVideoCodecH264:
+      if (!StaticPrefs::MediaNavigatorMediadatadecoderH264Enabled()) {
+        return nullptr;
+      }
       break;
     default:
       return nullptr;
   }
   return new WebrtcMediaDataDecoder();
 }
 
 } // namespace mozilla
--- a/modules/libpref/init/StaticPrefList.h
+++ b/modules/libpref/init/StaticPrefList.h
@@ -1109,25 +1109,26 @@ VARCACHE_PREF(
 )
 
 PREF("media.navigator.hardware.vp8_encode.acceleration_enabled", bool, true)
 
 PREF("media.navigator.hardware.vp8_decode.acceleration_enabled", bool, false)
 
 #endif // ANDROID
 
-// Use MediaDataDecoder API for WebRTC. This includes hardware acceleration for
-// decoding.
+// Use MediaDataDecoder API for VP8/VP9 in WebRTC. This includes hardware
+// acceleration for decoding.
 VARCACHE_PREF(
-  "media.navigator.mediadatadecoder_enabled",
-   MediaNavigatorMediadatadecoderEnabled,
-  bool, false
+  "media.navigator.mediadatadecoder_vpx_enabled",
+   MediaNavigatorMediadatadecoderVPXEnabled,
+  RelaxedAtomicBool, false
 )
-// Use MediaDataDecoder API for WebRTC. This includes hardware acceleration for
-// decoding.
+
+// Use MediaDataDecoder API for H264 in WebRTC. This includes hardware
+// acceleration for decoding.
 # if defined(ANDROID)
 #  define PREF_VALUE false // Bug 1509316
 # else
 #  define PREF_VALUE true
 # endif
 
 VARCACHE_PREF(
   "media.navigator.mediadatadecoder_h264_enabled",