| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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_ACM2_AUDIO_CODING_MODULE_IMPL_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_ACM2_AUDIO_CODING_MODULE_IMPL_H_ |
| 12 #define WEBRTC_MODULES_AUDIO_CODING_ACM2_AUDIO_CODING_MODULE_IMPL_H_ | 12 #define WEBRTC_MODULES_AUDIO_CODING_ACM2_AUDIO_CODING_MODULE_IMPL_H_ |
| 13 | 13 |
| 14 #include <memory> |
| 14 #include <string> | 15 #include <string> |
| 15 #include <vector> | 16 #include <vector> |
| 16 | 17 |
| 17 #include "webrtc/base/buffer.h" | 18 #include "webrtc/base/buffer.h" |
| 18 #include "webrtc/base/criticalsection.h" | 19 #include "webrtc/base/criticalsection.h" |
| 19 #include "webrtc/base/scoped_ptr.h" | |
| 20 #include "webrtc/base/thread_annotations.h" | 20 #include "webrtc/base/thread_annotations.h" |
| 21 #include "webrtc/common_types.h" | 21 #include "webrtc/common_types.h" |
| 22 #include "webrtc/engine_configurations.h" | 22 #include "webrtc/engine_configurations.h" |
| 23 #include "webrtc/modules/audio_coding/acm2/acm_receiver.h" | 23 #include "webrtc/modules/audio_coding/acm2/acm_receiver.h" |
| 24 #include "webrtc/modules/audio_coding/acm2/acm_resampler.h" | 24 #include "webrtc/modules/audio_coding/acm2/acm_resampler.h" |
| 25 #include "webrtc/modules/audio_coding/acm2/codec_manager.h" | 25 #include "webrtc/modules/audio_coding/acm2/codec_manager.h" |
| 26 | 26 |
| 27 namespace webrtc { | 27 namespace webrtc { |
| 28 | 28 |
| 29 class AudioCodingImpl; | 29 class AudioCodingImpl; |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 uint32_t expected_codec_ts_ GUARDED_BY(acm_crit_sect_); | 246 uint32_t expected_codec_ts_ GUARDED_BY(acm_crit_sect_); |
| 247 uint32_t expected_in_ts_ GUARDED_BY(acm_crit_sect_); | 247 uint32_t expected_in_ts_ GUARDED_BY(acm_crit_sect_); |
| 248 ACMResampler resampler_ GUARDED_BY(acm_crit_sect_); | 248 ACMResampler resampler_ GUARDED_BY(acm_crit_sect_); |
| 249 AcmReceiver receiver_; // AcmReceiver has it's own internal lock. | 249 AcmReceiver receiver_; // AcmReceiver has it's own internal lock. |
| 250 ChangeLogger bitrate_logger_ GUARDED_BY(acm_crit_sect_); | 250 ChangeLogger bitrate_logger_ GUARDED_BY(acm_crit_sect_); |
| 251 | 251 |
| 252 struct EncoderFactory { | 252 struct EncoderFactory { |
| 253 CodecManager codec_manager; | 253 CodecManager codec_manager; |
| 254 RentACodec rent_a_codec; | 254 RentACodec rent_a_codec; |
| 255 }; | 255 }; |
| 256 rtc::scoped_ptr<EncoderFactory> encoder_factory_ GUARDED_BY(acm_crit_sect_); | 256 std::unique_ptr<EncoderFactory> encoder_factory_ GUARDED_BY(acm_crit_sect_); |
| 257 | 257 |
| 258 // Current encoder stack, either obtained from | 258 // Current encoder stack, either obtained from |
| 259 // encoder_factory_->rent_a_codec.RentEncoderStack or provided by a call to | 259 // encoder_factory_->rent_a_codec.RentEncoderStack or provided by a call to |
| 260 // RegisterEncoder. | 260 // RegisterEncoder. |
| 261 AudioEncoder* encoder_stack_ GUARDED_BY(acm_crit_sect_); | 261 AudioEncoder* encoder_stack_ GUARDED_BY(acm_crit_sect_); |
| 262 | 262 |
| 263 // This is to keep track of CN instances where we can send DTMFs. | 263 // This is to keep track of CN instances where we can send DTMFs. |
| 264 uint8_t previous_pltype_ GUARDED_BY(acm_crit_sect_); | 264 uint8_t previous_pltype_ GUARDED_BY(acm_crit_sect_); |
| 265 | 265 |
| 266 // Used when payloads are pushed into ACM without any RTP info | 266 // Used when payloads are pushed into ACM without any RTP info |
| 267 // One example is when pre-encoded bit-stream is pushed from | 267 // One example is when pre-encoded bit-stream is pushed from |
| 268 // a file. | 268 // a file. |
| 269 // IMPORTANT: this variable is only used in IncomingPayload(), therefore, | 269 // IMPORTANT: this variable is only used in IncomingPayload(), therefore, |
| 270 // no lock acquired when interacting with this variable. If it is going to | 270 // no lock acquired when interacting with this variable. If it is going to |
| 271 // be used in other methods, locks need to be taken. | 271 // be used in other methods, locks need to be taken. |
| 272 rtc::scoped_ptr<WebRtcRTPHeader> aux_rtp_header_; | 272 std::unique_ptr<WebRtcRTPHeader> aux_rtp_header_; |
| 273 | 273 |
| 274 bool receiver_initialized_ GUARDED_BY(acm_crit_sect_); | 274 bool receiver_initialized_ GUARDED_BY(acm_crit_sect_); |
| 275 | 275 |
| 276 AudioFrame preprocess_frame_ GUARDED_BY(acm_crit_sect_); | 276 AudioFrame preprocess_frame_ GUARDED_BY(acm_crit_sect_); |
| 277 bool first_10ms_data_ GUARDED_BY(acm_crit_sect_); | 277 bool first_10ms_data_ GUARDED_BY(acm_crit_sect_); |
| 278 | 278 |
| 279 bool first_frame_ GUARDED_BY(acm_crit_sect_); | 279 bool first_frame_ GUARDED_BY(acm_crit_sect_); |
| 280 uint32_t last_timestamp_ GUARDED_BY(acm_crit_sect_); | 280 uint32_t last_timestamp_ GUARDED_BY(acm_crit_sect_); |
| 281 uint32_t last_rtp_timestamp_ GUARDED_BY(acm_crit_sect_); | 281 uint32_t last_rtp_timestamp_ GUARDED_BY(acm_crit_sect_); |
| 282 | 282 |
| 283 rtc::CriticalSection callback_crit_sect_; | 283 rtc::CriticalSection callback_crit_sect_; |
| 284 AudioPacketizationCallback* packetization_callback_ | 284 AudioPacketizationCallback* packetization_callback_ |
| 285 GUARDED_BY(callback_crit_sect_); | 285 GUARDED_BY(callback_crit_sect_); |
| 286 ACMVADCallback* vad_callback_ GUARDED_BY(callback_crit_sect_); | 286 ACMVADCallback* vad_callback_ GUARDED_BY(callback_crit_sect_); |
| 287 }; | 287 }; |
| 288 | 288 |
| 289 } // namespace acm2 | 289 } // namespace acm2 |
| 290 } // namespace webrtc | 290 } // namespace webrtc |
| 291 | 291 |
| 292 #endif // WEBRTC_MODULES_AUDIO_CODING_ACM2_AUDIO_CODING_MODULE_IMPL_H_ | 292 #endif // WEBRTC_MODULES_AUDIO_CODING_ACM2_AUDIO_CODING_MODULE_IMPL_H_ |
| OLD | NEW |