diff options
Diffstat (limited to 'chromium/media/base/audio_decoder.h')
-rw-r--r-- | chromium/media/base/audio_decoder.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/chromium/media/base/audio_decoder.h b/chromium/media/base/audio_decoder.h index da477072233..d27cd16cfa9 100644 --- a/chromium/media/base/audio_decoder.h +++ b/chromium/media/base/audio_decoder.h @@ -25,15 +25,19 @@ class CdmContext; class MEDIA_EXPORT AudioDecoder { public: // Callback for VideoDecoder initialization. - typedef base::Callback<void(bool success)> InitCB; + using InitCB = base::Callback<void(bool success)>; // Callback for AudioDecoder to return a decoded frame whenever it becomes // available. Only non-EOS frames should be returned via this callback. - typedef base::Callback<void(const scoped_refptr<AudioBuffer>&)> OutputCB; + using OutputCB = base::Callback<void(const scoped_refptr<AudioBuffer>&)>; // Callback for Decode(). Called after the decoder has accepted corresponding // DecoderBuffer, indicating that the pipeline can send next buffer to decode. - typedef base::Callback<void(DecodeStatus)> DecodeCB; + using DecodeCB = base::Callback<void(DecodeStatus)>; + + // Callback for whenever the key needed to decrypt the stream is not + // available. May be called at any time after Initialize(). + using WaitingForDecryptionKeyCB = base::RepeatingClosure; AudioDecoder(); @@ -57,10 +61,14 @@ class MEDIA_EXPORT AudioDecoder { // stream is not encrypted. // |init_cb| is used to return initialization status. // |output_cb| is called for decoded audio buffers (see Decode()). - virtual void Initialize(const AudioDecoderConfig& config, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) = 0; + // |waiting_for_decryption_key_cb| is called whenever the key needed to + // decrypt the stream is not available. + virtual void Initialize( + const AudioDecoderConfig& config, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) = 0; // Requests samples to be decoded. Only one decode may be in flight at any // given time. Once the buffer is decoded the decoder calls |decode_cb|. @@ -73,7 +81,7 @@ class MEDIA_EXPORT AudioDecoder { // If |buffer| is an EOS buffer then the decoder must be flushed, i.e. // |output_cb| must be called for each frame pending in the queue and // |decode_cb| must be called after that. - virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer, + virtual void Decode(scoped_refptr<DecoderBuffer> buffer, const DecodeCB& decode_cb) = 0; // Resets decoder state. All pending Decode() requests will be finished or |