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

Unified Diff: media/filters/ffmpeg_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/ffmpeg_demuxer.h ('k') | media/formats/webm/webm_stream_parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_demuxer.cc
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
index d54db072725801e754db463d2a00b5f299d2cf94..40a8c917c9000e5d3c777a2977d5e762f8af165b 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -394,6 +394,7 @@ FFmpegDemuxer::FFmpegDemuxer(
media_log_(media_log),
bitrate_(0),
start_time_(kNoTimestamp()),
+ liveness_(LIVENESS_UNKNOWN),
audio_disabled_(false),
text_enabled_(false),
duration_known_(false),
@@ -506,6 +507,11 @@ base::Time FFmpegDemuxer::GetTimelineOffset() const {
return timeline_offset_;
}
+Demuxer::Liveness FFmpegDemuxer::GetLiveness() const {
+ DCHECK(task_runner_->BelongsToCurrentThread());
+ return liveness_;
+}
+
void FFmpegDemuxer::AddTextStreams() {
DCHECK(task_runner_->BelongsToCurrentThread());
@@ -696,6 +702,14 @@ void FFmpegDemuxer::OnFindStreamInfoDone(const PipelineStatusCB& status_cb,
timeline_offset_ = ExtractTimelineOffset(format_context);
+ if (max_duration == kInfiniteDuration() && !timeline_offset_.is_null()) {
+ liveness_ = LIVENESS_LIVE;
+ } else if (max_duration != kInfiniteDuration()) {
+ liveness_ = LIVENESS_RECORDED;
+ } else {
+ liveness_ = LIVENESS_UNKNOWN;
+ }
+
// Good to go: set the duration and bitrate and notify we're done
// initializing.
host_->SetDuration(max_duration);
« no previous file with comments | « media/filters/ffmpeg_demuxer.h ('k') | media/formats/webm/webm_stream_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698