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

Side by Side Diff: media/mp4/mp4_stream_parser.cc

Issue 11088047: Support encrypted audio stream in demuxer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/filters/ffmpeg_audio_decoder_unittest.cc ('k') | media/webm/webm_cluster_parser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/mp4/mp4_stream_parser.h" 5 #include "media/mp4/mp4_stream_parser.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 entry.sinf.format.format == FOURCC_MP4A))) { 192 entry.sinf.format.format == FOURCC_MP4A))) {
193 LOG(ERROR) << "Unsupported audio format."; 193 LOG(ERROR) << "Unsupported audio format.";
194 return false; 194 return false;
195 } 195 }
196 // Check if it is MPEG4 AAC defined in ISO 14496 Part 3. 196 // Check if it is MPEG4 AAC defined in ISO 14496 Part 3.
197 if (entry.esds.object_type != kISO_14496_3) { 197 if (entry.esds.object_type != kISO_14496_3) {
198 LOG(ERROR) << "Unsupported audio object type."; 198 LOG(ERROR) << "Unsupported audio object type.";
199 return false; 199 return false;
200 } 200 }
201 201
202 bool is_encrypted = entry.sinf.info.track_encryption.is_encrypted;
202 audio_config.Initialize(kCodecAAC, entry.samplesize, 203 audio_config.Initialize(kCodecAAC, entry.samplesize,
203 aac.channel_layout(), 204 aac.channel_layout(),
204 aac.GetOutputSamplesPerSecond(has_sbr_), 205 aac.GetOutputSamplesPerSecond(has_sbr_),
205 NULL, 0, false); 206 NULL, 0, is_encrypted, false);
206 has_audio_ = true; 207 has_audio_ = true;
207 audio_track_id_ = track->header.track_id; 208 audio_track_id_ = track->header.track_id;
208 } 209 }
209 if (track->media.handler.type == kVideo && !video_config.IsValidConfig()) { 210 if (track->media.handler.type == kVideo && !video_config.IsValidConfig()) {
210 RCHECK(!samp_descr.video_entries.empty()); 211 RCHECK(!samp_descr.video_entries.empty());
211 if (desc_idx >= samp_descr.video_entries.size()) 212 if (desc_idx >= samp_descr.video_entries.size())
212 desc_idx = 0; 213 desc_idx = 0;
213 const VideoSampleEntry& entry = samp_descr.video_entries[desc_idx]; 214 const VideoSampleEntry& entry = samp_descr.video_entries[desc_idx];
214 215
215 if (!(entry.format == FOURCC_AVC1 || 216 if (!(entry.format == FOURCC_AVC1 ||
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 return !err; 496 return !err;
496 } 497 }
497 498
498 void MP4StreamParser::ChangeState(State new_state) { 499 void MP4StreamParser::ChangeState(State new_state) {
499 DVLOG(2) << "Changing state: " << new_state; 500 DVLOG(2) << "Changing state: " << new_state;
500 state_ = new_state; 501 state_ = new_state;
501 } 502 }
502 503
503 } // namespace mp4 504 } // namespace mp4
504 } // namespace media 505 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/ffmpeg_audio_decoder_unittest.cc ('k') | media/webm/webm_cluster_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698