OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_INCLUDE_AUDIO_DECODER_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_INCLUDE_AUDIO_DECODER_H_ |
12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_INCLUDE_AUDIO_DECODER_H_ | 12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_INCLUDE_AUDIO_DECODER_H_ |
13 | 13 |
14 #include <stdlib.h> // NULL | 14 #include <memory> |
15 #include <vector> | |
15 | 16 |
16 #include "webrtc/base/array_view.h" | 17 #include "webrtc/base/array_view.h" |
17 #include "webrtc/base/buffer.h" | 18 #include "webrtc/base/buffer.h" |
18 #include "webrtc/base/constructormagic.h" | 19 #include "webrtc/base/constructormagic.h" |
19 #include "webrtc/base/optional.h" | 20 #include "webrtc/base/optional.h" |
20 #include "webrtc/typedefs.h" | 21 #include "webrtc/typedefs.h" |
21 | 22 |
22 namespace webrtc { | 23 namespace webrtc { |
23 | 24 |
24 // This is the interface class for decoders in NetEQ. Each codec type will have | 25 // This is the interface class for decoders in NetEQ. Each codec type will have |
(...skipping 18 matching lines...) Expand all Loading... | |
43 SpeechType speech_type; | 44 SpeechType speech_type; |
44 }; | 45 }; |
45 | 46 |
46 virtual ~EncodedAudioFrame() = default; | 47 virtual ~EncodedAudioFrame() = default; |
47 | 48 |
48 // Returns the duration in samples-per-channel of this audio frame. | 49 // Returns the duration in samples-per-channel of this audio frame. |
49 // If no duration can be ascertained, returns zero. | 50 // If no duration can be ascertained, returns zero. |
50 virtual size_t Duration() const = 0; | 51 virtual size_t Duration() const = 0; |
51 | 52 |
52 // Decodes this frame of audio and writes the result in |decoded|. | 53 // Decodes this frame of audio and writes the result in |decoded|. |
53 // |decoded| will be large enough for 120 ms of audio at the decoder's | 54 // |decoded| will be large enough for 120 ms of audio at the decoder's |
hlundin-webrtc
2016/09/16 07:35:20
"|decoded| will be large enough"
This sounds like
kwiberg-webrtc
2016/09/16 07:56:33
Yeah, it's always troublesome to document interfac
ossu
2016/09/16 11:46:00
Hmm. It mustn't really, though. Since we have a Du
kwiberg-webrtc
2016/09/16 12:07:39
Acknowledged.
| |
54 // sample rate. On success, returns an rtc::Optional containing the total | 55 // sample rate. On success, returns an rtc::Optional containing the total |
55 // number of samples across all channels, as well as whether the decoder | 56 // number of samples across all channels, as well as whether the decoder |
56 // produced comfort noise or speech. On failure, returns an empty | 57 // produced comfort noise or speech. On failure, returns an empty |
57 // rtc::Optional. Decode must be called at most once per frame object. | 58 // rtc::Optional. Decode must be called at most once per frame object. |
58 virtual rtc::Optional<DecodeResult> Decode( | 59 virtual rtc::Optional<DecodeResult> Decode( |
59 rtc::ArrayView<int16_t> decoded) const = 0; | 60 rtc::ArrayView<int16_t> decoded) const = 0; |
60 }; | 61 }; |
61 | 62 |
62 struct ParseResult { | 63 struct ParseResult { |
63 ParseResult(); | 64 ParseResult(); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
167 int sample_rate_hz, | 168 int sample_rate_hz, |
168 int16_t* decoded, | 169 int16_t* decoded, |
169 SpeechType* speech_type); | 170 SpeechType* speech_type); |
170 | 171 |
171 private: | 172 private: |
172 RTC_DISALLOW_COPY_AND_ASSIGN(AudioDecoder); | 173 RTC_DISALLOW_COPY_AND_ASSIGN(AudioDecoder); |
173 }; | 174 }; |
174 | 175 |
175 } // namespace webrtc | 176 } // namespace webrtc |
176 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_INCLUDE_AUDIO_DECODER_H_ | 177 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_INCLUDE_AUDIO_DECODER_H_ |
OLD | NEW |