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

Side by Side Diff: media/base/demuxer_stream.h

Issue 2199913002: Notify demux stream clients when a stream is disabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass stream enabled/disabled flag into StatusChangeCB Created 4 years, 4 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 unified diff | Download patch
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 #ifndef MEDIA_BASE_DEMUXER_STREAM_H_ 5 #ifndef MEDIA_BASE_DEMUXER_STREAM_H_
6 #define MEDIA_BASE_DEMUXER_STREAM_H_ 6 #define MEDIA_BASE_DEMUXER_STREAM_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // Indicates whether a DemuxerStream is currently enabled (i.e. should be 95 // Indicates whether a DemuxerStream is currently enabled (i.e. should be
96 // decoded and rendered) or not. 96 // decoded and rendered) or not.
97 virtual bool enabled() const = 0; 97 virtual bool enabled() const = 0;
98 98
99 // Disables and re-enables the stream. Reading from a disabled stream will 99 // Disables and re-enables the stream. Reading from a disabled stream will
100 // return an end-of-stream (EOS) buffer. When a stream is re-enabled, it needs 100 // return an end-of-stream (EOS) buffer. When a stream is re-enabled, it needs
101 // to know the current playback position |timestamp| in order to resume 101 // to know the current playback position |timestamp| in order to resume
102 // reading data from a key frame preceeding the |timestamp|. 102 // reading data from a key frame preceeding the |timestamp|.
103 virtual void set_enabled(bool enabled, base::TimeDelta timestamp) = 0; 103 virtual void set_enabled(bool enabled, base::TimeDelta timestamp) = 0;
104 104
105 using StreamRestartedCB = 105 // The StreamStatusChangeCB allows DemuxerStream clients to receive
106 base::Callback<void(DemuxerStream*, base::TimeDelta)>; 106 // notifications about the stream being disabled or enabled.
107 virtual void SetStreamRestartedCB(const StreamRestartedCB& cb) = 0; 107 // The first parameter is the DemuxerStream whose status has changed.
108 // The second parameter indicates whether the stream is enabled or disabled.
109 // The third parameter is the playback position when the change occured.
110 using StreamStatusChangeCB =
alokp 2016/08/04 19:02:36 nit: is it necessary for the callback to specify t
servolk 2016/08/04 20:31:47 Done.
111 base::Callback<void(DemuxerStream*, bool, base::TimeDelta)>;
112 virtual void SetStreamStatusChangeCB(const StreamStatusChangeCB& cb) = 0;
108 113
109 protected: 114 protected:
110 // Only allow concrete implementations to get deleted. 115 // Only allow concrete implementations to get deleted.
111 virtual ~DemuxerStream(); 116 virtual ~DemuxerStream();
112 }; 117 };
113 118
114 } // namespace media 119 } // namespace media
115 120
116 #endif // MEDIA_BASE_DEMUXER_STREAM_H_ 121 #endif // MEDIA_BASE_DEMUXER_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698