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

Unified Diff: media/filters/chunk_demuxer.cc

Issue 10536014: Implement ISO BMFF support in Media Source. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 6 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 | « no previous file | media/filters/source_buffer.cc » ('j') | media/filters/source_buffer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « no previous file | media/filters/source_buffer.cc » ('j') | media/filters/source_buffer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698