OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |