Backed out changeset 85cacbef3243 (bug 1303247) for GTest Assertion failures
authorIris Hsiao <ihsiao@mozilla.com>
Wed, 21 Sep 2016 12:25:36 +0800
changeset 314678 44af49566fa3d433e2a34ba644c59cddc35dfef7
parent 314677 6383ff7f46f48963ffee9a32afd898c7a737ea0e
child 314679 a8648997af907afeee827f47a24303d6269d1982
push id30732
push usercbook@mozilla.com
push dateWed, 21 Sep 2016 10:04:03 +0000
treeherdermozilla-central@560b2c805bf7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1303247
milestone52.0a1
backs out85cacbef32435896a7d88fad8dad6b1be98cc3c6
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
Backed out changeset 85cacbef3243 (bug 1303247) for GTest Assertion failures CLOSED TREE
dom/media/MediaPrefs.h
media/libstagefright/binding/MP4Metadata.cpp
media/libstagefright/binding/include/mp4_demuxer/MP4Metadata.h
--- a/dom/media/MediaPrefs.h
+++ b/dom/media/MediaPrefs.h
@@ -149,20 +149,16 @@ private:
 
   // Ogg
   DECL_MEDIA_PREF("media.ogg.enabled",                        OggEnabled, bool, true);
   DECL_MEDIA_PREF("media.format-reader.ogg",                  OggFormatReader, bool, true);
   // Flac
   DECL_MEDIA_PREF("media.ogg.flac.enabled",                   FlacInOgg, bool, false);
   DECL_MEDIA_PREF("media.flac.enabled",                       FlacEnabled, bool, true);
 
-#if defined(MOZ_RUST_MP4PARSE) && !defined(RELEASE_BUILD)
-  DECL_MEDIA_PREF("media.rust.test_mode",                     RustTestMode, bool, false);
-#endif
-
 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
@@ -13,17 +13,16 @@
 #include "mozilla/Logging.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/UniquePtr.h"
 #include "VideoUtils.h"
 #include "mp4_demuxer/MoofParser.h"
 #include "mp4_demuxer/MP4Metadata.h"
 #include "mp4_demuxer/Stream.h"
-#include "MediaPrefs.h"
 
 #include <limits>
 #include <stdint.h>
 #include <vector>
 
 #ifdef MOZ_RUST_MP4PARSE
 // OpusDecoder header is really needed only by MP4 in rust
 #include "OpusDecoder.h"
@@ -154,19 +153,16 @@ private:
 
 MP4Metadata::MP4Metadata(Stream* aSource)
  : mStagefright(MakeUnique<MP4MetadataStagefright>(aSource))
 #ifdef MOZ_RUST_MP4PARSE
  , mRust(MakeUnique<MP4MetadataRust>(aSource))
  , mPreferRust(false)
  , mReportedAudioTrackTelemetry(false)
  , mReportedVideoTrackTelemetry(false)
-#ifndef RELEASE_BUILD
- , mRustTestMode(MediaPrefs::RustTestMode())
-#endif
 #endif
 {
 }
 
 MP4Metadata::~MP4Metadata()
 {
 }
 
@@ -268,60 +264,24 @@ bool MP4Metadata::ShouldPreferRust() con
 mozilla::UniquePtr<mozilla::TrackInfo>
 MP4Metadata::GetTrackInfo(mozilla::TrackInfo::TrackType aType,
                           size_t aTrackNumber) const
 {
   mozilla::UniquePtr<mozilla::TrackInfo> info =
       mStagefright->GetTrackInfo(aType, aTrackNumber);
 
 #ifdef MOZ_RUST_MP4PARSE
-  if (!mRust) {
+  if (!mRust || !mPreferRust) {
     return info;
   }
 
   mozilla::UniquePtr<mozilla::TrackInfo> infoRust =
       mRust->GetTrackInfo(aType, aTrackNumber);
   MOZ_ASSERT(infoRust);
 
-#ifndef RELEASE_BUILD
-  if (mRustTestMode) {
-    MOZ_ASSERT(infoRust->mId == info->mId);
-    MOZ_ASSERT(infoRust->mKind == info->mKind);
-    MOZ_ASSERT(infoRust->mLabel == info->mLabel);
-    MOZ_ASSERT(infoRust->mLanguage == info->mLanguage);
-    MOZ_ASSERT(infoRust->mEnabled == info->mEnabled);
-    MOZ_ASSERT(infoRust->mTrackId == info->mTrackId);
-    MOZ_ASSERT(infoRust->mMimeType == info->mMimeType);
-    MOZ_ASSERT(infoRust->mDuration == info->mDuration);
-    MOZ_ASSERT(infoRust->mMediaTime == info->mMediaTime);
-    switch (aType) {
-    case mozilla::TrackInfo::kAudioTrack: {
-      AudioInfo *audioRust = infoRust->GetAsAudioInfo(), *audio = info->GetAsAudioInfo();
-      MOZ_ASSERT(audioRust->mRate == audio->mRate);
-      MOZ_ASSERT(audioRust->mChannels == audio->mChannels);
-      MOZ_ASSERT(audioRust->mBitDepth == audio->mBitDepth);
-      //MOZ_ASSERT(audioRust->mProfile == audio->mProfile);
-      //MOZ_ASSERT(audioRust->mExtendedProfile == audio->mExtendedProfile);
-      break;
-    }
-    case mozilla::TrackInfo::kVideoTrack: {
-      VideoInfo *videoRust = infoRust->GetAsVideoInfo(), *video = info->GetAsVideoInfo();
-      MOZ_ASSERT(videoRust->mDisplay == video->mDisplay);
-      MOZ_ASSERT(videoRust->mImage == video->mImage);
-      break;
-    }
-    default:
-      break;
-    }
-  }
-#endif
-
-  if (!mPreferRust) {
-    return info;
-  }
   return infoRust;
 #endif
 
   return info;
 }
 
 bool
 MP4Metadata::CanSeek() const
--- a/media/libstagefright/binding/include/mp4_demuxer/MP4Metadata.h
+++ b/media/libstagefright/binding/include/mp4_demuxer/MP4Metadata.h
@@ -37,18 +37,15 @@ public:
 
 private:
   UniquePtr<MP4MetadataStagefright> mStagefright;
 #ifdef MOZ_RUST_MP4PARSE
   UniquePtr<MP4MetadataRust> mRust;
   mutable bool mPreferRust;
   mutable bool mReportedAudioTrackTelemetry;
   mutable bool mReportedVideoTrackTelemetry;
-#ifndef RELEASE_BUILD
-  mutable bool mRustTestMode;
-#endif
   bool ShouldPreferRust() const;
 #endif
 };
 
 } // namespace mp4_demuxer
 
 #endif // MP4METADATA_H_