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

Unified Diff: media/filters/chunk_demuxer.cc

Issue 231283005: Add live mode detection in WebM MediaSource parser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/chunk_demuxer.h ('k') | media/filters/ffmpeg_demuxer.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 e6caaebc35ca68f420fab3b60cfb8a50119f2e8f..d2a2b649556eb2acff80a90f865ab77c35466663 100644
--- a/media/filters/chunk_demuxer.cc
+++ b/media/filters/chunk_demuxer.cc
@@ -974,6 +974,7 @@ ChunkDemuxer::ChunkDemuxer(const base::Closure& open_cb,
log_cb_(log_cb),
duration_(kNoTimestamp()),
user_specified_duration_(-1),
+ liveness_(LIVENESS_UNKNOWN),
splice_frames_enabled_(splice_frames_enabled) {
DCHECK(!open_cb_.is_null());
DCHECK(!need_key_cb_.is_null());
@@ -1064,6 +1065,10 @@ base::Time ChunkDemuxer::GetTimelineOffset() const {
return timeline_offset_;
}
+Demuxer::Liveness ChunkDemuxer::GetLiveness() const {
+ return liveness_;
+}
+
void ChunkDemuxer::StartWaitingForSeek(TimeDelta seek_time) {
DVLOG(1) << "StartWaitingForSeek()";
base::AutoLock auto_lock(lock_);
@@ -1508,6 +1513,17 @@ void ChunkDemuxer::OnSourceInitDone(
timeline_offset_ = params.timeline_offset;
}
+ if (params.liveness != LIVENESS_UNKNOWN) {
+ if (liveness_ != LIVENESS_UNKNOWN && params.liveness != liveness_) {
+ MEDIA_LOG(log_cb_)
+ << "Liveness is not the same across all SourceBuffers.";
+ ReportError_Locked(DEMUXER_ERROR_COULD_NOT_OPEN);
+ return;
+ }
+
+ liveness_ = params.liveness;
+ }
+
// Wait until all streams have initialized.
if ((!source_id_audio_.empty() && !audio_) ||
(!source_id_video_.empty() && !video_)) {
« no previous file with comments | « media/filters/chunk_demuxer.h ('k') | media/filters/ffmpeg_demuxer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698