OLD | NEW |
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // A DemuxerStream that returns 'true' to this may return the 'kConfigChange' | 87 // A DemuxerStream that returns 'true' to this may return the 'kConfigChange' |
88 // status from a Read() call. In this case the client is expected to be | 88 // status from a Read() call. In this case the client is expected to be |
89 // capable of taking appropriate action to handle config changes. Otherwise | 89 // capable of taking appropriate action to handle config changes. Otherwise |
90 // audio_decoder_config() and video_decoder_config()'s return values are | 90 // audio_decoder_config() and video_decoder_config()'s return values are |
91 // guaranteed to remain constant, and the client may make optimizations based | 91 // guaranteed to remain constant, and the client may make optimizations based |
92 // on this. | 92 // on this. |
93 virtual bool SupportsConfigChanges() = 0; | 93 virtual bool SupportsConfigChanges() = 0; |
94 | 94 |
95 virtual VideoRotation video_rotation() = 0; | 95 virtual VideoRotation video_rotation() = 0; |
96 | 96 |
97 // TODO(servolk): Remove enabled / set_enabled methods from DemuxerStream | |
98 // interface, since those are only called from demuxers. | |
99 | |
100 // Indicates whether a DemuxerStream is currently enabled (i.e. should be | |
101 // decoded and rendered) or not. | |
102 virtual bool enabled() const = 0; | |
103 | |
104 // Disables and re-enables the stream. Reading from a disabled stream will | |
105 // return an end-of-stream (EOS) buffer. When a stream is re-enabled, it needs | |
106 // to know the current playback position |timestamp| in order to resume | |
107 // reading data from a key frame preceeding the |timestamp|. | |
108 virtual void set_enabled(bool enabled, base::TimeDelta timestamp) = 0; | |
109 | |
110 protected: | 97 protected: |
111 // Only allow concrete implementations to get deleted. | 98 // Only allow concrete implementations to get deleted. |
112 virtual ~DemuxerStream(); | 99 virtual ~DemuxerStream(); |
113 }; | 100 }; |
114 | 101 |
115 } // namespace media | 102 } // namespace media |
116 | 103 |
117 #endif // MEDIA_BASE_DEMUXER_STREAM_H_ | 104 #endif // MEDIA_BASE_DEMUXER_STREAM_H_ |
OLD | NEW |