| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 struct ReportBlock; | 63 struct ReportBlock; |
| 64 struct SenderInfo; | 64 struct SenderInfo; |
| 65 | 65 |
| 66 namespace voe { | 66 namespace voe { |
| 67 | 67 |
| 68 class OutputMixer; | 68 class OutputMixer; |
| 69 class RtcEventLogProxy; | 69 class RtcEventLogProxy; |
| 70 class RtcpRttStatsProxy; | 70 class RtcpRttStatsProxy; |
| 71 class RtpPacketSenderProxy; | 71 class RtpPacketSenderProxy; |
| 72 class Statistics; | 72 class Statistics; |
| 73 class StatisticsProxy; | |
| 74 class TransportFeedbackProxy; | 73 class TransportFeedbackProxy; |
| 75 class TransmitMixer; | 74 class TransmitMixer; |
| 76 class TransportSequenceNumberProxy; | 75 class TransportSequenceNumberProxy; |
| 77 class VoERtcpObserver; | 76 class VoERtcpObserver; |
| 78 | 77 |
| 79 // Helper class to simplify locking scheme for members that are accessed from | 78 // Helper class to simplify locking scheme for members that are accessed from |
| 80 // multiple threads. | 79 // multiple threads. |
| 81 // Example: a member can be set on thread T1 and read by an internal audio | 80 // Example: a member can be set on thread T1 and read by an internal audio |
| 82 // thread T2. Accessing the member via this class ensures that we are | 81 // thread T2. Accessing the member via this class ensures that we are |
| 83 // safe and also avoid TSan v2 warnings. | 82 // safe and also avoid TSan v2 warnings. |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 // go. | 176 // go. |
| 178 const rtc::scoped_refptr<AudioDecoderFactory>& GetAudioDecoderFactory() const; | 177 const rtc::scoped_refptr<AudioDecoderFactory>& GetAudioDecoderFactory() const; |
| 179 | 178 |
| 180 // API methods | 179 // API methods |
| 181 | 180 |
| 182 // VoEBase | 181 // VoEBase |
| 183 int32_t StartPlayout(); | 182 int32_t StartPlayout(); |
| 184 int32_t StopPlayout(); | 183 int32_t StopPlayout(); |
| 185 int32_t StartSend(); | 184 int32_t StartSend(); |
| 186 int32_t StopSend(); | 185 int32_t StopSend(); |
| 187 void ResetDiscardedPacketCount(); | |
| 188 int32_t RegisterVoiceEngineObserver(VoiceEngineObserver& observer); | 186 int32_t RegisterVoiceEngineObserver(VoiceEngineObserver& observer); |
| 189 int32_t DeRegisterVoiceEngineObserver(); | 187 int32_t DeRegisterVoiceEngineObserver(); |
| 190 | 188 |
| 191 // VoECodec | 189 // VoECodec |
| 192 int32_t GetSendCodec(CodecInst& codec); | 190 int32_t GetSendCodec(CodecInst& codec); |
| 193 int32_t GetRecCodec(CodecInst& codec); | 191 int32_t GetRecCodec(CodecInst& codec); |
| 194 int32_t SetSendCodec(const CodecInst& codec); | 192 int32_t SetSendCodec(const CodecInst& codec); |
| 195 void SetBitRate(int bitrate_bps, int64_t probing_interval_ms); | 193 void SetBitRate(int bitrate_bps, int64_t probing_interval_ms); |
| 196 int32_t SetVADStatus(bool enableVAD, ACMVADMode mode, bool disableDTX); | 194 int32_t SetVADStatus(bool enableVAD, ACMVADMode mode, bool disableDTX); |
| 197 int32_t GetVADStatus(bool& enabledVAD, ACMVADMode& mode, bool& disabledDTX); | 195 int32_t GetVADStatus(bool& enabledVAD, ACMVADMode& mode, bool& disabledDTX); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 | 290 |
| 293 // VoEAudioProcessingImpl | 291 // VoEAudioProcessingImpl |
| 294 int VoiceActivityIndicator(int& activity); | 292 int VoiceActivityIndicator(int& activity); |
| 295 | 293 |
| 296 // VoERTP_RTCP | 294 // VoERTP_RTCP |
| 297 int SetLocalSSRC(unsigned int ssrc); | 295 int SetLocalSSRC(unsigned int ssrc); |
| 298 int GetLocalSSRC(unsigned int& ssrc); | 296 int GetLocalSSRC(unsigned int& ssrc); |
| 299 int GetRemoteSSRC(unsigned int& ssrc); | 297 int GetRemoteSSRC(unsigned int& ssrc); |
| 300 int SetSendAudioLevelIndicationStatus(bool enable, unsigned char id); | 298 int SetSendAudioLevelIndicationStatus(bool enable, unsigned char id); |
| 301 int SetReceiveAudioLevelIndicationStatus(bool enable, unsigned char id); | 299 int SetReceiveAudioLevelIndicationStatus(bool enable, unsigned char id); |
| 302 int SetSendAbsoluteSenderTimeStatus(bool enable, unsigned char id); | |
| 303 int SetReceiveAbsoluteSenderTimeStatus(bool enable, unsigned char id); | |
| 304 void EnableSendTransportSequenceNumber(int id); | 300 void EnableSendTransportSequenceNumber(int id); |
| 305 void EnableReceiveTransportSequenceNumber(int id); | 301 void EnableReceiveTransportSequenceNumber(int id); |
| 306 | 302 |
| 307 void RegisterSenderCongestionControlObjects( | 303 void RegisterSenderCongestionControlObjects( |
| 308 RtpPacketSender* rtp_packet_sender, | 304 RtpPacketSender* rtp_packet_sender, |
| 309 TransportFeedbackObserver* transport_feedback_observer, | 305 TransportFeedbackObserver* transport_feedback_observer, |
| 310 PacketRouter* packet_router, | 306 PacketRouter* packet_router, |
| 311 RtcpBandwidthObserver* bandwidth_observer); | 307 RtcpBandwidthObserver* bandwidth_observer); |
| 312 void RegisterReceiverCongestionControlObjects(PacketRouter* packet_router); | 308 void RegisterReceiverCongestionControlObjects(PacketRouter* packet_router); |
| 313 void ResetCongestionControlObjects(); | 309 void ResetCongestionControlObjects(); |
| 314 | 310 |
| 315 void SetRTCPStatus(bool enable); | 311 void SetRTCPStatus(bool enable); |
| 316 int GetRTCPStatus(bool& enabled); | 312 int GetRTCPStatus(bool& enabled); |
| 317 int SetRTCP_CNAME(const char cName[256]); | 313 int SetRTCP_CNAME(const char cName[256]); |
| 318 int GetRemoteRTCP_CNAME(char cName[256]); | 314 int GetRemoteRTCP_CNAME(char cName[256]); |
| 319 int GetRemoteRTCPData(unsigned int& NTPHigh, | |
| 320 unsigned int& NTPLow, | |
| 321 unsigned int& timestamp, | |
| 322 unsigned int& playoutTimestamp, | |
| 323 unsigned int* jitter, | |
| 324 unsigned short* fractionLost); | |
| 325 int SendApplicationDefinedRTCPPacket(unsigned char subType, | 315 int SendApplicationDefinedRTCPPacket(unsigned char subType, |
| 326 unsigned int name, | 316 unsigned int name, |
| 327 const char* data, | 317 const char* data, |
| 328 unsigned short dataLengthInBytes); | 318 unsigned short dataLengthInBytes); |
| 329 int GetRTPStatistics(unsigned int& averageJitterMs, | |
| 330 unsigned int& maxJitterMs, | |
| 331 unsigned int& discardedPackets); | |
| 332 int GetRemoteRTCPReportBlocks(std::vector<ReportBlock>* report_blocks); | 319 int GetRemoteRTCPReportBlocks(std::vector<ReportBlock>* report_blocks); |
| 333 int GetRTPStatistics(CallStatistics& stats); | 320 int GetRTPStatistics(CallStatistics& stats); |
| 334 int SetCodecFECStatus(bool enable); | 321 int SetCodecFECStatus(bool enable); |
| 335 bool GetCodecFECStatus(); | 322 bool GetCodecFECStatus(); |
| 336 void SetNACKStatus(bool enable, int maxNumberOfPackets); | 323 void SetNACKStatus(bool enable, int maxNumberOfPackets); |
| 337 | 324 |
| 338 // From AudioPacketizationCallback in the ACM | 325 // From AudioPacketizationCallback in the ACM |
| 339 int32_t SendData(FrameType frameType, | 326 int32_t SendData(FrameType frameType, |
| 340 uint8_t payloadType, | 327 uint8_t payloadType, |
| 341 uint32_t timeStamp, | 328 uint32_t timeStamp, |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 int32_t _channelId; | 443 int32_t _channelId; |
| 457 | 444 |
| 458 ChannelState channel_state_; | 445 ChannelState channel_state_; |
| 459 | 446 |
| 460 std::unique_ptr<voe::RtcEventLogProxy> event_log_proxy_; | 447 std::unique_ptr<voe::RtcEventLogProxy> event_log_proxy_; |
| 461 std::unique_ptr<voe::RtcpRttStatsProxy> rtcp_rtt_stats_proxy_; | 448 std::unique_ptr<voe::RtcpRttStatsProxy> rtcp_rtt_stats_proxy_; |
| 462 | 449 |
| 463 std::unique_ptr<RtpHeaderParser> rtp_header_parser_; | 450 std::unique_ptr<RtpHeaderParser> rtp_header_parser_; |
| 464 std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry_; | 451 std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry_; |
| 465 std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_; | 452 std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_; |
| 466 std::unique_ptr<StatisticsProxy> statistics_proxy_; | |
| 467 std::unique_ptr<RtpReceiver> rtp_receiver_; | 453 std::unique_ptr<RtpReceiver> rtp_receiver_; |
| 468 TelephoneEventHandler* telephone_event_handler_; | 454 TelephoneEventHandler* telephone_event_handler_; |
| 469 std::unique_ptr<RtpRtcp> _rtpRtcpModule; | 455 std::unique_ptr<RtpRtcp> _rtpRtcpModule; |
| 470 std::unique_ptr<AudioCodingModule> audio_coding_; | 456 std::unique_ptr<AudioCodingModule> audio_coding_; |
| 471 acm2::CodecManager codec_manager_; | 457 acm2::CodecManager codec_manager_; |
| 472 acm2::RentACodec rent_a_codec_; | 458 acm2::RentACodec rent_a_codec_; |
| 473 std::unique_ptr<AudioSinkInterface> audio_sink_; | 459 std::unique_ptr<AudioSinkInterface> audio_sink_; |
| 474 AudioLevel _outputAudioLevel; | 460 AudioLevel _outputAudioLevel; |
| 475 bool _externalTransport; | 461 bool _externalTransport; |
| 476 AudioFrame _audioFrame; | 462 AudioFrame _audioFrame; |
| 477 // Downsamples to the codec rate if necessary. | 463 // Downsamples to the codec rate if necessary. |
| 478 PushResampler<int16_t> input_resampler_; | 464 PushResampler<int16_t> input_resampler_; |
| 479 std::unique_ptr<FilePlayer> input_file_player_; | 465 std::unique_ptr<FilePlayer> input_file_player_; |
| 480 std::unique_ptr<FilePlayer> output_file_player_; | 466 std::unique_ptr<FilePlayer> output_file_player_; |
| 481 std::unique_ptr<FileRecorder> output_file_recorder_; | 467 std::unique_ptr<FileRecorder> output_file_recorder_; |
| 482 int _inputFilePlayerId; | 468 int _inputFilePlayerId; |
| 483 int _outputFilePlayerId; | 469 int _outputFilePlayerId; |
| 484 int _outputFileRecorderId; | 470 int _outputFileRecorderId; |
| 485 bool _outputFileRecording; | 471 bool _outputFileRecording; |
| 486 bool _outputExternalMedia; | 472 bool _outputExternalMedia; |
| 487 VoEMediaProcess* _inputExternalMediaCallbackPtr; | 473 VoEMediaProcess* _inputExternalMediaCallbackPtr; |
| 488 VoEMediaProcess* _outputExternalMediaCallbackPtr; | 474 VoEMediaProcess* _outputExternalMediaCallbackPtr; |
| 489 uint32_t _timeStamp; | 475 uint32_t _timeStamp; |
| 490 | 476 |
| 491 RemoteNtpTimeEstimator ntp_estimator_ GUARDED_BY(ts_stats_lock_); | 477 RemoteNtpTimeEstimator ntp_estimator_ GUARDED_BY(ts_stats_lock_); |
| 492 | 478 |
| 493 // Timestamp of the audio pulled from NetEq. | 479 // Timestamp of the audio pulled from NetEq. |
| 494 rtc::Optional<uint32_t> jitter_buffer_playout_timestamp_; | 480 rtc::Optional<uint32_t> jitter_buffer_playout_timestamp_; |
| 495 uint32_t playout_timestamp_rtp_ GUARDED_BY(video_sync_lock_); | 481 uint32_t playout_timestamp_rtp_ GUARDED_BY(video_sync_lock_); |
| 496 uint32_t playout_timestamp_rtcp_; | |
| 497 uint32_t playout_delay_ms_ GUARDED_BY(video_sync_lock_); | 482 uint32_t playout_delay_ms_ GUARDED_BY(video_sync_lock_); |
| 498 uint32_t _numberOfDiscardedPackets; | |
| 499 uint16_t send_sequence_number_; | 483 uint16_t send_sequence_number_; |
| 500 uint8_t restored_packet_[kVoiceEngineMaxIpPacketSizeBytes]; | 484 uint8_t restored_packet_[kVoiceEngineMaxIpPacketSizeBytes]; |
| 501 | 485 |
| 502 rtc::CriticalSection ts_stats_lock_; | 486 rtc::CriticalSection ts_stats_lock_; |
| 503 | 487 |
| 504 std::unique_ptr<rtc::TimestampWrapAroundHandler> rtp_ts_wraparound_handler_; | 488 std::unique_ptr<rtc::TimestampWrapAroundHandler> rtp_ts_wraparound_handler_; |
| 505 // The rtp timestamp of the first played out audio frame. | 489 // The rtp timestamp of the first played out audio frame. |
| 506 int64_t capture_start_rtp_time_stamp_; | 490 int64_t capture_start_rtp_time_stamp_; |
| 507 // The capture ntp time (in local timebase) of the first played out audio | 491 // The capture ntp time (in local timebase) of the first played out audio |
| 508 // frame. | 492 // frame. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 std::unique_ptr<RateLimiter> retransmission_rate_limiter_; | 538 std::unique_ptr<RateLimiter> retransmission_rate_limiter_; |
| 555 | 539 |
| 556 // TODO(ossu): Remove once GetAudioDecoderFactory() is no longer needed. | 540 // TODO(ossu): Remove once GetAudioDecoderFactory() is no longer needed. |
| 557 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_; | 541 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_; |
| 558 }; | 542 }; |
| 559 | 543 |
| 560 } // namespace voe | 544 } // namespace voe |
| 561 } // namespace webrtc | 545 } // namespace webrtc |
| 562 | 546 |
| 563 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ | 547 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ |
| OLD | NEW |