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

Unified Diff: media/base/demuxer_stream.h

Issue 1935873002: Implement disabling and enabling media tracks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@track-control2
Patch Set: rebase Created 4 years, 6 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/base/demuxer.h ('k') | media/base/fake_demuxer_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/demuxer_stream.h
diff --git a/media/base/demuxer_stream.h b/media/base/demuxer_stream.h
index 596ab67e83692aba287f11e6c1488a623ffee8e6..17f193f24acb06c420bd3f00f674da55778dd24f 100644
--- a/media/base/demuxer_stream.h
+++ b/media/base/demuxer_stream.h
@@ -7,6 +7,7 @@
#include "base/callback.h"
#include "base/memory/ref_counted.h"
+#include "base/time/time.h"
#include "media/base/media_export.h"
#include "media/base/video_rotation.h"
@@ -91,6 +92,20 @@ class MEDIA_EXPORT DemuxerStream {
virtual VideoRotation video_rotation() = 0;
+ // Indicates whether a DemuxerStream is currently enabled (i.e. should be
+ // decoded and rendered) or not.
+ virtual bool enabled() const = 0;
+
+ // Disables and re-enables the stream. Reading from a disabled stream will
+ // return an end-of-stream (EOS) buffer. When a stream is re-enabled, it needs
+ // to know the current playback position |timestamp| in order to resume
+ // reading data from a key frame preceeding the |timestamp|.
+ virtual void set_enabled(bool enabled, base::TimeDelta timestamp) = 0;
+
+ using StreamRestartedCB =
+ base::Callback<void(DemuxerStream*, base::TimeDelta)>;
+ virtual void SetStreamRestartedCB(const StreamRestartedCB& cb) = 0;
+
protected:
// Only allow concrete implementations to get deleted.
virtual ~DemuxerStream();
« no previous file with comments | « media/base/demuxer.h ('k') | media/base/fake_demuxer_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698