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

Side by Side Diff: media/formats/webm/webm_cluster_parser.cc

Issue 251893002: Support start trimming post-decoding. Use it with FFmpegDemuxer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. Created 6 years, 7 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
OLDNEW
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/webm/webm_cluster_parser.h" 5 #include "media/formats/webm/webm_cluster_parser.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/sys_byteorder.h" 10 #include "base/sys_byteorder.h"
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 409
410 if (block_duration >= 0) { 410 if (block_duration >= 0) {
411 buffer->set_duration(base::TimeDelta::FromMicroseconds( 411 buffer->set_duration(base::TimeDelta::FromMicroseconds(
412 block_duration * timecode_multiplier_)); 412 block_duration * timecode_multiplier_));
413 } else { 413 } else {
414 DCHECK_NE(buffer_type, DemuxerStream::TEXT); 414 DCHECK_NE(buffer_type, DemuxerStream::TEXT);
415 buffer->set_duration(track->default_duration()); 415 buffer->set_duration(track->default_duration());
416 } 416 }
417 417
418 if (discard_padding != 0) { 418 if (discard_padding != 0) {
419 buffer->set_discard_padding(base::TimeDelta::FromMicroseconds( 419 buffer->set_discard_padding(std::make_pair(
420 discard_padding / 1000)); 420 base::TimeDelta(),
421 base::TimeDelta::FromMicroseconds(discard_padding / 1000)));
wolenetz 2014/05/05 19:01:23 Matroska allows for negative DiscardPadding to ind
DaleCurtis 2014/05/05 20:16:03 I didn't know that. If WebM supports that, probab
421 } 422 }
422 423
423 return track->AddBuffer(buffer); 424 return track->AddBuffer(buffer);
424 } 425 }
425 426
426 WebMClusterParser::Track::Track(int track_num, 427 WebMClusterParser::Track::Track(int track_num,
427 bool is_video, 428 bool is_video,
428 base::TimeDelta default_duration, 429 base::TimeDelta default_duration,
429 const LogCB& log_cb) 430 const LogCB& log_cb)
430 : track_num_(track_num), 431 : track_num_(track_num),
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 WebMClusterParser::FindTextTrack(int track_num) { 677 WebMClusterParser::FindTextTrack(int track_num) {
677 const TextTrackMap::iterator it = text_track_map_.find(track_num); 678 const TextTrackMap::iterator it = text_track_map_.find(track_num);
678 679
679 if (it == text_track_map_.end()) 680 if (it == text_track_map_.end())
680 return NULL; 681 return NULL;
681 682
682 return &it->second; 683 return &it->second;
683 } 684 }
684 685
685 } // namespace media 686 } // namespace media
OLDNEW
« media/base/audio_discard_helper.cc ('K') | « media/filters/pipeline_integration_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698