| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 return false; | 220 return false; |
| 221 } | 221 } |
| 222 RCHECK(EmitKeyNeeded(entry.sinf.info.track_encryption)); | 222 RCHECK(EmitKeyNeeded(entry.sinf.info.track_encryption)); |
| 223 | 223 |
| 224 // TODO(strobe): Recover correct crop box | 224 // TODO(strobe): Recover correct crop box |
| 225 gfx::Size coded_size(entry.width, entry.height); | 225 gfx::Size coded_size(entry.width, entry.height); |
| 226 gfx::Rect visible_rect(coded_size); | 226 gfx::Rect visible_rect(coded_size); |
| 227 gfx::Size natural_size = GetNaturalSize(visible_rect.size(), | 227 gfx::Size natural_size = GetNaturalSize(visible_rect.size(), |
| 228 entry.pixel_aspect.h_spacing, | 228 entry.pixel_aspect.h_spacing, |
| 229 entry.pixel_aspect.v_spacing); | 229 entry.pixel_aspect.v_spacing); |
| 230 bool is_encrypted = entry.sinf.info.track_encryption.is_encrypted; |
| 230 video_config.Initialize(kCodecH264, H264PROFILE_MAIN, VideoFrame::YV12, | 231 video_config.Initialize(kCodecH264, H264PROFILE_MAIN, VideoFrame::YV12, |
| 231 coded_size, visible_rect, natural_size, | 232 coded_size, visible_rect, natural_size, |
| 232 // No decoder-specific buffer needed for AVC; | 233 // No decoder-specific buffer needed for AVC; |
| 233 // SPS/PPS are embedded in the video stream | 234 // SPS/PPS are embedded in the video stream |
| 234 NULL, 0, true); | 235 NULL, 0, is_encrypted, true); |
| 235 has_video_ = true; | 236 has_video_ = true; |
| 236 video_track_id_ = track->header.track_id; | 237 video_track_id_ = track->header.track_id; |
| 237 } | 238 } |
| 238 } | 239 } |
| 239 | 240 |
| 240 RCHECK(config_cb_.Run(audio_config, video_config)); | 241 RCHECK(config_cb_.Run(audio_config, video_config)); |
| 241 | 242 |
| 242 base::TimeDelta duration; | 243 base::TimeDelta duration; |
| 243 if (moov_->extends.header.fragment_duration > 0) { | 244 if (moov_->extends.header.fragment_duration > 0) { |
| 244 duration = TimeDeltaFromRational(moov_->extends.header.fragment_duration, | 245 duration = TimeDeltaFromRational(moov_->extends.header.fragment_duration, |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 return !err; | 484 return !err; |
| 484 } | 485 } |
| 485 | 486 |
| 486 void MP4StreamParser::ChangeState(State new_state) { | 487 void MP4StreamParser::ChangeState(State new_state) { |
| 487 DVLOG(2) << "Changing state: " << new_state; | 488 DVLOG(2) << "Changing state: " << new_state; |
| 488 state_ = new_state; | 489 state_ = new_state; |
| 489 } | 490 } |
| 490 | 491 |
| 491 } // namespace mp4 | 492 } // namespace mp4 |
| 492 } // namespace media | 493 } // namespace media |
| OLD | NEW |