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 valid frames should be returned via this callback. EOS | |
35 // frames should not be returned via this callback. | |
Sergey Ulanov
2014/06/16 23:49:32
nit: the last two sentences can be reduced to one.
xhwang
2014/06/17 18:56:35
Done.
| |
34 typedef base::Callback<void(const scoped_refptr<AudioBuffer>&)> OutputCB; | 36 typedef base::Callback<void(const scoped_refptr<AudioBuffer>&)> OutputCB; |
35 | 37 |
36 // Callback for Decode(). Called after the decoder has completed decoding | 38 // Callback for Decode(). Called after the decoder has completed decoding |
37 // corresponding DecoderBuffer, indicating that it's ready to accept another | 39 // corresponding DecoderBuffer, indicating that it's ready to accept another |
38 // buffer to decode. | 40 // buffer to decode. |
39 typedef base::Callback<void(Status)> DecodeCB; | 41 typedef base::Callback<void(Status)> DecodeCB; |
40 | 42 |
41 AudioDecoder(); | 43 AudioDecoder(); |
42 virtual ~AudioDecoder(); | 44 virtual ~AudioDecoder(); |
43 | 45 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
75 // must be called before destructing the decoder. | 77 // must be called before destructing the decoder. |
76 virtual void Stop() = 0; | 78 virtual void Stop() = 0; |
77 | 79 |
78 private: | 80 private: |
79 DISALLOW_COPY_AND_ASSIGN(AudioDecoder); | 81 DISALLOW_COPY_AND_ASSIGN(AudioDecoder); |
80 }; | 82 }; |
81 | 83 |
82 } // namespace media | 84 } // namespace media |
83 | 85 |
84 #endif // MEDIA_BASE_AUDIO_DECODER_H_ | 86 #endif // MEDIA_BASE_AUDIO_DECODER_H_ |
OLD | NEW |