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 const base::Closure& waiting_for_decryption_key_cb); | 36 const base::Closure& waiting_for_decryption_key_cb); |
37 ~DecryptingAudioDecoder() override; | 37 ~DecryptingAudioDecoder() override; |
38 | 38 |
39 // AudioDecoder implementation. | 39 // AudioDecoder implementation. |
40 std::string GetDisplayName() const override; | 40 std::string GetDisplayName() const override; |
41 void Initialize(const AudioDecoderConfig& config, | 41 void Initialize(const AudioDecoderConfig& config, |
42 const PipelineStatusCB& status_cb, | 42 const InitCB& init_cb, |
43 const OutputCB& output_cb) override; | 43 const OutputCB& output_cb) override; |
44 void Decode(const scoped_refptr<DecoderBuffer>& buffer, | 44 void Decode(const scoped_refptr<DecoderBuffer>& buffer, |
45 const DecodeCB& decode_cb) override; | 45 const DecodeCB& decode_cb) override; |
46 void Reset(const base::Closure& closure) override; | 46 void Reset(const base::Closure& closure) override; |
47 | 47 |
48 private: | 48 private: |
49 // 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 |
50 // 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 |
51 // stabilizes. | 51 // stabilizes. |
52 // TODO(xhwang): Update this diagram for DecryptingAudioDecoder. | 52 // TODO(xhwang): Update this diagram for DecryptingAudioDecoder. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // Resets decoder and calls |reset_cb_|. | 86 // Resets decoder and calls |reset_cb_|. |
87 void DoReset(); | 87 void DoReset(); |
88 | 88 |
89 // Sets timestamps for |frames| and then passes them to |output_cb_|. | 89 // Sets timestamps for |frames| and then passes them to |output_cb_|. |
90 void ProcessDecodedFrames(const Decryptor::AudioFrames& frames); | 90 void ProcessDecodedFrames(const Decryptor::AudioFrames& frames); |
91 | 91 |
92 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 92 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
93 | 93 |
94 State state_; | 94 State state_; |
95 | 95 |
96 PipelineStatusCB init_cb_; | 96 InitCB init_cb_; |
97 OutputCB output_cb_; | 97 OutputCB output_cb_; |
98 DecodeCB decode_cb_; | 98 DecodeCB decode_cb_; |
99 base::Closure reset_cb_; | 99 base::Closure reset_cb_; |
100 base::Closure waiting_for_decryption_key_cb_; | 100 base::Closure waiting_for_decryption_key_cb_; |
101 | 101 |
102 // The current decoder configuration. | 102 // The current decoder configuration. |
103 AudioDecoderConfig config_; | 103 AudioDecoderConfig config_; |
104 | 104 |
105 // Callback to request/cancel decryptor creation notification. | 105 // Callback to request/cancel decryptor creation notification. |
106 SetDecryptorReadyCB set_decryptor_ready_cb_; | 106 SetDecryptorReadyCB set_decryptor_ready_cb_; |
(...skipping 14 matching lines...) Expand all Loading... |
121 | 121 |
122 base::WeakPtr<DecryptingAudioDecoder> weak_this_; | 122 base::WeakPtr<DecryptingAudioDecoder> weak_this_; |
123 base::WeakPtrFactory<DecryptingAudioDecoder> weak_factory_; | 123 base::WeakPtrFactory<DecryptingAudioDecoder> weak_factory_; |
124 | 124 |
125 DISALLOW_COPY_AND_ASSIGN(DecryptingAudioDecoder); | 125 DISALLOW_COPY_AND_ASSIGN(DecryptingAudioDecoder); |
126 }; | 126 }; |
127 | 127 |
128 } // namespace media | 128 } // namespace media |
129 | 129 |
130 #endif // MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_ | 130 #endif // MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_ |
OLD | NEW |