Backed out changeset 0b041d1c5307 (bug 1125340)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 11 Feb 2015 11:35:54 +0100
changeset 255742 a4c3c73e958198191f53613deea02460fee0c9d6
parent 255741 0b041d1c53072783f2c8974544e7eeb646229397
child 255743 231df1c81dee363a232151ca0bfa6dc9d7f7d66d
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1125340
milestone38.0a1
backs out0b041d1c53072783f2c8974544e7eeb646229397
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 0b041d1c5307 (bug 1125340)
dom/media/fmp4/MP4Reader.cpp
dom/media/fmp4/MP4Reader.h
toolkit/components/telemetry/Histograms.json
--- a/dom/media/fmp4/MP4Reader.cpp
+++ b/dom/media/fmp4/MP4Reader.cpp
@@ -10,20 +10,17 @@
 #include "nsPrintfCString.h"
 #include "nsSize.h"
 #include "VideoUtils.h"
 #include "mozilla/dom/HTMLMediaElement.h"
 #include "ImageContainer.h"
 #include "Layers.h"
 #include "SharedThreadPool.h"
 #include "mozilla/Preferences.h"
-#include "mozilla/Telemetry.h"
 #include "mozilla/dom/TimeRanges.h"
-#include "mp4_demuxer/AnnexB.h"
-#include "mp4_demuxer/H264.h"
 #include "SharedDecoderManager.h"
 
 #ifdef MOZ_EME
 #include "mozilla/CDMProxy.h"
 #endif
 
 using mozilla::layers::Image;
 using mozilla::layers::LayerManager;
@@ -62,38 +59,16 @@ TrackTypeToStr(TrackType aTrack)
   case kVideo:
     return "Video";
   default:
     return "Unknown";
   }
 }
 #endif
 
-bool
-AccumulateSPSTelemetry(const ByteBuffer* aExtradata)
-{
-  SPSData spsdata;
-  if (H264::DecodeSPSFromExtraData(aExtradata, spsdata) &&
-      spsdata.profile_idc && spsdata.level_idc) {
-    // Collect profile_idc values up to 244, otherwise 0 for unknown.
-    Telemetry::Accumulate(Telemetry::VIDEO_DECODED_H264_SPS_PROFILE,
-                          spsdata.profile_idc <= 244 ? spsdata.profile_idc : 0);
-
-    // Make sure level_idc represents a value between levels 1 and 5.2,
-    // otherwise collect 0 for unknown level.
-    Telemetry::Accumulate(Telemetry::VIDEO_DECODED_H264_SPS_LEVEL,
-                          (spsdata.level_idc >= 10 && spsdata.level_idc <= 52) ?
-                          spsdata.level_idc : 0);
-
-    return true;
-  }
-
-  return false;
-}
-
 // MP4Demuxer wants to do various blocking reads, which cause deadlocks while
 // mDemuxerMonitor is held. This stuff should really be redesigned, but we don't
 // have time for that right now. So in order to get proper synchronization while
 // keeping behavior as similar as possible, we do the following nasty hack:
 //
 // The demuxer has a Stream object with APIs to do both blocking and non-blocking
 // reads. When it does a blocking read, MP4Stream actually redirects it to a non-
 // blocking read, but records the parameters of the read on the MP4Stream itself.
