Chromium Code Reviews| 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 245 sample_format = kSampleFormatS16; | 245 sample_format = kSampleFormatS16; |
| 246 } else if (entry.samplesize == 32) { | 246 } else if (entry.samplesize == 32) { |
| 247 sample_format = kSampleFormatS32; | 247 sample_format = kSampleFormatS32; |
| 248 } else { | 248 } else { |
| 249 LOG(ERROR) << "Unsupported sample size."; | 249 LOG(ERROR) << "Unsupported sample size."; |
| 250 return false; | 250 return false; |
| 251 } | 251 } |
| 252 | 252 |
| 253 is_audio_track_encrypted_ = entry.sinf.info.track_encryption.is_encrypted; | 253 is_audio_track_encrypted_ = entry.sinf.info.track_encryption.is_encrypted; |
| 254 DVLOG(1) << "is_audio_track_encrypted_: " << is_audio_track_encrypted_; | 254 DVLOG(1) << "is_audio_track_encrypted_: " << is_audio_track_encrypted_; |
| 255 #if defined(OS_ANDROID) | |
| 256 if (ESDescriptor::IsAAC(audio_type)) { | |
| 257 std::vector<uint8> csd = aac.GetCodecSpecificData(); | |
|
acolwell GONE FROM CHROMIUM
2013/05/29 22:37:25
How about something like this instead?
std::vecto
qinmin
2013/05/30 03:07:55
Done.
| |
| 258 CHECK_EQ(2u, csd.size()); | |
| 259 audio_config.Initialize( | |
| 260 codec, sample_format,channel_layout,sample_per_second, | |
| 261 &csd[0], csd.size(), is_audio_track_encrypted_, false); | |
| 262 } else { | |
| 263 #endif | |
| 255 audio_config.Initialize(codec, sample_format, | 264 audio_config.Initialize(codec, sample_format, |
| 256 channel_layout, | 265 channel_layout, |
| 257 sample_per_second, | 266 sample_per_second, |
| 258 NULL, 0, is_audio_track_encrypted_, false); | 267 NULL, 0, is_audio_track_encrypted_, false); |
| 268 #if defined(OS_ANDROID) | |
| 269 } | |
| 270 #endif | |
| 259 has_audio_ = true; | 271 has_audio_ = true; |
| 260 audio_track_id_ = track->header.track_id; | 272 audio_track_id_ = track->header.track_id; |
| 261 } | 273 } |
| 262 if (track->media.handler.type == kVideo && !video_config.IsValidConfig()) { | 274 if (track->media.handler.type == kVideo && !video_config.IsValidConfig()) { |
| 263 RCHECK(!samp_descr.video_entries.empty()); | 275 RCHECK(!samp_descr.video_entries.empty()); |
| 264 if (desc_idx >= samp_descr.video_entries.size()) | 276 if (desc_idx >= samp_descr.video_entries.size()) |
| 265 desc_idx = 0; | 277 desc_idx = 0; |
| 266 const VideoSampleEntry& entry = samp_descr.video_entries[desc_idx]; | 278 const VideoSampleEntry& entry = samp_descr.video_entries[desc_idx]; |
| 267 | 279 |
| 268 if (!(entry.format == FOURCC_AVC1 || | 280 if (!(entry.format == FOURCC_AVC1 || |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 563 return !err; | 575 return !err; |
| 564 } | 576 } |
| 565 | 577 |
| 566 void MP4StreamParser::ChangeState(State new_state) { | 578 void MP4StreamParser::ChangeState(State new_state) { |
| 567 DVLOG(2) << "Changing state: " << new_state; | 579 DVLOG(2) << "Changing state: " << new_state; |
| 568 state_ = new_state; | 580 state_ = new_state; |
| 569 } | 581 } |
| 570 | 582 |
| 571 } // namespace mp4 | 583 } // namespace mp4 |
| 572 } // namespace media | 584 } // namespace media |
| OLD | NEW |