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/time.h" | 10 #include "base/time/time.h" |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 } else { | 250 } else { |
251 LOG(ERROR) << "Unsupported sample size."; | 251 LOG(ERROR) << "Unsupported sample size."; |
252 return false; | 252 return false; |
253 } | 253 } |
254 | 254 |
255 is_audio_track_encrypted_ = entry.sinf.info.track_encryption.is_encrypted; | 255 is_audio_track_encrypted_ = entry.sinf.info.track_encryption.is_encrypted; |
256 DVLOG(1) << "is_audio_track_encrypted_: " << is_audio_track_encrypted_; | 256 DVLOG(1) << "is_audio_track_encrypted_: " << is_audio_track_encrypted_; |
257 audio_config.Initialize( | 257 audio_config.Initialize( |
258 codec, sample_format, channel_layout, sample_per_second, | 258 codec, sample_format, channel_layout, sample_per_second, |
259 extra_data.size() ? &extra_data[0] : NULL, extra_data.size(), | 259 extra_data.size() ? &extra_data[0] : NULL, extra_data.size(), |
260 is_audio_track_encrypted_, false); | 260 is_audio_track_encrypted_, false, base::TimeDelta(), |
| 261 base::TimeDelta()); |
261 has_audio_ = true; | 262 has_audio_ = true; |
262 audio_track_id_ = track->header.track_id; | 263 audio_track_id_ = track->header.track_id; |
263 } | 264 } |
264 if (track->media.handler.type == kVideo && !video_config.IsValidConfig()) { | 265 if (track->media.handler.type == kVideo && !video_config.IsValidConfig()) { |
265 RCHECK(!samp_descr.video_entries.empty()); | 266 RCHECK(!samp_descr.video_entries.empty()); |
266 if (desc_idx >= samp_descr.video_entries.size()) | 267 if (desc_idx >= samp_descr.video_entries.size()) |
267 desc_idx = 0; | 268 desc_idx = 0; |
268 const VideoSampleEntry& entry = samp_descr.video_entries[desc_idx]; | 269 const VideoSampleEntry& entry = samp_descr.video_entries[desc_idx]; |
269 | 270 |
270 if (!(entry.format == FOURCC_AVC1 || | 271 if (!(entry.format == FOURCC_AVC1 || |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 return !err; | 569 return !err; |
569 } | 570 } |
570 | 571 |
571 void MP4StreamParser::ChangeState(State new_state) { | 572 void MP4StreamParser::ChangeState(State new_state) { |
572 DVLOG(2) << "Changing state: " << new_state; | 573 DVLOG(2) << "Changing state: " << new_state; |
573 state_ = new_state; | 574 state_ = new_state; |
574 } | 575 } |
575 | 576 |
576 } // namespace mp4 | 577 } // namespace mp4 |
577 } // namespace media | 578 } // namespace media |
OLD | NEW |