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