Chromium Code Reviews| 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_AUDIO_DECODER_H_ | 5 #ifndef MEDIA_BASE_AUDIO_DECODER_H_ |
| 6 #define MEDIA_BASE_AUDIO_DECODER_H_ | 6 #define MEDIA_BASE_AUDIO_DECODER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 // depends on |this|. | 49 // depends on |this|. |
| 50 virtual ~AudioDecoder(); | 50 virtual ~AudioDecoder(); |
| 51 | 51 |
| 52 // Returns the name of the decoder for logging purpose. | 52 // Returns the name of the decoder for logging purpose. |
| 53 virtual std::string GetDisplayName() const = 0; | 53 virtual std::string GetDisplayName() const = 0; |
| 54 | 54 |
| 55 // Initializes an AudioDecoder with the given DemuxerStream, executing the | 55 // Initializes an AudioDecoder with the given DemuxerStream, executing the |
| 56 // callback upon completion. | 56 // callback upon completion. |
| 57 // |statistics_cb| is used to update global pipeline statistics. | 57 // |statistics_cb| is used to update global pipeline statistics. |
| 58 // |output_cb| is called for decoded audio buffers (see Decode()). | 58 // |output_cb| is called for decoded audio buffers (see Decode()). |
| 59 virtual void Initialize(const AudioDecoderConfig& config, | 59 // |waiting_for_encryption_key_cb| is called whenever a new key needs to be |
|
ddorwin
2015/02/19 05:33:17
...whenever the key needed to decrypt the stream i
jrummell
2015/02/23 22:06:31
Done.
| |
| 60 const PipelineStatusCB& status_cb, | 60 // provided in order to decrypt the stream. |
| 61 const OutputCB& output_cb) = 0; | 61 virtual void Initialize( |
| 62 const AudioDecoderConfig& config, | |
| 63 const PipelineStatusCB& status_cb, | |
| 64 const OutputCB& output_cb, | |
| 65 const base::Closure& waiting_for_encryption_key_cb) = 0; | |
|
ddorwin
2015/02/19 05:33:17
s/encryption/decryption/
jrummell
2015/02/23 22:06:31
Done.
| |
| 62 | 66 |
| 63 // Requests samples to be decoded. Only one decode may be in flight at any | 67 // Requests samples to be decoded. Only one decode may be in flight at any |
| 64 // given time. Once the buffer is decoded the decoder calls |decode_cb|. | 68 // given time. Once the buffer is decoded the decoder calls |decode_cb|. |
| 65 // |output_cb| specified in Initialize() is called for each decoded buffer, | 69 // |output_cb| specified in Initialize() is called for each decoded buffer, |
| 66 // before or after |decode_cb|. | 70 // before or after |decode_cb|. |
| 67 // | 71 // |
| 68 // Implementations guarantee that the callbacks will not be called from within | 72 // Implementations guarantee that the callbacks will not be called from within |
| 69 // this method. | 73 // this method. |
| 70 // | 74 // |
| 71 // If |buffer| is an EOS buffer then the decoder must be flushed, i.e. | 75 // If |buffer| is an EOS buffer then the decoder must be flushed, i.e. |
| 72 // |output_cb| must be called for each frame pending in the queue and | 76 // |output_cb| must be called for each frame pending in the queue and |
| 73 // |decode_cb| must be called after that. | 77 // |decode_cb| must be called after that. |
| 74 virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer, | 78 virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer, |
| 75 const DecodeCB& decode_cb) = 0; | 79 const DecodeCB& decode_cb) = 0; |
| 76 | 80 |
| 77 // Resets decoder state. All pending Decode() requests will be finished or | 81 // Resets decoder state. All pending Decode() requests will be finished or |
| 78 // aborted before |closure| is called. | 82 // aborted before |closure| is called. |
| 79 virtual void Reset(const base::Closure& closure) = 0; | 83 virtual void Reset(const base::Closure& closure) = 0; |
| 80 | 84 |
| 81 private: | 85 private: |
| 82 DISALLOW_COPY_AND_ASSIGN(AudioDecoder); | 86 DISALLOW_COPY_AND_ASSIGN(AudioDecoder); |
| 83 }; | 87 }; |
| 84 | 88 |
| 85 } // namespace media | 89 } // namespace media |
| 86 | 90 |
| 87 #endif // MEDIA_BASE_AUDIO_DECODER_H_ | 91 #endif // MEDIA_BASE_AUDIO_DECODER_H_ |
| OLD | NEW |