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

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: Address CR comments. 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') | no next file with comments »
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..e28a2d313062f98d03e01817df9ba54d39e2db9c 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,19 @@ static const CodecInfo* kAudioMP4Codecs[] = {
NULL
};
-static StreamParser* BuildMP4Parser() {
- return new mp4::MP4StreamParser();
+// Mimetype codec string that indicates the content contains AAC SBR frames.
+static const char* kSBRCodecId = "mp4a.40.5";
+
+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] == kSBRCodecId) {
+ has_sbr = true;
+ break;
+ }
+ }
+
+ return new mp4::MP4StreamParser(has_sbr);
}
#endif
@@ -639,7 +651,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698