Line data Source code
1 : /*
2 : * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 : *
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
6 : * tree. An additional intellectual property rights grant can be found
7 : * in the file PATENTS. All contributing project authors may
8 : * be found in the AUTHORS file in the root of the source tree.
9 : */
10 :
11 : #ifndef WEBRTC_VOICE_ENGINE_CHANNEL_H_
12 : #define WEBRTC_VOICE_ENGINE_CHANNEL_H_
13 :
14 : #include <memory>
15 :
16 : #include "webrtc/api/audio/audio_mixer.h"
17 : #include "webrtc/api/call/audio_sink.h"
18 : #include "webrtc/base/criticalsection.h"
19 : #include "webrtc/base/optional.h"
20 : #include "webrtc/common_audio/resampler/include/push_resampler.h"
21 : #include "webrtc/common_types.h"
22 : #include "webrtc/modules/audio_coding/acm2/codec_manager.h"
23 : #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h"
24 : #include "webrtc/modules/audio_coding/include/audio_coding_module.h"
25 : #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_defines.h"
26 : #include "webrtc/modules/audio_processing/rms_level.h"
27 : #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h"
28 : #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
29 : #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h"
30 : #include "webrtc/voice_engine/file_player.h"
31 : #include "webrtc/voice_engine/file_recorder.h"
32 : #include "webrtc/voice_engine/include/voe_audio_processing.h"
33 : #include "webrtc/voice_engine/include/voe_base.h"
34 : #include "webrtc/voice_engine/include/voe_network.h"
35 : #include "webrtc/voice_engine/level_indicator.h"
36 : #include "webrtc/voice_engine/shared_data.h"
37 : #include "webrtc/voice_engine/voice_engine_defines.h"
38 :
39 : namespace rtc {
40 : class TimestampWrapAroundHandler;
41 : }
42 :
43 : namespace webrtc {
44 :
45 : class AudioDeviceModule;
46 : class FileWrapper;
47 : class PacketRouter;
48 : class ProcessThread;
49 : class RateLimiter;
50 : class ReceiveStatistics;
51 : class RemoteNtpTimeEstimator;
52 : class RtcEventLog;
53 : class RTPPayloadRegistry;
54 : class RtpReceiver;
55 : class RTPReceiverAudio;
56 : class RtpRtcp;
57 : class TelephoneEventHandler;
58 : class VoEMediaProcess;
59 : class VoERTPObserver;
60 : class VoiceEngineObserver;
61 :
62 : struct CallStatistics;
63 : struct ReportBlock;
64 : struct SenderInfo;
65 :
66 : namespace voe {
67 :
68 : class OutputMixer;
69 : class RtcEventLogProxy;
70 : class RtcpRttStatsProxy;
71 : class RtpPacketSenderProxy;
72 : class Statistics;
73 : class StatisticsProxy;
74 : class TransportFeedbackProxy;
75 : class TransmitMixer;
76 : class TransportSequenceNumberProxy;
77 : class VoERtcpObserver;
78 :
79 : // Helper class to simplify locking scheme for members that are accessed from
80 : // multiple threads.
81 : // 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
83 : // safe and also avoid TSan v2 warnings.
84 : class ChannelState {
85 : public:
86 0 : struct State {
87 : bool input_external_media = false;
88 : bool output_file_playing = false;
89 : bool input_file_playing = false;
90 : bool playing = false;
91 : bool sending = false;
92 : };
93 :
94 0 : ChannelState() {}
95 0 : virtual ~ChannelState() {}
96 :
97 0 : void Reset() {
98 0 : rtc::CritScope lock(&lock_);
99 0 : state_ = State();
100 0 : }
101 :
102 0 : State Get() const {
103 0 : rtc::CritScope lock(&lock_);
104 0 : return state_;
105 : }
106 :
107 0 : void SetInputExternalMedia(bool enable) {
108 0 : rtc::CritScope lock(&lock_);
109 0 : state_.input_external_media = enable;
110 0 : }
111 :
112 0 : void SetOutputFilePlaying(bool enable) {
113 0 : rtc::CritScope lock(&lock_);
114 0 : state_.output_file_playing = enable;
115 0 : }
116 :
117 0 : void SetInputFilePlaying(bool enable) {
118 0 : rtc::CritScope lock(&lock_);
119 0 : state_.input_file_playing = enable;
120 0 : }
121 :
122 0 : void SetPlaying(bool enable) {
123 0 : rtc::CritScope lock(&lock_);
124 0 : state_.playing = enable;
125 0 : }
126 :
127 0 : void SetSending(bool enable) {
128 0 : rtc::CritScope lock(&lock_);
129 0 : state_.sending = enable;
130 0 : }
131 :
132 : private:
133 : rtc::CriticalSection lock_;
134 : State state_;
135 : };
136 :
137 : class Channel
138 : : public RtpData,
139 : public RtpFeedback,
140 : public FileCallback, // receiving notification from file player &
141 : // recorder
142 : public Transport,
143 : public AudioPacketizationCallback, // receive encoded packets from the
144 : // ACM
145 : public ACMVADCallback, // receive voice activity from the ACM
146 : public MixerParticipant, // supplies output mixer with audio frames
147 : public OverheadObserver {
148 : public:
149 : friend class VoERtcpObserver;
150 :
151 : enum { KNumSocketThreads = 1 };
152 : enum { KNumberOfSocketBuffers = 8 };
153 : virtual ~Channel();
154 : static int32_t CreateChannel(
155 : Channel*& channel,
156 : int32_t channelId,
157 : uint32_t instanceId,
158 : const VoEBase::ChannelConfig& config);
159 : Channel(int32_t channelId,
160 : uint32_t instanceId,
161 : const VoEBase::ChannelConfig& config);
162 : int32_t Init();
163 : int32_t SetEngineInformation(Statistics& engineStatistics,
164 : OutputMixer& outputMixer,
165 : TransmitMixer& transmitMixer,
166 : ProcessThread& moduleProcessThread,
167 : AudioDeviceModule& audioDeviceModule,
168 : VoiceEngineObserver* voiceEngineObserver,
169 : rtc::CriticalSection* callbackCritSect);
170 : int32_t UpdateLocalTimeStamp();
171 :
172 : void SetSink(std::unique_ptr<AudioSinkInterface> sink);
173 :
174 : // TODO(ossu): Don't use! It's only here to confirm that the decoder factory
175 : // passed into AudioReceiveStream is the same as the one set when creating the
176 : // ADM. Once Channel creation is moved into Audio{Send,Receive}Stream this can
177 : // go.
178 : const rtc::scoped_refptr<AudioDecoderFactory>& GetAudioDecoderFactory() const;
179 :
180 : // API methods
181 :
182 : // VoEBase
183 : int32_t StartPlayout();
184 : int32_t StopPlayout();
185 : int32_t StartSend();
186 : int32_t StopSend();
187 : void ResetDiscardedPacketCount();
188 : int32_t RegisterVoiceEngineObserver(VoiceEngineObserver& observer);
189 : int32_t DeRegisterVoiceEngineObserver();
190 :
191 : // VoECodec
192 : int32_t GetSendCodec(CodecInst& codec);
193 : int32_t GetRecCodec(CodecInst& codec);
194 : int32_t SetSendCodec(const CodecInst& codec);
195 : void SetBitRate(int bitrate_bps, int64_t probing_interval_ms);
196 : int32_t SetVADStatus(bool enableVAD, ACMVADMode mode, bool disableDTX);
197 : int32_t GetVADStatus(bool& enabledVAD, ACMVADMode& mode, bool& disabledDTX);
198 : int32_t SetRecPayloadType(const CodecInst& codec);
199 : int32_t GetRecPayloadType(CodecInst& codec);
200 : int32_t SetSendCNPayloadType(int type, PayloadFrequencies frequency);
201 : int SetOpusMaxPlaybackRate(int frequency_hz);
202 : int SetOpusDtx(bool enable_dtx);
203 : int GetOpusDtx(bool* enabled);
204 : bool EnableAudioNetworkAdaptor(const std::string& config_string);
205 : void DisableAudioNetworkAdaptor();
206 : void SetReceiverFrameLengthRange(int min_frame_length_ms,
207 : int max_frame_length_ms);
208 :
209 : // VoENetwork
210 : int32_t RegisterExternalTransport(Transport* transport);
211 : int32_t DeRegisterExternalTransport();
212 : int32_t ReceivedRTPPacket(const uint8_t* received_packet,
213 : size_t length,
214 : const PacketTime& packet_time);
215 : int32_t ReceivedRTCPPacket(const uint8_t* data, size_t length);
216 :
217 : // VoEFile
218 : int StartPlayingFileLocally(const char* fileName,
219 : bool loop,
220 : FileFormats format,
221 : int startPosition,
222 : float volumeScaling,
223 : int stopPosition,
224 : const CodecInst* codecInst);
225 : int StartPlayingFileLocally(InStream* stream,
226 : FileFormats format,
227 : int startPosition,
228 : float volumeScaling,
229 : int stopPosition,
230 : const CodecInst* codecInst);
231 : int StopPlayingFileLocally();
232 : int IsPlayingFileLocally() const;
233 : int RegisterFilePlayingToMixer();
234 : int StartPlayingFileAsMicrophone(const char* fileName,
235 : bool loop,
236 : FileFormats format,
237 : int startPosition,
238 : float volumeScaling,
239 : int stopPosition,
240 : const CodecInst* codecInst);
241 : int StartPlayingFileAsMicrophone(InStream* stream,
242 : FileFormats format,
243 : int startPosition,
244 : float volumeScaling,
245 : int stopPosition,
246 : const CodecInst* codecInst);
247 : int StopPlayingFileAsMicrophone();
248 : int IsPlayingFileAsMicrophone() const;
249 : int StartRecordingPlayout(const char* fileName, const CodecInst* codecInst);
250 : int StartRecordingPlayout(OutStream* stream, const CodecInst* codecInst);
251 : int StopRecordingPlayout();
252 :
253 : void SetMixWithMicStatus(bool mix);
254 :
255 : // VoEExternalMediaProcessing
256 : int RegisterExternalMediaProcessing(ProcessingTypes type,
257 : VoEMediaProcess& processObject);
258 : int DeRegisterExternalMediaProcessing(ProcessingTypes type);
259 : int SetExternalMixing(bool enabled);
260 :
261 : // VoEVolumeControl
262 : int GetSpeechOutputLevel(uint32_t& level) const;
263 : int GetSpeechOutputLevelFullRange(uint32_t& level) const;
264 : int SetInputMute(bool enable);
265 : bool InputMute() const;
266 : int SetOutputVolumePan(float left, float right);
267 : int GetOutputVolumePan(float& left, float& right) const;
268 : int SetChannelOutputVolumeScaling(float scaling);
269 : int GetChannelOutputVolumeScaling(float& scaling) const;
270 :
271 : // VoENetEqStats
272 : int GetNetworkStatistics(NetworkStatistics& stats);
273 : void GetDecodingCallStatistics(AudioDecodingCallStats* stats) const;
274 :
275 : // VoEVideoSync
276 : bool GetDelayEstimate(int* jitter_buffer_delay_ms,
277 : int* playout_buffer_delay_ms,
278 : int* avsync_offset_ms) const;
279 : uint32_t GetDelayEstimate() const;
280 : int LeastRequiredDelayMs() const;
281 : int SetMinimumPlayoutDelay(int delayMs);
282 0 : void SetCurrentSyncOffset(int offsetMs) { _current_sync_offset = offsetMs; }
283 : int GetPlayoutTimestamp(unsigned int& timestamp);
284 : int SetInitTimestamp(unsigned int timestamp);
285 : int SetInitSequenceNumber(short sequenceNumber);
286 :
287 : // VoEVideoSyncExtended
288 : int GetRtpRtcp(RtpRtcp** rtpRtcpModule, RtpReceiver** rtp_receiver) const;
289 :
290 : // DTMF
291 : int SendTelephoneEventOutband(int event, int duration_ms);
292 : int SetSendTelephoneEventPayloadType(int payload_type, int payload_frequency);
293 :
294 : // VoEAudioProcessingImpl
295 : int VoiceActivityIndicator(int& activity);
296 :
297 : // VoERTP_RTCP
298 : int SetLocalSSRC(unsigned int ssrc);
299 : int GetLocalSSRC(unsigned int& ssrc);
300 : int GetRemoteSSRC(unsigned int& ssrc);
301 : int SetSendAudioLevelIndicationStatus(bool enable, unsigned char id);
302 : int SetReceiveAudioLevelIndicationStatus(bool enable, unsigned char id);
303 : int SetSendAbsoluteSenderTimeStatus(bool enable, unsigned char id);
304 : int SetReceiveAbsoluteSenderTimeStatus(bool enable, unsigned char id);
305 : void EnableSendTransportSequenceNumber(int id);
306 : void EnableReceiveTransportSequenceNumber(int id);
307 :
308 : void RegisterSenderCongestionControlObjects(
309 : RtpPacketSender* rtp_packet_sender,
310 : TransportFeedbackObserver* transport_feedback_observer,
311 : PacketRouter* packet_router);
312 : void RegisterReceiverCongestionControlObjects(PacketRouter* packet_router);
313 : void ResetCongestionControlObjects();
314 :
315 : void SetRTCPStatus(bool enable);
316 : int GetRTCPStatus(bool& enabled);
317 : int SetRTCP_CNAME(const char cName[256]);
318 : 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,
326 : unsigned int name,
327 : const char* data,
328 : unsigned short dataLengthInBytes);
329 : int GetRTPStatistics(unsigned int& averageJitterMs,
330 : unsigned int& maxJitterMs,
331 : unsigned int& discardedPackets,
332 : unsigned int& cumulativeLost);
333 : int GetRTCPPacketTypeCounters(RtcpPacketTypeCounter& stats);
334 : int GetRemoteRTCPReportBlocks(std::vector<ReportBlock>* report_blocks);
335 : int GetRTPStatistics(CallStatistics& stats);
336 : int SetCodecFECStatus(bool enable);
337 : bool GetCodecFECStatus();
338 : void SetNACKStatus(bool enable, int maxNumberOfPackets);
339 :
340 : // From AudioPacketizationCallback in the ACM
341 : int32_t SendData(FrameType frameType,
342 : uint8_t payloadType,
343 : uint32_t timeStamp,
344 : const uint8_t* payloadData,
345 : size_t payloadSize,
346 : const RTPFragmentationHeader* fragmentation) override;
347 :
348 : // From ACMVADCallback in the ACM
349 : int32_t InFrameType(FrameType frame_type) override;
350 :
351 : // From RtpData in the RTP/RTCP module
352 : int32_t OnReceivedPayloadData(const uint8_t* payloadData,
353 : size_t payloadSize,
354 : const WebRtcRTPHeader* rtpHeader) override;
355 : bool OnRecoveredPacket(const uint8_t* packet, size_t packet_length) override;
356 :
357 : // From RtpFeedback in the RTP/RTCP module
358 : int32_t OnInitializeDecoder(int8_t payloadType,
359 : const char payloadName[RTP_PAYLOAD_NAME_SIZE],
360 : int frequency,
361 : size_t channels,
362 : uint32_t rate) override;
363 : void OnIncomingSSRCChanged(uint32_t ssrc) override;
364 : void OnIncomingCSRCChanged(uint32_t CSRC, bool added) override;
365 :
366 : // From Transport (called by the RTP/RTCP module)
367 : bool SendRtp(const uint8_t* data,
368 : size_t len,
369 : const PacketOptions& packet_options) override;
370 : bool SendRtcp(const uint8_t* data, size_t len) override;
371 :
372 : // From MixerParticipant
373 : MixerParticipant::AudioFrameInfo GetAudioFrameWithMuted(
374 : int32_t id,
375 : AudioFrame* audioFrame) override;
376 : int32_t NeededFrequency(int32_t id) const override;
377 :
378 : // From AudioMixer::Source.
379 : AudioMixer::Source::AudioFrameInfo GetAudioFrameWithInfo(
380 : int sample_rate_hz,
381 : AudioFrame* audio_frame);
382 :
383 : // From FileCallback
384 : void PlayNotification(int32_t id, uint32_t durationMs) override;
385 : void RecordNotification(int32_t id, uint32_t durationMs) override;
386 : void PlayFileEnded(int32_t id) override;
387 : void RecordFileEnded(int32_t id) override;
388 :
389 : uint32_t InstanceId() const { return _instanceId; }
390 0 : int32_t ChannelId() const { return _channelId; }
391 0 : bool Playing() const { return channel_state_.Get().playing; }
392 0 : bool Sending() const { return channel_state_.Get().sending; }
393 0 : bool ExternalTransport() const {
394 0 : rtc::CritScope cs(&_callbackCritSect);
395 0 : return _externalTransport;
396 : }
397 0 : bool ExternalMixing() const { return _externalMixing; }
398 : RtpRtcp* RtpRtcpModulePtr() const { return _rtpRtcpModule.get(); }
399 : int8_t OutputEnergyLevel() const { return _outputAudioLevel.Level(); }
400 : uint32_t Demultiplex(const AudioFrame& audioFrame);
401 : // Demultiplex the data to the channel's |_audioFrame|. The difference
402 : // between this method and the overloaded method above is that |audio_data|
403 : // does not go through transmit_mixer and APM.
404 : void Demultiplex(const int16_t* audio_data,
405 : int sample_rate,
406 : size_t number_of_frames,
407 : size_t number_of_channels);
408 : uint32_t PrepareEncodeAndSend(int mixingFrequency);
409 : uint32_t EncodeAndSend();
410 :
411 : // Associate to a send channel.
412 : // Used for obtaining RTT for a receive-only channel.
413 : void set_associate_send_channel(const ChannelOwner& channel);
414 : // Disassociate a send channel if it was associated.
415 : void DisassociateSendChannel(int channel_id);
416 :
417 : // Set a RtcEventLog logging object.
418 : void SetRtcEventLog(RtcEventLog* event_log);
419 :
420 : void SetRtcpRttStats(RtcpRttStats* rtcp_rtt_stats);
421 : void SetTransportOverhead(size_t transport_overhead_per_packet);
422 :
423 : // From OverheadObserver in the RTP/RTCP module
424 : void OnOverheadChanged(size_t overhead_bytes_per_packet) override;
425 :
426 : protected:
427 : void OnIncomingFractionLoss(int fraction_lost);
428 :
429 : private:
430 : bool ReceivePacket(const uint8_t* packet,
431 : size_t packet_length,
432 : const RTPHeader& header,
433 : bool in_order);
434 : bool HandleRtxPacket(const uint8_t* packet,
435 : size_t packet_length,
436 : const RTPHeader& header);
437 : bool IsPacketInOrder(const RTPHeader& header) const;
438 : bool IsPacketRetransmitted(const RTPHeader& header, bool in_order) const;
439 : int ResendPackets(const uint16_t* sequence_numbers, int length);
440 : int32_t MixOrReplaceAudioWithFile(int mixingFrequency);
441 : int32_t MixAudioWithFile(AudioFrame& audioFrame, int mixingFrequency);
442 : void UpdatePlayoutTimestamp(bool rtcp);
443 : void RegisterReceiveCodecsToRTPModule();
444 :
445 : int SetSendRtpHeaderExtension(bool enable,
446 : RTPExtensionType type,
447 : unsigned char id);
448 :
449 : void UpdateOverheadForEncoder();
450 :
451 : int GetRtpTimestampRateHz() const;
452 : int64_t GetRTT(bool allow_associate_channel) const;
453 :
454 : rtc::CriticalSection _fileCritSect;
455 : rtc::CriticalSection _callbackCritSect;
456 : rtc::CriticalSection volume_settings_critsect_;
457 : uint32_t _instanceId;
458 : int32_t _channelId;
459 :
460 : ChannelState channel_state_;
461 :
462 : std::unique_ptr<voe::RtcEventLogProxy> event_log_proxy_;
463 : std::unique_ptr<voe::RtcpRttStatsProxy> rtcp_rtt_stats_proxy_;
464 :
465 : std::unique_ptr<RtpHeaderParser> rtp_header_parser_;
466 : std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry_;
467 : std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_;
468 : std::unique_ptr<StatisticsProxy> statistics_proxy_;
469 : std::unique_ptr<RtpReceiver> rtp_receiver_;
470 : TelephoneEventHandler* telephone_event_handler_;
471 : std::unique_ptr<RtpRtcp> _rtpRtcpModule;
472 : std::unique_ptr<AudioCodingModule> audio_coding_;
473 : acm2::CodecManager codec_manager_;
474 : acm2::RentACodec rent_a_codec_;
475 : std::unique_ptr<AudioSinkInterface> audio_sink_;
476 : AudioLevel _outputAudioLevel;
477 : bool _externalTransport;
478 : AudioFrame _audioFrame;
479 : // Downsamples to the codec rate if necessary.
480 : PushResampler<int16_t> input_resampler_;
481 : std::unique_ptr<FilePlayer> input_file_player_;
482 : std::unique_ptr<FilePlayer> output_file_player_;
483 : std::unique_ptr<FileRecorder> output_file_recorder_;
484 : int _inputFilePlayerId;
485 : int _outputFilePlayerId;
486 : int _outputFileRecorderId;
487 : bool _outputFileRecording;
488 : bool _outputExternalMedia;
489 : VoEMediaProcess* _inputExternalMediaCallbackPtr;
490 : VoEMediaProcess* _outputExternalMediaCallbackPtr;
491 : uint32_t _timeStamp;
492 :
493 : RemoteNtpTimeEstimator ntp_estimator_ GUARDED_BY(ts_stats_lock_);
494 :
495 : // Timestamp of the audio pulled from NetEq.
496 : rtc::Optional<uint32_t> jitter_buffer_playout_timestamp_;
497 : uint32_t playout_timestamp_rtp_ GUARDED_BY(video_sync_lock_);
498 : uint32_t playout_timestamp_rtcp_;
499 : uint32_t playout_delay_ms_ GUARDED_BY(video_sync_lock_);
500 : uint32_t _numberOfDiscardedPackets;
501 : uint16_t send_sequence_number_;
502 : uint8_t restored_packet_[kVoiceEngineMaxIpPacketSizeBytes];
503 :
504 : rtc::CriticalSection ts_stats_lock_;
505 :
506 : std::unique_ptr<rtc::TimestampWrapAroundHandler> rtp_ts_wraparound_handler_;
507 : // The rtp timestamp of the first played out audio frame.
508 : int64_t capture_start_rtp_time_stamp_;
509 : // The capture ntp time (in local timebase) of the first played out audio
510 : // frame.
511 : int64_t capture_start_ntp_time_ms_ GUARDED_BY(ts_stats_lock_);
512 :
513 : // uses
514 : Statistics* _engineStatisticsPtr;
515 : OutputMixer* _outputMixerPtr;
516 : TransmitMixer* _transmitMixerPtr;
517 : ProcessThread* _moduleProcessThreadPtr;
518 : AudioDeviceModule* _audioDeviceModulePtr;
519 : VoiceEngineObserver* _voiceEngineObserverPtr; // owned by base
520 : rtc::CriticalSection* _callbackCritSectPtr; // owned by base
521 : Transport* _transportPtr; // WebRtc socket or external transport
522 : RmsLevel rms_level_;
523 : int32_t _sendFrameType; // Send data is voice, 1-voice, 0-otherwise
524 : // VoEBase
525 : bool _externalMixing;
526 : bool _mixFileWithMicrophone;
527 : // VoEVolumeControl
528 : bool input_mute_ GUARDED_BY(volume_settings_critsect_);
529 : bool previous_frame_muted_; // Only accessed from PrepareEncodeAndSend().
530 : float _panLeft GUARDED_BY(volume_settings_critsect_);
531 : float _panRight GUARDED_BY(volume_settings_critsect_);
532 : float _outputGain GUARDED_BY(volume_settings_critsect_);
533 : // VoeRTP_RTCP
534 : uint32_t _lastLocalTimeStamp;
535 : int8_t _lastPayloadType;
536 : bool _includeAudioLevelIndication;
537 : size_t transport_overhead_per_packet_;
538 : size_t rtp_overhead_per_packet_;
539 : // VoENetwork
540 : AudioFrame::SpeechType _outputSpeechType;
541 : // VoEVideoSync
542 : rtc::CriticalSection video_sync_lock_;
543 : int _current_sync_offset;
544 : // VoEAudioProcessing
545 : bool restored_packet_in_use_;
546 : // RtcpBandwidthObserver
547 : std::unique_ptr<VoERtcpObserver> rtcp_observer_;
548 : // An associated send channel.
549 : rtc::CriticalSection assoc_send_channel_lock_;
550 : ChannelOwner associate_send_channel_ GUARDED_BY(assoc_send_channel_lock_);
551 :
552 : bool pacing_enabled_;
553 : PacketRouter* packet_router_ = nullptr;
554 : std::unique_ptr<TransportFeedbackProxy> feedback_observer_proxy_;
555 : std::unique_ptr<TransportSequenceNumberProxy> seq_num_allocator_proxy_;
556 : std::unique_ptr<RtpPacketSenderProxy> rtp_packet_sender_proxy_;
557 : std::unique_ptr<RateLimiter> retransmission_rate_limiter_;
558 :
559 : // TODO(ossu): Remove once GetAudioDecoderFactory() is no longer needed.
560 : rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_;
561 : };
562 :
563 : } // namespace voe
564 : } // namespace webrtc
565 :
566 : #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_
|