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 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 for (size_t j = 0; j < num_channels_; ++j) | 138 for (size_t j = 0; j < num_channels_; ++j) |
139 encoded[i * num_channels_ + j] = | 139 encoded[i * num_channels_ + j] = |
140 interleave_buffer_.data()[2 * j] << 4 | | 140 interleave_buffer_.data()[2 * j] << 4 | |
141 interleave_buffer_.data()[2 * j + 1]; | 141 interleave_buffer_.data()[2 * j + 1]; |
142 } | 142 } |
143 | 143 |
144 return bytes_to_encode; | 144 return bytes_to_encode; |
145 }); | 145 }); |
146 info.encoded_timestamp = first_timestamp_in_buffer_; | 146 info.encoded_timestamp = first_timestamp_in_buffer_; |
147 info.payload_type = payload_type_; | 147 info.payload_type = payload_type_; |
| 148 info.encoder_type = CodecType::kG722; |
148 return info; | 149 return info; |
149 } | 150 } |
150 | 151 |
151 AudioEncoderG722::EncoderState::EncoderState() { | 152 AudioEncoderG722::EncoderState::EncoderState() { |
152 RTC_CHECK_EQ(0, WebRtcG722_CreateEncoder(&encoder)); | 153 RTC_CHECK_EQ(0, WebRtcG722_CreateEncoder(&encoder)); |
153 } | 154 } |
154 | 155 |
155 AudioEncoderG722::EncoderState::~EncoderState() { | 156 AudioEncoderG722::EncoderState::~EncoderState() { |
156 RTC_CHECK_EQ(0, WebRtcG722_FreeEncoder(encoder)); | 157 RTC_CHECK_EQ(0, WebRtcG722_FreeEncoder(encoder)); |
157 } | 158 } |
158 | 159 |
159 size_t AudioEncoderG722::SamplesPerChannel() const { | 160 size_t AudioEncoderG722::SamplesPerChannel() const { |
160 return kSampleRateHz / 100 * num_10ms_frames_per_packet_; | 161 return kSampleRateHz / 100 * num_10ms_frames_per_packet_; |
161 } | 162 } |
162 | 163 |
163 } // namespace webrtc | 164 } // namespace webrtc |
OLD | NEW |