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 "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "media/base/audio_decoder_config.h" | 10 #include "media/base/audio_decoder_config.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 // Status codes for decode operations. | 23 // Status codes for decode operations. |
24 // TODO(rileya): Now that both AudioDecoder and VideoDecoder Status enums | 24 // TODO(rileya): Now that both AudioDecoder and VideoDecoder Status enums |
25 // match, break them into a decoder_status.h. | 25 // match, break them into a decoder_status.h. |
26 enum Status { | 26 enum Status { |
27 kOk, // We're all good. | 27 kOk, // We're all good. |
28 kAborted, // We aborted as a result of Stop() or Reset(). | 28 kAborted, // We aborted as a result of Stop() or Reset(). |
29 kDecodeError, // A decoding error occurred. | 29 kDecodeError, // A decoding error occurred. |
30 kDecryptError // Decrypting error happened. | 30 kDecryptError // Decrypting error happened. |
31 }; | 31 }; |
32 | 32 |
33 // Callback to return decoded buffers. | 33 // Callback for AudioDecoder to return a decoded frame whenever it becomes |
| 34 // available. Only non-EOS frames should be returned via this callback. |
34 typedef base::Callback<void(const scoped_refptr<AudioBuffer>&)> OutputCB; | 35 typedef base::Callback<void(const scoped_refptr<AudioBuffer>&)> OutputCB; |
35 | 36 |
36 // Callback for Decode(). Called after the decoder has completed decoding | 37 // Callback for Decode(). Called after the decoder has completed decoding |
37 // corresponding DecoderBuffer, indicating that it's ready to accept another | 38 // corresponding DecoderBuffer, indicating that it's ready to accept another |
38 // buffer to decode. | 39 // buffer to decode. |
39 typedef base::Callback<void(Status)> DecodeCB; | 40 typedef base::Callback<void(Status)> DecodeCB; |
40 | 41 |
41 AudioDecoder(); | 42 AudioDecoder(); |
42 virtual ~AudioDecoder(); | 43 virtual ~AudioDecoder(); |
43 | 44 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // must be called before destructing the decoder. | 76 // must be called before destructing the decoder. |
76 virtual void Stop() = 0; | 77 virtual void Stop() = 0; |
77 | 78 |
78 private: | 79 private: |
79 DISALLOW_COPY_AND_ASSIGN(AudioDecoder); | 80 DISALLOW_COPY_AND_ASSIGN(AudioDecoder); |
80 }; | 81 }; |
81 | 82 |
82 } // namespace media | 83 } // namespace media |
83 | 84 |
84 #endif // MEDIA_BASE_AUDIO_DECODER_H_ | 85 #endif // MEDIA_BASE_AUDIO_DECODER_H_ |
OLD | NEW |