OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 |
(...skipping 17 matching lines...) Expand all Loading... |
28 AudioEncoderCopyRed::Config::~Config() = default; | 28 AudioEncoderCopyRed::Config::~Config() = default; |
29 | 29 |
30 AudioEncoderCopyRed::AudioEncoderCopyRed(Config&& config) | 30 AudioEncoderCopyRed::AudioEncoderCopyRed(Config&& config) |
31 : speech_encoder_(std::move(config.speech_encoder)), | 31 : speech_encoder_(std::move(config.speech_encoder)), |
32 red_payload_type_(config.payload_type) { | 32 red_payload_type_(config.payload_type) { |
33 RTC_CHECK(speech_encoder_) << "Speech encoder not provided."; | 33 RTC_CHECK(speech_encoder_) << "Speech encoder not provided."; |
34 } | 34 } |
35 | 35 |
36 AudioEncoderCopyRed::~AudioEncoderCopyRed() = default; | 36 AudioEncoderCopyRed::~AudioEncoderCopyRed() = default; |
37 | 37 |
38 size_t AudioEncoderCopyRed::MaxEncodedBytes() const { | |
39 return 2 * speech_encoder_->MaxEncodedBytes(); | |
40 } | |
41 | |
42 int AudioEncoderCopyRed::SampleRateHz() const { | 38 int AudioEncoderCopyRed::SampleRateHz() const { |
43 return speech_encoder_->SampleRateHz(); | 39 return speech_encoder_->SampleRateHz(); |
44 } | 40 } |
45 | 41 |
46 size_t AudioEncoderCopyRed::NumChannels() const { | 42 size_t AudioEncoderCopyRed::NumChannels() const { |
47 return speech_encoder_->NumChannels(); | 43 return speech_encoder_->NumChannels(); |
48 } | 44 } |
49 | 45 |
50 int AudioEncoderCopyRed::RtpTimestampRateHz() const { | 46 int AudioEncoderCopyRed::RtpTimestampRateHz() const { |
51 return speech_encoder_->RtpTimestampRateHz(); | 47 return speech_encoder_->RtpTimestampRateHz(); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 122 |
127 void AudioEncoderCopyRed::SetProjectedPacketLossRate(double fraction) { | 123 void AudioEncoderCopyRed::SetProjectedPacketLossRate(double fraction) { |
128 speech_encoder_->SetProjectedPacketLossRate(fraction); | 124 speech_encoder_->SetProjectedPacketLossRate(fraction); |
129 } | 125 } |
130 | 126 |
131 void AudioEncoderCopyRed::SetTargetBitrate(int bits_per_second) { | 127 void AudioEncoderCopyRed::SetTargetBitrate(int bits_per_second) { |
132 speech_encoder_->SetTargetBitrate(bits_per_second); | 128 speech_encoder_->SetTargetBitrate(bits_per_second); |
133 } | 129 } |
134 | 130 |
135 } // namespace webrtc | 131 } // namespace webrtc |
OLD | NEW |