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 "media/base/media_export.h" | 11 #include "media/base/media_export.h" |
11 #include "media/base/video_rotation.h" | 12 #include "media/base/video_rotation.h" |
12 | 13 |
13 namespace media { | 14 namespace media { |
14 | 15 |
15 class AudioDecoderConfig; | 16 class AudioDecoderConfig; |
16 class DecoderBuffer; | 17 class DecoderBuffer; |
17 class VideoDecoderConfig; | 18 class VideoDecoderConfig; |
18 | 19 |
19 class MEDIA_EXPORT DemuxerStream { | 20 class MEDIA_EXPORT DemuxerStream { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // A DemuxerStream that returns 'true' to this may return the 'kConfigChange' | 85 // A DemuxerStream that returns 'true' to this may return the 'kConfigChange' |
85 // status from a Read() call. In this case the client is expected to be | 86 // status from a Read() call. In this case the client is expected to be |
86 // capable of taking appropriate action to handle config changes. Otherwise | 87 // capable of taking appropriate action to handle config changes. Otherwise |
87 // audio_decoder_config() and video_decoder_config()'s return values are | 88 // audio_decoder_config() and video_decoder_config()'s return values are |
88 // guaranteed to remain constant, and the client may make optimizations based | 89 // guaranteed to remain constant, and the client may make optimizations based |
89 // on this. | 90 // on this. |
90 virtual bool SupportsConfigChanges() = 0; | 91 virtual bool SupportsConfigChanges() = 0; |
91 | 92 |
92 virtual VideoRotation video_rotation() = 0; | 93 virtual VideoRotation video_rotation() = 0; |
93 | 94 |
| 95 // Indicates whether a DemuxerStream is currently enabled (i.e. should be |
| 96 // decoded and rendered) or not. |
| 97 virtual bool enabled() const = 0; |
| 98 |
| 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 |
| 101 // to know the current playback position |timestamp| in order to resume |
| 102 // reading data from a key frame preceeding the |timestamp|. |
| 103 virtual void set_enabled(bool enabled, base::TimeDelta timestamp) = 0; |
| 104 |
| 105 using StreamRestartedCB = |
| 106 base::Callback<void(DemuxerStream*, base::TimeDelta)>; |
| 107 virtual void SetStreamRestartedCB(const StreamRestartedCB& cb) = 0; |
| 108 |
94 protected: | 109 protected: |
95 // Only allow concrete implementations to get deleted. | 110 // Only allow concrete implementations to get deleted. |
96 virtual ~DemuxerStream(); | 111 virtual ~DemuxerStream(); |
97 }; | 112 }; |
98 | 113 |
99 } // namespace media | 114 } // namespace media |
100 | 115 |
101 #endif // MEDIA_BASE_DEMUXER_STREAM_H_ | 116 #endif // MEDIA_BASE_DEMUXER_STREAM_H_ |
OLD | NEW |