| 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_VOICE_ENGINE_CHANNEL_H_ | 11 #ifndef WEBRTC_VOICE_ENGINE_CHANNEL_H_ |
| 12 #define WEBRTC_VOICE_ENGINE_CHANNEL_H_ | 12 #define WEBRTC_VOICE_ENGINE_CHANNEL_H_ |
| 13 | 13 |
| 14 #include <memory> | 14 #include <memory> |
| 15 | 15 |
| 16 #include "webrtc/audio_sink.h" | 16 #include "webrtc/audio_sink.h" |
| 17 #include "webrtc/base/criticalsection.h" | 17 #include "webrtc/base/criticalsection.h" |
| 18 #include "webrtc/common_audio/resampler/include/push_resampler.h" | 18 #include "webrtc/common_audio/resampler/include/push_resampler.h" |
| 19 #include "webrtc/common_types.h" | 19 #include "webrtc/common_types.h" |
| 20 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" | 20 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" |
| 21 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_d
efines.h" | 21 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_d
efines.h" |
| 22 #include "webrtc/modules/audio_processing/rms_level.h" | 22 #include "webrtc/modules/audio_processing/rms_level.h" |
| 23 #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h" | 23 #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h" |
| 24 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" | 24 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" |
| 25 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" | 25 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" |
| 26 #include "webrtc/modules/utility/include/file_player.h" | 26 #include "webrtc/modules/utility/include/file_player.h" |
| 27 #include "webrtc/modules/utility/include/file_recorder.h" | 27 #include "webrtc/modules/utility/include/file_recorder.h" |
| 28 #include "webrtc/voice_engine/dtmf_inband.h" |
| 29 #include "webrtc/voice_engine/dtmf_inband_queue.h" |
| 28 #include "webrtc/voice_engine/include/voe_audio_processing.h" | 30 #include "webrtc/voice_engine/include/voe_audio_processing.h" |
| 29 #include "webrtc/voice_engine/include/voe_network.h" | 31 #include "webrtc/voice_engine/include/voe_network.h" |
| 30 #include "webrtc/voice_engine/level_indicator.h" | 32 #include "webrtc/voice_engine/level_indicator.h" |
| 31 #include "webrtc/voice_engine/network_predictor.h" | 33 #include "webrtc/voice_engine/network_predictor.h" |
| 32 #include "webrtc/voice_engine/shared_data.h" | 34 #include "webrtc/voice_engine/shared_data.h" |
| 33 #include "webrtc/voice_engine/voice_engine_defines.h" | 35 #include "webrtc/voice_engine/voice_engine_defines.h" |
| 34 | 36 |
| 35 namespace rtc { | 37 namespace rtc { |
| 36 | 38 |
| 37 class TimestampWrapAroundHandler; | 39 class TimestampWrapAroundHandler; |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 uint32_t GetDelayEstimate() const; | 289 uint32_t GetDelayEstimate() const; |
| 288 int LeastRequiredDelayMs() const; | 290 int LeastRequiredDelayMs() const; |
| 289 int SetMinimumPlayoutDelay(int delayMs); | 291 int SetMinimumPlayoutDelay(int delayMs); |
| 290 int GetPlayoutTimestamp(unsigned int& timestamp); | 292 int GetPlayoutTimestamp(unsigned int& timestamp); |
| 291 int SetInitTimestamp(unsigned int timestamp); | 293 int SetInitTimestamp(unsigned int timestamp); |
| 292 int SetInitSequenceNumber(short sequenceNumber); | 294 int SetInitSequenceNumber(short sequenceNumber); |
| 293 | 295 |
| 294 // VoEVideoSyncExtended | 296 // VoEVideoSyncExtended |
| 295 int GetRtpRtcp(RtpRtcp** rtpRtcpModule, RtpReceiver** rtp_receiver) const; | 297 int GetRtpRtcp(RtpRtcp** rtpRtcpModule, RtpReceiver** rtp_receiver) const; |
| 296 | 298 |
| 297 // DTMF | 299 // VoEDtmf |
| 298 int SendTelephoneEventOutband(int event, int duration_ms); | 300 int SendTelephoneEventOutband(unsigned char eventCode, |
| 299 int SetSendTelephoneEventPayloadType(int payload_type); | 301 int lengthMs, |
| 302 int attenuationDb, |
| 303 bool playDtmfEvent); |
| 304 int SendTelephoneEventInband(unsigned char eventCode, |
| 305 int lengthMs, |
| 306 int attenuationDb, |
| 307 bool playDtmfEvent); |
| 308 int SetSendTelephoneEventPayloadType(unsigned char type); |
| 309 int GetSendTelephoneEventPayloadType(unsigned char& type); |
| 300 | 310 |
| 301 // VoEAudioProcessingImpl | 311 // VoEAudioProcessingImpl |
| 302 int UpdateRxVadDetection(AudioFrame& audioFrame); | 312 int UpdateRxVadDetection(AudioFrame& audioFrame); |
| 303 int RegisterRxVadObserver(VoERxVadCallback& observer); | 313 int RegisterRxVadObserver(VoERxVadCallback& observer); |
| 304 int DeRegisterRxVadObserver(); | 314 int DeRegisterRxVadObserver(); |
| 305 int VoiceActivityIndicator(int& activity); | 315 int VoiceActivityIndicator(int& activity); |
| 306 #ifdef WEBRTC_VOICE_ENGINE_AGC | 316 #ifdef WEBRTC_VOICE_ENGINE_AGC |
| 307 int SetRxAgcStatus(bool enable, AgcModes mode); | 317 int SetRxAgcStatus(bool enable, AgcModes mode); |
| 308 int GetRxAgcStatus(bool& enabled, AgcModes& mode); | 318 int GetRxAgcStatus(bool& enabled, AgcModes& mode); |
| 309 int SetRxAgcConfig(AgcConfig config); | 319 int SetRxAgcConfig(AgcConfig config); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 bool ReceivePacket(const uint8_t* packet, | 457 bool ReceivePacket(const uint8_t* packet, |
| 448 size_t packet_length, | 458 size_t packet_length, |
| 449 const RTPHeader& header, | 459 const RTPHeader& header, |
| 450 bool in_order); | 460 bool in_order); |
| 451 bool HandleRtxPacket(const uint8_t* packet, | 461 bool HandleRtxPacket(const uint8_t* packet, |
| 452 size_t packet_length, | 462 size_t packet_length, |
| 453 const RTPHeader& header); | 463 const RTPHeader& header); |
| 454 bool IsPacketInOrder(const RTPHeader& header) const; | 464 bool IsPacketInOrder(const RTPHeader& header) const; |
| 455 bool IsPacketRetransmitted(const RTPHeader& header, bool in_order) const; | 465 bool IsPacketRetransmitted(const RTPHeader& header, bool in_order) const; |
| 456 int ResendPackets(const uint16_t* sequence_numbers, int length); | 466 int ResendPackets(const uint16_t* sequence_numbers, int length); |
| 467 int InsertInbandDtmfTone(); |
| 457 int32_t MixOrReplaceAudioWithFile(int mixingFrequency); | 468 int32_t MixOrReplaceAudioWithFile(int mixingFrequency); |
| 458 int32_t MixAudioWithFile(AudioFrame& audioFrame, int mixingFrequency); | 469 int32_t MixAudioWithFile(AudioFrame& audioFrame, int mixingFrequency); |
| 459 void UpdatePlayoutTimestamp(bool rtcp); | 470 void UpdatePlayoutTimestamp(bool rtcp); |
| 460 void UpdatePacketDelay(uint32_t timestamp, uint16_t sequenceNumber); | 471 void UpdatePacketDelay(uint32_t timestamp, uint16_t sequenceNumber); |
| 461 void RegisterReceiveCodecsToRTPModule(); | 472 void RegisterReceiveCodecsToRTPModule(); |
| 462 | 473 |
| 463 int SetRedPayloadType(int red_payload_type); | 474 int SetRedPayloadType(int red_payload_type); |
| 464 int SetSendRtpHeaderExtension(bool enable, | 475 int SetSendRtpHeaderExtension(bool enable, |
| 465 RTPExtensionType type, | 476 RTPExtensionType type, |
| 466 unsigned char id); | 477 unsigned char id); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 492 AudioFrame _audioFrame; | 503 AudioFrame _audioFrame; |
| 493 // Downsamples to the codec rate if necessary. | 504 // Downsamples to the codec rate if necessary. |
| 494 PushResampler<int16_t> input_resampler_; | 505 PushResampler<int16_t> input_resampler_; |
| 495 FilePlayer* _inputFilePlayerPtr; | 506 FilePlayer* _inputFilePlayerPtr; |
| 496 FilePlayer* _outputFilePlayerPtr; | 507 FilePlayer* _outputFilePlayerPtr; |
| 497 FileRecorder* _outputFileRecorderPtr; | 508 FileRecorder* _outputFileRecorderPtr; |
| 498 int _inputFilePlayerId; | 509 int _inputFilePlayerId; |
| 499 int _outputFilePlayerId; | 510 int _outputFilePlayerId; |
| 500 int _outputFileRecorderId; | 511 int _outputFileRecorderId; |
| 501 bool _outputFileRecording; | 512 bool _outputFileRecording; |
| 513 DtmfInbandQueue _inbandDtmfQueue; |
| 514 DtmfInband _inbandDtmfGenerator; |
| 502 bool _outputExternalMedia; | 515 bool _outputExternalMedia; |
| 503 VoEMediaProcess* _inputExternalMediaCallbackPtr; | 516 VoEMediaProcess* _inputExternalMediaCallbackPtr; |
| 504 VoEMediaProcess* _outputExternalMediaCallbackPtr; | 517 VoEMediaProcess* _outputExternalMediaCallbackPtr; |
| 505 uint32_t _timeStamp; | 518 uint32_t _timeStamp; |
| 519 uint8_t _sendTelephoneEventPayloadType; |
| 506 | 520 |
| 507 RemoteNtpTimeEstimator ntp_estimator_ GUARDED_BY(ts_stats_lock_); | 521 RemoteNtpTimeEstimator ntp_estimator_ GUARDED_BY(ts_stats_lock_); |
| 508 | 522 |
| 509 // Timestamp of the audio pulled from NetEq. | 523 // Timestamp of the audio pulled from NetEq. |
| 510 uint32_t jitter_buffer_playout_timestamp_; | 524 uint32_t jitter_buffer_playout_timestamp_; |
| 511 uint32_t playout_timestamp_rtp_ GUARDED_BY(video_sync_lock_); | 525 uint32_t playout_timestamp_rtp_ GUARDED_BY(video_sync_lock_); |
| 512 uint32_t playout_timestamp_rtcp_; | 526 uint32_t playout_timestamp_rtcp_; |
| 513 uint32_t playout_delay_ms_ GUARDED_BY(video_sync_lock_); | 527 uint32_t playout_delay_ms_ GUARDED_BY(video_sync_lock_); |
| 514 uint32_t _numberOfDiscardedPackets; | 528 uint32_t _numberOfDiscardedPackets; |
| 515 uint16_t send_sequence_number_; | 529 uint16_t send_sequence_number_; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 539 int32_t _oldVadDecision; | 553 int32_t _oldVadDecision; |
| 540 int32_t _sendFrameType; // Send data is voice, 1-voice, 0-otherwise | 554 int32_t _sendFrameType; // Send data is voice, 1-voice, 0-otherwise |
| 541 // VoEBase | 555 // VoEBase |
| 542 bool _externalMixing; | 556 bool _externalMixing; |
| 543 bool _mixFileWithMicrophone; | 557 bool _mixFileWithMicrophone; |
| 544 // VoEVolumeControl | 558 // VoEVolumeControl |
| 545 bool _mute; | 559 bool _mute; |
| 546 float _panLeft; | 560 float _panLeft; |
| 547 float _panRight; | 561 float _panRight; |
| 548 float _outputGain; | 562 float _outputGain; |
| 563 // VoEDtmf |
| 564 bool _playOutbandDtmfEvent; |
| 565 bool _playInbandDtmfEvent; |
| 549 // VoeRTP_RTCP | 566 // VoeRTP_RTCP |
| 550 uint32_t _lastLocalTimeStamp; | 567 uint32_t _lastLocalTimeStamp; |
| 551 int8_t _lastPayloadType; | 568 int8_t _lastPayloadType; |
| 552 bool _includeAudioLevelIndication; | 569 bool _includeAudioLevelIndication; |
| 553 // VoENetwork | 570 // VoENetwork |
| 554 AudioFrame::SpeechType _outputSpeechType; | 571 AudioFrame::SpeechType _outputSpeechType; |
| 555 // VoEVideoSync | 572 // VoEVideoSync |
| 556 rtc::CriticalSection video_sync_lock_; | 573 rtc::CriticalSection video_sync_lock_; |
| 557 uint32_t _average_jitter_buffer_delay_us GUARDED_BY(video_sync_lock_); | 574 uint32_t _average_jitter_buffer_delay_us GUARDED_BY(video_sync_lock_); |
| 558 uint32_t _previousTimestamp; | 575 uint32_t _previousTimestamp; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 573 PacketRouter* packet_router_ = nullptr; | 590 PacketRouter* packet_router_ = nullptr; |
| 574 std::unique_ptr<TransportFeedbackProxy> feedback_observer_proxy_; | 591 std::unique_ptr<TransportFeedbackProxy> feedback_observer_proxy_; |
| 575 std::unique_ptr<TransportSequenceNumberProxy> seq_num_allocator_proxy_; | 592 std::unique_ptr<TransportSequenceNumberProxy> seq_num_allocator_proxy_; |
| 576 std::unique_ptr<RtpPacketSenderProxy> rtp_packet_sender_proxy_; | 593 std::unique_ptr<RtpPacketSenderProxy> rtp_packet_sender_proxy_; |
| 577 }; | 594 }; |
| 578 | 595 |
| 579 } // namespace voe | 596 } // namespace voe |
| 580 } // namespace webrtc | 597 } // namespace webrtc |
| 581 | 598 |
| 582 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ | 599 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ |
| OLD | NEW |