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

Unified Diff: media/filters/chunk_demuxer.cc

Issue 743483002: Emit Media Source codec names as media_log events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix missed call to ChunkDemuxer constructor. Created 6 years, 1 month 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 8d7cabae993bb95e5e820775f5ec400d53c0892f..7b9a3ccb2fea816df4476000a672f4b75f54efa5 100644
--- a/media/filters/chunk_demuxer.cc
+++ b/media/filters/chunk_demuxer.cc
@@ -98,7 +98,8 @@ class SourceState {
SourceState(
scoped_ptr<StreamParser> stream_parser,
scoped_ptr<FrameProcessor> frame_processor, const LogCB& log_cb,
- const CreateDemuxerStreamCB& create_demuxer_stream_cb);
+ const CreateDemuxerStreamCB& create_demuxer_stream_cb,
+ const scoped_refptr<MediaLog>& media_log);
~SourceState();
@@ -235,6 +236,7 @@ class SourceState {
scoped_ptr<FrameProcessor> frame_processor_;
LogCB log_cb_;
+ scoped_refptr<MediaLog> media_log_;
StreamParser::InitCB init_cb_;
// During Append(), OnNewConfigs() will trigger the initialization segment
@@ -256,7 +258,8 @@ class SourceState {
SourceState::SourceState(scoped_ptr<StreamParser> stream_parser,
scoped_ptr<FrameProcessor> frame_processor,
const LogCB& log_cb,
- const CreateDemuxerStreamCB& create_demuxer_stream_cb)
+ const CreateDemuxerStreamCB& create_demuxer_stream_cb,
+ const scoped_refptr<MediaLog>& media_log)
: create_demuxer_stream_cb_(create_demuxer_stream_cb),
timestamp_offset_during_append_(NULL),
new_media_segment_(false),
@@ -266,6 +269,7 @@ SourceState::SourceState(scoped_ptr<StreamParser> stream_parser,
video_(NULL),
frame_processor_(frame_processor.release()),
log_cb_(log_cb),
+ media_log_(media_log),
auto_update_timestamp_offset_(false) {
DCHECK(!create_demuxer_stream_cb_.is_null());
DCHECK(frame_processor_);
@@ -592,6 +596,10 @@ bool SourceState::OnNewConfigs(
bool success = true;
if (audio_config.IsValidConfig()) {
if (!audio_) {
+ media_log_->SetBooleanProperty("found_audio_stream", true);
+ media_log_->SetStringProperty(
DaleCurtis 2014/11/19 00:03:57 This works today since we don't allow codec switch
watk 2014/11/19 19:18:09 Good point. I did talk to wolenetz@ about this, an
+ "audio_codec_name",
+ AudioCodecName(audio_config.codec(), audio_config.sample_format()));
audio_ = create_demuxer_stream_cb_.Run(DemuxerStream::AUDIO);
if (!audio_) {
@@ -611,6 +619,9 @@ bool SourceState::OnNewConfigs(
if (video_config.IsValidConfig()) {
if (!video_) {
+ media_log_->SetBooleanProperty("found_video_stream", true);
+ media_log_->SetStringProperty("video_codec_name",
+ VideoCodecName(video_config.codec()));
video_ = create_demuxer_stream_cb_.Run(DemuxerStream::VIDEO);
if (!video_) {
@@ -623,7 +634,6 @@ bool SourceState::OnNewConfigs(
return false;
}
}
-
success &= video_->UpdateVideoConfig(video_config, log_cb_);
}
@@ -1065,6 +1075,7 @@ void ChunkDemuxerStream::CompletePendingReadIfPossible_Locked() {
ChunkDemuxer::ChunkDemuxer(const base::Closure& open_cb,
const NeedKeyCB& need_key_cb,
const LogCB& log_cb,
+ const scoped_refptr<MediaLog>& media_log,
bool splice_frames_enabled)
: state_(WAITING_FOR_INIT),
cancel_next_seek_(false),
@@ -1073,6 +1084,7 @@ ChunkDemuxer::ChunkDemuxer(const base::Closure& open_cb,
need_key_cb_(need_key_cb),
enable_text_(false),
log_cb_(log_cb),
+ media_log_(media_log),
duration_(kNoTimestamp()),
user_specified_duration_(-1),
liveness_(DemuxerStream::LIVENESS_UNKNOWN),
@@ -1231,7 +1243,8 @@ ChunkDemuxer::Status ChunkDemuxer::AddId(const std::string& id,
new SourceState(stream_parser.Pass(),
frame_processor.Pass(), log_cb_,
base::Bind(&ChunkDemuxer::CreateDemuxerStream,
- base::Unretained(this))));
+ base::Unretained(this)),
+ media_log_));
SourceState::NewTextTrackCB new_text_track_cb;

Powered by Google App Engine
This is Rietveld 408576698