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 |
11 #include "webrtc/modules/audio_coding/codecs/g722/audio_encoder_g722.h" | 11 #include "webrtc/modules/audio_coding/codecs/g722/audio_encoder_g722.h" |
12 | 12 |
13 #include <algorithm> | 13 #include <algorithm> |
14 | 14 |
15 #include <limits> | 15 #include <limits> |
| 16 #include "webrtc/base/checks.h" |
| 17 #include "webrtc/base/safe_conversions.h" |
| 18 #include "webrtc/base/string_to_number.h" |
16 #include "webrtc/common_types.h" | 19 #include "webrtc/common_types.h" |
17 #include "webrtc/modules/audio_coding/codecs/g722/g722_interface.h" | 20 #include "webrtc/modules/audio_coding/codecs/g722/g722_interface.h" |
18 #include "webrtc/rtc_base/checks.h" | |
19 #include "webrtc/rtc_base/safe_conversions.h" | |
20 #include "webrtc/rtc_base/string_to_number.h" | |
21 | 21 |
22 namespace webrtc { | 22 namespace webrtc { |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 const size_t kSampleRateHz = 16000; | 26 const size_t kSampleRateHz = 16000; |
27 | 27 |
28 AudioEncoderG722Config CreateConfig(const CodecInst& codec_inst) { | 28 AudioEncoderG722Config CreateConfig(const CodecInst& codec_inst) { |
29 AudioEncoderG722Config config; | 29 AudioEncoderG722Config config; |
30 config.num_channels = rtc::dchecked_cast<int>(codec_inst.channels); | 30 config.num_channels = rtc::dchecked_cast<int>(codec_inst.channels); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 193 |
194 AudioEncoderG722Impl::EncoderState::~EncoderState() { | 194 AudioEncoderG722Impl::EncoderState::~EncoderState() { |
195 RTC_CHECK_EQ(0, WebRtcG722_FreeEncoder(encoder)); | 195 RTC_CHECK_EQ(0, WebRtcG722_FreeEncoder(encoder)); |
196 } | 196 } |
197 | 197 |
198 size_t AudioEncoderG722Impl::SamplesPerChannel() const { | 198 size_t AudioEncoderG722Impl::SamplesPerChannel() const { |
199 return kSampleRateHz / 100 * num_10ms_frames_per_packet_; | 199 return kSampleRateHz / 100 * num_10ms_frames_per_packet_; |
200 } | 200 } |
201 | 201 |
202 } // namespace webrtc | 202 } // namespace webrtc |
OLD | NEW |