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 #ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_AUDIO_ENCODER_ISAC_T_IMPL_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_AUDIO_ENCODER_ISAC_T_IMPL_H_ |
12 #define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_AUDIO_ENCODER_ISAC_T_IMPL_H_ | 12 #define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_AUDIO_ENCODER_ISAC_T_IMPL_H_ |
13 | 13 |
14 #include "webrtc/modules/audio_coding/codecs/isac/main/include/audio_encoder_isa c.h" | 14 #include "webrtc/modules/audio_coding/codecs/isac/main/include/audio_encoder_isa c.h" |
15 | 15 |
16 #include "webrtc/base/checks.h" | 16 #include "webrtc/base/checks.h" |
17 #include "webrtc/common_types.h" | 17 #include "webrtc/common_types.h" |
18 #include "webrtc/modules/audio_coding/codecs/audio_encoder.h" | |
hlundin-webrtc
2016/05/13 11:18:19
Still not needed... or?
aleloi
2016/05/16 08:02:24
No, missed that one.
| |
18 | 19 |
19 namespace webrtc { | 20 namespace webrtc { |
20 | 21 |
21 template <typename T> | 22 template <typename T> |
22 typename AudioEncoderIsacT<T>::Config CreateIsacConfig( | 23 typename AudioEncoderIsacT<T>::Config CreateIsacConfig( |
23 const CodecInst& codec_inst, | 24 const CodecInst& codec_inst, |
24 const rtc::scoped_refptr<LockedIsacBandwidthInfo>& bwinfo) { | 25 const rtc::scoped_refptr<LockedIsacBandwidthInfo>& bwinfo) { |
25 typename AudioEncoderIsacT<T>::Config config; | 26 typename AudioEncoderIsacT<T>::Config config; |
26 config.bwinfo = bwinfo; | 27 config.bwinfo = bwinfo; |
27 config.payload_type = codec_inst.pltype; | 28 config.payload_type = codec_inst.pltype; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 if (encoded_bytes == 0) | 139 if (encoded_bytes == 0) |
139 return EncodedInfo(); | 140 return EncodedInfo(); |
140 | 141 |
141 // Got enough input to produce a packet. Return the saved timestamp from | 142 // Got enough input to produce a packet. Return the saved timestamp from |
142 // the first chunk of input that went into the packet. | 143 // the first chunk of input that went into the packet. |
143 packet_in_progress_ = false; | 144 packet_in_progress_ = false; |
144 EncodedInfo info; | 145 EncodedInfo info; |
145 info.encoded_bytes = encoded_bytes; | 146 info.encoded_bytes = encoded_bytes; |
146 info.encoded_timestamp = packet_timestamp_; | 147 info.encoded_timestamp = packet_timestamp_; |
147 info.payload_type = config_.payload_type; | 148 info.payload_type = config_.payload_type; |
149 info.encoder_type = AudioEncoder::CodecType::kIsac; | |
148 return info; | 150 return info; |
149 } | 151 } |
150 | 152 |
151 template <typename T> | 153 template <typename T> |
152 void AudioEncoderIsacT<T>::Reset() { | 154 void AudioEncoderIsacT<T>::Reset() { |
153 RecreateEncoderInstance(config_); | 155 RecreateEncoderInstance(config_); |
154 } | 156 } |
155 | 157 |
156 template <typename T> | 158 template <typename T> |
157 void AudioEncoderIsacT<T>::RecreateEncoderInstance(const Config& config) { | 159 void AudioEncoderIsacT<T>::RecreateEncoderInstance(const Config& config) { |
(...skipping 23 matching lines...) Expand all Loading... | |
181 // we get an encoding that isn't bit-for-bit identical with what a combined | 183 // we get an encoding that isn't bit-for-bit identical with what a combined |
182 // encoder+decoder object produces. | 184 // encoder+decoder object produces. |
183 RTC_CHECK_EQ(0, T::SetDecSampRate(isac_state_, config.sample_rate_hz)); | 185 RTC_CHECK_EQ(0, T::SetDecSampRate(isac_state_, config.sample_rate_hz)); |
184 | 186 |
185 config_ = config; | 187 config_ = config; |
186 } | 188 } |
187 | 189 |
188 } // namespace webrtc | 190 } // namespace webrtc |
189 | 191 |
190 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_AUDIO_ENCODER_ISAC_T_IMPL_H_ | 192 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_AUDIO_ENCODER_ISAC_T_IMPL_H_ |
OLD | NEW |