| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/formats/mp4/mp4_stream_parser.h" | 5 #include "media/formats/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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 moov_->header.timescale); | 294 moov_->header.timescale); |
| 295 } else if (moov_->header.duration > 0 && | 295 } else if (moov_->header.duration > 0 && |
| 296 moov_->header.duration != kuint64max) { | 296 moov_->header.duration != kuint64max) { |
| 297 duration = TimeDeltaFromRational(moov_->header.duration, | 297 duration = TimeDeltaFromRational(moov_->header.duration, |
| 298 moov_->header.timescale); | 298 moov_->header.timescale); |
| 299 } else { | 299 } else { |
| 300 duration = kInfiniteDuration(); | 300 duration = kInfiniteDuration(); |
| 301 } | 301 } |
| 302 | 302 |
| 303 if (!init_cb_.is_null()) | 303 if (!init_cb_.is_null()) |
| 304 base::ResetAndReturn(&init_cb_).Run(true, duration); | 304 base::ResetAndReturn(&init_cb_).Run(true, duration, false); |
| 305 | 305 |
| 306 EmitNeedKeyIfNecessary(moov_->pssh); | 306 EmitNeedKeyIfNecessary(moov_->pssh); |
| 307 return true; | 307 return true; |
| 308 } | 308 } |
| 309 | 309 |
| 310 bool MP4StreamParser::ParseMoof(BoxReader* reader) { | 310 bool MP4StreamParser::ParseMoof(BoxReader* reader) { |
| 311 RCHECK(moov_.get()); // Must already have initialization segment | 311 RCHECK(moov_.get()); // Must already have initialization segment |
| 312 MovieFragment moof; | 312 MovieFragment moof; |
| 313 RCHECK(moof.Parse(reader)); | 313 RCHECK(moof.Parse(reader)); |
| 314 if (!runs_) | 314 if (!runs_) |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 return !err; | 569 return !err; |
| 570 } | 570 } |
| 571 | 571 |
| 572 void MP4StreamParser::ChangeState(State new_state) { | 572 void MP4StreamParser::ChangeState(State new_state) { |
| 573 DVLOG(2) << "Changing state: " << new_state; | 573 DVLOG(2) << "Changing state: " << new_state; |
| 574 state_ = new_state; | 574 state_ = new_state; |
| 575 } | 575 } |
| 576 | 576 |
| 577 } // namespace mp4 | 577 } // namespace mp4 |
| 578 } // namespace media | 578 } // namespace media |
| OLD | NEW |