OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CHROMECAST_PUBLIC_MEDIA_MEDIA_PIPELINE_BACKEND_H_ | 5 #ifndef CHROMECAST_PUBLIC_MEDIA_MEDIA_PIPELINE_BACKEND_H_ |
6 #define CHROMECAST_PUBLIC_MEDIA_MEDIA_PIPELINE_BACKEND_H_ | 6 #define CHROMECAST_PUBLIC_MEDIA_MEDIA_PIPELINE_BACKEND_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 #include <string> |
| 10 |
| 11 #include "cast_key_status.h" |
8 #include "decoder_config.h" | 12 #include "decoder_config.h" |
9 | 13 |
10 namespace chromecast { | 14 namespace chromecast { |
11 struct Size; | 15 struct Size; |
12 | 16 |
13 namespace media { | 17 namespace media { |
14 class CastDecoderBuffer; | 18 class CastDecoderBuffer; |
15 class DecryptContext; | 19 class DecryptContext; |
16 | 20 |
17 // Interface for platform-specific output of media. | 21 // Interface for platform-specific output of media. |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 BufferStatus status) = 0; | 139 BufferStatus status) = 0; |
136 | 140 |
137 // Must be called after an end-of-stream buffer has been rendered (ie, the | 141 // Must be called after an end-of-stream buffer has been rendered (ie, the |
138 // last real buffer has been sent to the output hardware). | 142 // last real buffer has been sent to the output hardware). |
139 virtual void OnEndOfStream(Decoder* decoder) = 0; | 143 virtual void OnEndOfStream(Decoder* decoder) = 0; |
140 | 144 |
141 // May be called if a decoder error occurs. No more calls to PushBuffer() | 145 // May be called if a decoder error occurs. No more calls to PushBuffer() |
142 // will be made after this is called. | 146 // will be made after this is called. |
143 virtual void OnDecoderError(Decoder* decoder) = 0; | 147 virtual void OnDecoderError(Decoder* decoder) = 0; |
144 | 148 |
| 149 // Must be called when a decryption key status changes. |
| 150 virtual void OnKeyStatusChanged(const std::string& key_id, |
| 151 CastKeyStatus key_status, |
| 152 uint32_t system_code) = 0; |
| 153 |
145 protected: | 154 protected: |
146 virtual ~Delegate() {} | 155 virtual ~Delegate() {} |
147 }; | 156 }; |
148 | 157 |
149 virtual ~MediaPipelineBackend() {} | 158 virtual ~MediaPipelineBackend() {} |
150 | 159 |
151 // Creates a new AudioDecoder attached to this pipeline. MediaPipelineBackend | 160 // Creates a new AudioDecoder attached to this pipeline. MediaPipelineBackend |
152 // maintains ownership of the decoder object (and must not delete before it's | 161 // maintains ownership of the decoder object (and must not delete before it's |
153 // destroyed). Will be called zero or more times, all calls made before | 162 // destroyed). Will be called zero or more times, all calls made before |
154 // Initialize. May return nullptr if the platform implementation cannot | 163 // Initialize. May return nullptr if the platform implementation cannot |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // Sets the playback rate. |rate| > 0. If this is not called, a default rate | 202 // Sets the playback rate. |rate| > 0. If this is not called, a default rate |
194 // of 1.0 is assumed. Returns true if successful. Only called when in | 203 // of 1.0 is assumed. Returns true if successful. Only called when in |
195 // the "playing" or "paused" states. | 204 // the "playing" or "paused" states. |
196 virtual bool SetPlaybackRate(float rate) = 0; | 205 virtual bool SetPlaybackRate(float rate) = 0; |
197 }; | 206 }; |
198 | 207 |
199 } // namespace media | 208 } // namespace media |
200 } // namespace chromecast | 209 } // namespace chromecast |
201 | 210 |
202 #endif // CHROMECAST_PUBLIC_MEDIA_MEDIA_PIPELINE_BACKEND_H_ | 211 #endif // CHROMECAST_PUBLIC_MEDIA_MEDIA_PIPELINE_BACKEND_H_ |
OLD | NEW |