Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Unified Diff: media/filters/chunk_demuxer.cc

Issue 1826583003: MSE: Record counts of detected MSE audio, video and text tracks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/filters/chunk_demuxer.cc
diff --git a/media/filters/chunk_demuxer.cc b/media/filters/chunk_demuxer.cc
index e13dcc1799b5b118a27720c7a4a89685babd789b..0957b8b78637fba491dce04a26941ef2423d64d4 100644
--- a/media/filters/chunk_demuxer.cc
+++ b/media/filters/chunk_demuxer.cc
@@ -13,6 +13,7 @@
#include "base/callback_helpers.h"
#include "base/location.h"
#include "base/macros.h"
+#include "base/metrics/histogram_macros.h"
#include "base/stl_util.h"
#include "media/base/audio_decoder_config.h"
#include "media/base/bind_to_current_loop.h"
@@ -367,7 +368,10 @@ ChunkDemuxer::ChunkDemuxer(
duration_(kNoTimestamp()),
user_specified_duration_(-1),
liveness_(DemuxerStream::LIVENESS_UNKNOWN),
- splice_frames_enabled_(splice_frames_enabled) {
+ splice_frames_enabled_(splice_frames_enabled),
+ detected_audio_track_count_(0),
+ detected_video_track_count_(0),
+ detected_text_track_count_(0) {
DCHECK(!open_cb_.is_null());
DCHECK(!encrypted_media_init_data_cb_.is_null());
}
@@ -961,12 +965,25 @@ void ChunkDemuxer::OnSourceInitDone(
video_->SetLiveness(params.liveness);
}
+ detected_audio_track_count_ += params.detected_audio_track_count;
+ detected_video_track_count_ += params.detected_video_track_count;
+ detected_text_track_count_ += params.detected_text_track_count;
+
// Wait until all streams have initialized.
chcunningham 2016/03/23 23:05:56 OK, we chatted f2f quite a bit. For posterity, let
wolenetz 2016/03/25 23:25:08 All current Chromium stream parsers (not just mp4)
chcunningham 2016/03/29 22:14:50 Acknowledged.
if ((!source_id_audio_.empty() && !audio_) ||
(!source_id_video_.empty() && !video_)) {
return;
}
+ // Record detected track counts by type corresponding to an MSE playback.
+ // Counts are split into 50 buckets, capped into [0,100] range.
+ UMA_HISTOGRAM_COUNTS_100("Media.MSE.DetectedTrackCount.Audio",
+ detected_audio_track_count_);
+ UMA_HISTOGRAM_COUNTS_100("Media.MSE.DetectedTrackCount.Video",
+ detected_video_track_count_);
+ UMA_HISTOGRAM_COUNTS_100("Media.MSE.DetectedTrackCount.Text",
+ detected_text_track_count_);
+
SeekAllSources(GetStartTime());
StartReturningData();

Powered by Google App Engine
This is Rietveld 408576698