@@ -134,17 +109,16 @@ InvokeAndRetry(ThisType* aThisVal, Retur
 
 MP4Reader::MP4Reader(AbstractMediaDecoder* aDecoder)
   : MediaDecoderReader(aDecoder)
   , mAudio(MediaData::AUDIO_DATA, Preferences::GetUint("media.mp4-audio-decode-ahead", 2))
   , mVideo(MediaData::VIDEO_DATA, Preferences::GetUint("media.mp4-video-decode-ahead", 2))
   , mLastReportedNumDecodedFrames(0)
   , mLayersBackendType(layers::LayersBackend::LAYERS_NONE)
   , mDemuxerInitialized(false)
-  , mFoundSPSForTelemetry(false)
   , mIsEncrypted(false)
   , mIndexReady(false)
   , mDemuxerMonitor("MP4 Demuxer")
 #if defined(XP_WIN)
   , mDormantEnabled(Preferences::GetBool("media.decoder.heuristic.dormant.enabled", false))
 #endif
 {
   MOZ_ASSERT(NS_IsMainThread(), "Must be on main thread.");
@@ -486,21 +460,16 @@ MP4Reader::ReadMetadata(MediaInfo* aInfo
                                                       mDecoder->GetImageContainer(),
                                                       mVideo.mTaskQueue,
                                                       mVideo.mCallback);
     }
     NS_ENSURE_TRUE(mVideo.mDecoder != nullptr, NS_ERROR_FAILURE);
     nsresult rv = mVideo.mDecoder->Init();
     NS_ENSURE_SUCCESS(rv, rv);
     mInfo.mVideo.mIsHardwareAccelerated = mVideo.mDecoder->IsHardwareAccelerated();
-
-    // Collect telemetry from h264 AVCC SPS.
-    if (!mFoundSPSForTelemetry) {
-      mFoundSPSForTelemetry = AccumulateSPSTelemetry(video.extra_data);
-    }
   }
 
   // Get the duration, and report it to the decoder if we have it.
   Microseconds duration;
   {
     MonitorAutoLock lock(mDemuxerMonitor);
     duration = mDemuxer->Duration();
   }
@@ -711,23 +680,16 @@ MP4Reader::Update(TrackType aTrack)
        TrackTypeToStr(aTrack),
        needInput,
        needOutput,
        decoder.mInputExhausted,
        decoder.mIsFlushing);
 
   if (needInput) {
     MP4Sample* sample = PopSample(aTrack);
-
-    // Collect telemetry from h264 Annex B SPS.
-    if (!mFoundSPSForTelemetry && AnnexB::HasSPS(sample)) {
-      nsRefPtr<ByteBuffer> extradata = AnnexB::ExtractExtraData(sample);
-      mFoundSPSForTelemetry = AccumulateSPSTelemetry(extradata);
-    }
-
     if (sample) {
       decoder.mDecoder->Input(sample);
       if (aTrack == kVideo) {
         parsed++;
       }
     } else {
       {
         MonitorAutoLock lock(decoder.mMonitor);
--- a/dom/media/fmp4/MP4Reader.h
+++ b/dom/media/fmp4/MP4Reader.h
@@ -255,19 +255,16 @@ private:
 
   layers::LayersBackend mLayersBackendType;
 
   nsTArray<nsTArray<uint8_t>> mInitDataEncountered;
 
   // True if we've read the streams' metadata.
   bool mDemuxerInitialized;
 
-  // True if we've gathered telemetry from an SPS.
-  bool mFoundSPSForTelemetry;
-
   // Synchronized by decoder monitor.
   bool mIsEncrypted;
 
   bool mIndexReady;
   Monitor mDemuxerMonitor;
   nsRefPtr<SharedDecoderManager> mSharedDecoderManager;
 
 #if defined(XP_WIN)
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -5454,28 +5454,16 @@
     "description": "The H.264 level (level_idc) as extracted from the codecs parameter passed to HTMLMediaElement.canPlayType, from levels 1 (10) to 5.2 (51), with the addition of 0 for unknown values."
   },
   "VIDEO_CANPLAYTYPE_H264_PROFILE": {
     "expires_in_version": "40",
     "kind": "enumerated",
     "n_values": 244,
     "description": "The H.264 profile number (profile_idc) as extracted from the codecs parameter passed to HTMLMediaElement.canPlayType."
   },
-  "VIDEO_DECODED_H264_SPS_LEVEL": {
-    "expires_in_version": "40",
-    "kind": "enumerated",
-    "n_values": 51,
-    "description": "The H.264 level (level_idc) as extracted from the decoded SPS, from levels 1 (10) to 5.2 (51), with the addition of 0 for unknown values."
-  },
-  "VIDEO_DECODED_H264_SPS_PROFILE": {
-    "expires_in_version": "40",
-    "kind": "enumerated",
-    "n_values": 244,
-    "description": "The H.264 profile number (profile_idc) as extracted from the decoded SPS."
-  },
   "WEBRTC_ICE_FINAL_CONNECTION_STATE": {
     "expires_in_version": "never",
     "kind": "enumerated",
     "n_values": 7,
     "description": "The ICE connection state when the PC was closed"
   },
   "WEBRTC_ICE_ON_TIME_TRICKLE_ARRIVAL_TIME": {
     "expires_in_version": "never",