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