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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/chunk_demuxer.cc
diff --git a/media/filters/chunk_demuxer.cc b/media/filters/chunk_demuxer.cc
index 1b57c3a1b18d35587bf6f07e8b2f6a68c258f15f..d0b4e4ad956ec7b8e1c0f2b30d15aeaa1f1d9586 100644
--- a/media/filters/chunk_demuxer.cc
+++ b/media/filters/chunk_demuxer.cc
@@ -1032,6 +1032,11 @@ void ChunkDemuxerStream::SetLiveness(Liveness liveness) {
liveness_ = liveness;
}
+void ChunkDemuxerStream::NotifyMediaTimeUpdate(DecodeTimestamp media_time) {
+ base::AutoLock auto_lock(lock_);
+ stream_->NotifyMediaTimeUpdate(media_time);
+}
+
void ChunkDemuxerStream::ChangeState_Locked(State state) {
lock_.AssertAcquired();
DVLOG(1) << "ChunkDemuxerStream::ChangeState_Locked() : "
@@ -1124,6 +1129,11 @@ ChunkDemuxer::ChunkDemuxer(
DCHECK(!encrypted_media_init_data_cb_.is_null());
}
+void ChunkDemuxer::SetMediaTimeProvider(
+ const base::Callback<base::TimeDelta(void)>& get_media_time_cb) {
+ get_media_time_cb_ = get_media_time_cb;
+}
+
void ChunkDemuxer::Initialize(
DemuxerHost* host,
const PipelineStatusCB& cb,
@@ -1332,6 +1342,15 @@ void ChunkDemuxer::AppendData(
Ranges<TimeDelta> ranges;
+ if (!get_media_time_cb_.is_null()) {
+ DecodeTimestamp current_media_time =
+ DecodeTimestamp::FromPresentationTime(get_media_time_cb_.Run());
+ if (audio_)
+ audio_->NotifyMediaTimeUpdate(current_media_time);
+ if (video_)
+ video_->NotifyMediaTimeUpdate(current_media_time);
+ }
+
{
base::AutoLock auto_lock(lock_);
DCHECK_NE(state_, ENDED);
« 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