From 4ca5011760106134db0f099c9b9efa5f7ded394c Mon Sep 17 00:00:00 2001 From: cobalt-github-releaser-bot <95661244+cobalt-github-releaser-bot@users.noreply.github.com> Date: Tue, 21 May 2024 15:27:38 -0700 Subject: [PATCH] Cherry pick PR #3289: [media] Improve MediaSource related logging (#3313) Refer to the original PR: https://github.com/youtube/cobalt/pull/3289 b/300321069 Change-Id: I4b1e49d8f659d88efa9a035447142d448e35b88b Co-authored-by: xiaomings --- cobalt/dom/html_media_element.cc | 3 +++ cobalt/dom/media_source.cc | 3 +++ cobalt/media/base/sbplayer_pipeline.cc | 2 ++ 3 files changed, 8 insertions(+) diff --git a/cobalt/dom/html_media_element.cc b/cobalt/dom/html_media_element.cc index cc2c7b0567fb..add247eb09ce 100644 --- a/cobalt/dom/html_media_element.cc +++ b/cobalt/dom/html_media_element.cc @@ -913,6 +913,9 @@ void HTMLMediaElement::LoadResource(const GURL& initial_url, return; } media_source_url_ = url; + + LOG(INFO) << "Attached MediaSource (0x" << media_source_.get() + << ") to HTMLMediaElement (0x" << this << ")"; } // The resource fetch algorithm network_state_ = kNetworkLoading; diff --git a/cobalt/dom/media_source.cc b/cobalt/dom/media_source.cc index 0265e3f93be3..ce1b2e772023 100644 --- a/cobalt/dom/media_source.cc +++ b/cobalt/dom/media_source.cc @@ -285,6 +285,9 @@ scoped_refptr MediaSource::AddSourceBuffer( DCHECK(source_buffer); source_buffers_->Add(source_buffer); + LOG(INFO) << "added SourceBuffer (0x" << source_buffer.get() + << ") to MediaSource (0x" << this << ") with type " << type + << " id = " << guid; return source_buffer; } diff --git a/cobalt/media/base/sbplayer_pipeline.cc b/cobalt/media/base/sbplayer_pipeline.cc index 0895be9b5df3..4d1998e016f7 100644 --- a/cobalt/media/base/sbplayer_pipeline.cc +++ b/cobalt/media/base/sbplayer_pipeline.cc @@ -702,6 +702,8 @@ void SbPlayerPipeline::OnDemuxerError(PipelineStatus error) { return; } + LOG(INFO) << "SbPlayerPipeline::OnDemuxerError() called with error " << error; + if (error != ::media::PIPELINE_OK) { CallErrorCB(error, "Demuxer error."); }