Bug 1330243 - add preference to enable rust mp4 parser. r=kinetik
authorAlfredo.Yang <ayang@mozilla.com>
Tue, 14 Mar 2017 15:42:09 +0800
changeset 397860 4d539d11ebc9151d25e38cf72992c0479a0913df
parent 397859 43143f8b9fa1aee0819cf7d96b9e0e0d65fbcb6e
child 397861 7ac8812719a11344a4cbcb5b1f6d55b5a68de0e6
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik
bugs1330243
milestone55.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 1330243 - add preference to enable rust mp4 parser. r=kinetik MozReview-Commit-ID: LINNEMiXYx4
dom/media/MediaPrefs.h
media/libstagefright/binding/MP4Metadata.cpp
--- a/dom/media/MediaPrefs.h
+++ b/dom/media/MediaPrefs.h
@@ -165,16 +165,18 @@ private:
   // Flac
   DECL_MEDIA_PREF("media.ogg.flac.enabled",                   FlacInOgg, bool, false);
   DECL_MEDIA_PREF("media.flac.enabled",                       FlacEnabled, bool, true);
 
 #if !defined(RELEASE_OR_BETA)
   DECL_MEDIA_PREF("media.rust.test_mode",                     RustTestMode, bool, false);
 #endif
 
+  DECL_MEDIA_PREF("media.rust.mp4parser",                     EnableRustMP4Parser, bool, false);
+
 public:
   // Manage the singleton:
   static MediaPrefs& GetSingleton();
   static bool SingletonExists();
 
 private:
   template<class T> friend class StaticAutoPtr;
   static StaticAutoPtr<MediaPrefs> sInstance;
--- a/media/libstagefright/binding/MP4Metadata.cpp
+++ b/media/libstagefright/binding/MP4Metadata.cpp
@@ -225,17 +225,17 @@ IndiceWrapperRust::GetIndice(size_t aInd
   aIndice.start_decode = indice->start_decode;
   aIndice.sync = indice->sync;
   return true;
 }
 
 MP4Metadata::MP4Metadata(Stream* aSource)
  : mStagefright(MakeUnique<MP4MetadataStagefright>(aSource))
  , mRust(MakeUnique<MP4MetadataRust>(aSource))
- , mPreferRust(false)
+ , mPreferRust(MediaPrefs::EnableRustMP4Parser())
  , mReportedAudioTrackTelemetry(false)
  , mReportedVideoTrackTelemetry(false)
 #ifndef RELEASE_OR_BETA
  , mRustTestMode(MediaPrefs::RustTestMode())
 #endif
 {
 }