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_BASE_AUDIO_DECODER_H_ | 5 #ifndef MEDIA_BASE_AUDIO_DECODER_H_ |
6 #define MEDIA_BASE_AUDIO_DECODER_H_ | 6 #define MEDIA_BASE_AUDIO_DECODER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 kDecodeError // A decoding error occurred. | 33 kDecodeError // A decoding error occurred. |
34 }; | 34 }; |
35 | 35 |
36 // Callback for VideoDecoder initialization. | 36 // Callback for VideoDecoder initialization. |
37 typedef base::Callback<void(bool success)> InitCB; | 37 typedef base::Callback<void(bool success)> InitCB; |
38 | 38 |
39 // Callback for AudioDecoder to return a decoded frame whenever it becomes | 39 // Callback for AudioDecoder to return a decoded frame whenever it becomes |
40 // available. Only non-EOS frames should be returned via this callback. | 40 // available. Only non-EOS frames should be returned via this callback. |
41 typedef base::Callback<void(const scoped_refptr<AudioBuffer>&)> OutputCB; | 41 typedef base::Callback<void(const scoped_refptr<AudioBuffer>&)> OutputCB; |
42 | 42 |
43 // Callback for Decode(). Called after the decoder has completed decoding | 43 // Callback for Decode(). Called after the decoder has accepted corresponding |
44 // corresponding DecoderBuffer, indicating that it's ready to accept another | 44 // DecoderBuffer, indicating that the pipeline can send next buffer to decode. |
45 // buffer to decode. | |
46 typedef base::Callback<void(Status)> DecodeCB; | 45 typedef base::Callback<void(Status)> DecodeCB; |
47 | 46 |
48 AudioDecoder(); | 47 AudioDecoder(); |
49 | 48 |
50 // Fires any pending callbacks, stops and destroys the decoder. | 49 // Fires any pending callbacks, stops and destroys the decoder. |
51 // Note: Since this is a destructor, |this| will be destroyed after this call. | 50 // Note: Since this is a destructor, |this| will be destroyed after this call. |
52 // Make sure the callbacks fired from this call doesn't post any task that | 51 // Make sure the callbacks fired from this call doesn't post any task that |
53 // depends on |this|. | 52 // depends on |this|. |
54 virtual ~AudioDecoder(); | 53 virtual ~AudioDecoder(); |
55 | 54 |
(...skipping 30 matching lines...) Expand all Loading... |
86 // aborted before |closure| is called. | 85 // aborted before |closure| is called. |
87 virtual void Reset(const base::Closure& closure) = 0; | 86 virtual void Reset(const base::Closure& closure) = 0; |
88 | 87 |
89 private: | 88 private: |
90 DISALLOW_COPY_AND_ASSIGN(AudioDecoder); | 89 DISALLOW_COPY_AND_ASSIGN(AudioDecoder); |
91 }; | 90 }; |
92 | 91 |
93 } // namespace media | 92 } // namespace media |
94 | 93 |
95 #endif // MEDIA_BASE_AUDIO_DECODER_H_ | 94 #endif // MEDIA_BASE_AUDIO_DECODER_H_ |
OLD | NEW |