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

Side by Side Diff: webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc

Issue 1753293002: Safe numeric library: base/numerics (copied from Chromium) (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase with master + correct new safe_conversions.h include Created 4 years, 9 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
OLDNEW
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
11 #include "webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.h" 11 #include "webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.h"
12 12
13 #include "webrtc/base/checks.h" 13 #include "webrtc/base/checks.h"
14 #include "webrtc/base/safe_conversions.h" 14 #include "webrtc/base/numerics/safe_conversions.h"
15 #include "webrtc/common_types.h" 15 #include "webrtc/common_types.h"
16 #include "webrtc/modules/audio_coding/codecs/opus/opus_interface.h" 16 #include "webrtc/modules/audio_coding/codecs/opus/opus_interface.h"
17 17
18 namespace webrtc { 18 namespace webrtc {
19 19
20 namespace { 20 namespace {
21 21
22 const int kSampleRateHz = 48000; 22 const int kSampleRateHz = 48000;
23 const int kMinBitrateBps = 500; 23 const int kMinBitrateBps = 500;
24 const int kMaxBitrateBps = 512000; 24 const int kMaxBitrateBps = 512000;
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 RTC_CHECK_EQ(0, WebRtcOpus_DisableDtx(inst_)); 258 RTC_CHECK_EQ(0, WebRtcOpus_DisableDtx(inst_));
259 } 259 }
260 RTC_CHECK_EQ(0, 260 RTC_CHECK_EQ(0,
261 WebRtcOpus_SetPacketLossRate( 261 WebRtcOpus_SetPacketLossRate(
262 inst_, static_cast<int32_t>(packet_loss_rate_ * 100 + .5))); 262 inst_, static_cast<int32_t>(packet_loss_rate_ * 100 + .5)));
263 config_ = config; 263 config_ = config;
264 return true; 264 return true;
265 } 265 }
266 266
267 } // namespace webrtc 267 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/acm2/audio_coding_module_impl.cc ('k') | webrtc/modules/audio_coding/neteq/delay_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698