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/channel_layout.h" | 10 #include "media/base/channel_layout.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 // this method. | 42 // this method. |
43 // | 43 // |
44 // Non-NULL sample buffer pointers will contain decoded audio data or may | 44 // Non-NULL sample buffer pointers will contain decoded audio data or may |
45 // indicate the end of the stream. A NULL buffer pointer indicates an aborted | 45 // indicate the end of the stream. A NULL buffer pointer indicates an aborted |
46 // Read(). This can happen if the DemuxerStream gets flushed and doesn't have | 46 // Read(). This can happen if the DemuxerStream gets flushed and doesn't have |
47 // any more data to return. | 47 // any more data to return. |
48 typedef base::Callback<void(Status, const scoped_refptr<AudioBuffer>&)> | 48 typedef base::Callback<void(Status, const scoped_refptr<AudioBuffer>&)> |
49 ReadCB; | 49 ReadCB; |
50 virtual void Read(const ReadCB& read_cb) = 0; | 50 virtual void Read(const ReadCB& read_cb) = 0; |
51 | 51 |
52 // Reset decoder state, dropping any queued encoded data. | 52 // Reset decoder state, dropping any queued encoded data. |
xhwang
2014/01/08 01:33:37
nit: since you are here, s/Reset/Resets, same as I
| |
53 virtual void Reset(const base::Closure& closure) = 0; | 53 virtual void Reset(const base::Closure& closure) = 0; |
54 | 54 |
55 // Stops decoder, fires any pending callbacks and sets the decoder to an | |
56 // uninitialized state. An AudioDecoder cannot be re-initialized after it has | |
57 // been stopped. | |
58 // Note that if Initialize() has been called, Stop() must be called and | |
59 // complete before deleting the decoder. | |
60 virtual void Stop(const base::Closure& closure) = 0; | |
61 | |
55 // Returns various information about the decoded audio format. | 62 // Returns various information about the decoded audio format. |
56 virtual int bits_per_channel() = 0; | 63 virtual int bits_per_channel() = 0; |
57 virtual ChannelLayout channel_layout() = 0; | 64 virtual ChannelLayout channel_layout() = 0; |
58 virtual int samples_per_second() = 0; | 65 virtual int samples_per_second() = 0; |
59 | 66 |
60 private: | 67 private: |
61 DISALLOW_COPY_AND_ASSIGN(AudioDecoder); | 68 DISALLOW_COPY_AND_ASSIGN(AudioDecoder); |
62 }; | 69 }; |
63 | 70 |
64 } // namespace media | 71 } // namespace media |
65 | 72 |
66 #endif // MEDIA_BASE_AUDIO_DECODER_H_ | 73 #endif // MEDIA_BASE_AUDIO_DECODER_H_ |
OLD | NEW |