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

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

Issue 2491043003: MediaResource refactoring to support multiple streams (Closed)
Patch Set: Reintroduc GetFirstStream API and return only enabled streams from GetAllStreams Created 3 years, 10 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 virtual VideoRotation video_rotation() = 0; 95 virtual VideoRotation video_rotation() = 0;
96 96
97 // Indicates whether a DemuxerStream is currently enabled (i.e. should be 97 // Indicates whether a DemuxerStream is currently enabled (i.e. should be
98 // decoded and rendered) or not. 98 // decoded and rendered) or not.
99 virtual bool enabled() const = 0; 99 virtual bool enabled() const = 0;
100 100
101 // Disables and re-enables the stream. Reading from a disabled stream will 101 // Disables and re-enables the stream. Reading from a disabled stream will
102 // return an end-of-stream (EOS) buffer. When a stream is re-enabled, it needs 102 // return an end-of-stream (EOS) buffer. When a stream is re-enabled, it needs
103 // to know the current playback position |timestamp| in order to resume 103 // to know the current playback position |timestamp| in order to resume
104 // reading data from a key frame preceeding the |timestamp|. 104 // reading data from a key frame preceeding the |timestamp|.
105 virtual void set_enabled(bool enabled, base::TimeDelta timestamp) = 0; 105 virtual void set_enabled(bool enabled, base::TimeDelta timestamp) = 0;
xhwang 2017/02/15 05:32:19 Will we remove this method in later CLs? If so, ca
servolk 2017/02/15 17:39:16 No, I wasn't planning to remove this. Why would we
xhwang 2017/02/15 17:43:53 This should only be exposed to demuxers, not to th
106 106
107 // The StreamStatusChangeCB allows DemuxerStream clients to receive
108 // notifications about the stream being disabled or enabled.
109 // The first parameter indicates whether the stream is enabled or disabled.
110 // The second parameter is the playback position when the change occured.
111 using StreamStatusChangeCB = base::Callback<void(bool, base::TimeDelta)>;
112 virtual void SetStreamStatusChangeCB(const StreamStatusChangeCB& cb) = 0;
113
114 protected: 107 protected:
115 // Only allow concrete implementations to get deleted. 108 // Only allow concrete implementations to get deleted.
116 virtual ~DemuxerStream(); 109 virtual ~DemuxerStream();
117 }; 110 };
118 111
119 } // namespace media 112 } // namespace media
120 113
121 #endif // MEDIA_BASE_DEMUXER_STREAM_H_ 114 #endif // MEDIA_BASE_DEMUXER_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698