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/include/audio_encoder_g722.h" | 11 #include "webrtc/modules/audio_coding/codecs/g722/audio_encoder_g722.h" |
12 | 12 |
13 #include <limits> | 13 #include <limits> |
14 #include "webrtc/base/checks.h" | 14 #include "webrtc/base/checks.h" |
15 #include "webrtc/common_types.h" | 15 #include "webrtc/common_types.h" |
16 #include "webrtc/modules/audio_coding/codecs/g722/include/g722_interface.h" | 16 #include "webrtc/modules/audio_coding/codecs/g722/g722_interface.h" |
17 | 17 |
18 namespace webrtc { | 18 namespace webrtc { |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 const size_t kSampleRateHz = 16000; | 22 const size_t kSampleRateHz = 16000; |
23 | 23 |
24 AudioEncoderG722::Config CreateConfig(const CodecInst& codec_inst) { | 24 AudioEncoderG722::Config CreateConfig(const CodecInst& codec_inst) { |
25 AudioEncoderG722::Config config; | 25 AudioEncoderG722::Config config; |
26 config.num_channels = codec_inst.channels; | 26 config.num_channels = codec_inst.channels; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 AudioEncoderG722::EncoderState::~EncoderState() { | 156 AudioEncoderG722::EncoderState::~EncoderState() { |
157 RTC_CHECK_EQ(0, WebRtcG722_FreeEncoder(encoder)); | 157 RTC_CHECK_EQ(0, WebRtcG722_FreeEncoder(encoder)); |
158 } | 158 } |
159 | 159 |
160 size_t AudioEncoderG722::SamplesPerChannel() const { | 160 size_t AudioEncoderG722::SamplesPerChannel() const { |
161 return kSampleRateHz / 100 * num_10ms_frames_per_packet_; | 161 return kSampleRateHz / 100 * num_10ms_frames_per_packet_; |
162 } | 162 } |
163 | 163 |
164 } // namespace webrtc | 164 } // namespace webrtc |
OLD | NEW |