| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 } | 180 } |
| 181 | 181 |
| 182 void AudioEncoderCng::SetProjectedPacketLossRate(double fraction) { | 182 void AudioEncoderCng::SetProjectedPacketLossRate(double fraction) { |
| 183 speech_encoder_->SetProjectedPacketLossRate(fraction); | 183 speech_encoder_->SetProjectedPacketLossRate(fraction); |
| 184 } | 184 } |
| 185 | 185 |
| 186 void AudioEncoderCng::SetTargetBitrate(int bits_per_second) { | 186 void AudioEncoderCng::SetTargetBitrate(int bits_per_second) { |
| 187 speech_encoder_->SetTargetBitrate(bits_per_second); | 187 speech_encoder_->SetTargetBitrate(bits_per_second); |
| 188 } | 188 } |
| 189 | 189 |
| 190 rtc::ArrayView<std::unique_ptr<AudioEncoder>> |
| 191 AudioEncoderCng::ReclaimContainedEncoders() { |
| 192 return rtc::ArrayView<std::unique_ptr<AudioEncoder>>(&speech_encoder_, 1); |
| 193 } |
| 194 |
| 190 AudioEncoder::EncodedInfo AudioEncoderCng::EncodePassive( | 195 AudioEncoder::EncodedInfo AudioEncoderCng::EncodePassive( |
| 191 size_t frames_to_encode, | 196 size_t frames_to_encode, |
| 192 rtc::Buffer* encoded) { | 197 rtc::Buffer* encoded) { |
| 193 bool force_sid = last_frame_active_; | 198 bool force_sid = last_frame_active_; |
| 194 bool output_produced = false; | 199 bool output_produced = false; |
| 195 const size_t samples_per_10ms_frame = SamplesPer10msFrame(); | 200 const size_t samples_per_10ms_frame = SamplesPer10msFrame(); |
| 196 AudioEncoder::EncodedInfo info; | 201 AudioEncoder::EncodedInfo info; |
| 197 | 202 |
| 198 for (size_t i = 0; i < frames_to_encode; ++i) { | 203 for (size_t i = 0; i < frames_to_encode; ++i) { |
| 199 // It's important not to pass &info.encoded_bytes directly to | 204 // It's important not to pass &info.encoded_bytes directly to |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 } | 247 } |
| 243 } | 248 } |
| 244 return info; | 249 return info; |
| 245 } | 250 } |
| 246 | 251 |
| 247 size_t AudioEncoderCng::SamplesPer10msFrame() const { | 252 size_t AudioEncoderCng::SamplesPer10msFrame() const { |
| 248 return rtc::CheckedDivExact(10 * SampleRateHz(), 1000); | 253 return rtc::CheckedDivExact(10 * SampleRateHz(), 1000); |
| 249 } | 254 } |
| 250 | 255 |
| 251 } // namespace webrtc | 256 } // namespace webrtc |
| OLD | NEW |