Bug 1538474 - Enable dav1d in RDD process. r=mjf
☠☠ backed out by d04ec06581a0 ☠ ☠
authorAlex Chronopoulos <achronop@gmail.com>
Mon, 25 Mar 2019 16:41:48 +0000
changeset 465971 6ef62825d79f142b9aabd982d84f2e69e4eded06
parent 465970 5b0704b4bf50c69b9552c0f4f9043444b2e04b19
child 465972 5a29abda45117075cc7ce1299d96edecaa4bb0dc
push id81358
push userachronopoulos@mozilla.com
push dateMon, 25 Mar 2019 16:43:08 +0000
treeherderautoland@6ef62825d79f [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
@@ -1652,31 +1652,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
 )