Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / voice_engine / channel.h
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 "webrtc/common_audio/resampler/include/push_resampler.h"
15 #include "webrtc/common_types.h"
16 #include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h"
17 #include "webrtc/modules/audio_conference_mixer/interface/audio_conference_mixer_defines.h"
18 #include "webrtc/modules/audio_processing/rms_level.h"
19 #include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h"
20 #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h"
21 #include "webrtc/modules/utility/interface/file_player.h"
22 #include "webrtc/modules/utility/interface/file_recorder.h"
23 #include "webrtc/system_wrappers/interface/scoped_ptr.h"
24 #include "webrtc/voice_engine/dtmf_inband.h"
25 #include "webrtc/voice_engine/dtmf_inband_queue.h"
26 #include "webrtc/voice_engine/include/voe_audio_processing.h"
27 #include "webrtc/voice_engine/include/voe_network.h"
28 #include "webrtc/voice_engine/level_indicator.h"
29 #include "webrtc/voice_engine/shared_data.h"
30 #include "webrtc/voice_engine/voice_engine_defines.h"
31
32 #ifdef WEBRTC_DTMF_DETECTION
33 // TelephoneEventDetectionMethods, TelephoneEventObserver
34 #include "webrtc/voice_engine/include/voe_dtmf.h"
35 #endif
36
37 namespace webrtc {
38
39 class AudioDeviceModule;
40 class Config;
41 class CriticalSectionWrapper;
42 class FileWrapper;
43 class ProcessThread;
44 class ReceiveStatistics;
45 class RtpDump;
46 class RTPPayloadRegistry;
47 class RtpReceiver;
48 class RTPReceiverAudio;
49 class RtpRtcp;
50 class TelephoneEventHandler;
51 class ViENetwork;
52 class VoEMediaProcess;
53 class VoERTCPObserver;
54 class VoERTPObserver;
55 class VoiceEngineObserver;
56
57 struct CallStatistics;
58 struct ReportBlock;
59 struct SenderInfo;
60
61 namespace voe {
62
63 class Statistics;
64 class StatisticsProxy;
65 class TransmitMixer;
66 class OutputMixer;
67
68 // Helper class to simplify locking scheme for members that are accessed from
69 // multiple threads.
70 // Example: a member can be set on thread T1 and read by an internal audio
71 // thread T2. Accessing the member via this class ensures that we are
72 // safe and also avoid TSan v2 warnings.
73 class ChannelState {
74  public:
75     struct State {
76         State() : rx_apm_is_enabled(false),
77                   input_external_media(false),
78                   output_file_playing(false),
79                   input_file_playing(false),
80                   playing(false),
81                   sending(false),
82                   receiving(false) {}
83
84         bool rx_apm_is_enabled;
85         bool input_external_media;
86         bool output_file_playing;
87         bool input_file_playing;
88         bool playing;
89         bool sending;
90         bool receiving;
91     };
92
93     ChannelState() : lock_(CriticalSectionWrapper::CreateCriticalSection()) {
94     }
95     virtual ~ChannelState() {}
96
97     void Reset() {
98         CriticalSectionScoped lock(lock_.get());
99         state_ = State();
100     }
101
102     State Get() const {
103         CriticalSectionScoped lock(lock_.get());
104         return state_;
105     }
106
107     void SetRxApmIsEnabled(bool enable) {
108         CriticalSectionScoped lock(lock_.get());
109         state_.rx_apm_is_enabled = enable;
110     }
111
112     void SetInputExternalMedia(bool enable) {
113         CriticalSectionScoped lock(lock_.get());
114         state_.input_external_media = enable;
115     }
116
117     void SetOutputFilePlaying(bool enable) {
118         CriticalSectionScoped lock(lock_.get());
119         state_.output_file_playing = enable;
120     }
121
122     void SetInputFilePlaying(bool enable) {
123         CriticalSectionScoped lock(lock_.get());
124         state_.input_file_playing = enable;
125     }
126
127     void SetPlaying(bool enable) {
128         CriticalSectionScoped lock(lock_.get());
129         state_.playing = enable;
130     }
131
132     void SetSending(bool enable) {
133         CriticalSectionScoped lock(lock_.get());
134         state_.sending = enable;
135     }
136
137     void SetReceiving(bool enable) {
138         CriticalSectionScoped lock(lock_.get());
139         state_.receiving = enable;
140     }
141
142 private:
143     scoped_ptr<CriticalSectionWrapper> lock_;
144     State state_;
145 };
146
147 class Channel:
148     public RtpData,
149     public RtpFeedback,
150     public RtcpFeedback,
151     public FileCallback, // receiving notification from file player & recorder
152     public Transport,
153     public RtpAudioFeedback,
154     public AudioPacketizationCallback, // receive encoded packets from the ACM
155     public ACMVADCallback, // receive voice activity from the ACM
156     public MixerParticipant // supplies output mixer with audio frames
157 {
158 public:
159     enum {KNumSocketThreads = 1};
160     enum {KNumberOfSocketBuffers = 8};
161     virtual ~Channel();
162     static int32_t CreateChannel(Channel*& channel,
163                                  int32_t channelId,
164                                  uint32_t instanceId,
165                                  const Config& config);
166     Channel(int32_t channelId, uint32_t instanceId, const Config& config);
167     int32_t Init();
168     int32_t SetEngineInformation(
169         Statistics& engineStatistics,
170         OutputMixer& outputMixer,
171         TransmitMixer& transmitMixer,
172         ProcessThread& moduleProcessThread,
173         AudioDeviceModule& audioDeviceModule,
174         VoiceEngineObserver* voiceEngineObserver,
175         CriticalSectionWrapper* callbackCritSect);
176     int32_t UpdateLocalTimeStamp();
177
178     // API methods
179
180     // VoEBase
181     int32_t StartPlayout();
182     int32_t StopPlayout();
183     int32_t StartSend();
184     int32_t StopSend();
185     int32_t StartReceiving();
186     int32_t StopReceiving();
187
188     int32_t SetNetEQPlayoutMode(NetEqModes mode);
189     int32_t GetNetEQPlayoutMode(NetEqModes& mode);
190     int32_t RegisterVoiceEngineObserver(VoiceEngineObserver& observer);
191     int32_t DeRegisterVoiceEngineObserver();
192
193     // VoECodec
194     int32_t GetSendCodec(CodecInst& codec);
195     int32_t GetRecCodec(CodecInst& codec);
196     int32_t SetSendCodec(const CodecInst& codec);
197     int32_t SetVADStatus(bool enableVAD, ACMVADMode mode, bool disableDTX);
198     int32_t GetVADStatus(bool& enabledVAD, ACMVADMode& mode, bool& disabledDTX);
199     int32_t SetRecPayloadType(const CodecInst& codec);
200     int32_t GetRecPayloadType(CodecInst& codec);
201     int32_t SetSendCNPayloadType(int type, PayloadFrequencies frequency);
202
203     // VoE dual-streaming.
204     int SetSecondarySendCodec(const CodecInst& codec, int red_payload_type);
205     void RemoveSecondarySendCodec();
206     int GetSecondarySendCodec(CodecInst* codec);
207
208     // VoENetwork
209     int32_t RegisterExternalTransport(Transport& transport);
210     int32_t DeRegisterExternalTransport();
211     int32_t ReceivedRTPPacket(const int8_t* data, int32_t length,
212                               const PacketTime& packet_time);
213     int32_t ReceivedRTCPPacket(const int8_t* data, int32_t length);
214
215     // VoEFile
216     int StartPlayingFileLocally(const char* fileName, bool loop,
217                                 FileFormats format,
218                                 int startPosition,
219                                 float volumeScaling,
220                                 int stopPosition,
221                                 const CodecInst* codecInst);
222     int StartPlayingFileLocally(InStream* stream, FileFormats format,
223                                 int startPosition,
224                                 float volumeScaling,
225                                 int stopPosition,
226                                 const CodecInst* codecInst);
227     int StopPlayingFileLocally();
228     int IsPlayingFileLocally() const;
229     int RegisterFilePlayingToMixer();
230     int ScaleLocalFilePlayout(float scale);
231     int GetLocalPlayoutPosition(int& positionMs);
232     int StartPlayingFileAsMicrophone(const char* fileName, bool loop,
233                                      FileFormats format,
234                                      int startPosition,
235                                      float volumeScaling,
236                                      int stopPosition,
237                                      const CodecInst* codecInst);
238     int StartPlayingFileAsMicrophone(InStream* stream,
239                                      FileFormats format,
240                                      int startPosition,
241                                      float volumeScaling,
242                                      int stopPosition,
243                                      const CodecInst* codecInst);
244     int StopPlayingFileAsMicrophone();
245     int IsPlayingFileAsMicrophone() const;
246     int ScaleFileAsMicrophonePlayout(float scale);
247     int StartRecordingPlayout(const char* fileName, const CodecInst* codecInst);
248     int StartRecordingPlayout(OutStream* stream, const CodecInst* codecInst);
249     int StopRecordingPlayout();
250
251     void SetMixWithMicStatus(bool mix);
252
253     // VoEExternalMediaProcessing
254     int RegisterExternalMediaProcessing(ProcessingTypes type,
255                                         VoEMediaProcess& processObject);
256     int DeRegisterExternalMediaProcessing(ProcessingTypes type);
257     int SetExternalMixing(bool enabled);
258
259     // VoEVolumeControl
260     int GetSpeechOutputLevel(uint32_t& level) const;
261     int GetSpeechOutputLevelFullRange(uint32_t& level) const;
262     int SetMute(bool enable);
263     bool Mute() const;
264     int SetOutputVolumePan(float left, float right);
265     int GetOutputVolumePan(float& left, float& right) const;
266     int SetChannelOutputVolumeScaling(float scaling);
267     int GetChannelOutputVolumeScaling(float& scaling) const;
268
269     // VoENetEqStats
270     int GetNetworkStatistics(NetworkStatistics& stats);
271     void GetDecodingCallStatistics(AudioDecodingCallStats* stats) const;
272
273     // VoEVideoSync
274     bool GetDelayEstimate(int* jitter_buffer_delay_ms,
275                           int* playout_buffer_delay_ms) const;
276     int least_required_delay_ms() const { return least_required_delay_ms_; }
277     int SetInitialPlayoutDelay(int delay_ms);
278     int SetMinimumPlayoutDelay(int delayMs);
279     int GetPlayoutTimestamp(unsigned int& timestamp);
280     void UpdatePlayoutTimestamp(bool rtcp);
281     int SetInitTimestamp(unsigned int timestamp);
282     int SetInitSequenceNumber(short sequenceNumber);
283
284     // VoEVideoSyncExtended
285     int GetRtpRtcp(RtpRtcp** rtpRtcpModule, RtpReceiver** rtp_receiver) const;
286
287     // VoEDtmf
288     int SendTelephoneEventOutband(unsigned char eventCode, int lengthMs,
289                                   int attenuationDb, bool playDtmfEvent);
290     int SendTelephoneEventInband(unsigned char eventCode, int lengthMs,
291                                  int attenuationDb, bool playDtmfEvent);
292     int SetDtmfPlayoutStatus(bool enable);
293     bool DtmfPlayoutStatus() const;
294     int SetSendTelephoneEventPayloadType(unsigned char type);
295     int GetSendTelephoneEventPayloadType(unsigned char& type);
296
297     // VoEAudioProcessingImpl
298     int UpdateRxVadDetection(AudioFrame& audioFrame);
299     int RegisterRxVadObserver(VoERxVadCallback &observer);
300     int DeRegisterRxVadObserver();
301     int VoiceActivityIndicator(int &activity);
302 #ifdef WEBRTC_VOICE_ENGINE_AGC
303     int SetRxAgcStatus(bool enable, AgcModes mode);
304     int GetRxAgcStatus(bool& enabled, AgcModes& mode);
305     int SetRxAgcConfig(AgcConfig config);
306     int GetRxAgcConfig(AgcConfig& config);
307 #endif
308 #ifdef WEBRTC_VOICE_ENGINE_NR
309     int SetRxNsStatus(bool enable, NsModes mode);
310     int GetRxNsStatus(bool& enabled, NsModes& mode);
311 #endif
312
313     // VoERTP_RTCP
314     int RegisterRTPObserver(VoERTPObserver& observer);
315     int DeRegisterRTPObserver();
316     int RegisterRTCPObserver(VoERTCPObserver& observer);
317     int DeRegisterRTCPObserver();
318     int SetLocalSSRC(unsigned int ssrc);
319     int GetLocalSSRC(unsigned int& ssrc);
320     int GetRemoteSSRC(unsigned int& ssrc);
321     int GetRemoteCSRCs(unsigned int arrCSRC[15]);
322     int SetSendAudioLevelIndicationStatus(bool enable, unsigned char id);
323     int SetReceiveAudioLevelIndicationStatus(bool enable, unsigned char id);
324     int SetSendAbsoluteSenderTimeStatus(bool enable, unsigned char id);
325     int SetReceiveAbsoluteSenderTimeStatus(bool enable, unsigned char id);
326     int SetRTCPStatus(bool enable);
327     int GetRTCPStatus(bool& enabled);
328     int SetRTCP_CNAME(const char cName[256]);
329     int GetRTCP_CNAME(char cName[256]);
330     int GetRemoteRTCP_CNAME(char cName[256]);
331     int GetRemoteRTCPData(unsigned int& NTPHigh, unsigned int& NTPLow,
332                           unsigned int& timestamp,
333                           unsigned int& playoutTimestamp, unsigned int* jitter,
334                           unsigned short* fractionLost);
335     int SendApplicationDefinedRTCPPacket(unsigned char subType,
336                                          unsigned int name, const char* data,
337                                          unsigned short dataLengthInBytes);
338     int GetRTPStatistics(unsigned int& averageJitterMs,
339                          unsigned int& maxJitterMs,
340                          unsigned int& discardedPackets);
341     int GetRemoteRTCPSenderInfo(SenderInfo* sender_info);
342     int GetRemoteRTCPReportBlocks(std::vector<ReportBlock>* report_blocks);
343     int GetRTPStatistics(CallStatistics& stats);
344     int SetFECStatus(bool enable, int redPayloadtype);
345     int GetFECStatus(bool& enabled, int& redPayloadtype);
346     void SetNACKStatus(bool enable, int maxNumberOfPackets);
347     int StartRTPDump(const char fileNameUTF8[1024], RTPDirections direction);
348     int StopRTPDump(RTPDirections direction);
349     bool RTPDumpIsActive(RTPDirections direction);
350     uint32_t LastRemoteTimeStamp() { return _lastRemoteTimeStamp; }
351     // Takes ownership of the ViENetwork.
352     void SetVideoEngineBWETarget(ViENetwork* vie_network, int video_channel);
353
354     // From AudioPacketizationCallback in the ACM
355     int32_t SendData(FrameType frameType,
356                      uint8_t payloadType,
357                      uint32_t timeStamp,
358                      const uint8_t* payloadData,
359                      uint16_t payloadSize,
360                      const RTPFragmentationHeader* fragmentation);
361     // From ACMVADCallback in the ACM
362     int32_t InFrameType(int16_t frameType);
363
364     int32_t OnRxVadDetected(int vadDecision);
365
366     // From RtpData in the RTP/RTCP module
367     int32_t OnReceivedPayloadData(const uint8_t* payloadData,
368                                   uint16_t payloadSize,
369                                   const WebRtcRTPHeader* rtpHeader);
370
371     bool OnRecoveredPacket(const uint8_t* packet, int packet_length);
372
373     // From RtpFeedback in the RTP/RTCP module
374     int32_t OnInitializeDecoder(
375             int32_t id,
376             int8_t payloadType,
377             const char payloadName[RTP_PAYLOAD_NAME_SIZE],
378             int frequency,
379             uint8_t channels,
380             uint32_t rate);
381
382     void OnPacketTimeout(int32_t id);
383
384     void OnReceivedPacket(int32_t id, RtpRtcpPacketType packetType);
385
386     void OnPeriodicDeadOrAlive(int32_t id,
387                                RTPAliveType alive);
388
389     void OnIncomingSSRCChanged(int32_t id,
390                                uint32_t ssrc);
391
392     void OnIncomingCSRCChanged(int32_t id,
393                                uint32_t CSRC, bool added);
394
395     void ResetStatistics(uint32_t ssrc);
396
397     // From RtcpFeedback in the RTP/RTCP module
398     void OnApplicationDataReceived(int32_t id,
399                                    uint8_t subType,
400                                    uint32_t name,
401                                    uint16_t length,
402                                    const uint8_t* data);
403
404     // From RtpAudioFeedback in the RTP/RTCP module
405     void OnReceivedTelephoneEvent(int32_t id,
406                                   uint8_t event,
407                                   bool endOfEvent);
408
409     void OnPlayTelephoneEvent(int32_t id,
410                               uint8_t event,
411                               uint16_t lengthMs,
412                               uint8_t volume);
413
414     // From Transport (called by the RTP/RTCP module)
415     int SendPacket(int /*channel*/, const void *data, int len);
416     int SendRTCPPacket(int /*channel*/, const void *data, int len);
417
418     // From MixerParticipant
419     int32_t GetAudioFrame(int32_t id, AudioFrame& audioFrame);
420     int32_t NeededFrequency(int32_t id);
421
422     // From MonitorObserver
423     void OnPeriodicProcess();
424
425     // From FileCallback
426     void PlayNotification(int32_t id,
427                           uint32_t durationMs);
428     void RecordNotification(int32_t id,
429                             uint32_t durationMs);
430     void PlayFileEnded(int32_t id);
431     void RecordFileEnded(int32_t id);
432
433     uint32_t InstanceId() const
434     {
435         return _instanceId;
436     }
437     int32_t ChannelId() const
438     {
439         return _channelId;
440     }
441     bool Playing() const
442     {
443         return channel_state_.Get().playing;
444     }
445     bool Sending() const
446     {
447         return channel_state_.Get().sending;
448     }
449     bool Receiving() const
450     {
451         return channel_state_.Get().receiving;
452     }
453     bool ExternalTransport() const
454     {
455         CriticalSectionScoped cs(&_callbackCritSect);
456         return _externalTransport;
457     }
458     bool ExternalMixing() const
459     {
460         return _externalMixing;
461     }
462     RtpRtcp* RtpRtcpModulePtr() const
463     {
464         return _rtpRtcpModule.get();
465     }
466     int8_t OutputEnergyLevel() const
467     {
468         return _outputAudioLevel.Level();
469     }
470     uint32_t Demultiplex(const AudioFrame& audioFrame);
471     // Demultiplex the data to the channel's |_audioFrame|. The difference
472     // between this method and the overloaded method above is that |audio_data|
473     // does not go through transmit_mixer and APM.
474     void Demultiplex(const int16_t* audio_data,
475                      int sample_rate,
476                      int number_of_frames,
477                      int number_of_channels);
478     uint32_t PrepareEncodeAndSend(int mixingFrequency);
479     uint32_t EncodeAndSend();
480
481 private:
482     bool ReceivePacket(const uint8_t* packet, int packet_length,
483                        const RTPHeader& header, bool in_order);
484     bool HandleEncapsulation(const uint8_t* packet,
485                              int packet_length,
486                              const RTPHeader& header);
487     bool IsPacketInOrder(const RTPHeader& header) const;
488     bool IsPacketRetransmitted(const RTPHeader& header, bool in_order) const;
489     int ResendPackets(const uint16_t* sequence_numbers, int length);
490     int InsertInbandDtmfTone();
491     int32_t MixOrReplaceAudioWithFile(int mixingFrequency);
492     int32_t MixAudioWithFile(AudioFrame& audioFrame, int mixingFrequency);
493     int32_t SendPacketRaw(const void *data, int len, bool RTCP);
494     void UpdatePacketDelay(uint32_t timestamp,
495                            uint16_t sequenceNumber);
496     void RegisterReceiveCodecsToRTPModule();
497
498     int SetRedPayloadType(int red_payload_type);
499     int SetSendRtpHeaderExtension(bool enable, RTPExtensionType type,
500                                   unsigned char id);
501
502     CriticalSectionWrapper& _fileCritSect;
503     CriticalSectionWrapper& _callbackCritSect;
504     CriticalSectionWrapper& volume_settings_critsect_;
505     uint32_t _instanceId;
506     int32_t _channelId;
507
508     ChannelState channel_state_;
509
510     scoped_ptr<RtpHeaderParser> rtp_header_parser_;
511     scoped_ptr<RTPPayloadRegistry> rtp_payload_registry_;
512     scoped_ptr<ReceiveStatistics> rtp_receive_statistics_;
513     scoped_ptr<StatisticsProxy> statistics_proxy_;
514     scoped_ptr<RtpReceiver> rtp_receiver_;
515     TelephoneEventHandler* telephone_event_handler_;
516     scoped_ptr<RtpRtcp> _rtpRtcpModule;
517     scoped_ptr<AudioCodingModule> audio_coding_;
518     RtpDump& _rtpDumpIn;
519     RtpDump& _rtpDumpOut;
520     AudioLevel _outputAudioLevel;
521     bool _externalTransport;
522     AudioFrame _audioFrame;
523     scoped_ptr<int16_t[]> mono_recording_audio_;
524     // Downsamples to the codec rate if necessary.
525     PushResampler<int16_t> input_resampler_;
526     uint8_t _audioLevel_dBov;
527     FilePlayer* _inputFilePlayerPtr;
528     FilePlayer* _outputFilePlayerPtr;
529     FileRecorder* _outputFileRecorderPtr;
530     int _inputFilePlayerId;
531     int _outputFilePlayerId;
532     int _outputFileRecorderId;
533     bool _outputFileRecording;
534     DtmfInbandQueue _inbandDtmfQueue;
535     DtmfInband _inbandDtmfGenerator;
536     bool _outputExternalMedia;
537     VoEMediaProcess* _inputExternalMediaCallbackPtr;
538     VoEMediaProcess* _outputExternalMediaCallbackPtr;
539     uint32_t _timeStamp;
540     uint8_t _sendTelephoneEventPayloadType;
541
542     // Timestamp of the audio pulled from NetEq.
543     uint32_t jitter_buffer_playout_timestamp_;
544     uint32_t playout_timestamp_rtp_;
545     uint32_t playout_timestamp_rtcp_;
546     uint32_t playout_delay_ms_;
547     uint32_t _numberOfDiscardedPackets;
548     uint16_t send_sequence_number_;
549     uint8_t restored_packet_[kVoiceEngineMaxIpPacketSizeBytes];
550
551     // uses
552     Statistics* _engineStatisticsPtr;
553     OutputMixer* _outputMixerPtr;
554     TransmitMixer* _transmitMixerPtr;
555     ProcessThread* _moduleProcessThreadPtr;
556     AudioDeviceModule* _audioDeviceModulePtr;
557     VoiceEngineObserver* _voiceEngineObserverPtr; // owned by base
558     CriticalSectionWrapper* _callbackCritSectPtr; // owned by base
559     Transport* _transportPtr; // WebRtc socket or external transport
560     RMSLevel rms_level_;
561     scoped_ptr<AudioProcessing> rx_audioproc_; // far end AudioProcessing
562     VoERxVadCallback* _rxVadObserverPtr;
563     int32_t _oldVadDecision;
564     int32_t _sendFrameType; // Send data is voice, 1-voice, 0-otherwise
565     VoERTPObserver* _rtpObserverPtr;
566     VoERTCPObserver* _rtcpObserverPtr;
567     // VoEBase
568     bool _externalPlayout;
569     bool _externalMixing;
570     bool _mixFileWithMicrophone;
571     bool _rtpObserver;
572     bool _rtcpObserver;
573     // VoEVolumeControl
574     bool _mute;
575     float _panLeft;
576     float _panRight;
577     float _outputGain;
578     // VoEDtmf
579     bool _playOutbandDtmfEvent;
580     bool _playInbandDtmfEvent;
581     // VoeRTP_RTCP
582     uint32_t _lastLocalTimeStamp;
583     uint32_t _lastRemoteTimeStamp;
584     int8_t _lastPayloadType;
585     bool _includeAudioLevelIndication;
586     // VoENetwork
587     bool _rtpPacketTimedOut;
588     bool _rtpPacketTimeOutIsEnabled;
589     uint32_t _rtpTimeOutSeconds;
590     bool _connectionObserver;
591     VoEConnectionObserver* _connectionObserverPtr;
592     AudioFrame::SpeechType _outputSpeechType;
593     ViENetwork* vie_network_;
594     int video_channel_;
595     // VoEVideoSync
596     uint32_t _average_jitter_buffer_delay_us;
597     int least_required_delay_ms_;
598     uint32_t _previousTimestamp;
599     uint16_t _recPacketDelayMs;
600     // VoEAudioProcessing
601     bool _RxVadDetection;
602     bool _rxAgcIsEnabled;
603     bool _rxNsIsEnabled;
604     bool restored_packet_in_use_;
605 };
606
607 }  // namespace voe
608 }  // namespace webrtc
609
610 #endif  // WEBRTC_VOICE_ENGINE_CHANNEL_H_