Bug 1538474 - Enable dav1d in RDD process. r=mjf a=pascalc
authorAlex Chronopoulos <achronop@gmail.com>
Thu, 28 Mar 2019 10:41:29 +0000
changeset 525878 d1ca56d685a6c3c701e7b99884b2365ac8ae4679
parent 525877 f3907c8d89f9b811d3fc50d961bfa6f376353be0
child 525879 6f8f5bd9d9f249e93b377a957aac44b2ca32fb65
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)
reviewersmjf, pascalc
bugs1538474
milestone67.0
Bug 1538474 - Enable dav1d in RDD process. r=mjf a=pascalc 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
@@ -1622,31 +1622,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
 )