AudioDecoderOpus: Add support for 16 kHz output sample rate

In addition to the 48 kHz that we've always used.

Bug: webrtc:10631
Change-Id: If73bf7ff9c1c0d22e0d1caa245128612850f8e41
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138268
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28104}
This commit is contained in:
Karl Wiberg
2019-05-29 13:46:09 +02:00
committed by Commit Bot
parent ed69d41b62
commit 7eb0a5e210
5 changed files with 66 additions and 60 deletions

View File

@ -24,7 +24,8 @@ namespace webrtc {
class AudioDecoderOpusImpl final : public AudioDecoder {
public:
explicit AudioDecoderOpusImpl(size_t num_channels);
explicit AudioDecoderOpusImpl(size_t num_channels,
int sample_rate_hz = 48000);
~AudioDecoderOpusImpl() override;
std::vector<ParseResult> ParsePayload(rtc::Buffer&& payload,
@ -52,6 +53,7 @@ class AudioDecoderOpusImpl final : public AudioDecoder {
private:
OpusDecInst* dec_state_;
const size_t channels_;
const int sample_rate_hz_;
RTC_DISALLOW_COPY_AND_ASSIGN(AudioDecoderOpusImpl);
};