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

Unified Diff: media/mp4/mp4_stream_parser.cc

Issue 16114009: Add AAC codec specific data for MSE on android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressing comments Created 7 years, 7 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 | « media/mp4/aac.cc ('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 77fa2b80c214d503e997fda76caac964be406f39..9f808eaf4b80a2404b44afd80632a39796ea09f7 100644
--- a/media/mp4/mp4_stream_parser.cc
+++ b/media/mp4/mp4_stream_parser.cc
@@ -222,12 +222,16 @@ bool MP4StreamParser::ParseMoov(BoxReader* reader) {
AudioCodec codec = kUnknownAudioCodec;
ChannelLayout channel_layout = CHANNEL_LAYOUT_NONE;
int sample_per_second = 0;
+ std::vector<uint8> extra_data;
// Check if it is MPEG4 AAC defined in ISO 14496 Part 3 or
// supported MPEG2 AAC varients.
if (ESDescriptor::IsAAC(audio_type)) {
codec = kCodecAAC;
channel_layout = aac.GetChannelLayout(has_sbr_);
sample_per_second = aac.GetOutputSamplesPerSecond(has_sbr_);
+#if defined(OS_ANDROID)
+ extra_data = aac.codec_specific_data();
+#endif
} else if (audio_type == kEAC3) {
codec = kCodecEAC3;
channel_layout = GuessChannelLayout(entry.channelcount);
@@ -252,10 +256,10 @@ bool MP4StreamParser::ParseMoov(BoxReader* reader) {
is_audio_track_encrypted_ = entry.sinf.info.track_encryption.is_encrypted;
DVLOG(1) << "is_audio_track_encrypted_: " << is_audio_track_encrypted_;
- audio_config.Initialize(codec, sample_format,
- channel_layout,
- sample_per_second,
- NULL, 0, is_audio_track_encrypted_, false);
+ audio_config.Initialize(
+ codec, sample_format, channel_layout, sample_per_second,
+ extra_data.size() ? &extra_data[0] : NULL, extra_data.size(),
+ is_audio_track_encrypted_, false);
has_audio_ = true;
audio_track_id_ = track->header.track_id;
}
« no previous file with comments | « media/mp4/aac.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698