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

Unified Diff: media/filters/ffmpeg_demuxer.cc

Issue 2272293002: Introducing DemuxerHost::OnMetadata. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | third_party/WebKit/LayoutTests/TestExpectations » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_demuxer.cc
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
index b34d8bc3cb784c81bdae8ca48c4c1ee5d77076b5..348b6a86750a4fdee89fa9197a4393e6e7b579d9 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -1440,6 +1440,7 @@ void FFmpegDemuxer::OnFindStreamInfoDone(const PipelineStatusCB& status_cb,
if (bitrate_ > 0)
data_source_->SetBitrate(bitrate_);
+ PipelineMetadata metadata;
// Use a single MediaLogEvent to batch all parameter updates at once; this
// prevents throttling of events due to the large number of updates here.
std::unique_ptr<MediaLogEvent> metadata_event =
@@ -1449,6 +1450,7 @@ void FFmpegDemuxer::OnFindStreamInfoDone(const PipelineStatusCB& status_cb,
metadata_event->params.SetBoolean("found_audio_stream", !!audio_stream);
if (audio_stream) {
const AVCodecContext* audio_codec = audio_stream->codec;
+ metadata.has_audio = true;
metadata_event->params.SetString("audio_codec_name",
GetCodecName(audio_codec));
metadata_event->params.SetInteger("audio_channels_count",
@@ -1464,6 +1466,9 @@ void FFmpegDemuxer::OnFindStreamInfoDone(const PipelineStatusCB& status_cb,
metadata_event->params.SetBoolean("found_video_stream", !!video_stream);
if (video_stream) {
const AVCodecContext* video_codec = video_stream->codec;
+ metadata.has_video = true;
+ metadata.natural_size = video_->video_decoder_config().natural_size();
+ metadata.video_rotation = video_->video_rotation();
metadata_event->params.SetString("video_codec_name",
GetCodecName(video_codec));
metadata_event->params.SetInteger("width", video_codec->width);
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | third_party/WebKit/LayoutTests/TestExpectations » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698