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 17 matching lines...) Expand all Loading... |
28 | 28 |
29 // Decryptor-based AudioDecoder implementation that can decrypt and decode | 29 // Decryptor-based AudioDecoder implementation that can decrypt and decode |
30 // encrypted audio buffers and return decrypted and decompressed audio frames. | 30 // encrypted audio buffers and return decrypted and decompressed audio frames. |
31 // All public APIs and callbacks are trampolined to the |task_runner_| so | 31 // All public APIs and callbacks are trampolined to the |task_runner_| so |
32 // that no locks are required for thread safety. | 32 // that no locks are required for thread safety. |
33 class MEDIA_EXPORT DecryptingAudioDecoder : public AudioDecoder { | 33 class MEDIA_EXPORT DecryptingAudioDecoder : public AudioDecoder { |
34 public: | 34 public: |
35 DecryptingAudioDecoder( | 35 DecryptingAudioDecoder( |
36 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 36 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
37 const scoped_refptr<MediaLog>& media_log, | 37 const scoped_refptr<MediaLog>& media_log, |
38 const SetCdmReadyCB& set_cdm_ready_cb, | |
39 const base::Closure& waiting_for_decryption_key_cb); | 38 const base::Closure& waiting_for_decryption_key_cb); |
40 ~DecryptingAudioDecoder() override; | 39 ~DecryptingAudioDecoder() override; |
41 | 40 |
42 // AudioDecoder implementation. | 41 // AudioDecoder implementation. |
43 std::string GetDisplayName() const override; | 42 std::string GetDisplayName() const override; |
44 void Initialize(const AudioDecoderConfig& config, | 43 void Initialize(const AudioDecoderConfig& config, |
| 44 const SetCdmReadyCB& set_cdm_ready_cb, |
45 const InitCB& init_cb, | 45 const InitCB& init_cb, |
46 const OutputCB& output_cb) override; | 46 const OutputCB& output_cb) override; |
47 void Decode(const scoped_refptr<DecoderBuffer>& buffer, | 47 void Decode(const scoped_refptr<DecoderBuffer>& buffer, |
48 const DecodeCB& decode_cb) override; | 48 const DecodeCB& decode_cb) override; |
49 void Reset(const base::Closure& closure) override; | 49 void Reset(const base::Closure& closure) override; |
50 | 50 |
51 private: | 51 private: |
52 // For a detailed state diagram please see this link: http://goo.gl/8jAok | 52 // For a detailed state diagram please see this link: http://goo.gl/8jAok |
53 // TODO(xhwang): Add a ASCII state diagram in this file after this class | 53 // TODO(xhwang): Add a ASCII state diagram in this file after this class |
54 // stabilizes. | 54 // stabilizes. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 125 |
126 base::WeakPtr<DecryptingAudioDecoder> weak_this_; | 126 base::WeakPtr<DecryptingAudioDecoder> weak_this_; |
127 base::WeakPtrFactory<DecryptingAudioDecoder> weak_factory_; | 127 base::WeakPtrFactory<DecryptingAudioDecoder> weak_factory_; |
128 | 128 |
129 DISALLOW_COPY_AND_ASSIGN(DecryptingAudioDecoder); | 129 DISALLOW_COPY_AND_ASSIGN(DecryptingAudioDecoder); |
130 }; | 130 }; |
131 | 131 |
132 } // namespace media | 132 } // namespace media |
133 | 133 |
134 #endif // MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_ | 134 #endif // MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_ |
OLD | NEW |