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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 void InitializeDecoder(); | 69 void InitializeDecoder(); |
70 | 70 |
71 // Callback for Decryptor::InitializeAudioDecoder() during initialization. | 71 // Callback for Decryptor::InitializeAudioDecoder() during initialization. |
72 void FinishInitialization(bool success); | 72 void FinishInitialization(bool success); |
73 | 73 |
74 void DecodePendingBuffer(); | 74 void DecodePendingBuffer(); |
75 | 75 |
76 // Callback for Decryptor::DecryptAndDecodeAudio(). | 76 // Callback for Decryptor::DecryptAndDecodeAudio(). |
77 void DeliverFrame(int buffer_size, | 77 void DeliverFrame(int buffer_size, |
78 Decryptor::Status status, | 78 Decryptor::Status status, |
79 const Decryptor::AudioBuffers& frames); | 79 const Decryptor::AudioFrames& frames); |
80 | 80 |
81 // Callback for the |decryptor_| to notify this object that a new key has been | 81 // Callback for the |decryptor_| to notify this object that a new key has been |
82 // added. | 82 // added. |
83 void OnKeyAdded(); | 83 void OnKeyAdded(); |
84 | 84 |
85 // Resets decoder and calls |reset_cb_|. | 85 // Resets decoder and calls |reset_cb_|. |
86 void DoReset(); | 86 void DoReset(); |
87 | 87 |
88 // Sets timestamps for |frames| and then passes them to |output_cb_|. | 88 // Sets timestamps for |frames| and then passes them to |output_cb_|. |
89 void ProcessDecodedFrames(const Decryptor::AudioBuffers& frames); | 89 void ProcessDecodedFrames(const Decryptor::AudioFrames& frames); |
90 | 90 |
91 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 91 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
92 | 92 |
93 State state_; | 93 State state_; |
94 | 94 |
95 PipelineStatusCB init_cb_; | 95 PipelineStatusCB init_cb_; |
96 OutputCB output_cb_; | 96 OutputCB output_cb_; |
97 DecodeCB decode_cb_; | 97 DecodeCB decode_cb_; |
98 base::Closure reset_cb_; | 98 base::Closure reset_cb_; |
99 | 99 |
(...skipping 19 matching lines...) Expand all Loading... |
119 | 119 |
120 base::WeakPtr<DecryptingAudioDecoder> weak_this_; | 120 base::WeakPtr<DecryptingAudioDecoder> weak_this_; |
121 base::WeakPtrFactory<DecryptingAudioDecoder> weak_factory_; | 121 base::WeakPtrFactory<DecryptingAudioDecoder> weak_factory_; |
122 | 122 |
123 DISALLOW_COPY_AND_ASSIGN(DecryptingAudioDecoder); | 123 DISALLOW_COPY_AND_ASSIGN(DecryptingAudioDecoder); |
124 }; | 124 }; |
125 | 125 |
126 } // namespace media | 126 } // namespace media |
127 | 127 |
128 #endif // MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_ | 128 #endif // MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_ |
OLD | NEW |