| 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 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 // -1: if encountering an error. | 257 // -1: if encountering an error. |
| 258 // 0: otherwise. | 258 // 0: otherwise. |
| 259 int PreprocessToAddData(const AudioFrame& in_frame, | 259 int PreprocessToAddData(const AudioFrame& in_frame, |
| 260 const AudioFrame** ptr_out) | 260 const AudioFrame** ptr_out) |
| 261 EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_); | 261 EXCLUSIVE_LOCKS_REQUIRED(acm_crit_sect_); |
| 262 | 262 |
| 263 // Change required states after starting to receive the codec corresponding | 263 // Change required states after starting to receive the codec corresponding |
| 264 // to |index|. | 264 // to |index|. |
| 265 int UpdateUponReceivingCodec(int index); | 265 int UpdateUponReceivingCodec(int index); |
| 266 | 266 |
| 267 CriticalSectionWrapper* acm_crit_sect_; | 267 const rtc::scoped_ptr<CriticalSectionWrapper> acm_crit_sect_; |
| 268 int id_; // TODO(henrik.lundin) Make const. | 268 int id_; // TODO(henrik.lundin) Make const. |
| 269 uint32_t expected_codec_ts_ GUARDED_BY(acm_crit_sect_); | 269 uint32_t expected_codec_ts_ GUARDED_BY(acm_crit_sect_); |
| 270 uint32_t expected_in_ts_ GUARDED_BY(acm_crit_sect_); | 270 uint32_t expected_in_ts_ GUARDED_BY(acm_crit_sect_); |
| 271 ACMResampler resampler_ GUARDED_BY(acm_crit_sect_); | 271 ACMResampler resampler_ GUARDED_BY(acm_crit_sect_); |
| 272 AcmReceiver receiver_; // AcmReceiver has it's own internal lock. | 272 AcmReceiver receiver_; // AcmReceiver has it's own internal lock. |
| 273 ChangeLogger bitrate_logger_ GUARDED_BY(acm_crit_sect_); | 273 ChangeLogger bitrate_logger_ GUARDED_BY(acm_crit_sect_); |
| 274 CodecManager codec_manager_ GUARDED_BY(acm_crit_sect_); | 274 CodecManager codec_manager_ GUARDED_BY(acm_crit_sect_); |
| 275 | 275 |
| 276 // This is to keep track of CN instances where we can send DTMFs. | 276 // This is to keep track of CN instances where we can send DTMFs. |
| 277 uint8_t previous_pltype_ GUARDED_BY(acm_crit_sect_); | 277 uint8_t previous_pltype_ GUARDED_BY(acm_crit_sect_); |
| 278 | 278 |
| 279 // Used when payloads are pushed into ACM without any RTP info | 279 // Used when payloads are pushed into ACM without any RTP info |
| 280 // One example is when pre-encoded bit-stream is pushed from | 280 // One example is when pre-encoded bit-stream is pushed from |
| 281 // a file. | 281 // a file. |
| 282 // IMPORTANT: this variable is only used in IncomingPayload(), therefore, | 282 // IMPORTANT: this variable is only used in IncomingPayload(), therefore, |
| 283 // no lock acquired when interacting with this variable. If it is going to | 283 // no lock acquired when interacting with this variable. If it is going to |
| 284 // be used in other methods, locks need to be taken. | 284 // be used in other methods, locks need to be taken. |
| 285 WebRtcRTPHeader* aux_rtp_header_; | 285 rtc::scoped_ptr<WebRtcRTPHeader> aux_rtp_header_; |
| 286 | 286 |
| 287 bool receiver_initialized_ GUARDED_BY(acm_crit_sect_); | 287 bool receiver_initialized_ GUARDED_BY(acm_crit_sect_); |
| 288 | 288 |
| 289 AudioFrame preprocess_frame_ GUARDED_BY(acm_crit_sect_); | 289 AudioFrame preprocess_frame_ GUARDED_BY(acm_crit_sect_); |
| 290 bool first_10ms_data_ GUARDED_BY(acm_crit_sect_); | 290 bool first_10ms_data_ GUARDED_BY(acm_crit_sect_); |
| 291 | 291 |
| 292 bool first_frame_ GUARDED_BY(acm_crit_sect_); | 292 bool first_frame_ GUARDED_BY(acm_crit_sect_); |
| 293 uint32_t last_timestamp_ GUARDED_BY(acm_crit_sect_); | 293 uint32_t last_timestamp_ GUARDED_BY(acm_crit_sect_); |
| 294 uint32_t last_rtp_timestamp_ GUARDED_BY(acm_crit_sect_); | 294 uint32_t last_rtp_timestamp_ GUARDED_BY(acm_crit_sect_); |
| 295 | 295 |
| 296 CriticalSectionWrapper* callback_crit_sect_; | 296 const rtc::scoped_ptr<CriticalSectionWrapper> callback_crit_sect_; |
| 297 AudioPacketizationCallback* packetization_callback_ | 297 AudioPacketizationCallback* packetization_callback_ |
| 298 GUARDED_BY(callback_crit_sect_); | 298 GUARDED_BY(callback_crit_sect_); |
| 299 ACMVADCallback* vad_callback_ GUARDED_BY(callback_crit_sect_); | 299 ACMVADCallback* vad_callback_ GUARDED_BY(callback_crit_sect_); |
| 300 }; | 300 }; |
| 301 | 301 |
| 302 } // namespace acm2 | 302 } // namespace acm2 |
| 303 | 303 |
| 304 class AudioCodingImpl : public AudioCoding { | 304 class AudioCodingImpl : public AudioCoding { |
| 305 public: | 305 public: |
| 306 AudioCodingImpl(const Config& config); | 306 AudioCodingImpl(const Config& config); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 int playout_frequency_hz_; | 369 int playout_frequency_hz_; |
| 370 // TODO(henrik.lundin): All members below this line are temporary and should | 370 // TODO(henrik.lundin): All members below this line are temporary and should |
| 371 // be removed after refactoring is completed. | 371 // be removed after refactoring is completed. |
| 372 rtc::scoped_ptr<acm2::AudioCodingModuleImpl> acm_old_; | 372 rtc::scoped_ptr<acm2::AudioCodingModuleImpl> acm_old_; |
| 373 CodecInst current_send_codec_; | 373 CodecInst current_send_codec_; |
| 374 }; | 374 }; |
| 375 | 375 |
| 376 } // namespace webrtc | 376 } // namespace webrtc |
| 377 | 377 |
| 378 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_AUDIO_CODING_MODULE_IMPL_H_ | 378 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_AUDIO_CODING_MODULE_IMPL_H_ |
| OLD | NEW |