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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 } else if (entry.samplesize == 32) { | 230 } else if (entry.samplesize == 32) { |
231 sample_format = kSampleFormatS32; | 231 sample_format = kSampleFormatS32; |
232 } else { | 232 } else { |
233 LOG(ERROR) << "Unsupported sample size."; | 233 LOG(ERROR) << "Unsupported sample size."; |
234 return false; | 234 return false; |
235 } | 235 } |
236 | 236 |
237 is_audio_track_encrypted_ = entry.sinf.info.track_encryption.is_encrypted; | 237 is_audio_track_encrypted_ = entry.sinf.info.track_encryption.is_encrypted; |
238 DVLOG(1) << "is_audio_track_encrypted_: " << is_audio_track_encrypted_; | 238 DVLOG(1) << "is_audio_track_encrypted_: " << is_audio_track_encrypted_; |
239 audio_config.Initialize(kCodecAAC, sample_format, | 239 audio_config.Initialize(kCodecAAC, sample_format, |
240 aac.channel_layout(), | 240 aac.GetChannelLayout(has_sbr_), |
241 aac.GetOutputSamplesPerSecond(has_sbr_), | 241 aac.GetOutputSamplesPerSecond(has_sbr_), |
242 NULL, 0, is_audio_track_encrypted_, false); | 242 NULL, 0, is_audio_track_encrypted_, false); |
243 has_audio_ = true; | 243 has_audio_ = true; |
244 audio_track_id_ = track->header.track_id; | 244 audio_track_id_ = track->header.track_id; |
245 } | 245 } |
246 if (track->media.handler.type == kVideo && !video_config.IsValidConfig()) { | 246 if (track->media.handler.type == kVideo && !video_config.IsValidConfig()) { |
247 RCHECK(!samp_descr.video_entries.empty()); | 247 RCHECK(!samp_descr.video_entries.empty()); |
248 if (desc_idx >= samp_descr.video_entries.size()) | 248 if (desc_idx >= samp_descr.video_entries.size()) |
249 desc_idx = 0; | 249 desc_idx = 0; |
250 const VideoSampleEntry& entry = samp_descr.video_entries[desc_idx]; | 250 const VideoSampleEntry& entry = samp_descr.video_entries[desc_idx]; |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 return !err; | 546 return !err; |
547 } | 547 } |
548 | 548 |
549 void MP4StreamParser::ChangeState(State new_state) { | 549 void MP4StreamParser::ChangeState(State new_state) { |
550 DVLOG(2) << "Changing state: " << new_state; | 550 DVLOG(2) << "Changing state: " << new_state; |
551 state_ = new_state; | 551 state_ = new_state; |
552 } | 552 } |
553 | 553 |
554 } // namespace mp4 | 554 } // namespace mp4 |
555 } // namespace media | 555 } // namespace media |
OLD | NEW |