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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 entry.sinf.format.format == FOURCC_AVC1))) { | 215 entry.sinf.format.format == FOURCC_AVC1))) { |
216 LOG(ERROR) << "Unsupported video format."; | 216 LOG(ERROR) << "Unsupported video format."; |
217 return false; | 217 return false; |
218 } | 218 } |
219 RCHECK(EmitKeyNeeded(entry.sinf.info.track_encryption)); | 219 RCHECK(EmitKeyNeeded(entry.sinf.info.track_encryption)); |
220 | 220 |
221 // TODO(strobe): Recover correct crop box | 221 // TODO(strobe): Recover correct crop box |
222 video_config.Initialize(kCodecH264, H264PROFILE_MAIN, VideoFrame::YV12, | 222 video_config.Initialize(kCodecH264, H264PROFILE_MAIN, VideoFrame::YV12, |
223 gfx::Size(entry.width, entry.height), | 223 gfx::Size(entry.width, entry.height), |
224 gfx::Rect(0, 0, entry.width, entry.height), | 224 gfx::Rect(0, 0, entry.width, entry.height), |
225 // Framerate of zero is provided to signal that | |
226 // the decoder should trust demuxer timestamps | |
227 0, 1, | |
228 entry.pixel_aspect.h_spacing, | 225 entry.pixel_aspect.h_spacing, |
229 entry.pixel_aspect.v_spacing, | 226 entry.pixel_aspect.v_spacing, |
230 // No decoder-specific buffer needed for AVC; | 227 // No decoder-specific buffer needed for AVC; |
231 // SPS/PPS are embedded in the video stream | 228 // SPS/PPS are embedded in the video stream |
232 NULL, 0, false); | 229 NULL, 0, false); |
233 has_video_ = true; | 230 has_video_ = true; |
234 video_track_id_ = track->header.track_id; | 231 video_track_id_ = track->header.track_id; |
235 } | 232 } |
236 } | 233 } |
237 | 234 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 return true; | 460 return true; |
464 } | 461 } |
465 | 462 |
466 void MP4StreamParser::ChangeState(State new_state) { | 463 void MP4StreamParser::ChangeState(State new_state) { |
467 DVLOG(2) << "Changing state: " << new_state; | 464 DVLOG(2) << "Changing state: " << new_state; |
468 state_ = new_state; | 465 state_ = new_state; |
469 } | 466 } |
470 | 467 |
471 } // namespace mp4 | 468 } // namespace mp4 |
472 } // namespace media | 469 } // namespace media |
OLD | NEW |