OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 |
11 #include "webrtc/modules/audio_coding/main/acm2/codec_manager.h" | 11 #include "webrtc/modules/audio_coding/main/acm2/codec_manager.h" |
12 | 12 |
13 #include "webrtc/base/checks.h" | 13 #include "webrtc/base/checks.h" |
14 #include "webrtc/engine_configurations.h" | 14 #include "webrtc/engine_configurations.h" |
15 #include "webrtc/modules/audio_coding/main/acm2/acm_codec_database.h" | 15 #include "webrtc/modules/audio_coding/main/acm2/acm_codec_database.h" |
| 16 #include "webrtc/system_wrappers/interface/metrics.h" |
16 #include "webrtc/system_wrappers/interface/trace.h" | 17 #include "webrtc/system_wrappers/interface/trace.h" |
17 | 18 |
18 namespace webrtc { | 19 namespace webrtc { |
19 namespace acm2 { | 20 namespace acm2 { |
20 | 21 |
21 namespace { | 22 namespace { |
22 bool IsCodecRED(const CodecInst& codec) { | 23 bool IsCodecRED(const CodecInst& codec) { |
23 return (STR_CASE_CMP(codec.plname, "RED") == 0); | 24 return (STR_CASE_CMP(codec.plname, "RED") == 0); |
24 } | 25 } |
25 | 26 |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 vad_mode_, red_enabled_ ? RedPayloadType(send_codec.plfreq) : -1); | 305 vad_mode_, red_enabled_ ? RedPayloadType(send_codec.plfreq) : -1); |
305 DCHECK(codec_owner_.Encoder()); | 306 DCHECK(codec_owner_.Encoder()); |
306 } | 307 } |
307 send_codec_inst_.plfreq = send_codec.plfreq; | 308 send_codec_inst_.plfreq = send_codec.plfreq; |
308 send_codec_inst_.pacsize = send_codec.pacsize; | 309 send_codec_inst_.pacsize = send_codec.pacsize; |
309 send_codec_inst_.channels = send_codec.channels; | 310 send_codec_inst_.channels = send_codec.channels; |
310 send_codec_inst_.pltype = send_codec.pltype; | 311 send_codec_inst_.pltype = send_codec.pltype; |
311 | 312 |
312 // Check if a change in Rate is required. | 313 // Check if a change in Rate is required. |
313 if (send_codec.rate != send_codec_inst_.rate) { | 314 if (send_codec.rate != send_codec_inst_.rate) { |
| 315 RTC_HISTOGRAM_COUNTS_100("WebRTC.Audio.TargetBitrateInKbps", |
| 316 send_codec.rate / 1000); |
314 codec_owner_.SpeechEncoder()->SetTargetBitrate(send_codec.rate); | 317 codec_owner_.SpeechEncoder()->SetTargetBitrate(send_codec.rate); |
315 send_codec_inst_.rate = send_codec.rate; | 318 send_codec_inst_.rate = send_codec.rate; |
316 } | 319 } |
317 | 320 |
318 codec_fec_enabled_ = codec_fec_enabled_ && | 321 codec_fec_enabled_ = codec_fec_enabled_ && |
319 codec_owner_.SpeechEncoder()->SetFec(codec_fec_enabled_); | 322 codec_owner_.SpeechEncoder()->SetFec(codec_fec_enabled_); |
320 | 323 |
321 return 0; | 324 return 0; |
322 } | 325 } |
323 | 326 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 case 48000: | 468 case 48000: |
466 return -1; | 469 return -1; |
467 default: | 470 default: |
468 FATAL() << sample_rate_hz << " Hz is not supported"; | 471 FATAL() << sample_rate_hz << " Hz is not supported"; |
469 return -1; | 472 return -1; |
470 } | 473 } |
471 } | 474 } |
472 | 475 |
473 } // namespace acm2 | 476 } // namespace acm2 |
474 } // namespace webrtc | 477 } // namespace webrtc |
OLD | NEW |