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