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

Side by Side Diff: media/filters/chunk_demuxer.cc

Issue 447963003: Introduce DecodeTimestamp class to make it easier to distiguish presentation and decode timestamps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
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/filters/chunk_demuxer.h" 5 #include "media/filters/chunk_demuxer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <list> 9 #include <list>
10 10
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 // range. 847 // range.
848 Ranges<TimeDelta> valid_time_range; 848 Ranges<TimeDelta> valid_time_range;
849 valid_time_range.Add(range.start(0), duration); 849 valid_time_range.Add(range.start(0), duration);
850 return range.IntersectionWith(valid_time_range); 850 return range.IntersectionWith(valid_time_range);
851 } 851 }
852 852
853 TimeDelta ChunkDemuxerStream::GetBufferedDuration() const { 853 TimeDelta ChunkDemuxerStream::GetBufferedDuration() const {
854 return stream_->GetBufferedDuration(); 854 return stream_->GetBufferedDuration();
855 } 855 }
856 856
857 void ChunkDemuxerStream::OnNewMediaSegment(TimeDelta start_timestamp) { 857 void ChunkDemuxerStream::OnNewMediaSegment(DecodeTimestamp start_timestamp) {
858 DVLOG(2) << "ChunkDemuxerStream::OnNewMediaSegment(" 858 DVLOG(2) << "ChunkDemuxerStream::OnNewMediaSegment("
859 << start_timestamp.InSecondsF() << ")"; 859 << start_timestamp.InSecondsF() << ")";
860 base::AutoLock auto_lock(lock_); 860 base::AutoLock auto_lock(lock_);
861 stream_->OnNewMediaSegment(start_timestamp); 861 stream_->OnNewMediaSegment(start_timestamp);
862 } 862 }
863 863
864 bool ChunkDemuxerStream::UpdateAudioConfig(const AudioDecoderConfig& config, 864 bool ChunkDemuxerStream::UpdateAudioConfig(const AudioDecoderConfig& config,
865 const LogCB& log_cb) { 865 const LogCB& log_cb) {
866 DCHECK(config.IsValidConfig()); 866 DCHECK(config.IsValidConfig());
867 DCHECK_EQ(type_, AUDIO); 867 DCHECK_EQ(type_, AUDIO);
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
1140 if (cancel_next_seek_) 1140 if (cancel_next_seek_)
1141 return; 1141 return;
1142 1142
1143 AbortPendingReads(); 1143 AbortPendingReads();
1144 SeekAllSources(seek_time); 1144 SeekAllSources(seek_time);
1145 1145
1146 if (seek_cb_.is_null()) { 1146 if (seek_cb_.is_null()) {
1147 cancel_next_seek_ = true; 1147 cancel_next_seek_ = true;
1148 return; 1148 return;
1149 } 1149 }
1150
wolenetz 2014/08/08 21:30:04 nit: I like blank line after } in this case, and d
acolwell GONE FROM CHROMIUM 2014/08/11 17:05:05 Done.
1151 base::ResetAndReturn(&seek_cb_).Run(PIPELINE_OK); 1150 base::ResetAndReturn(&seek_cb_).Run(PIPELINE_OK);
1152 } 1151 }
1153 1152
1154 ChunkDemuxer::Status ChunkDemuxer::AddId(const std::string& id, 1153 ChunkDemuxer::Status ChunkDemuxer::AddId(const std::string& id,
1155 const std::string& type, 1154 const std::string& type,
1156 std::vector<std::string>& codecs) { 1155 std::vector<std::string>& codecs) {
1157 base::AutoLock auto_lock(lock_); 1156 base::AutoLock auto_lock(lock_);
1158 1157
1159 if ((state_ != WAITING_FOR_INIT && state_ != INITIALIZING) || IsValidId(id)) 1158 if ((state_ != WAITING_FOR_INIT && state_ != INITIALIZING) || IsValidId(id))
1160 return kReachedIdLimit; 1159 return kReachedIdLimit;
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
1753 } 1752 }
1754 1753
1755 void ChunkDemuxer::ShutdownAllStreams() { 1754 void ChunkDemuxer::ShutdownAllStreams() {
1756 for (SourceStateMap::iterator itr = source_state_map_.begin(); 1755 for (SourceStateMap::iterator itr = source_state_map_.begin();
1757 itr != source_state_map_.end(); ++itr) { 1756 itr != source_state_map_.end(); ++itr) {
1758 itr->second->Shutdown(); 1757 itr->second->Shutdown();
1759 } 1758 }
1760 } 1759 }
1761 1760
1762 } // namespace media 1761 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698