Chromium Code Reviews| Index: media/filters/chunk_demuxer.cc |
| diff --git a/media/filters/chunk_demuxer.cc b/media/filters/chunk_demuxer.cc |
| index 38527043154fdf30a4ca0a22622f0a0c726301d0..3e71a9d5ae9061b373d8b08968802be2789ff1cd 100644 |
| --- a/media/filters/chunk_demuxer.cc |
| +++ b/media/filters/chunk_demuxer.cc |
| @@ -12,6 +12,7 @@ |
| #include "media/base/video_decoder_config.h" |
| #include "media/filters/chunk_demuxer_client.h" |
| #include "media/webm/webm_stream_parser.h" |
| +#include "media/mp4/mp4_stream_parser.h" |
|
acolwell GONE FROM CHROMIUM
2012/06/06 17:32:39
includes should be alphabetical
strobe_
2012/06/07 16:33:54
Done.
|
| namespace media { |
| @@ -31,6 +32,11 @@ struct SupportedTypeInfo { |
| static const CodecInfo kVP8CodecInfo = { "vp8", DemuxerStream::VIDEO }; |
| static const CodecInfo kVorbisCodecInfo = { "vorbis", DemuxerStream::AUDIO }; |
| +// TODO(strobe): Perform matching against supported profiles and levels, or |
| +// simply accept codecs that match a prefix. |
| +static const CodecInfo kH264CodecInfo = { "avc1.4D4041", DemuxerStream::VIDEO }; |
| +static const CodecInfo kAACCodecInfo = { "mp4a.40.2", DemuxerStream::AUDIO }; |
| + |
| static const CodecInfo* kVideoWebMCodecs[] = { |
| &kVP8CodecInfo, |
| &kVorbisCodecInfo, |
| @@ -38,17 +44,35 @@ static const CodecInfo* kVideoWebMCodecs[] = { |
| }; |
| static const CodecInfo* kAudioWebMCodecs[] = { |
| + &kVP8CodecInfo, |
|
acolwell GONE FROM CHROMIUM
2012/06/06 17:32:39
remove. VP8 should not be allowed in an audio only
strobe_
2012/06/07 16:33:54
Done. Sorry, copy and paste error.
|
| &kVorbisCodecInfo, |
| NULL |
| }; |
| +static const CodecInfo* kVideoMP4Codecs[] = { |
| + &kH264CodecInfo, |
| + &kAACCodecInfo, |
| + NULL |
| +}; |
| + |
| +static const CodecInfo* kAudioMP4Codecs[] = { |
| + &kAACCodecInfo, |
| + NULL |
| +}; |
| + |
| static StreamParser* BuildWebMParser() { |
| return new WebMStreamParser(); |
| } |
| +static StreamParser* BuildMP4Parser() { |
| + return new MP4StreamParser(); |
| +} |
| + |
| static const SupportedTypeInfo kSupportedTypeInfo[] = { |
| { "video/webm", &BuildWebMParser, kVideoWebMCodecs }, |
| { "audio/webm", &BuildWebMParser, kAudioWebMCodecs }, |
| + { "video/mp4", &BuildMP4Parser, kVideoMP4Codecs }, |
| + { "audio/mp4", &BuildMP4Parser, kAudioMP4Codecs }, |
| }; |
| // Checks to see if the specified |type| and |codecs| list are supported. |
| @@ -516,15 +540,6 @@ bool ChunkDemuxer::AppendData(const std::string& id, |
| const uint8* data, |
| size_t length) { |
| DVLOG(1) << "AppendData(" << id << ", " << length << ")"; |
| - |
| - // TODO(acolwell): Remove when http://webk.it/83788 fix lands. |
| - if (source_id_.empty()) { |
| - std::vector<std::string> codecs(2); |
| - codecs[0] = "vp8"; |
| - codecs[1] = "vorbis"; |
| - AddId(id, "video/webm", codecs); |
| - } |
| - |
| DCHECK(!source_id_.empty()); |
| DCHECK_EQ(source_id_, id); |
| DCHECK(!id.empty()); |