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 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 int UnregisterReceiveCodec(uint8_t payload_type) override; | 197 int UnregisterReceiveCodec(uint8_t payload_type) override; |
198 | 198 |
199 int EnableNack(size_t max_nack_list_size) override; | 199 int EnableNack(size_t max_nack_list_size) override; |
200 | 200 |
201 void DisableNack() override; | 201 void DisableNack() override; |
202 | 202 |
203 std::vector<uint16_t> GetNackList(int64_t round_trip_time_ms) const override; | 203 std::vector<uint16_t> GetNackList(int64_t round_trip_time_ms) const override; |
204 | 204 |
205 void GetDecodingCallStatistics(AudioDecodingCallStats* stats) const override; | 205 void GetDecodingCallStatistics(AudioDecodingCallStats* stats) const override; |
206 | 206 |
| 207 AudioEncoder::AudioEncoderStats GetAudioEncoderStatistics() const override; |
| 208 |
207 private: | 209 private: |
208 struct InputData { | 210 struct InputData { |
209 uint32_t input_timestamp; | 211 uint32_t input_timestamp; |
210 const int16_t* audio; | 212 const int16_t* audio; |
211 size_t length_per_channel; | 213 size_t length_per_channel; |
212 size_t audio_channel; | 214 size_t audio_channel; |
213 // If a re-mix is required (up or down), this buffer will store a re-mixed | 215 // If a re-mix is required (up or down), this buffer will store a re-mixed |
214 // version of the input. | 216 // version of the input. |
215 int16_t buffer[WEBRTC_10MS_PCM_AUDIO]; | 217 int16_t buffer[WEBRTC_10MS_PCM_AUDIO]; |
216 }; | 218 }; |
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1263 | 1265 |
1264 int AudioCodingModuleImpl::LeastRequiredDelayMs() const { | 1266 int AudioCodingModuleImpl::LeastRequiredDelayMs() const { |
1265 return receiver_.LeastRequiredDelayMs(); | 1267 return receiver_.LeastRequiredDelayMs(); |
1266 } | 1268 } |
1267 | 1269 |
1268 void AudioCodingModuleImpl::GetDecodingCallStatistics( | 1270 void AudioCodingModuleImpl::GetDecodingCallStatistics( |
1269 AudioDecodingCallStats* call_stats) const { | 1271 AudioDecodingCallStats* call_stats) const { |
1270 receiver_.GetDecodingCallStatistics(call_stats); | 1272 receiver_.GetDecodingCallStatistics(call_stats); |
1271 } | 1273 } |
1272 | 1274 |
| 1275 AudioEncoder::AudioEncoderStats |
| 1276 AudioCodingModuleImpl::GetAudioEncoderStatistics() const { |
| 1277 rtc::CritScope lock(&acm_crit_sect_); |
| 1278 if (encoder_stack_) |
| 1279 return encoder_stack_->GetStats(); |
| 1280 // If no encoder is set, return default stats. |
| 1281 return AudioEncoder::AudioEncoderStats(); |
| 1282 } |
| 1283 |
1273 } // namespace | 1284 } // namespace |
1274 | 1285 |
1275 AudioCodingModule::Config::Config() | 1286 AudioCodingModule::Config::Config() |
1276 : id(0), neteq_config(), clock(Clock::GetRealTimeClock()) { | 1287 : id(0), neteq_config(), clock(Clock::GetRealTimeClock()) { |
1277 // Post-decode VAD is disabled by default in NetEq, however, Audio | 1288 // Post-decode VAD is disabled by default in NetEq, however, Audio |
1278 // Conference Mixer relies on VAD decisions and fails without them. | 1289 // Conference Mixer relies on VAD decisions and fails without them. |
1279 neteq_config.enable_post_decode_vad = true; | 1290 neteq_config.enable_post_decode_vad = true; |
1280 } | 1291 } |
1281 | 1292 |
1282 AudioCodingModule::Config::Config(const Config&) = default; | 1293 AudioCodingModule::Config::Config(const Config&) = default; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1360 | 1371 |
1361 // Checks the validity of the parameters of the given codec | 1372 // Checks the validity of the parameters of the given codec |
1362 bool AudioCodingModule::IsCodecValid(const CodecInst& codec) { | 1373 bool AudioCodingModule::IsCodecValid(const CodecInst& codec) { |
1363 bool valid = acm2::RentACodec::IsCodecValid(codec); | 1374 bool valid = acm2::RentACodec::IsCodecValid(codec); |
1364 if (!valid) | 1375 if (!valid) |
1365 LOG(LS_ERROR) << "Invalid codec setting"; | 1376 LOG(LS_ERROR) << "Invalid codec setting"; |
1366 return valid; | 1377 return valid; |
1367 } | 1378 } |
1368 | 1379 |
1369 } // namespace webrtc | 1380 } // namespace webrtc |
OLD | NEW |