Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: media/mp4/track_run_iterator.cc

Issue 20123002: Add Chromium-side support for SourceBuffer.appendWindowStart and SourceBuffer.appendWindowEnd. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and remove URL in comment to make presubmit happy. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/mp4/track_run_iterator.h ('k') | media/mp4/track_run_iterator_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/mp4/track_run_iterator.h ('k') | media/mp4/track_run_iterator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698