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

Unified Diff: media/filters/chunk_demuxer.cc

Issue 10795050: Fix MediaSource code so it can handle HE-AAC content that uses implicit signalling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added implicit SBR test Created 8 years, 5 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/ffmpeg_audio_decoder.cc » ('j') | media/mp4/aac.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 af7927bdc0cb4d394f17ab2d593822e3b7ddfa4c..d49701355f67b3d53f036b58f934a95cd7eeed15 100644
--- a/media/filters/chunk_demuxer.cc
+++ b/media/filters/chunk_demuxer.cc
@@ -27,7 +27,8 @@ struct CodecInfo {
DemuxerStream::Type type;
};
-typedef StreamParser* (*ParserFactoryFunction)();
+typedef StreamParser* (*ParserFactoryFunction)(
+ const std::vector<std::string>& codecs);
struct SupportedTypeInfo {
const char* type;
@@ -49,7 +50,7 @@ static const CodecInfo* kAudioWebMCodecs[] = {
NULL
};
-static StreamParser* BuildWebMParser() {
+static StreamParser* BuildWebMParser(const std::vector<std::string>& codecs) {
return new WebMStreamParser();
}
@@ -68,8 +69,16 @@ static const CodecInfo* kAudioMP4Codecs[] = {
NULL
};
-static StreamParser* BuildMP4Parser() {
- return new mp4::MP4StreamParser();
+static StreamParser* BuildMP4Parser(const std::vector<std::string>& codecs) {
+ bool has_sbr = false;
+ for (size_t i = 0; i < codecs.size(); ++i) {
+ if (codecs[i] == "mp4a.40.5") {
vrk (LEFT CHROMIUM) 2012/07/20 23:08:48 nit: put string in a constant?
acolwell GONE FROM CHROMIUM 2012/07/20 23:20:05 Done.
+ has_sbr = true;
+ break;
+ }
+ }
+
+ return new mp4::MP4StreamParser(has_sbr);
}
#endif
@@ -639,7 +648,7 @@ ChunkDemuxer::Status ChunkDemuxer::AddId(const std::string& id,
base::Unretained(this));
}
- scoped_ptr<StreamParser> stream_parser(factory_function());
+ scoped_ptr<StreamParser> stream_parser(factory_function(codecs));
CHECK(stream_parser.get());
stream_parser->Init(
« no previous file with comments | « no previous file | media/filters/ffmpeg_audio_decoder.cc » ('j') | media/mp4/aac.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698