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

Unified Diff: media/mp4/mp4_stream_parser.cc

Issue 10753005: Add HE AAC support to ISO BMFF. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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
« media/base/bit_reader.h ('K') | « media/mp4/mp4_stream_parser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mp4/mp4_stream_parser.cc
diff --git a/media/mp4/mp4_stream_parser.cc b/media/mp4/mp4_stream_parser.cc
index bb2a95c57024c65d4f96ebe1803406a26d898b77..ebaa2a2b4af6f40a3637fa6ca33d77a04265827a 100644
--- a/media/mp4/mp4_stream_parser.cc
+++ b/media/mp4/mp4_stream_parser.cc
@@ -13,6 +13,7 @@
#include "media/base/video_decoder_config.h"
#include "media/mp4/box_definitions.h"
#include "media/mp4/box_reader.h"
+#include "media/mp4/es_descriptor.h"
#include "media/mp4/rcheck.h"
namespace media {
@@ -162,10 +163,13 @@ bool MP4StreamParser::ParseMoov(BoxReader* reader) {
// (entry.format == FOURCC_ENCA &&
// entry.sinf.format.format == FOURCC_MP4A));
- const ChannelLayout layout =
- AVC::ConvertAACChannelCountToChannelLayout(entry.channelcount);
- audio_config.Initialize(kCodecAAC, entry.samplesize, layout,
- entry.samplerate, NULL, 0, false);
+ // Check if it is MPEG4 AAC defined in ISO 14496 Part 3.
+ RCHECK(entry.esds.object_type == kISO_14496_3);
+ aac_ = entry.esds.aac;
+ audio_config.Initialize(kCodecAAC, entry.samplesize,
+ aac_.channel_layout(), aac_.frequency(),
+ NULL, 0, false);
+
has_audio_ = true;
audio_track_id_ = track->header.track_id;
}
@@ -291,6 +295,10 @@ bool MP4StreamParser::EnqueueSample(BufferQueue* audio_buffers,
}
}
+ if (audio) {
+ aac_.ConvertEsdsToADTS(&frame_buf);
+ }
+
scoped_refptr<StreamParserBuffer> stream_buf =
StreamParserBuffer::CopyFrom(&frame_buf[0], frame_buf.size(),
runs_.is_keyframe());
« media/base/bit_reader.h ('K') | « media/mp4/mp4_stream_parser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698