niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
leozwang@webrtc.org | 813e4b0 | 2012-03-01 18:34:25 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 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 | |
andrew@webrtc.org | 382c0c2 | 2014-05-05 18:22:21 +0000 | [diff] [blame] | 11 | #ifndef WEBRTC_VOICE_ENGINE_CHANNEL_H_ |
| 12 | #define WEBRTC_VOICE_ENGINE_CHANNEL_H_ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 13 | |
xians@webrtc.org | 2f84afa | 2013-07-31 16:23:37 +0000 | [diff] [blame] | 14 | #include "webrtc/common_audio/resampler/include/push_resampler.h" |
turaj@webrtc.org | 6388c3e | 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" |
andrew@webrtc.org | 382c0c2 | 2014-05-05 18:22:21 +0000 | [diff] [blame] | 18 | #include "webrtc/modules/audio_processing/rms_level.h" |
minyue@webrtc.org | c1a40a7 | 2014-05-28 09:52:06 +0000 | [diff] [blame] | 19 | #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" |
stefan@webrtc.org | 8e24d87 | 2014-09-02 18:58:24 +0000 | [diff] [blame] | 20 | #include "webrtc/modules/rtp_rtcp/interface/remote_ntp_time_estimator.h" |
stefan@webrtc.org | a5cb98c | 2013-05-29 12:12:51 +0000 | [diff] [blame] | 21 | #include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h" |
turaj@webrtc.org | 6388c3e | 2013-02-12 21:42:18 +0000 | [diff] [blame] | 22 | #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h" |
| 23 | #include "webrtc/modules/utility/interface/file_player.h" |
| 24 | #include "webrtc/modules/utility/interface/file_recorder.h" |
| 25 | #include "webrtc/system_wrappers/interface/scoped_ptr.h" |
| 26 | #include "webrtc/voice_engine/dtmf_inband.h" |
| 27 | #include "webrtc/voice_engine/dtmf_inband_queue.h" |
| 28 | #include "webrtc/voice_engine/include/voe_audio_processing.h" |
| 29 | #include "webrtc/voice_engine/include/voe_network.h" |
| 30 | #include "webrtc/voice_engine/level_indicator.h" |
minyue@webrtc.org | 74aaf29 | 2014-07-16 21:28:26 +0000 | [diff] [blame] | 31 | #include "webrtc/voice_engine/network_predictor.h" |
turaj@webrtc.org | 6388c3e | 2013-02-12 21:42:18 +0000 | [diff] [blame] | 32 | #include "webrtc/voice_engine/shared_data.h" |
| 33 | #include "webrtc/voice_engine/voice_engine_defines.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 34 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 35 | #ifdef WEBRTC_DTMF_DETECTION |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 36 | // TelephoneEventDetectionMethods, TelephoneEventObserver |
| 37 | #include "webrtc/voice_engine/include/voe_dtmf.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 38 | #endif |
| 39 | |
wu@webrtc.org | 94454b7 | 2014-06-05 20:34:08 +0000 | [diff] [blame] | 40 | namespace rtc { |
| 41 | |
| 42 | class TimestampWrapAroundHandler; |
| 43 | } |
| 44 | |
andrew@webrtc.org | eb524d9 | 2013-09-23 23:02:24 +0000 | [diff] [blame] | 45 | namespace webrtc { |
| 46 | |
tnakamura@webrtc.org | aa4d96a | 2013-07-16 19:25:04 +0000 | [diff] [blame] | 47 | class AudioDeviceModule; |
minyue@webrtc.org | e509f94 | 2013-09-12 17:03:00 +0000 | [diff] [blame] | 48 | class Config; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 49 | class CriticalSectionWrapper; |
tnakamura@webrtc.org | aa4d96a | 2013-07-16 19:25:04 +0000 | [diff] [blame] | 50 | class FileWrapper; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 51 | class ProcessThread; |
| 52 | class ReceiveStatistics; |
wu@webrtc.org | 82c4b85 | 2014-05-20 22:55:01 +0000 | [diff] [blame] | 53 | class RemoteNtpTimeEstimator; |
tnakamura@webrtc.org | aa4d96a | 2013-07-16 19:25:04 +0000 | [diff] [blame] | 54 | class RtpDump; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 55 | class RTPPayloadRegistry; |
| 56 | class RtpReceiver; |
| 57 | class RTPReceiverAudio; |
| 58 | class RtpRtcp; |
| 59 | class TelephoneEventHandler; |
solenberg@webrtc.org | b1f5010 | 2014-03-24 10:38:25 +0000 | [diff] [blame] | 60 | class ViENetwork; |
tnakamura@webrtc.org | aa4d96a | 2013-07-16 19:25:04 +0000 | [diff] [blame] | 61 | class VoEMediaProcess; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 62 | class VoERTPObserver; |
| 63 | class VoiceEngineObserver; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 64 | |
| 65 | struct CallStatistics; |
henrika@webrtc.org | 8a2fc88 | 2012-08-22 08:53:55 +0000 | [diff] [blame] | 66 | struct ReportBlock; |
| 67 | struct SenderInfo; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 68 | |
andrew@webrtc.org | eb524d9 | 2013-09-23 23:02:24 +0000 | [diff] [blame] | 69 | namespace voe { |
| 70 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 71 | class Statistics; |
sprang@webrtc.org | 54ae4ff | 2013-12-19 13:26:02 +0000 | [diff] [blame] | 72 | class StatisticsProxy; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 73 | class TransmitMixer; |
| 74 | class OutputMixer; |
| 75 | |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 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), |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 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; |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 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 | |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 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 | }; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 154 | |
| 155 | class Channel: |
| 156 | public RtpData, |
| 157 | public RtpFeedback, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 158 | public FileCallback, // receiving notification from file player & recorder |
| 159 | public Transport, |
| 160 | public RtpAudioFeedback, |
| 161 | public AudioPacketizationCallback, // receive encoded packets from the ACM |
| 162 | public ACMVADCallback, // receive voice activity from the ACM |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 163 | public MixerParticipant // supplies output mixer with audio frames |
| 164 | { |
| 165 | public: |
| 166 | enum {KNumSocketThreads = 1}; |
| 167 | enum {KNumberOfSocketBuffers = 8}; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 168 | virtual ~Channel(); |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 169 | static int32_t CreateChannel(Channel*& channel, |
pbos@webrtc.org | 9213521 | 2013-05-14 08:31:39 +0000 | [diff] [blame] | 170 | int32_t channelId, |
minyue@webrtc.org | e509f94 | 2013-09-12 17:03:00 +0000 | [diff] [blame] | 171 | uint32_t instanceId, |
| 172 | const Config& config); |
| 173 | Channel(int32_t channelId, uint32_t instanceId, const Config& config); |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 174 | int32_t Init(); |
| 175 | int32_t SetEngineInformation( |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 176 | Statistics& engineStatistics, |
| 177 | OutputMixer& outputMixer, |
| 178 | TransmitMixer& transmitMixer, |
| 179 | ProcessThread& moduleProcessThread, |
| 180 | AudioDeviceModule& audioDeviceModule, |
| 181 | VoiceEngineObserver* voiceEngineObserver, |
| 182 | CriticalSectionWrapper* callbackCritSect); |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 183 | int32_t UpdateLocalTimeStamp(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 184 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 185 | // API methods |
| 186 | |
| 187 | // VoEBase |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 188 | int32_t StartPlayout(); |
| 189 | int32_t StopPlayout(); |
| 190 | int32_t StartSend(); |
| 191 | int32_t StopSend(); |
| 192 | int32_t StartReceiving(); |
| 193 | int32_t StopReceiving(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 194 | |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 195 | int32_t RegisterVoiceEngineObserver(VoiceEngineObserver& observer); |
| 196 | int32_t DeRegisterVoiceEngineObserver(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 197 | |
| 198 | // VoECodec |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 199 | int32_t GetSendCodec(CodecInst& codec); |
| 200 | int32_t GetRecCodec(CodecInst& codec); |
| 201 | int32_t SetSendCodec(const CodecInst& codec); |
| 202 | int32_t SetVADStatus(bool enableVAD, ACMVADMode mode, bool disableDTX); |
| 203 | int32_t GetVADStatus(bool& enabledVAD, ACMVADMode& mode, bool& disabledDTX); |
| 204 | int32_t SetRecPayloadType(const CodecInst& codec); |
| 205 | int32_t GetRecPayloadType(CodecInst& codec); |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 206 | int32_t SetSendCNPayloadType(int type, PayloadFrequencies frequency); |
minyue@webrtc.org | adee8f9 | 2014-09-03 12:28:06 +0000 | [diff] [blame] | 207 | int SetOpusMaxPlaybackRate(int frequency_hz); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 208 | |
turaj@webrtc.org | 42259e7 | 2012-12-11 02:15:12 +0000 | [diff] [blame] | 209 | // VoE dual-streaming. |
| 210 | int SetSecondarySendCodec(const CodecInst& codec, int red_payload_type); |
| 211 | void RemoveSecondarySendCodec(); |
| 212 | int GetSecondarySendCodec(CodecInst* codec); |
| 213 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 214 | // VoENetwork |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 215 | int32_t RegisterExternalTransport(Transport& transport); |
| 216 | int32_t DeRegisterExternalTransport(); |
pkasting@chromium.org | 4591fbd | 2014-11-20 22:28:14 +0000 | [diff] [blame] | 217 | int32_t ReceivedRTPPacket(const int8_t* data, size_t length, |
solenberg@webrtc.org | b1f5010 | 2014-03-24 10:38:25 +0000 | [diff] [blame] | 218 | const PacketTime& packet_time); |
pkasting@chromium.org | 4591fbd | 2014-11-20 22:28:14 +0000 | [diff] [blame] | 219 | int32_t ReceivedRTCPPacket(const int8_t* data, size_t length); |
pwestin@webrtc.org | 684f057 | 2013-03-13 23:20:57 +0000 | [diff] [blame] | 220 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 221 | // VoEFile |
pbos@webrtc.org | 9213521 | 2013-05-14 08:31:39 +0000 | [diff] [blame] | 222 | int StartPlayingFileLocally(const char* fileName, bool loop, |
| 223 | FileFormats format, |
| 224 | int startPosition, |
| 225 | float volumeScaling, |
| 226 | int stopPosition, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 227 | const CodecInst* codecInst); |
pbos@webrtc.org | 9213521 | 2013-05-14 08:31:39 +0000 | [diff] [blame] | 228 | int StartPlayingFileLocally(InStream* stream, FileFormats format, |
| 229 | int startPosition, |
| 230 | float volumeScaling, |
| 231 | int stopPosition, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 232 | const CodecInst* codecInst); |
| 233 | int StopPlayingFileLocally(); |
| 234 | int IsPlayingFileLocally() const; |
braveyao@webrtc.org | ab12990 | 2012-06-04 03:26:39 +0000 | [diff] [blame] | 235 | int RegisterFilePlayingToMixer(); |
pbos@webrtc.org | 9213521 | 2013-05-14 08:31:39 +0000 | [diff] [blame] | 236 | int StartPlayingFileAsMicrophone(const char* fileName, bool loop, |
| 237 | FileFormats format, |
| 238 | int startPosition, |
| 239 | float volumeScaling, |
| 240 | int stopPosition, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 241 | const CodecInst* codecInst); |
| 242 | int StartPlayingFileAsMicrophone(InStream* stream, |
pbos@webrtc.org | 9213521 | 2013-05-14 08:31:39 +0000 | [diff] [blame] | 243 | FileFormats format, |
| 244 | int startPosition, |
| 245 | float volumeScaling, |
| 246 | int stopPosition, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 247 | const CodecInst* codecInst); |
| 248 | int StopPlayingFileAsMicrophone(); |
| 249 | int IsPlayingFileAsMicrophone() const; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 250 | int StartRecordingPlayout(const char* fileName, const CodecInst* codecInst); |
| 251 | int StartRecordingPlayout(OutStream* stream, const CodecInst* codecInst); |
| 252 | int StopRecordingPlayout(); |
| 253 | |
| 254 | void SetMixWithMicStatus(bool mix); |
| 255 | |
| 256 | // VoEExternalMediaProcessing |
| 257 | int RegisterExternalMediaProcessing(ProcessingTypes type, |
| 258 | VoEMediaProcess& processObject); |
| 259 | int DeRegisterExternalMediaProcessing(ProcessingTypes type); |
roosa@google.com | 1b60ceb | 2012-12-12 23:00:29 +0000 | [diff] [blame] | 260 | int SetExternalMixing(bool enabled); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 261 | |
| 262 | // VoEVolumeControl |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 263 | int GetSpeechOutputLevel(uint32_t& level) const; |
| 264 | int GetSpeechOutputLevelFullRange(uint32_t& level) const; |
pbos@webrtc.org | 9213521 | 2013-05-14 08:31:39 +0000 | [diff] [blame] | 265 | int SetMute(bool enable); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 266 | bool Mute() const; |
| 267 | int SetOutputVolumePan(float left, float right); |
| 268 | int GetOutputVolumePan(float& left, float& right) const; |
| 269 | int SetChannelOutputVolumeScaling(float scaling); |
| 270 | int GetChannelOutputVolumeScaling(float& scaling) const; |
| 271 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 272 | // VoENetEqStats |
| 273 | int GetNetworkStatistics(NetworkStatistics& stats); |
wu@webrtc.org | 24301a6 | 2013-12-13 19:17:43 +0000 | [diff] [blame] | 274 | void GetDecodingCallStatistics(AudioDecodingCallStats* stats) const; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 275 | |
| 276 | // VoEVideoSync |
pwestin@webrtc.org | 1de0135 | 2013-04-11 20:23:35 +0000 | [diff] [blame] | 277 | bool GetDelayEstimate(int* jitter_buffer_delay_ms, |
| 278 | int* playout_buffer_delay_ms) const; |
turaj@webrtc.org | e46c8d3 | 2013-05-22 20:39:43 +0000 | [diff] [blame] | 279 | int least_required_delay_ms() const { return least_required_delay_ms_; } |
turaj@webrtc.org | 6388c3e | 2013-02-12 21:42:18 +0000 | [diff] [blame] | 280 | int SetInitialPlayoutDelay(int delay_ms); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 281 | int SetMinimumPlayoutDelay(int delayMs); |
| 282 | int GetPlayoutTimestamp(unsigned int& timestamp); |
pwestin@webrtc.org | 1de0135 | 2013-04-11 20:23:35 +0000 | [diff] [blame] | 283 | void UpdatePlayoutTimestamp(bool rtcp); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 284 | int SetInitTimestamp(unsigned int timestamp); |
| 285 | int SetInitSequenceNumber(short sequenceNumber); |
| 286 | |
| 287 | // VoEVideoSyncExtended |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 288 | int GetRtpRtcp(RtpRtcp** rtpRtcpModule, RtpReceiver** rtp_receiver) const; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 289 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 290 | // VoEDtmf |
| 291 | int SendTelephoneEventOutband(unsigned char eventCode, int lengthMs, |
| 292 | int attenuationDb, bool playDtmfEvent); |
| 293 | int SendTelephoneEventInband(unsigned char eventCode, int lengthMs, |
| 294 | int attenuationDb, bool playDtmfEvent); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 295 | int SetSendTelephoneEventPayloadType(unsigned char type); |
| 296 | int GetSendTelephoneEventPayloadType(unsigned char& type); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 297 | |
| 298 | // VoEAudioProcessingImpl |
| 299 | int UpdateRxVadDetection(AudioFrame& audioFrame); |
| 300 | int RegisterRxVadObserver(VoERxVadCallback &observer); |
| 301 | int DeRegisterRxVadObserver(); |
| 302 | int VoiceActivityIndicator(int &activity); |
| 303 | #ifdef WEBRTC_VOICE_ENGINE_AGC |
pbos@webrtc.org | 9213521 | 2013-05-14 08:31:39 +0000 | [diff] [blame] | 304 | int SetRxAgcStatus(bool enable, AgcModes mode); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 305 | int GetRxAgcStatus(bool& enabled, AgcModes& mode); |
pbos@webrtc.org | 9213521 | 2013-05-14 08:31:39 +0000 | [diff] [blame] | 306 | int SetRxAgcConfig(AgcConfig config); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 307 | int GetRxAgcConfig(AgcConfig& config); |
| 308 | #endif |
| 309 | #ifdef WEBRTC_VOICE_ENGINE_NR |
pbos@webrtc.org | 9213521 | 2013-05-14 08:31:39 +0000 | [diff] [blame] | 310 | int SetRxNsStatus(bool enable, NsModes mode); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 311 | int GetRxNsStatus(bool& enabled, NsModes& mode); |
| 312 | #endif |
| 313 | |
| 314 | // VoERTP_RTCP |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 315 | int SetLocalSSRC(unsigned int ssrc); |
| 316 | int GetLocalSSRC(unsigned int& ssrc); |
| 317 | int GetRemoteSSRC(unsigned int& ssrc); |
wu@webrtc.org | ebdb0e3 | 2014-03-06 23:49:08 +0000 | [diff] [blame] | 318 | int SetSendAudioLevelIndicationStatus(bool enable, unsigned char id); |
wu@webrtc.org | 93fd25c | 2014-04-24 20:33:08 +0000 | [diff] [blame] | 319 | int SetReceiveAudioLevelIndicationStatus(bool enable, unsigned char id); |
wu@webrtc.org | ebdb0e3 | 2014-03-06 23:49:08 +0000 | [diff] [blame] | 320 | int SetSendAbsoluteSenderTimeStatus(bool enable, unsigned char id); |
| 321 | int SetReceiveAbsoluteSenderTimeStatus(bool enable, unsigned char id); |
pbos@webrtc.org | d16e839 | 2014-12-19 13:49:55 +0000 | [diff] [blame^] | 322 | void SetRTCPStatus(bool enable); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 323 | int GetRTCPStatus(bool& enabled); |
| 324 | int SetRTCP_CNAME(const char cName[256]); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 325 | int GetRemoteRTCP_CNAME(char cName[256]); |
| 326 | int GetRemoteRTCPData(unsigned int& NTPHigh, unsigned int& NTPLow, |
| 327 | unsigned int& timestamp, |
| 328 | unsigned int& playoutTimestamp, unsigned int* jitter, |
| 329 | unsigned short* fractionLost); |
pbos@webrtc.org | 9213521 | 2013-05-14 08:31:39 +0000 | [diff] [blame] | 330 | int SendApplicationDefinedRTCPPacket(unsigned char subType, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 331 | unsigned int name, const char* data, |
| 332 | unsigned short dataLengthInBytes); |
| 333 | int GetRTPStatistics(unsigned int& averageJitterMs, |
| 334 | unsigned int& maxJitterMs, |
| 335 | unsigned int& discardedPackets); |
henrika@webrtc.org | 8a2fc88 | 2012-08-22 08:53:55 +0000 | [diff] [blame] | 336 | int GetRemoteRTCPReportBlocks(std::vector<ReportBlock>* report_blocks); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 337 | int GetRTPStatistics(CallStatistics& stats); |
minyue@webrtc.org | c1a40a7 | 2014-05-28 09:52:06 +0000 | [diff] [blame] | 338 | int SetREDStatus(bool enable, int redPayloadtype); |
| 339 | int GetREDStatus(bool& enabled, int& redPayloadtype); |
| 340 | int SetCodecFECStatus(bool enable); |
| 341 | bool GetCodecFECStatus(); |
pwestin@webrtc.org | db24995 | 2013-06-05 15:33:20 +0000 | [diff] [blame] | 342 | void SetNACKStatus(bool enable, int maxNumberOfPackets); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 343 | int StartRTPDump(const char fileNameUTF8[1024], RTPDirections direction); |
| 344 | int StopRTPDump(RTPDirections direction); |
| 345 | bool RTPDumpIsActive(RTPDirections direction); |
solenberg@webrtc.org | b1f5010 | 2014-03-24 10:38:25 +0000 | [diff] [blame] | 346 | // Takes ownership of the ViENetwork. |
| 347 | void SetVideoEngineBWETarget(ViENetwork* vie_network, int video_channel); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 348 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 349 | // From AudioPacketizationCallback in the ACM |
xians@webrtc.org | 3cefbc9 | 2014-10-10 09:42:53 +0000 | [diff] [blame] | 350 | virtual int32_t SendData( |
| 351 | FrameType frameType, |
| 352 | uint8_t payloadType, |
| 353 | uint32_t timeStamp, |
| 354 | const uint8_t* payloadData, |
pkasting@chromium.org | 4591fbd | 2014-11-20 22:28:14 +0000 | [diff] [blame] | 355 | size_t payloadSize, |
xians@webrtc.org | 3cefbc9 | 2014-10-10 09:42:53 +0000 | [diff] [blame] | 356 | const RTPFragmentationHeader* fragmentation) OVERRIDE; |
| 357 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 358 | // From ACMVADCallback in the ACM |
xians@webrtc.org | 3cefbc9 | 2014-10-10 09:42:53 +0000 | [diff] [blame] | 359 | virtual int32_t InFrameType(int16_t frameType) OVERRIDE; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 360 | |
pbos@webrtc.org | 9213521 | 2013-05-14 08:31:39 +0000 | [diff] [blame] | 361 | int32_t OnRxVadDetected(int vadDecision); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 362 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 363 | // From RtpData in the RTP/RTCP module |
xians@webrtc.org | 3cefbc9 | 2014-10-10 09:42:53 +0000 | [diff] [blame] | 364 | virtual int32_t OnReceivedPayloadData( |
| 365 | const uint8_t* payloadData, |
pkasting@chromium.org | 4591fbd | 2014-11-20 22:28:14 +0000 | [diff] [blame] | 366 | size_t payloadSize, |
xians@webrtc.org | 3cefbc9 | 2014-10-10 09:42:53 +0000 | [diff] [blame] | 367 | const WebRtcRTPHeader* rtpHeader) OVERRIDE; |
| 368 | virtual bool OnRecoveredPacket(const uint8_t* packet, |
pkasting@chromium.org | 4591fbd | 2014-11-20 22:28:14 +0000 | [diff] [blame] | 369 | size_t packet_length) OVERRIDE; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 370 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 371 | // From RtpFeedback in the RTP/RTCP module |
xians@webrtc.org | 3cefbc9 | 2014-10-10 09:42:53 +0000 | [diff] [blame] | 372 | virtual int32_t OnInitializeDecoder( |
| 373 | int32_t id, |
| 374 | int8_t payloadType, |
| 375 | const char payloadName[RTP_PAYLOAD_NAME_SIZE], |
| 376 | int frequency, |
| 377 | uint8_t channels, |
| 378 | uint32_t rate) OVERRIDE; |
| 379 | virtual void OnIncomingSSRCChanged(int32_t id, |
| 380 | uint32_t ssrc) OVERRIDE; |
| 381 | virtual void OnIncomingCSRCChanged(int32_t id, |
| 382 | uint32_t CSRC, bool added) OVERRIDE; |
| 383 | virtual void ResetStatistics(uint32_t ssrc) OVERRIDE; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 384 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 385 | // From RtpAudioFeedback in the RTP/RTCP module |
xians@webrtc.org | 3cefbc9 | 2014-10-10 09:42:53 +0000 | [diff] [blame] | 386 | virtual void OnPlayTelephoneEvent(int32_t id, |
| 387 | uint8_t event, |
| 388 | uint16_t lengthMs, |
| 389 | uint8_t volume) OVERRIDE; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 390 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 391 | // From Transport (called by the RTP/RTCP module) |
pkasting@chromium.org | 4591fbd | 2014-11-20 22:28:14 +0000 | [diff] [blame] | 392 | virtual int SendPacket(int /*channel*/, |
| 393 | const void *data, |
| 394 | size_t len) OVERRIDE; |
xians@webrtc.org | 3cefbc9 | 2014-10-10 09:42:53 +0000 | [diff] [blame] | 395 | virtual int SendRTCPPacket(int /*channel*/, |
| 396 | const void *data, |
pkasting@chromium.org | 4591fbd | 2014-11-20 22:28:14 +0000 | [diff] [blame] | 397 | size_t len) OVERRIDE; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 398 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 399 | // From MixerParticipant |
xians@webrtc.org | 3cefbc9 | 2014-10-10 09:42:53 +0000 | [diff] [blame] | 400 | virtual int32_t GetAudioFrame(int32_t id, AudioFrame& audioFrame) OVERRIDE; |
| 401 | virtual int32_t NeededFrequency(int32_t id) OVERRIDE; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 402 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 403 | // From FileCallback |
xians@webrtc.org | 3cefbc9 | 2014-10-10 09:42:53 +0000 | [diff] [blame] | 404 | virtual void PlayNotification(int32_t id, uint32_t durationMs) OVERRIDE; |
| 405 | virtual void RecordNotification(int32_t id, uint32_t durationMs) OVERRIDE; |
| 406 | virtual void PlayFileEnded(int32_t id) OVERRIDE; |
| 407 | virtual void RecordFileEnded(int32_t id) OVERRIDE; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 408 | |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 409 | uint32_t InstanceId() const |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 410 | { |
| 411 | return _instanceId; |
xians@webrtc.org | e07247a | 2011-11-28 16:31:28 +0000 | [diff] [blame] | 412 | } |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 413 | int32_t ChannelId() const |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 414 | { |
| 415 | return _channelId; |
xians@webrtc.org | e07247a | 2011-11-28 16:31:28 +0000 | [diff] [blame] | 416 | } |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 417 | bool Playing() const |
| 418 | { |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 419 | return channel_state_.Get().playing; |
xians@webrtc.org | e07247a | 2011-11-28 16:31:28 +0000 | [diff] [blame] | 420 | } |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 421 | bool Sending() const |
| 422 | { |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 423 | return channel_state_.Get().sending; |
xians@webrtc.org | e07247a | 2011-11-28 16:31:28 +0000 | [diff] [blame] | 424 | } |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 425 | bool Receiving() const |
| 426 | { |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 427 | return channel_state_.Get().receiving; |
xians@webrtc.org | e07247a | 2011-11-28 16:31:28 +0000 | [diff] [blame] | 428 | } |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 429 | bool ExternalTransport() const |
| 430 | { |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 431 | CriticalSectionScoped cs(&_callbackCritSect); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 432 | return _externalTransport; |
xians@webrtc.org | e07247a | 2011-11-28 16:31:28 +0000 | [diff] [blame] | 433 | } |
roosa@google.com | 1b60ceb | 2012-12-12 23:00:29 +0000 | [diff] [blame] | 434 | bool ExternalMixing() const |
| 435 | { |
| 436 | return _externalMixing; |
| 437 | } |
andrew@webrtc.org | f81f9f8 | 2011-08-19 22:56:22 +0000 | [diff] [blame] | 438 | RtpRtcp* RtpRtcpModulePtr() const |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 439 | { |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 440 | return _rtpRtcpModule.get(); |
xians@webrtc.org | e07247a | 2011-11-28 16:31:28 +0000 | [diff] [blame] | 441 | } |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 442 | int8_t OutputEnergyLevel() const |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 443 | { |
| 444 | return _outputAudioLevel.Level(); |
xians@webrtc.org | e07247a | 2011-11-28 16:31:28 +0000 | [diff] [blame] | 445 | } |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 446 | uint32_t Demultiplex(const AudioFrame& audioFrame); |
xians@webrtc.org | 2f84afa | 2013-07-31 16:23:37 +0000 | [diff] [blame] | 447 | // Demultiplex the data to the channel's |_audioFrame|. The difference |
| 448 | // between this method and the overloaded method above is that |audio_data| |
| 449 | // does not go through transmit_mixer and APM. |
| 450 | void Demultiplex(const int16_t* audio_data, |
xians@webrtc.org | 8fff1f0 | 2013-07-31 16:27:42 +0000 | [diff] [blame] | 451 | int sample_rate, |
xians@webrtc.org | 2f84afa | 2013-07-31 16:23:37 +0000 | [diff] [blame] | 452 | int number_of_frames, |
xians@webrtc.org | 8fff1f0 | 2013-07-31 16:27:42 +0000 | [diff] [blame] | 453 | int number_of_channels); |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 454 | uint32_t PrepareEncodeAndSend(int mixingFrequency); |
| 455 | uint32_t EncodeAndSend(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 456 | |
minyue@webrtc.org | c1a40a7 | 2014-05-28 09:52:06 +0000 | [diff] [blame] | 457 | // From BitrateObserver (called by the RTP/RTCP module). |
| 458 | void OnNetworkChanged(const uint32_t bitrate_bps, |
| 459 | const uint8_t fraction_lost, // 0 - 255. |
| 460 | const uint32_t rtt); |
| 461 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 462 | private: |
pkasting@chromium.org | 4591fbd | 2014-11-20 22:28:14 +0000 | [diff] [blame] | 463 | bool ReceivePacket(const uint8_t* packet, size_t packet_length, |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 464 | const RTPHeader& header, bool in_order); |
| 465 | bool HandleEncapsulation(const uint8_t* packet, |
pkasting@chromium.org | 4591fbd | 2014-11-20 22:28:14 +0000 | [diff] [blame] | 466 | size_t packet_length, |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 467 | const RTPHeader& header); |
| 468 | bool IsPacketInOrder(const RTPHeader& header) const; |
stefan@webrtc.org | 48df381 | 2013-11-08 15:18:52 +0000 | [diff] [blame] | 469 | bool IsPacketRetransmitted(const RTPHeader& header, bool in_order) const; |
andrew@webrtc.org | da71044 | 2013-06-07 01:43:12 +0000 | [diff] [blame] | 470 | int ResendPackets(const uint16_t* sequence_numbers, int length); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 471 | int InsertInbandDtmfTone(); |
pbos@webrtc.org | 9213521 | 2013-05-14 08:31:39 +0000 | [diff] [blame] | 472 | int32_t MixOrReplaceAudioWithFile(int mixingFrequency); |
| 473 | int32_t MixAudioWithFile(AudioFrame& audioFrame, int mixingFrequency); |
pkasting@chromium.org | 4591fbd | 2014-11-20 22:28:14 +0000 | [diff] [blame] | 474 | int32_t SendPacketRaw(const void *data, size_t len, bool RTCP); |
pwestin@webrtc.org | 1de0135 | 2013-04-11 20:23:35 +0000 | [diff] [blame] | 475 | void UpdatePacketDelay(uint32_t timestamp, |
| 476 | uint16_t sequenceNumber); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 477 | void RegisterReceiveCodecsToRTPModule(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 478 | |
turaj@webrtc.org | 42259e7 | 2012-12-11 02:15:12 +0000 | [diff] [blame] | 479 | int SetRedPayloadType(int red_payload_type); |
wu@webrtc.org | ebdb0e3 | 2014-03-06 23:49:08 +0000 | [diff] [blame] | 480 | int SetSendRtpHeaderExtension(bool enable, RTPExtensionType type, |
| 481 | unsigned char id); |
andrew@webrtc.org | eb524d9 | 2013-09-23 23:02:24 +0000 | [diff] [blame] | 482 | |
wu@webrtc.org | 94454b7 | 2014-06-05 20:34:08 +0000 | [diff] [blame] | 483 | int32_t GetPlayoutFrequency(); |
minyue@webrtc.org | 2b58a44 | 2014-09-11 07:51:53 +0000 | [diff] [blame] | 484 | int GetRTT() const; |
wu@webrtc.org | 94454b7 | 2014-06-05 20:34:08 +0000 | [diff] [blame] | 485 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 486 | CriticalSectionWrapper& _fileCritSect; |
| 487 | CriticalSectionWrapper& _callbackCritSect; |
wu@webrtc.org | 6342066 | 2013-10-17 18:28:55 +0000 | [diff] [blame] | 488 | CriticalSectionWrapper& volume_settings_critsect_; |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 489 | uint32_t _instanceId; |
| 490 | int32_t _channelId; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 491 | |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 492 | ChannelState channel_state_; |
| 493 | |
stefan@webrtc.org | a5cb98c | 2013-05-29 12:12:51 +0000 | [diff] [blame] | 494 | scoped_ptr<RtpHeaderParser> rtp_header_parser_; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 495 | scoped_ptr<RTPPayloadRegistry> rtp_payload_registry_; |
| 496 | scoped_ptr<ReceiveStatistics> rtp_receive_statistics_; |
sprang@webrtc.org | 54ae4ff | 2013-12-19 13:26:02 +0000 | [diff] [blame] | 497 | scoped_ptr<StatisticsProxy> statistics_proxy_; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 498 | scoped_ptr<RtpReceiver> rtp_receiver_; |
| 499 | TelephoneEventHandler* telephone_event_handler_; |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 500 | scoped_ptr<RtpRtcp> _rtpRtcpModule; |
andrew@webrtc.org | eb524d9 | 2013-09-23 23:02:24 +0000 | [diff] [blame] | 501 | scoped_ptr<AudioCodingModule> audio_coding_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 502 | RtpDump& _rtpDumpIn; |
| 503 | RtpDump& _rtpDumpOut; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 504 | AudioLevel _outputAudioLevel; |
| 505 | bool _externalTransport; |
| 506 | AudioFrame _audioFrame; |
andrew@webrtc.org | 40ee3d0 | 2014-04-03 21:56:01 +0000 | [diff] [blame] | 507 | scoped_ptr<int16_t[]> mono_recording_audio_; |
andrew@webrtc.org | f5a33f1 | 2014-04-19 00:32:07 +0000 | [diff] [blame] | 508 | // Downsamples to the codec rate if necessary. |
| 509 | PushResampler<int16_t> input_resampler_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 510 | FilePlayer* _inputFilePlayerPtr; |
| 511 | FilePlayer* _outputFilePlayerPtr; |
| 512 | FileRecorder* _outputFileRecorderPtr; |
xians@google.com | 0b0665a | 2011-08-08 08:18:44 +0000 | [diff] [blame] | 513 | int _inputFilePlayerId; |
| 514 | int _outputFilePlayerId; |
| 515 | int _outputFileRecorderId; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 516 | bool _outputFileRecording; |
| 517 | DtmfInbandQueue _inbandDtmfQueue; |
| 518 | DtmfInband _inbandDtmfGenerator; |
xians@google.com | 22963ab | 2011-08-03 12:40:23 +0000 | [diff] [blame] | 519 | bool _outputExternalMedia; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 520 | VoEMediaProcess* _inputExternalMediaCallbackPtr; |
| 521 | VoEMediaProcess* _outputExternalMediaCallbackPtr; |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 522 | uint32_t _timeStamp; |
| 523 | uint8_t _sendTelephoneEventPayloadType; |
turaj@webrtc.org | 167b6df | 2013-12-13 21:05:07 +0000 | [diff] [blame] | 524 | |
stefan@webrtc.org | 8e24d87 | 2014-09-02 18:58:24 +0000 | [diff] [blame] | 525 | RemoteNtpTimeEstimator ntp_estimator_ GUARDED_BY(ts_stats_lock_); |
wu@webrtc.org | 82c4b85 | 2014-05-20 22:55:01 +0000 | [diff] [blame] | 526 | |
turaj@webrtc.org | 167b6df | 2013-12-13 21:05:07 +0000 | [diff] [blame] | 527 | // Timestamp of the audio pulled from NetEq. |
| 528 | uint32_t jitter_buffer_playout_timestamp_; |
pwestin@webrtc.org | 1de0135 | 2013-04-11 20:23:35 +0000 | [diff] [blame] | 529 | uint32_t playout_timestamp_rtp_; |
| 530 | uint32_t playout_timestamp_rtcp_; |
| 531 | uint32_t playout_delay_ms_; |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 532 | uint32_t _numberOfDiscardedPackets; |
xians@webrtc.org | 09e8c47 | 2013-07-31 16:30:19 +0000 | [diff] [blame] | 533 | uint16_t send_sequence_number_; |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 534 | uint8_t restored_packet_[kVoiceEngineMaxIpPacketSizeBytes]; |
pwestin@webrtc.org | 1de0135 | 2013-04-11 20:23:35 +0000 | [diff] [blame] | 535 | |
wu@webrtc.org | cb711f7 | 2014-05-19 17:39:11 +0000 | [diff] [blame] | 536 | scoped_ptr<CriticalSectionWrapper> ts_stats_lock_; |
| 537 | |
wu@webrtc.org | 94454b7 | 2014-06-05 20:34:08 +0000 | [diff] [blame] | 538 | scoped_ptr<rtc::TimestampWrapAroundHandler> rtp_ts_wraparound_handler_; |
wu@webrtc.org | cb711f7 | 2014-05-19 17:39:11 +0000 | [diff] [blame] | 539 | // The rtp timestamp of the first played out audio frame. |
wu@webrtc.org | 94454b7 | 2014-06-05 20:34:08 +0000 | [diff] [blame] | 540 | int64_t capture_start_rtp_time_stamp_; |
wu@webrtc.org | cb711f7 | 2014-05-19 17:39:11 +0000 | [diff] [blame] | 541 | // The capture ntp time (in local timebase) of the first played out audio |
| 542 | // frame. |
stefan@webrtc.org | 8e24d87 | 2014-09-02 18:58:24 +0000 | [diff] [blame] | 543 | int64_t capture_start_ntp_time_ms_ GUARDED_BY(ts_stats_lock_); |
wu@webrtc.org | cb711f7 | 2014-05-19 17:39:11 +0000 | [diff] [blame] | 544 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 545 | // uses |
| 546 | Statistics* _engineStatisticsPtr; |
| 547 | OutputMixer* _outputMixerPtr; |
| 548 | TransmitMixer* _transmitMixerPtr; |
| 549 | ProcessThread* _moduleProcessThreadPtr; |
| 550 | AudioDeviceModule* _audioDeviceModulePtr; |
| 551 | VoiceEngineObserver* _voiceEngineObserverPtr; // owned by base |
| 552 | CriticalSectionWrapper* _callbackCritSectPtr; // owned by base |
| 553 | Transport* _transportPtr; // WebRtc socket or external transport |
andrew@webrtc.org | 382c0c2 | 2014-05-05 18:22:21 +0000 | [diff] [blame] | 554 | RMSLevel rms_level_; |
andrew@webrtc.org | f3930e9 | 2013-09-18 22:37:32 +0000 | [diff] [blame] | 555 | scoped_ptr<AudioProcessing> rx_audioproc_; // far end AudioProcessing |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 556 | VoERxVadCallback* _rxVadObserverPtr; |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 557 | int32_t _oldVadDecision; |
| 558 | int32_t _sendFrameType; // Send data is voice, 1-voice, 0-otherwise |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 559 | // VoEBase |
roosa@google.com | 1b60ceb | 2012-12-12 23:00:29 +0000 | [diff] [blame] | 560 | bool _externalMixing; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 561 | bool _mixFileWithMicrophone; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 562 | // VoEVolumeControl |
| 563 | bool _mute; |
| 564 | float _panLeft; |
| 565 | float _panRight; |
| 566 | float _outputGain; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 567 | // VoEDtmf |
| 568 | bool _playOutbandDtmfEvent; |
| 569 | bool _playInbandDtmfEvent; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 570 | // VoeRTP_RTCP |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 571 | uint32_t _lastLocalTimeStamp; |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 572 | int8_t _lastPayloadType; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 573 | bool _includeAudioLevelIndication; |
| 574 | // VoENetwork |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 575 | AudioFrame::SpeechType _outputSpeechType; |
solenberg@webrtc.org | b1f5010 | 2014-03-24 10:38:25 +0000 | [diff] [blame] | 576 | ViENetwork* vie_network_; |
| 577 | int video_channel_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 578 | // VoEVideoSync |
pwestin@webrtc.org | 1de0135 | 2013-04-11 20:23:35 +0000 | [diff] [blame] | 579 | uint32_t _average_jitter_buffer_delay_us; |
turaj@webrtc.org | e46c8d3 | 2013-05-22 20:39:43 +0000 | [diff] [blame] | 580 | int least_required_delay_ms_; |
pbos@webrtc.org | 6141e13 | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 581 | uint32_t _previousTimestamp; |
| 582 | uint16_t _recPacketDelayMs; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 583 | // VoEAudioProcessing |
| 584 | bool _RxVadDetection; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 585 | bool _rxAgcIsEnabled; |
| 586 | bool _rxNsIsEnabled; |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 587 | bool restored_packet_in_use_; |
minyue@webrtc.org | c1a40a7 | 2014-05-28 09:52:06 +0000 | [diff] [blame] | 588 | // RtcpBandwidthObserver |
| 589 | scoped_ptr<BitrateController> bitrate_controller_; |
| 590 | scoped_ptr<RtcpBandwidthObserver> rtcp_bandwidth_observer_; |
| 591 | scoped_ptr<BitrateObserver> send_bitrate_observer_; |
minyue@webrtc.org | 74aaf29 | 2014-07-16 21:28:26 +0000 | [diff] [blame] | 592 | scoped_ptr<NetworkPredictor> network_predictor_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 593 | }; |
| 594 | |
pbos@webrtc.org | d900e8b | 2013-07-03 15:12:26 +0000 | [diff] [blame] | 595 | } // namespace voe |
pbos@webrtc.org | d900e8b | 2013-07-03 15:12:26 +0000 | [diff] [blame] | 596 | } // namespace webrtc |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 597 | |
andrew@webrtc.org | 382c0c2 | 2014-05-05 18:22:21 +0000 | [diff] [blame] | 598 | #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ |