| 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/track_run_iterator.h" | 5 #include "media/mp4/track_run_iterator.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "media/base/buffers.h" | 9 #include "media/base/buffers.h" |
| 10 #include "media/base/stream_parser_buffer.h" | 10 #include "media/base/stream_parser_buffer.h" |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 if (next_run != runs_.end()) { | 336 if (next_run != runs_.end()) { |
| 337 offset = std::min(offset, next_run->sample_start_offset); | 337 offset = std::min(offset, next_run->sample_start_offset); |
| 338 if (next_run->aux_info_total_size) | 338 if (next_run->aux_info_total_size) |
| 339 offset = std::min(offset, next_run->aux_info_start_offset); | 339 offset = std::min(offset, next_run->aux_info_start_offset); |
| 340 } | 340 } |
| 341 } | 341 } |
| 342 if (offset == kint64max) return 0; | 342 if (offset == kint64max) return 0; |
| 343 return offset; | 343 return offset; |
| 344 } | 344 } |
| 345 | 345 |
| 346 TimeDelta TrackRunIterator::GetMinDecodeTimestamp() { | |
| 347 TimeDelta dts = kInfiniteDuration(); | |
| 348 for (size_t i = 0; i < runs_.size(); i++) { | |
| 349 dts = std::min(dts, TimeDeltaFromRational(runs_[i].start_dts, | |
| 350 runs_[i].timescale)); | |
| 351 } | |
| 352 return dts; | |
| 353 } | |
| 354 | |
| 355 uint32 TrackRunIterator::track_id() const { | 346 uint32 TrackRunIterator::track_id() const { |
| 356 DCHECK(IsRunValid()); | 347 DCHECK(IsRunValid()); |
| 357 return run_itr_->track_id; | 348 return run_itr_->track_id; |
| 358 } | 349 } |
| 359 | 350 |
| 360 bool TrackRunIterator::is_encrypted() const { | 351 bool TrackRunIterator::is_encrypted() const { |
| 361 DCHECK(IsRunValid()); | 352 DCHECK(IsRunValid()); |
| 362 return track_encryption().is_encrypted; | 353 return track_encryption().is_encrypted; |
| 363 } | 354 } |
| 364 | 355 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 return scoped_ptr<DecryptConfig>(new DecryptConfig( | 432 return scoped_ptr<DecryptConfig>(new DecryptConfig( |
| 442 std::string(reinterpret_cast<const char*>(&kid[0]), kid.size()), | 433 std::string(reinterpret_cast<const char*>(&kid[0]), kid.size()), |
| 443 std::string(reinterpret_cast<const char*>(cenc_info.iv), | 434 std::string(reinterpret_cast<const char*>(cenc_info.iv), |
| 444 arraysize(cenc_info.iv)), | 435 arraysize(cenc_info.iv)), |
| 445 0, // No offset to start of media data in MP4 using CENC. | 436 0, // No offset to start of media data in MP4 using CENC. |
| 446 cenc_info.subsamples)); | 437 cenc_info.subsamples)); |
| 447 } | 438 } |
| 448 | 439 |
| 449 } // namespace mp4 | 440 } // namespace mp4 |
| 450 } // namespace media | 441 } // namespace media |
| OLD | NEW |