| 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_FILTERS_DECRYPTING_AUDIO_DECODER_H_ | 5 #ifndef MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_ |
| 6 #define MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_ | 6 #define MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_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/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 public: | 32 public: |
| 33 DecryptingAudioDecoder( | 33 DecryptingAudioDecoder( |
| 34 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 34 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 35 const SetDecryptorReadyCB& set_decryptor_ready_cb); | 35 const SetDecryptorReadyCB& set_decryptor_ready_cb); |
| 36 ~DecryptingAudioDecoder() override; | 36 ~DecryptingAudioDecoder() override; |
| 37 | 37 |
| 38 // AudioDecoder implementation. | 38 // AudioDecoder implementation. |
| 39 std::string GetDisplayName() const override; | 39 std::string GetDisplayName() const override; |
| 40 void Initialize(const AudioDecoderConfig& config, | 40 void Initialize(const AudioDecoderConfig& config, |
| 41 const PipelineStatusCB& status_cb, | 41 const PipelineStatusCB& status_cb, |
| 42 const OutputCB& output_cb) override; | 42 const OutputCB& output_cb, |
| 43 const base::Closure& waiting_for_encryption_key_cb) override; |
| 43 void Decode(const scoped_refptr<DecoderBuffer>& buffer, | 44 void Decode(const scoped_refptr<DecoderBuffer>& buffer, |
| 44 const DecodeCB& decode_cb) override; | 45 const DecodeCB& decode_cb) override; |
| 45 void Reset(const base::Closure& closure) override; | 46 void Reset(const base::Closure& closure) override; |
| 46 | 47 |
| 47 private: | 48 private: |
| 48 // For a detailed state diagram please see this link: http://goo.gl/8jAok | 49 // For a detailed state diagram please see this link: http://goo.gl/8jAok |
| 49 // TODO(xhwang): Add a ASCII state diagram in this file after this class | 50 // TODO(xhwang): Add a ASCII state diagram in this file after this class |
| 50 // stabilizes. | 51 // stabilizes. |
| 51 // TODO(xhwang): Update this diagram for DecryptingAudioDecoder. | 52 // TODO(xhwang): Update this diagram for DecryptingAudioDecoder. |
| 52 enum State { | 53 enum State { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 void ProcessDecodedFrames(const Decryptor::AudioFrames& frames); | 90 void ProcessDecodedFrames(const Decryptor::AudioFrames& frames); |
| 90 | 91 |
| 91 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 92 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 92 | 93 |
| 93 State state_; | 94 State state_; |
| 94 | 95 |
| 95 PipelineStatusCB init_cb_; | 96 PipelineStatusCB init_cb_; |
| 96 OutputCB output_cb_; | 97 OutputCB output_cb_; |
| 97 DecodeCB decode_cb_; | 98 DecodeCB decode_cb_; |
| 98 base::Closure reset_cb_; | 99 base::Closure reset_cb_; |
| 100 base::Closure waiting_for_encryption_key_cb_; |
| 99 | 101 |
| 100 // The current decoder configuration. | 102 // The current decoder configuration. |
| 101 AudioDecoderConfig config_; | 103 AudioDecoderConfig config_; |
| 102 | 104 |
| 103 // Callback to request/cancel decryptor creation notification. | 105 // Callback to request/cancel decryptor creation notification. |
| 104 SetDecryptorReadyCB set_decryptor_ready_cb_; | 106 SetDecryptorReadyCB set_decryptor_ready_cb_; |
| 105 | 107 |
| 106 Decryptor* decryptor_; | 108 Decryptor* decryptor_; |
| 107 | 109 |
| 108 // The buffer that needs decrypting/decoding. | 110 // The buffer that needs decrypting/decoding. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 119 | 121 |
| 120 base::WeakPtr<DecryptingAudioDecoder> weak_this_; | 122 base::WeakPtr<DecryptingAudioDecoder> weak_this_; |
| 121 base::WeakPtrFactory<DecryptingAudioDecoder> weak_factory_; | 123 base::WeakPtrFactory<DecryptingAudioDecoder> weak_factory_; |
| 122 | 124 |
| 123 DISALLOW_COPY_AND_ASSIGN(DecryptingAudioDecoder); | 125 DISALLOW_COPY_AND_ASSIGN(DecryptingAudioDecoder); |
| 124 }; | 126 }; |
| 125 | 127 |
| 126 } // namespace media | 128 } // namespace media |
| 127 | 129 |
| 128 #endif // MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_ | 130 #endif // MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_ |
| OLD | NEW |