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

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: Typo. 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 404
405 if (block_duration >= 0) { 405 if (block_duration >= 0) {
406 buffer->set_duration(base::TimeDelta::FromMicroseconds( 406 buffer->set_duration(base::TimeDelta::FromMicroseconds(
407 block_duration * timecode_multiplier_)); 407 block_duration * timecode_multiplier_));
408 } else { 408 } else {
409 DCHECK_NE(buffer_type, DemuxerStream::TEXT); 409 DCHECK_NE(buffer_type, DemuxerStream::TEXT);
410 buffer->set_duration(track->default_duration()); 410 buffer->set_duration(track->default_duration());
411 } 411 }
412 412
413 if (discard_padding != 0) { 413 if (discard_padding != 0) {
414 buffer->set_discard_padding(base::TimeDelta::FromMicroseconds( 414 buffer->set_discard_padding(std::make_pair(
415 discard_padding / 1000)); 415 base::TimeDelta(),
416 base::TimeDelta::FromMicroseconds(discard_padding / 1000)));
416 } 417 }
417 418
418 return track->AddBuffer(buffer); 419 return track->AddBuffer(buffer);
419 } 420 }
420 421
421 WebMClusterParser::Track::Track(int track_num, bool is_video, 422 WebMClusterParser::Track::Track(int track_num, bool is_video,
422 base::TimeDelta default_duration) 423 base::TimeDelta default_duration)
423 : track_num_(track_num), 424 : track_num_(track_num),
424 is_video_(is_video), 425 is_video_(is_video),
425 default_duration_(default_duration), 426 default_duration_(default_duration),
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 WebMClusterParser::FindTextTrack(int track_num) { 580 WebMClusterParser::FindTextTrack(int track_num) {
580 const TextTrackMap::iterator it = text_track_map_.find(track_num); 581 const TextTrackMap::iterator it = text_track_map_.find(track_num);
581 582
582 if (it == text_track_map_.end()) 583 if (it == text_track_map_.end())
583 return NULL; 584 return NULL;
584 585
585 return &it->second; 586 return &it->second;
586 } 587 }
587 588
588 } // namespace media 589 } // namespace media
OLDNEW
« media/base/audio_buffer_unittest.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