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

Unified Diff: media/filters/ffmpeg_demuxer.cc

Issue 8341033: Remove DemuxerStream::GetAVStream() once and for all. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 9 years, 2 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/ffmpeg_demuxer.cc
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
index 45e5298fa32375bbc7bc7adca19bfc7265e2c537..f428c45844aec5437d9d5e36e7b315a7c4f7424a 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -73,6 +73,10 @@ FFmpegDemuxerStream::FFmpegDemuxerStream(FFmpegDemuxer* demuxer,
break;
case AVMEDIA_TYPE_VIDEO:
type_ = VIDEO;
+ AVCodecContextToVideoDecoderConfig(stream->codec,
+ stream->r_frame_rate,
+ GetAspectRatio(stream),
+ &video_config_);
break;
default:
NOTREACHED();
@@ -254,15 +258,16 @@ void FFmpegDemuxerStream::EnableBitstreamConverter() {
}
}
-AVStream* FFmpegDemuxerStream::GetAVStream() {
- return stream_;
-}
-
const AudioDecoderConfig& FFmpegDemuxerStream::audio_decoder_config() {
CHECK_EQ(type_, AUDIO);
return audio_config_;
}
+const VideoDecoderConfig& FFmpegDemuxerStream::video_decoder_config() {
+ CHECK_EQ(type_, VIDEO);
+ return video_config_;
+}
+
// static
base::TimeDelta FFmpegDemuxerStream::ConvertStreamTimestamp(
const AVRational& time_base, int64 timestamp) {
@@ -684,8 +689,7 @@ void FFmpegDemuxer::DisableAudioStreamTask() {
// If the codec type is audio, remove the reference. DemuxTask() will
// look for such reference, and this will result in deleting the
// audio packets after they are demuxed.
- if (packet_streams_[i]->GetAVStream()->codec->codec_type ==
- AVMEDIA_TYPE_AUDIO) {
+ if (packet_streams_[i]->type() == DemuxerStream::AUDIO) {
packet_streams_[i] = NULL;
}
}

Powered by Google App Engine
This is Rietveld 408576698