| Index: media/filters/chunk_demuxer.cc
|
| diff --git a/media/filters/chunk_demuxer.cc b/media/filters/chunk_demuxer.cc
|
| index 8862ad15fa50cf4f3d07f7716a68f017be04c686..8c9cceee0ba42aa638d83521f74fef504700694c 100644
|
| --- a/media/filters/chunk_demuxer.cc
|
| +++ b/media/filters/chunk_demuxer.cc
|
| @@ -11,6 +11,7 @@
|
| #include "media/base/stream_parser_buffer.h"
|
| #include "media/base/video_decoder_config.h"
|
| #include "media/filters/chunk_demuxer_client.h"
|
| +#include "media/mp4/mp4_stream_parser.h"
|
| #include "media/webm/webm_stream_parser.h"
|
|
|
| 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,
|
| @@ -42,13 +48,30 @@ static const CodecInfo* kAudioWebMCodecs[] = {
|
| 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 mp4::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.
|
| @@ -533,15 +556,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());
|
|
|