Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(851)

Side by Side Diff: webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc

Issue 1178053002: Add UMA logging for target audio bitrate (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/main/acm2/codec_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 #include "webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.h" 11 #include "webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.h"
12 12
13 #include <assert.h> 13 #include <assert.h>
14 #include <stdlib.h> 14 #include <stdlib.h>
15 #include <vector> 15 #include <vector>
16 16
17 #include "webrtc/base/checks.h" 17 #include "webrtc/base/checks.h"
18 #include "webrtc/base/safe_conversions.h" 18 #include "webrtc/base/safe_conversions.h"
19 #include "webrtc/engine_configurations.h" 19 #include "webrtc/engine_configurations.h"
20 #include "webrtc/modules/audio_coding/main/interface/audio_coding_module_typedef s.h" 20 #include "webrtc/modules/audio_coding/main/interface/audio_coding_module_typedef s.h"
21 #include "webrtc/modules/audio_coding/main/acm2/acm_common_defs.h" 21 #include "webrtc/modules/audio_coding/main/acm2/acm_common_defs.h"
22 #include "webrtc/modules/audio_coding/main/acm2/acm_resampler.h" 22 #include "webrtc/modules/audio_coding/main/acm2/acm_resampler.h"
23 #include "webrtc/modules/audio_coding/main/acm2/call_statistics.h" 23 #include "webrtc/modules/audio_coding/main/acm2/call_statistics.h"
24 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" 24 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
25 #include "webrtc/system_wrappers/interface/logging.h" 25 #include "webrtc/system_wrappers/interface/logging.h"
26 #include "webrtc/system_wrappers/interface/metrics.h"
26 #include "webrtc/system_wrappers/interface/rw_lock_wrapper.h" 27 #include "webrtc/system_wrappers/interface/rw_lock_wrapper.h"
27 #include "webrtc/system_wrappers/interface/trace.h" 28 #include "webrtc/system_wrappers/interface/trace.h"
28 #include "webrtc/typedefs.h" 29 #include "webrtc/typedefs.h"
29 30
30 namespace webrtc { 31 namespace webrtc {
31 32
32 namespace acm2 { 33 namespace acm2 {
33 34
34 enum { 35 enum {
35 kACMToneEnd = 999 36 kACMToneEnd = 999
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 // } 282 // }
282 // 283 //
283 // WebRtcACMCodecParams encoder_param; 284 // WebRtcACMCodecParams encoder_param;
284 // codec_manager_.current_encoder()->EncoderParams(&encoder_param); 285 // codec_manager_.current_encoder()->EncoderParams(&encoder_param);
285 // 286 //
286 // return encoder_param.codec_inst.rate; 287 // return encoder_param.codec_inst.rate;
287 } 288 }
288 289
289 void AudioCodingModuleImpl::SetBitRate(int bitrate_bps) { 290 void AudioCodingModuleImpl::SetBitRate(int bitrate_bps) {
290 CriticalSectionScoped lock(acm_crit_sect_); 291 CriticalSectionScoped lock(acm_crit_sect_);
291 292 RTC_HISTOGRAM_COUNTS_100("WebRTC.Audio.TargetBitrateInKbps",
kwiberg-webrtc 2015/06/11 10:03:13 Define a constant for this string? You use it in 3
hlundin-webrtc 2015/06/11 10:11:48 Yes, that might be a good idea. Any suggestion on
kwiberg-webrtc 2015/06/11 11:01:25 I think my preferred solution would be for all of
293 bitrate_bps / 1000);
292 if (codec_manager_.CurrentEncoder()) { 294 if (codec_manager_.CurrentEncoder()) {
293 codec_manager_.CurrentEncoder()->SetTargetBitrate(bitrate_bps); 295 codec_manager_.CurrentEncoder()->SetTargetBitrate(bitrate_bps);
kwiberg-webrtc 2015/06/11 10:03:13 If this method would just return the bitrate the e
hlundin-webrtc 2015/06/11 10:11:48 That could be useful. But it would mean that it mu
kwiberg-webrtc 2015/06/11 11:01:25 Yes---but the implementation would be trivial, so
294 } 296 }
295 } 297 }
296 298
297 // Set available bandwidth, inform the encoder about the estimated bandwidth 299 // Set available bandwidth, inform the encoder about the estimated bandwidth
298 // received from the remote party. 300 // received from the remote party.
299 // TODO(henrik.lundin): Remove; not used. 301 // TODO(henrik.lundin): Remove; not used.
300 int AudioCodingModuleImpl::SetReceivedEstimatedBandwidth(int bw) { 302 int AudioCodingModuleImpl::SetReceivedEstimatedBandwidth(int bw) {
301 CriticalSectionScoped lock(acm_crit_sect_); 303 CriticalSectionScoped lock(acm_crit_sect_);
302 FATAL() << "Dead code?"; 304 FATAL() << "Dead code?";
303 return -1; 305 return -1;
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after
1257 *channels = 1; 1259 *channels = 1;
1258 break; 1260 break;
1259 #endif 1261 #endif
1260 default: 1262 default:
1261 FATAL() << "Codec type " << codec_type << " not supported."; 1263 FATAL() << "Codec type " << codec_type << " not supported.";
1262 } 1264 }
1263 return true; 1265 return true;
1264 } 1266 }
1265 1267
1266 } // namespace webrtc 1268 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/main/acm2/codec_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698