| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_FILTERS_ANDROID_MEDIA_CODEC_AUDIO_DECODER_H_ | 5 #ifndef MEDIA_FILTERS_ANDROID_MEDIA_CODEC_AUDIO_DECODER_H_ |
| 6 #define MEDIA_FILTERS_ANDROID_MEDIA_CODEC_AUDIO_DECODER_H_ | 6 #define MEDIA_FILTERS_ANDROID_MEDIA_CODEC_AUDIO_DECODER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 InputBufferInfo DequeueInputBuffer(); | 183 InputBufferInfo DequeueInputBuffer(); |
| 184 | 184 |
| 185 // A helper method for QueueInput(). Fills an input buffer referred to by | 185 // A helper method for QueueInput(). Fills an input buffer referred to by |
| 186 // |input_info| with data and enqueues it to the codec. Returns true if | 186 // |input_info| with data and enqueues it to the codec. Returns true if |
| 187 // succeeded or false if an error occurs or there is no good CDM key. | 187 // succeeded or false if an error occurs or there is no good CDM key. |
| 188 // May set STATE_DRAINING, STATE_WAITING_FOR_KEY or STATE_ERROR. | 188 // May set STATE_DRAINING, STATE_WAITING_FOR_KEY or STATE_ERROR. |
| 189 bool EnqueueInputBuffer(const InputBufferInfo& input_info); | 189 bool EnqueueInputBuffer(const InputBufferInfo& input_info); |
| 190 | 190 |
| 191 // Calls DecodeCB with |decode_status| for every frame in |input_queue| and | 191 // Calls DecodeCB with |decode_status| for every frame in |input_queue| and |
| 192 // then clears it. | 192 // then clears it. |
| 193 void ClearInputQueue(Status decode_status); | 193 void ClearInputQueue(DecodeStatus decode_status); |
| 194 | 194 |
| 195 // Dequeues all output buffers from MediaCodec that are immediately available. | 195 // Dequeues all output buffers from MediaCodec that are immediately available. |
| 196 // Returns true if any output buffer was received from MediaCodec. | 196 // Returns true if any output buffer was received from MediaCodec. |
| 197 bool DequeueOutput(); | 197 bool DequeueOutput(); |
| 198 | 198 |
| 199 // Start the timer immediately if |start| is true or stop it based on elapsed | 199 // Start the timer immediately if |start| is true or stop it based on elapsed |
| 200 // idle time if |start| is false. | 200 // idle time if |start| is false. |
| 201 void ManageTimer(bool start); | 201 void ManageTimer(bool start); |
| 202 | 202 |
| 203 // Helper method to change the state. | 203 // Helper method to change the state. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 media::MediaDrmBridgeCdmContext::JavaObjectPtr media_crypto_; | 270 media::MediaDrmBridgeCdmContext::JavaObjectPtr media_crypto_; |
| 271 | 271 |
| 272 base::WeakPtrFactory<MediaCodecAudioDecoder> weak_factory_; | 272 base::WeakPtrFactory<MediaCodecAudioDecoder> weak_factory_; |
| 273 | 273 |
| 274 DISALLOW_COPY_AND_ASSIGN(MediaCodecAudioDecoder); | 274 DISALLOW_COPY_AND_ASSIGN(MediaCodecAudioDecoder); |
| 275 }; | 275 }; |
| 276 | 276 |
| 277 } // namespace media | 277 } // namespace media |
| 278 | 278 |
| 279 #endif // MEDIA_FILTERS_ANDROID_MEDIA_CODEC_AUDIO_DECODER_H_ | 279 #endif // MEDIA_FILTERS_ANDROID_MEDIA_CODEC_AUDIO_DECODER_H_ |
| OLD | NEW |