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 |
38 int AudioEncoderCopyRed::SampleRateHz() const { | 42 int AudioEncoderCopyRed::SampleRateHz() const { |
39 return speech_encoder_->SampleRateHz(); | 43 return speech_encoder_->SampleRateHz(); |
40 } | 44 } |
41 | 45 |
42 size_t AudioEncoderCopyRed::NumChannels() const { | 46 size_t AudioEncoderCopyRed::NumChannels() const { |
43 return speech_encoder_->NumChannels(); | 47 return speech_encoder_->NumChannels(); |
44 } | 48 } |
45 | 49 |
46 int AudioEncoderCopyRed::RtpTimestampRateHz() const { | 50 int AudioEncoderCopyRed::RtpTimestampRateHz() const { |
47 return speech_encoder_->RtpTimestampRateHz(); | 51 return speech_encoder_->RtpTimestampRateHz(); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 126 |
123 void AudioEncoderCopyRed::SetProjectedPacketLossRate(double fraction) { | 127 void AudioEncoderCopyRed::SetProjectedPacketLossRate(double fraction) { |
124 speech_encoder_->SetProjectedPacketLossRate(fraction); | 128 speech_encoder_->SetProjectedPacketLossRate(fraction); |
125 } | 129 } |
126 | 130 |
127 void AudioEncoderCopyRed::SetTargetBitrate(int bits_per_second) { | 131 void AudioEncoderCopyRed::SetTargetBitrate(int bits_per_second) { |
128 speech_encoder_->SetTargetBitrate(bits_per_second); | 132 speech_encoder_->SetTargetBitrate(bits_per_second); |
129 } | 133 } |
130 | 134 |
131 } // namespace webrtc | 135 } // namespace webrtc |
OLD | NEW |