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

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

Issue 791723003: Use of the playback time in the MSE garbage collection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « media/filters/chunk_demuxer.h ('k') | media/filters/source_buffer_range.h » ('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/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 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after
1025 CHECK_EQ(type_, TEXT); 1025 CHECK_EQ(type_, TEXT);
1026 base::AutoLock auto_lock(lock_); 1026 base::AutoLock auto_lock(lock_);
1027 return stream_->GetCurrentTextTrackConfig(); 1027 return stream_->GetCurrentTextTrackConfig();
1028 } 1028 }
1029 1029
1030 void ChunkDemuxerStream::SetLiveness(Liveness liveness) { 1030 void ChunkDemuxerStream::SetLiveness(Liveness liveness) {
1031 base::AutoLock auto_lock(lock_); 1031 base::AutoLock auto_lock(lock_);
1032 liveness_ = liveness; 1032 liveness_ = liveness;
1033 } 1033 }
1034 1034
1035 void ChunkDemuxerStream::NotifyMediaTimeUpdate(DecodeTimestamp media_time) {
1036 base::AutoLock auto_lock(lock_);
1037 stream_->NotifyMediaTimeUpdate(media_time);
1038 }
1039
1035 void ChunkDemuxerStream::ChangeState_Locked(State state) { 1040 void ChunkDemuxerStream::ChangeState_Locked(State state) {
1036 lock_.AssertAcquired(); 1041 lock_.AssertAcquired();
1037 DVLOG(1) << "ChunkDemuxerStream::ChangeState_Locked() : " 1042 DVLOG(1) << "ChunkDemuxerStream::ChangeState_Locked() : "
1038 << "type " << type_ 1043 << "type " << type_
1039 << " - " << state_ << " -> " << state; 1044 << " - " << state_ << " -> " << state;
1040 state_ = state; 1045 state_ = state;
1041 } 1046 }
1042 1047
1043 ChunkDemuxerStream::~ChunkDemuxerStream() {} 1048 ChunkDemuxerStream::~ChunkDemuxerStream() {}
1044 1049
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 log_cb_(log_cb), 1122 log_cb_(log_cb),
1118 media_log_(media_log), 1123 media_log_(media_log),
1119 duration_(kNoTimestamp()), 1124 duration_(kNoTimestamp()),
1120 user_specified_duration_(-1), 1125 user_specified_duration_(-1),
1121 liveness_(DemuxerStream::LIVENESS_UNKNOWN), 1126 liveness_(DemuxerStream::LIVENESS_UNKNOWN),
1122 splice_frames_enabled_(splice_frames_enabled) { 1127 splice_frames_enabled_(splice_frames_enabled) {
1123 DCHECK(!open_cb_.is_null()); 1128 DCHECK(!open_cb_.is_null());
1124 DCHECK(!encrypted_media_init_data_cb_.is_null()); 1129 DCHECK(!encrypted_media_init_data_cb_.is_null());
1125 } 1130 }
1126 1131
1132 void ChunkDemuxer::SetMediaTimeProvider(
1133 const base::Callback<base::TimeDelta(void)>& get_media_time_cb) {
1134 get_media_time_cb_ = get_media_time_cb;
1135 }
1136
1127 void ChunkDemuxer::Initialize( 1137 void ChunkDemuxer::Initialize(
1128 DemuxerHost* host, 1138 DemuxerHost* host,
1129 const PipelineStatusCB& cb, 1139 const PipelineStatusCB& cb,
1130 bool enable_text_tracks) { 1140 bool enable_text_tracks) {
1131 DVLOG(1) << "Init()"; 1141 DVLOG(1) << "Init()";
1132 1142
1133 base::AutoLock auto_lock(lock_); 1143 base::AutoLock auto_lock(lock_);
1134 1144
1135 init_cb_ = BindToCurrentLoop(cb); 1145 init_cb_ = BindToCurrentLoop(cb);
1136 if (state_ == SHUTDOWN) { 1146 if (state_ == SHUTDOWN) {
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 TimeDelta* timestamp_offset, 1335 TimeDelta* timestamp_offset,
1326 const InitSegmentReceivedCB& init_segment_received_cb) { 1336 const InitSegmentReceivedCB& init_segment_received_cb) {
1327 DVLOG(1) << "AppendData(" << id << ", " << length << ")"; 1337 DVLOG(1) << "AppendData(" << id << ", " << length << ")";
1328 1338
1329 DCHECK(!id.empty()); 1339 DCHECK(!id.empty());
1330 DCHECK(timestamp_offset); 1340 DCHECK(timestamp_offset);
1331 DCHECK(!init_segment_received_cb.is_null()); 1341 DCHECK(!init_segment_received_cb.is_null());
1332 1342
1333 Ranges<TimeDelta> ranges; 1343 Ranges<TimeDelta> ranges;
1334 1344
1345 if (!get_media_time_cb_.is_null()) {
1346 DecodeTimestamp current_media_time =
1347 DecodeTimestamp::FromPresentationTime(get_media_time_cb_.Run());
1348 if (audio_)
1349 audio_->NotifyMediaTimeUpdate(current_media_time);
1350 if (video_)
1351 video_->NotifyMediaTimeUpdate(current_media_time);
1352 }
1353
1335 { 1354 {
1336 base::AutoLock auto_lock(lock_); 1355 base::AutoLock auto_lock(lock_);
1337 DCHECK_NE(state_, ENDED); 1356 DCHECK_NE(state_, ENDED);
1338 1357
1339 // Capture if any of the SourceBuffers are waiting for data before we start 1358 // Capture if any of the SourceBuffers are waiting for data before we start
1340 // parsing. 1359 // parsing.
1341 bool old_waiting_for_data = IsSeekWaitingForData_Locked(); 1360 bool old_waiting_for_data = IsSeekWaitingForData_Locked();
1342 1361
1343 if (length == 0u) 1362 if (length == 0u)
1344 return; 1363 return;
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
1852 } 1871 }
1853 1872
1854 void ChunkDemuxer::ShutdownAllStreams() { 1873 void ChunkDemuxer::ShutdownAllStreams() {
1855 for (SourceStateMap::iterator itr = source_state_map_.begin(); 1874 for (SourceStateMap::iterator itr = source_state_map_.begin();
1856 itr != source_state_map_.end(); ++itr) { 1875 itr != source_state_map_.end(); ++itr) {
1857 itr->second->Shutdown(); 1876 itr->second->Shutdown();
1858 } 1877 }
1859 } 1878 }
1860 1879
1861 } // namespace media 1880 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/chunk_demuxer.h ('k') | media/filters/source_buffer_range.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698