Bug 1538474 - Enable dav1d in RDD process. r=mjf
authorAlex Chronopoulos <achronop@gmail.com>
Thu, 28 Mar 2019 10:41:29 +0000
changeset 466552 134d1cdc2c83d6ccecd4ea61fe7ecc8c214411bb
parent 466551 8d50eeb3a966db761058ee7a3be002cfa04ed3b8
child 466553 827a1c12a137e05172d6f24c509ad9acc62035c0
push id35771
push useropoprus@mozilla.com
push dateThu, 28 Mar 2019 17:29:49 +0000
treeherdermozilla-central@1ef00231db53 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmjf
bugs1538474
milestone68.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 1538474 - Enable dav1d in RDD process. r=mjf Differential Revision: https://phabricator.services.mozilla.com/D24726
dom/media/ipc/RemoteVideoDecoder.cpp
modules/libpref/init/StaticPrefList.h
--- a/dom/media/ipc/RemoteVideoDecoder.cpp
+++ b/dom/media/ipc/RemoteVideoDecoder.cpp
@@ -4,16 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #include "RemoteVideoDecoder.h"
 
 #include "mozilla/layers/ImageDataSerializer.h"
 
 #ifdef MOZ_AV1
 #  include "AOMDecoder.h"
+#  include "DAV1DDecoder.h"
 #endif
 #include "ImageContainer.h"  // for PlanarYCbCrData and BufferRecycleBin
 #include "RemoteDecoderManagerChild.h"
 
 namespace mozilla {
 
 using namespace layers;  // for PlanarYCbCrData and BufferRecycleBin
 
@@ -146,17 +147,21 @@ RemoteVideoDecoderParent::RemoteVideoDec
   params.mImageContainer = new layers::ImageContainer();
   params.mRate = CreateDecoderParams::VideoFrameRate(aFramerate);
   params.mOptions = aOptions;
   MediaResult error(NS_OK);
   params.mError = &error;
 
 #ifdef MOZ_AV1
   if (AOMDecoder::IsAV1(params.mConfig.mMimeType)) {
-    mDecoder = new AOMDecoder(params);
+    if (StaticPrefs::MediaAv1UseDav1d()) {
+      mDecoder = new DAV1DDecoder(params);
+    } else {
+      mDecoder = new AOMDecoder(params);
+    }
   }
 #endif
 
   if (NS_FAILED(error)) {
     MOZ_ASSERT(aErrorDescription);
     *aErrorDescription = error.Description();
   }
 
--- a/modules/libpref/init/StaticPrefList.h
+++ b/modules/libpref/init/StaticPrefList.h
@@ -1658,31 +1658,40 @@ VARCACHE_PREF(
   RelaxedAtomicBool, true
 )
 
 // AV1
 #if defined(XP_WIN) && !defined(_ARM64_)
 # define PREF_VALUE true
 #elif defined(XP_MACOSX)
 # define PREF_VALUE true
-#elif defined(XP_UNIX)
+#elif defined(XP_UNIX) && !defined(Android)
 # define PREF_VALUE true
 #else
 # define PREF_VALUE false
 #endif
 VARCACHE_PREF(
   "media.av1.enabled",
    MediaAv1Enabled,
   RelaxedAtomicBool, PREF_VALUE
 )
 #undef PREF_VALUE
+
 VARCACHE_PREF(
   "media.av1.use-dav1d",
    MediaAv1UseDav1d,
+#if defined(XP_WIN) && !defined(_ARM64_)
+  RelaxedAtomicBool, true
+#elif defined(XP_MACOSX)
+  RelaxedAtomicBool, true
+#elif defined(XP_UNIX) && !defined(Android)
+  RelaxedAtomicBool, true
+#else
   RelaxedAtomicBool, false
+#endif
 )
 
 VARCACHE_PREF(
   "media.flac.enabled",
    MediaFlacEnabled,
   bool, true
 )