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 | |
kwiberg | b7f89d6 | 2016-02-17 10:04:18 -0800 | [diff] [blame] | 14 | #include <memory> |
| 15 | |
kjellander@webrtc.org | 7ffeab5 | 2016-02-26 22:46:09 +0100 | [diff] [blame] | 16 | #include "webrtc/audio_sink.h" |
Stefan Holmer | b86d4e4 | 2015-12-07 10:26:18 +0100 | [diff] [blame] | 17 | #include "webrtc/base/criticalsection.h" |
henrik.lundin | 96bd502 | 2016-04-06 04:13:56 -0700 | [diff] [blame] | 18 | #include "webrtc/base/optional.h" |
xians@webrtc.org | 2f84afa | 2013-07-31 16:23:37 +0000 | [diff] [blame] | 19 | #include "webrtc/common_audio/resampler/include/push_resampler.h" |
turaj@webrtc.org | 6388c3e | 2013-02-12 21:42:18 +0000 | [diff] [blame] | 20 | #include "webrtc/common_types.h" |
kwiberg | c8d071e | 2016-04-06 12:22:38 -0700 | [diff] [blame] | 21 | #include "webrtc/modules/audio_coding/acm2/codec_manager.h" |
| 22 | #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h" |
kjellander | 3e6db23 | 2015-11-26 04:44:54 -0800 | [diff] [blame] | 23 | #include "webrtc/modules/audio_coding/include/audio_coding_module.h" |
Henrik Kjellander | ff761fb | 2015-11-04 08:31:52 +0100 | [diff] [blame] | 24 | #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_defines.h" |
andrew@webrtc.org | 382c0c2 | 2014-05-05 18:22:21 +0000 | [diff] [blame] | 25 | #include "webrtc/modules/audio_processing/rms_level.h" |
Henrik Kjellander | ff761fb | 2015-11-04 08:31:52 +0100 | [diff] [blame] | 26 | #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h" |
| 27 | #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" |
| 28 | #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" |
kwiberg | 9d7eb13 | 2016-08-16 04:08:30 -0700 | [diff] [blame^] | 29 | #include "webrtc/modules/utility/include/file_player.h" |
| 30 | #include "webrtc/modules/utility/include/file_recorder.h" |
turaj@webrtc.org | 6388c3e | 2013-02-12 21:42:18 +0000 | [diff] [blame] | 31 | #include "webrtc/voice_engine/include/voe_audio_processing.h" |
| 32 | #include "webrtc/voice_engine/include/voe_network.h" |
| 33 | #include "webrtc/voice_engine/level_indicator.h" |
minyue@webrtc.org | 74aaf29 | 2014-07-16 21:28:26 +0000 | [diff] [blame] | 34 | #include "webrtc/voice_engine/network_predictor.h" |
turaj@webrtc.org | 6388c3e | 2013-02-12 21:42:18 +0000 | [diff] [blame] | 35 | #include "webrtc/voice_engine/shared_data.h" |
| 36 | #include "webrtc/voice_engine/voice_engine_defines.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 37 | |
wu@webrtc.org | 94454b7 | 2014-06-05 20:34:08 +0000 | [diff] [blame] | 38 | namespace rtc { |
wu@webrtc.org | 94454b7 | 2014-06-05 20:34:08 +0000 | [diff] [blame] | 39 | class TimestampWrapAroundHandler; |
| 40 | } |
| 41 | |
andrew@webrtc.org | eb524d9 | 2013-09-23 23:02:24 +0000 | [diff] [blame] | 42 | namespace webrtc { |
| 43 | |
tnakamura@webrtc.org | aa4d96a | 2013-07-16 19:25:04 +0000 | [diff] [blame] | 44 | class AudioDeviceModule; |
minyue@webrtc.org | e509f94 | 2013-09-12 17:03:00 +0000 | [diff] [blame] | 45 | class Config; |
tnakamura@webrtc.org | aa4d96a | 2013-07-16 19:25:04 +0000 | [diff] [blame] | 46 | class FileWrapper; |
Stefan Holmer | b86d4e4 | 2015-12-07 10:26:18 +0100 | [diff] [blame] | 47 | class PacketRouter; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 48 | class ProcessThread; |
Erik Språng | 737336d | 2016-07-29 12:59:36 +0200 | [diff] [blame] | 49 | class RateLimiter; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 50 | class ReceiveStatistics; |
wu@webrtc.org | 82c4b85 | 2014-05-20 22:55:01 +0000 | [diff] [blame] | 51 | class RemoteNtpTimeEstimator; |
ivoc | b04965c | 2015-09-09 00:09:43 -0700 | [diff] [blame] | 52 | class RtcEventLog; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 53 | class RTPPayloadRegistry; |
| 54 | class RtpReceiver; |
| 55 | class RTPReceiverAudio; |
| 56 | class RtpRtcp; |
| 57 | class TelephoneEventHandler; |
tnakamura@webrtc.org | aa4d96a | 2013-07-16 19:25:04 +0000 | [diff] [blame] | 58 | class VoEMediaProcess; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 59 | class VoERTPObserver; |
| 60 | class VoiceEngineObserver; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 61 | |
| 62 | struct CallStatistics; |
henrika@webrtc.org | 8a2fc88 | 2012-08-22 08:53:55 +0000 | [diff] [blame] | 63 | struct ReportBlock; |
| 64 | struct SenderInfo; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 65 | |
andrew@webrtc.org | eb524d9 | 2013-09-23 23:02:24 +0000 | [diff] [blame] | 66 | namespace voe { |
| 67 | |
mflodman@webrtc.org | 0a7d4ee | 2015-02-17 12:57:14 +0000 | [diff] [blame] | 68 | class OutputMixer; |
ivoc | 14d5dbe | 2016-07-04 07:06:55 -0700 | [diff] [blame] | 69 | class RtcEventLogProxy; |
Stefan Holmer | b86d4e4 | 2015-12-07 10:26:18 +0100 | [diff] [blame] | 70 | class RtpPacketSenderProxy; |
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; |
Stefan Holmer | b86d4e4 | 2015-12-07 10:26:18 +0100 | [diff] [blame] | 73 | class TransportFeedbackProxy; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 74 | class TransmitMixer; |
Stefan Holmer | b86d4e4 | 2015-12-07 10:26:18 +0100 | [diff] [blame] | 75 | class TransportSequenceNumberProxy; |
mflodman@webrtc.org | 0a7d4ee | 2015-02-17 12:57:14 +0000 | [diff] [blame] | 76 | class VoERtcpObserver; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 77 | |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 78 | // Helper class to simplify locking scheme for members that are accessed from |
| 79 | // multiple threads. |
| 80 | // Example: a member can be set on thread T1 and read by an internal audio |
| 81 | // thread T2. Accessing the member via this class ensures that we are |
| 82 | // safe and also avoid TSan v2 warnings. |
| 83 | class ChannelState { |
| 84 | public: |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 85 | struct State { |
| 86 | State() |
| 87 | : rx_apm_is_enabled(false), |
| 88 | input_external_media(false), |
| 89 | output_file_playing(false), |
| 90 | input_file_playing(false), |
| 91 | playing(false), |
| 92 | sending(false), |
| 93 | receiving(false) {} |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 94 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 95 | bool rx_apm_is_enabled; |
| 96 | bool input_external_media; |
| 97 | bool output_file_playing; |
| 98 | bool input_file_playing; |
| 99 | bool playing; |
| 100 | bool sending; |
| 101 | bool receiving; |
| 102 | }; |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 103 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 104 | ChannelState() {} |
| 105 | virtual ~ChannelState() {} |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 106 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 107 | void Reset() { |
| 108 | rtc::CritScope lock(&lock_); |
| 109 | state_ = State(); |
| 110 | } |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 111 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 112 | State Get() const { |
| 113 | rtc::CritScope lock(&lock_); |
| 114 | return state_; |
| 115 | } |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 116 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 117 | void SetRxApmIsEnabled(bool enable) { |
| 118 | rtc::CritScope lock(&lock_); |
| 119 | state_.rx_apm_is_enabled = enable; |
| 120 | } |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 121 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 122 | void SetInputExternalMedia(bool enable) { |
| 123 | rtc::CritScope lock(&lock_); |
| 124 | state_.input_external_media = enable; |
| 125 | } |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 126 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 127 | void SetOutputFilePlaying(bool enable) { |
| 128 | rtc::CritScope lock(&lock_); |
| 129 | state_.output_file_playing = enable; |
| 130 | } |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 131 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 132 | void SetInputFilePlaying(bool enable) { |
| 133 | rtc::CritScope lock(&lock_); |
| 134 | state_.input_file_playing = enable; |
| 135 | } |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 136 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 137 | void SetPlaying(bool enable) { |
| 138 | rtc::CritScope lock(&lock_); |
| 139 | state_.playing = enable; |
| 140 | } |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 141 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 142 | void SetSending(bool enable) { |
| 143 | rtc::CritScope lock(&lock_); |
| 144 | state_.sending = enable; |
| 145 | } |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 146 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 147 | void SetReceiving(bool enable) { |
| 148 | rtc::CritScope lock(&lock_); |
| 149 | state_.receiving = enable; |
| 150 | } |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 151 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 152 | private: |
pbos | d8de115 | 2016-02-01 09:00:51 -0800 | [diff] [blame] | 153 | rtc::CriticalSection lock_; |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 154 | State state_; |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 155 | }; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 156 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 157 | class Channel |
| 158 | : public RtpData, |
| 159 | public RtpFeedback, |
| 160 | public FileCallback, // receiving notification from file player & |
| 161 | // recorder |
| 162 | public Transport, |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 163 | public AudioPacketizationCallback, // receive encoded packets from the |
| 164 | // ACM |
| 165 | public ACMVADCallback, // receive voice activity from the ACM |
| 166 | public MixerParticipant // supplies output mixer with audio frames |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 167 | { |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 168 | public: |
| 169 | friend class VoERtcpObserver; |
mflodman@webrtc.org | 0a7d4ee | 2015-02-17 12:57:14 +0000 | [diff] [blame] | 170 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 171 | enum { KNumSocketThreads = 1 }; |
| 172 | enum { KNumberOfSocketBuffers = 8 }; |
| 173 | virtual ~Channel(); |
| 174 | static int32_t CreateChannel(Channel*& channel, |
| 175 | int32_t channelId, |
| 176 | uint32_t instanceId, |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 177 | const Config& config); |
ossu | 5f7cfa5 | 2016-05-30 08:11:28 -0700 | [diff] [blame] | 178 | static int32_t CreateChannel( |
| 179 | Channel*& channel, |
| 180 | int32_t channelId, |
| 181 | uint32_t instanceId, |
ossu | 5f7cfa5 | 2016-05-30 08:11:28 -0700 | [diff] [blame] | 182 | const Config& config, |
| 183 | const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory); |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 184 | Channel(int32_t channelId, |
| 185 | uint32_t instanceId, |
ossu | 5f7cfa5 | 2016-05-30 08:11:28 -0700 | [diff] [blame] | 186 | const Config& config, |
| 187 | const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory); |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 188 | int32_t Init(); |
| 189 | int32_t SetEngineInformation(Statistics& engineStatistics, |
| 190 | OutputMixer& outputMixer, |
| 191 | TransmitMixer& transmitMixer, |
| 192 | ProcessThread& moduleProcessThread, |
| 193 | AudioDeviceModule& audioDeviceModule, |
| 194 | VoiceEngineObserver* voiceEngineObserver, |
| 195 | rtc::CriticalSection* callbackCritSect); |
| 196 | int32_t UpdateLocalTimeStamp(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 197 | |
kwiberg | b7f89d6 | 2016-02-17 10:04:18 -0800 | [diff] [blame] | 198 | void SetSink(std::unique_ptr<AudioSinkInterface> sink); |
Tommi | f888bb5 | 2015-12-12 01:37:01 +0100 | [diff] [blame] | 199 | |
ossu | 29b1a8d | 2016-06-13 07:34:51 -0700 | [diff] [blame] | 200 | // TODO(ossu): Don't use! It's only here to confirm that the decoder factory |
| 201 | // passed into AudioReceiveStream is the same as the one set when creating the |
| 202 | // ADM. Once Channel creation is moved into Audio{Send,Receive}Stream this can |
| 203 | // go. |
| 204 | const rtc::scoped_refptr<AudioDecoderFactory>& GetAudioDecoderFactory() const; |
| 205 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 206 | // API methods |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 207 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 208 | // VoEBase |
| 209 | int32_t StartPlayout(); |
| 210 | int32_t StopPlayout(); |
| 211 | int32_t StartSend(); |
| 212 | int32_t StopSend(); |
| 213 | int32_t StartReceiving(); |
| 214 | int32_t StopReceiving(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 215 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 216 | int32_t RegisterVoiceEngineObserver(VoiceEngineObserver& observer); |
| 217 | int32_t DeRegisterVoiceEngineObserver(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 218 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 219 | // VoECodec |
| 220 | int32_t GetSendCodec(CodecInst& codec); |
| 221 | int32_t GetRecCodec(CodecInst& codec); |
| 222 | int32_t SetSendCodec(const CodecInst& codec); |
| 223 | void SetBitRate(int bitrate_bps); |
| 224 | int32_t SetVADStatus(bool enableVAD, ACMVADMode mode, bool disableDTX); |
| 225 | int32_t GetVADStatus(bool& enabledVAD, ACMVADMode& mode, bool& disabledDTX); |
| 226 | int32_t SetRecPayloadType(const CodecInst& codec); |
| 227 | int32_t GetRecPayloadType(CodecInst& codec); |
| 228 | int32_t SetSendCNPayloadType(int type, PayloadFrequencies frequency); |
| 229 | int SetOpusMaxPlaybackRate(int frequency_hz); |
| 230 | int SetOpusDtx(bool enable_dtx); |
ivoc | 85228d6 | 2016-07-27 04:53:47 -0700 | [diff] [blame] | 231 | int GetOpusDtx(bool* enabled); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 232 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 233 | // VoENetwork |
mflodman | 3d7db26 | 2016-04-29 00:57:13 -0700 | [diff] [blame] | 234 | int32_t RegisterExternalTransport(Transport* transport); |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 235 | int32_t DeRegisterExternalTransport(); |
mflodman | 3d7db26 | 2016-04-29 00:57:13 -0700 | [diff] [blame] | 236 | int32_t ReceivedRTPPacket(const uint8_t* received_packet, |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 237 | size_t length, |
| 238 | const PacketTime& packet_time); |
mflodman | 3d7db26 | 2016-04-29 00:57:13 -0700 | [diff] [blame] | 239 | int32_t ReceivedRTCPPacket(const uint8_t* data, size_t length); |
pwestin@webrtc.org | 684f057 | 2013-03-13 23:20:57 +0000 | [diff] [blame] | 240 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 241 | // VoEFile |
| 242 | int StartPlayingFileLocally(const char* fileName, |
| 243 | bool loop, |
| 244 | FileFormats format, |
| 245 | int startPosition, |
| 246 | float volumeScaling, |
| 247 | int stopPosition, |
| 248 | const CodecInst* codecInst); |
| 249 | int StartPlayingFileLocally(InStream* stream, |
| 250 | FileFormats format, |
| 251 | int startPosition, |
| 252 | float volumeScaling, |
| 253 | int stopPosition, |
| 254 | const CodecInst* codecInst); |
| 255 | int StopPlayingFileLocally(); |
| 256 | int IsPlayingFileLocally() const; |
| 257 | int RegisterFilePlayingToMixer(); |
| 258 | int StartPlayingFileAsMicrophone(const char* fileName, |
| 259 | bool loop, |
| 260 | FileFormats format, |
| 261 | int startPosition, |
| 262 | float volumeScaling, |
| 263 | int stopPosition, |
| 264 | const CodecInst* codecInst); |
| 265 | int StartPlayingFileAsMicrophone(InStream* stream, |
| 266 | FileFormats format, |
| 267 | int startPosition, |
| 268 | float volumeScaling, |
| 269 | int stopPosition, |
| 270 | const CodecInst* codecInst); |
| 271 | int StopPlayingFileAsMicrophone(); |
| 272 | int IsPlayingFileAsMicrophone() const; |
| 273 | int StartRecordingPlayout(const char* fileName, const CodecInst* codecInst); |
| 274 | int StartRecordingPlayout(OutStream* stream, const CodecInst* codecInst); |
| 275 | int StopRecordingPlayout(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 276 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 277 | void SetMixWithMicStatus(bool mix); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 278 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 279 | // VoEExternalMediaProcessing |
| 280 | int RegisterExternalMediaProcessing(ProcessingTypes type, |
| 281 | VoEMediaProcess& processObject); |
| 282 | int DeRegisterExternalMediaProcessing(ProcessingTypes type); |
| 283 | int SetExternalMixing(bool enabled); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 284 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 285 | // VoEVolumeControl |
| 286 | int GetSpeechOutputLevel(uint32_t& level) const; |
| 287 | int GetSpeechOutputLevelFullRange(uint32_t& level) const; |
solenberg | 1c2af8e | 2016-03-24 10:36:00 -0700 | [diff] [blame] | 288 | int SetInputMute(bool enable); |
| 289 | bool InputMute() const; |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 290 | int SetOutputVolumePan(float left, float right); |
| 291 | int GetOutputVolumePan(float& left, float& right) const; |
| 292 | int SetChannelOutputVolumeScaling(float scaling); |
| 293 | int GetChannelOutputVolumeScaling(float& scaling) const; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 294 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 295 | // VoENetEqStats |
| 296 | int GetNetworkStatistics(NetworkStatistics& stats); |
| 297 | void GetDecodingCallStatistics(AudioDecodingCallStats* stats) const; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 298 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 299 | // VoEVideoSync |
| 300 | bool GetDelayEstimate(int* jitter_buffer_delay_ms, |
| 301 | int* playout_buffer_delay_ms) const; |
| 302 | uint32_t GetDelayEstimate() const; |
| 303 | int LeastRequiredDelayMs() const; |
| 304 | int SetMinimumPlayoutDelay(int delayMs); |
| 305 | int GetPlayoutTimestamp(unsigned int& timestamp); |
| 306 | int SetInitTimestamp(unsigned int timestamp); |
| 307 | int SetInitSequenceNumber(short sequenceNumber); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 308 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 309 | // VoEVideoSyncExtended |
| 310 | int GetRtpRtcp(RtpRtcp** rtpRtcpModule, RtpReceiver** rtp_receiver) const; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 311 | |
solenberg | 31642aa | 2016-03-14 08:00:37 -0700 | [diff] [blame] | 312 | // DTMF |
solenberg | 8842c3e | 2016-03-11 03:06:41 -0800 | [diff] [blame] | 313 | int SendTelephoneEventOutband(int event, int duration_ms); |
solenberg | 31642aa | 2016-03-14 08:00:37 -0700 | [diff] [blame] | 314 | int SetSendTelephoneEventPayloadType(int payload_type); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 315 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 316 | // VoEAudioProcessingImpl |
| 317 | int UpdateRxVadDetection(AudioFrame& audioFrame); |
| 318 | int RegisterRxVadObserver(VoERxVadCallback& observer); |
| 319 | int DeRegisterRxVadObserver(); |
| 320 | int VoiceActivityIndicator(int& activity); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 321 | #ifdef WEBRTC_VOICE_ENGINE_AGC |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 322 | int SetRxAgcStatus(bool enable, AgcModes mode); |
| 323 | int GetRxAgcStatus(bool& enabled, AgcModes& mode); |
| 324 | int SetRxAgcConfig(AgcConfig config); |
| 325 | int GetRxAgcConfig(AgcConfig& config); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 326 | #endif |
| 327 | #ifdef WEBRTC_VOICE_ENGINE_NR |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 328 | int SetRxNsStatus(bool enable, NsModes mode); |
| 329 | int GetRxNsStatus(bool& enabled, NsModes& mode); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 330 | #endif |
| 331 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 332 | // VoERTP_RTCP |
| 333 | int SetLocalSSRC(unsigned int ssrc); |
| 334 | int GetLocalSSRC(unsigned int& ssrc); |
| 335 | int GetRemoteSSRC(unsigned int& ssrc); |
| 336 | int SetSendAudioLevelIndicationStatus(bool enable, unsigned char id); |
| 337 | int SetReceiveAudioLevelIndicationStatus(bool enable, unsigned char id); |
| 338 | int SetSendAbsoluteSenderTimeStatus(bool enable, unsigned char id); |
| 339 | int SetReceiveAbsoluteSenderTimeStatus(bool enable, unsigned char id); |
| 340 | void EnableSendTransportSequenceNumber(int id); |
| 341 | void EnableReceiveTransportSequenceNumber(int id); |
Stefan Holmer | b86d4e4 | 2015-12-07 10:26:18 +0100 | [diff] [blame] | 342 | |
stefan | bba9dec | 2016-02-01 04:39:55 -0800 | [diff] [blame] | 343 | void RegisterSenderCongestionControlObjects( |
| 344 | RtpPacketSender* rtp_packet_sender, |
| 345 | TransportFeedbackObserver* transport_feedback_observer, |
| 346 | PacketRouter* packet_router); |
| 347 | void RegisterReceiverCongestionControlObjects(PacketRouter* packet_router); |
| 348 | void ResetCongestionControlObjects(); |
Stefan Holmer | b86d4e4 | 2015-12-07 10:26:18 +0100 | [diff] [blame] | 349 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 350 | void SetRTCPStatus(bool enable); |
| 351 | int GetRTCPStatus(bool& enabled); |
| 352 | int SetRTCP_CNAME(const char cName[256]); |
| 353 | int GetRemoteRTCP_CNAME(char cName[256]); |
| 354 | int GetRemoteRTCPData(unsigned int& NTPHigh, |
| 355 | unsigned int& NTPLow, |
| 356 | unsigned int& timestamp, |
| 357 | unsigned int& playoutTimestamp, |
| 358 | unsigned int* jitter, |
| 359 | unsigned short* fractionLost); |
| 360 | int SendApplicationDefinedRTCPPacket(unsigned char subType, |
| 361 | unsigned int name, |
| 362 | const char* data, |
| 363 | unsigned short dataLengthInBytes); |
| 364 | int GetRTPStatistics(unsigned int& averageJitterMs, |
| 365 | unsigned int& maxJitterMs, |
| 366 | unsigned int& discardedPackets); |
| 367 | int GetRemoteRTCPReportBlocks(std::vector<ReportBlock>* report_blocks); |
| 368 | int GetRTPStatistics(CallStatistics& stats); |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 369 | int SetCodecFECStatus(bool enable); |
| 370 | bool GetCodecFECStatus(); |
| 371 | void SetNACKStatus(bool enable, int maxNumberOfPackets); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 372 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 373 | // From AudioPacketizationCallback in the ACM |
| 374 | int32_t SendData(FrameType frameType, |
| 375 | uint8_t payloadType, |
| 376 | uint32_t timeStamp, |
| 377 | const uint8_t* payloadData, |
| 378 | size_t payloadSize, |
| 379 | const RTPFragmentationHeader* fragmentation) override; |
xians@webrtc.org | 3cefbc9 | 2014-10-10 09:42:53 +0000 | [diff] [blame] | 380 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 381 | // From ACMVADCallback in the ACM |
| 382 | int32_t InFrameType(FrameType frame_type) override; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 383 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 384 | int32_t OnRxVadDetected(int vadDecision); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 385 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 386 | // From RtpData in the RTP/RTCP module |
| 387 | int32_t OnReceivedPayloadData(const uint8_t* payloadData, |
| 388 | size_t payloadSize, |
| 389 | const WebRtcRTPHeader* rtpHeader) override; |
| 390 | bool OnRecoveredPacket(const uint8_t* packet, size_t packet_length) override; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 391 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 392 | // From RtpFeedback in the RTP/RTCP module |
| 393 | int32_t OnInitializeDecoder(int8_t payloadType, |
| 394 | const char payloadName[RTP_PAYLOAD_NAME_SIZE], |
| 395 | int frequency, |
| 396 | size_t channels, |
| 397 | uint32_t rate) override; |
| 398 | void OnIncomingSSRCChanged(uint32_t ssrc) override; |
| 399 | void OnIncomingCSRCChanged(uint32_t CSRC, bool added) override; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 400 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 401 | // From Transport (called by the RTP/RTCP module) |
| 402 | bool SendRtp(const uint8_t* data, |
| 403 | size_t len, |
| 404 | const PacketOptions& packet_options) override; |
| 405 | bool SendRtcp(const uint8_t* data, size_t len) override; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 406 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 407 | // From MixerParticipant |
henrik.lundin | 42dda50 | 2016-05-18 05:36:01 -0700 | [diff] [blame] | 408 | MixerParticipant::AudioFrameInfo GetAudioFrameWithMuted( |
| 409 | int32_t id, |
| 410 | AudioFrame* audioFrame) override; |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 411 | int32_t NeededFrequency(int32_t id) const override; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 412 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 413 | // From FileCallback |
| 414 | void PlayNotification(int32_t id, uint32_t durationMs) override; |
| 415 | void RecordNotification(int32_t id, uint32_t durationMs) override; |
| 416 | void PlayFileEnded(int32_t id) override; |
| 417 | void RecordFileEnded(int32_t id) override; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 418 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 419 | uint32_t InstanceId() const { return _instanceId; } |
| 420 | int32_t ChannelId() const { return _channelId; } |
| 421 | bool Playing() const { return channel_state_.Get().playing; } |
| 422 | bool Sending() const { return channel_state_.Get().sending; } |
| 423 | bool Receiving() const { return channel_state_.Get().receiving; } |
| 424 | bool ExternalTransport() const { |
| 425 | rtc::CritScope cs(&_callbackCritSect); |
| 426 | return _externalTransport; |
| 427 | } |
| 428 | bool ExternalMixing() const { return _externalMixing; } |
| 429 | RtpRtcp* RtpRtcpModulePtr() const { return _rtpRtcpModule.get(); } |
| 430 | int8_t OutputEnergyLevel() const { return _outputAudioLevel.Level(); } |
| 431 | uint32_t Demultiplex(const AudioFrame& audioFrame); |
| 432 | // Demultiplex the data to the channel's |_audioFrame|. The difference |
| 433 | // between this method and the overloaded method above is that |audio_data| |
| 434 | // does not go through transmit_mixer and APM. |
| 435 | void Demultiplex(const int16_t* audio_data, |
| 436 | int sample_rate, |
| 437 | size_t number_of_frames, |
| 438 | size_t number_of_channels); |
| 439 | uint32_t PrepareEncodeAndSend(int mixingFrequency); |
| 440 | uint32_t EncodeAndSend(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 441 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 442 | // Associate to a send channel. |
| 443 | // Used for obtaining RTT for a receive-only channel. |
| 444 | void set_associate_send_channel(const ChannelOwner& channel) { |
| 445 | assert(_channelId != channel.channel()->ChannelId()); |
| 446 | rtc::CritScope lock(&assoc_send_channel_lock_); |
| 447 | associate_send_channel_ = channel; |
| 448 | } |
Minyue | 2013aec | 2015-05-13 14:14:42 +0200 | [diff] [blame] | 449 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 450 | // Disassociate a send channel if it was associated. |
| 451 | void DisassociateSendChannel(int channel_id); |
Minyue | 2013aec | 2015-05-13 14:14:42 +0200 | [diff] [blame] | 452 | |
ivoc | 14d5dbe | 2016-07-04 07:06:55 -0700 | [diff] [blame] | 453 | // Set a RtcEventLog logging object. |
| 454 | void SetRtcEventLog(RtcEventLog* event_log); |
| 455 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 456 | protected: |
| 457 | void OnIncomingFractionLoss(int fraction_lost); |
minyue@webrtc.org | c1a40a7 | 2014-05-28 09:52:06 +0000 | [diff] [blame] | 458 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 459 | private: |
| 460 | bool ReceivePacket(const uint8_t* packet, |
| 461 | size_t packet_length, |
| 462 | const RTPHeader& header, |
| 463 | bool in_order); |
| 464 | bool HandleRtxPacket(const uint8_t* packet, |
| 465 | size_t packet_length, |
| 466 | const RTPHeader& header); |
| 467 | bool IsPacketInOrder(const RTPHeader& header) const; |
| 468 | bool IsPacketRetransmitted(const RTPHeader& header, bool in_order) const; |
| 469 | int ResendPackets(const uint16_t* sequence_numbers, int length); |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 470 | int32_t MixOrReplaceAudioWithFile(int mixingFrequency); |
| 471 | int32_t MixAudioWithFile(AudioFrame& audioFrame, int mixingFrequency); |
| 472 | void UpdatePlayoutTimestamp(bool rtcp); |
| 473 | void UpdatePacketDelay(uint32_t timestamp, uint16_t sequenceNumber); |
| 474 | void RegisterReceiveCodecsToRTPModule(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 475 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 476 | int SetSendRtpHeaderExtension(bool enable, |
| 477 | RTPExtensionType type, |
| 478 | unsigned char id); |
andrew@webrtc.org | eb524d9 | 2013-09-23 23:02:24 +0000 | [diff] [blame] | 479 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 480 | int32_t GetPlayoutFrequency(); |
| 481 | int64_t GetRTT(bool allow_associate_channel) const; |
wu@webrtc.org | 94454b7 | 2014-06-05 20:34:08 +0000 | [diff] [blame] | 482 | |
pbos | d8de115 | 2016-02-01 09:00:51 -0800 | [diff] [blame] | 483 | rtc::CriticalSection _fileCritSect; |
| 484 | rtc::CriticalSection _callbackCritSect; |
| 485 | rtc::CriticalSection volume_settings_critsect_; |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 486 | uint32_t _instanceId; |
| 487 | int32_t _channelId; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 488 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 489 | ChannelState channel_state_; |
henrika@webrtc.org | 944cbeb | 2014-03-18 10:32:33 +0000 | [diff] [blame] | 490 | |
ivoc | 14d5dbe | 2016-07-04 07:06:55 -0700 | [diff] [blame] | 491 | std::unique_ptr<voe::RtcEventLogProxy> event_log_proxy_; |
Ivo Creusen | ae856f2 | 2015-09-17 16:30:16 +0200 | [diff] [blame] | 492 | |
kwiberg | b7f89d6 | 2016-02-17 10:04:18 -0800 | [diff] [blame] | 493 | std::unique_ptr<RtpHeaderParser> rtp_header_parser_; |
| 494 | std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry_; |
| 495 | std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_; |
| 496 | std::unique_ptr<StatisticsProxy> statistics_proxy_; |
| 497 | std::unique_ptr<RtpReceiver> rtp_receiver_; |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 498 | TelephoneEventHandler* telephone_event_handler_; |
kwiberg | b7f89d6 | 2016-02-17 10:04:18 -0800 | [diff] [blame] | 499 | std::unique_ptr<RtpRtcp> _rtpRtcpModule; |
| 500 | std::unique_ptr<AudioCodingModule> audio_coding_; |
kwiberg | c8d071e | 2016-04-06 12:22:38 -0700 | [diff] [blame] | 501 | acm2::CodecManager codec_manager_; |
| 502 | acm2::RentACodec rent_a_codec_; |
kwiberg | b7f89d6 | 2016-02-17 10:04:18 -0800 | [diff] [blame] | 503 | std::unique_ptr<AudioSinkInterface> audio_sink_; |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 504 | AudioLevel _outputAudioLevel; |
| 505 | bool _externalTransport; |
| 506 | AudioFrame _audioFrame; |
| 507 | // Downsamples to the codec rate if necessary. |
| 508 | PushResampler<int16_t> input_resampler_; |
| 509 | FilePlayer* _inputFilePlayerPtr; |
| 510 | FilePlayer* _outputFilePlayerPtr; |
| 511 | FileRecorder* _outputFileRecorderPtr; |
| 512 | int _inputFilePlayerId; |
| 513 | int _outputFilePlayerId; |
| 514 | int _outputFileRecorderId; |
| 515 | bool _outputFileRecording; |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 516 | bool _outputExternalMedia; |
| 517 | VoEMediaProcess* _inputExternalMediaCallbackPtr; |
| 518 | VoEMediaProcess* _outputExternalMediaCallbackPtr; |
| 519 | uint32_t _timeStamp; |
turaj@webrtc.org | 167b6df | 2013-12-13 21:05:07 +0000 | [diff] [blame] | 520 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 521 | RemoteNtpTimeEstimator ntp_estimator_ GUARDED_BY(ts_stats_lock_); |
wu@webrtc.org | 82c4b85 | 2014-05-20 22:55:01 +0000 | [diff] [blame] | 522 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 523 | // Timestamp of the audio pulled from NetEq. |
henrik.lundin | 96bd502 | 2016-04-06 04:13:56 -0700 | [diff] [blame] | 524 | rtc::Optional<uint32_t> jitter_buffer_playout_timestamp_; |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 525 | uint32_t playout_timestamp_rtp_ GUARDED_BY(video_sync_lock_); |
| 526 | uint32_t playout_timestamp_rtcp_; |
| 527 | uint32_t playout_delay_ms_ GUARDED_BY(video_sync_lock_); |
| 528 | uint32_t _numberOfDiscardedPackets; |
| 529 | uint16_t send_sequence_number_; |
| 530 | uint8_t restored_packet_[kVoiceEngineMaxIpPacketSizeBytes]; |
pwestin@webrtc.org | 1de0135 | 2013-04-11 20:23:35 +0000 | [diff] [blame] | 531 | |
pbos | d8de115 | 2016-02-01 09:00:51 -0800 | [diff] [blame] | 532 | rtc::CriticalSection ts_stats_lock_; |
wu@webrtc.org | cb711f7 | 2014-05-19 17:39:11 +0000 | [diff] [blame] | 533 | |
kwiberg | b7f89d6 | 2016-02-17 10:04:18 -0800 | [diff] [blame] | 534 | std::unique_ptr<rtc::TimestampWrapAroundHandler> rtp_ts_wraparound_handler_; |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 535 | // The rtp timestamp of the first played out audio frame. |
| 536 | int64_t capture_start_rtp_time_stamp_; |
| 537 | // The capture ntp time (in local timebase) of the first played out audio |
| 538 | // frame. |
| 539 | 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] | 540 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 541 | // uses |
| 542 | Statistics* _engineStatisticsPtr; |
| 543 | OutputMixer* _outputMixerPtr; |
| 544 | TransmitMixer* _transmitMixerPtr; |
| 545 | ProcessThread* _moduleProcessThreadPtr; |
| 546 | AudioDeviceModule* _audioDeviceModulePtr; |
| 547 | VoiceEngineObserver* _voiceEngineObserverPtr; // owned by base |
| 548 | rtc::CriticalSection* _callbackCritSectPtr; // owned by base |
| 549 | Transport* _transportPtr; // WebRtc socket or external transport |
| 550 | RMSLevel rms_level_; |
kwiberg | b7f89d6 | 2016-02-17 10:04:18 -0800 | [diff] [blame] | 551 | std::unique_ptr<AudioProcessing> rx_audioproc_; // far end AudioProcessing |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 552 | VoERxVadCallback* _rxVadObserverPtr; |
| 553 | int32_t _oldVadDecision; |
| 554 | int32_t _sendFrameType; // Send data is voice, 1-voice, 0-otherwise |
| 555 | // VoEBase |
| 556 | bool _externalMixing; |
| 557 | bool _mixFileWithMicrophone; |
| 558 | // VoEVolumeControl |
solenberg | 1c2af8e | 2016-03-24 10:36:00 -0700 | [diff] [blame] | 559 | bool input_mute_ GUARDED_BY(volume_settings_critsect_); |
| 560 | bool previous_frame_muted_; // Only accessed from PrepareEncodeAndSend(). |
| 561 | float _panLeft GUARDED_BY(volume_settings_critsect_); |
| 562 | float _panRight GUARDED_BY(volume_settings_critsect_); |
| 563 | float _outputGain GUARDED_BY(volume_settings_critsect_); |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 564 | // VoeRTP_RTCP |
| 565 | uint32_t _lastLocalTimeStamp; |
| 566 | int8_t _lastPayloadType; |
| 567 | bool _includeAudioLevelIndication; |
| 568 | // VoENetwork |
| 569 | AudioFrame::SpeechType _outputSpeechType; |
| 570 | // VoEVideoSync |
pbos | d8de115 | 2016-02-01 09:00:51 -0800 | [diff] [blame] | 571 | rtc::CriticalSection video_sync_lock_; |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 572 | uint32_t _average_jitter_buffer_delay_us GUARDED_BY(video_sync_lock_); |
| 573 | uint32_t _previousTimestamp; |
| 574 | uint16_t _recPacketDelayMs GUARDED_BY(video_sync_lock_); |
| 575 | // VoEAudioProcessing |
| 576 | bool _RxVadDetection; |
| 577 | bool _rxAgcIsEnabled; |
| 578 | bool _rxNsIsEnabled; |
| 579 | bool restored_packet_in_use_; |
| 580 | // RtcpBandwidthObserver |
kwiberg | b7f89d6 | 2016-02-17 10:04:18 -0800 | [diff] [blame] | 581 | std::unique_ptr<VoERtcpObserver> rtcp_observer_; |
| 582 | std::unique_ptr<NetworkPredictor> network_predictor_; |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 583 | // An associated send channel. |
pbos | d8de115 | 2016-02-01 09:00:51 -0800 | [diff] [blame] | 584 | rtc::CriticalSection assoc_send_channel_lock_; |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 585 | ChannelOwner associate_send_channel_ GUARDED_BY(assoc_send_channel_lock_); |
Stefan Holmer | b86d4e4 | 2015-12-07 10:26:18 +0100 | [diff] [blame] | 586 | |
kwiberg | 55b97fe | 2016-01-28 05:22:45 -0800 | [diff] [blame] | 587 | bool pacing_enabled_; |
| 588 | PacketRouter* packet_router_ = nullptr; |
kwiberg | b7f89d6 | 2016-02-17 10:04:18 -0800 | [diff] [blame] | 589 | std::unique_ptr<TransportFeedbackProxy> feedback_observer_proxy_; |
| 590 | std::unique_ptr<TransportSequenceNumberProxy> seq_num_allocator_proxy_; |
| 591 | std::unique_ptr<RtpPacketSenderProxy> rtp_packet_sender_proxy_; |
Erik Språng | 737336d | 2016-07-29 12:59:36 +0200 | [diff] [blame] | 592 | std::unique_ptr<RateLimiter> retransmission_rate_limiter_; |
ossu | 29b1a8d | 2016-06-13 07:34:51 -0700 | [diff] [blame] | 593 | |
| 594 | // TODO(ossu): Remove once GetAudioDecoderFactory() is no longer needed. |
| 595 | rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 596 | }; |
| 597 | |
pbos@webrtc.org | d900e8b | 2013-07-03 15:12:26 +0000 | [diff] [blame] | 598 | } // namespace voe |
pbos@webrtc.org | d900e8b | 2013-07-03 15:12:26 +0000 | [diff] [blame] | 599 | } // namespace webrtc |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 600 | |
andrew@webrtc.org | 382c0c2 | 2014-05-05 18:22:21 +0000 | [diff] [blame] | 601 | #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ |