Chromium Code Reviews| Index: media/filters/chunk_demuxer.cc |
| diff --git a/media/filters/chunk_demuxer.cc b/media/filters/chunk_demuxer.cc |
| index b75a71a601ef1ceb58bca917bf2934f366b511a8..105b048b5c704cbb696ba66f9d805836ecf694f1 100644 |
| --- a/media/filters/chunk_demuxer.cc |
| +++ b/media/filters/chunk_demuxer.cc |
| @@ -31,6 +31,7 @@ namespace media { |
| // |
| // TODO(acolwell): Remove this once GetAVStream() has been removed from |
| // the DemuxerStream interface. |
| +// ^^^^^^^^^^^ IS THIS STILL NEEDED? ^^^^^^^^^^^^ |
|
acolwell GONE FROM CHROMIUM
2011/10/26 17:09:13
For now yes since we still need an AVStream to con
scherkus (not reviewing)
2011/10/26 19:08:00
Done.
|
| static const uint8 kWebMHeader[] = { |
| 0x1A, 0x45, 0xDF, 0xA3, 0x9F, // EBML (size = 0x1f) |
| 0x42, 0x86, 0x81, 0x01, // EBMLVersion = 1 |
| @@ -79,13 +80,14 @@ class ChunkDemuxerStream : public DemuxerStream { |
| virtual void Read(const ReadCallback& read_callback); |
| virtual Type type(); |
| virtual void EnableBitstreamConverter(); |
| - virtual AVStream* GetAVStream(); |
| virtual const AudioDecoderConfig& audio_decoder_config(); |
| + virtual const VideoDecoderConfig& video_decoder_config(); |
| private: |
| Type type_; |
| AVStream* av_stream_; |
| AudioDecoderConfig audio_config_; |
| + VideoDecoderConfig video_config_; |
| mutable base::Lock lock_; |
| ReadCBQueue read_cbs_; |
| @@ -109,6 +111,11 @@ ChunkDemuxerStream::ChunkDemuxerStream(Type type, AVStream* stream) |
| last_buffer_timestamp_(kNoTimestamp) { |
| if (type_ == AUDIO) { |
| AVCodecContextToAudioDecoderConfig(stream->codec, &audio_config_); |
| + } else if (type_ == VIDEO) { |
| + AVCodecContextToVideoDecoderConfig(stream->codec, |
| + stream->r_frame_rate, |
| + GetAspectRatio(stream), |
| + &video_config_); |
| } |
| } |
| @@ -271,13 +278,16 @@ DemuxerStream::Type ChunkDemuxerStream::type() { return type_; } |
| void ChunkDemuxerStream::EnableBitstreamConverter() {} |
| -AVStream* ChunkDemuxerStream::GetAVStream() { return av_stream_; } |
| - |
| const AudioDecoderConfig& ChunkDemuxerStream::audio_decoder_config() { |
| CHECK_EQ(type_, AUDIO); |
| return audio_config_; |
| } |
| +const VideoDecoderConfig& ChunkDemuxerStream::video_decoder_config() { |
| + CHECK_EQ(type_, VIDEO); |
| + return video_config_; |
| +} |
| + |
| ChunkDemuxer::ChunkDemuxer(ChunkDemuxerClient* client) |
| : state_(WAITING_FOR_INIT), |
| client_(client), |