blob: a4c8baa37fd57a430d53ee27d49ad6cc8bb68def [file] [log] [blame]
henrike@webrtc.org28e20752013-07-10 00:45:361/*
kjellander1afca732016-02-08 04:46:452 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved.
henrike@webrtc.org28e20752013-07-10 00:45:363 *
kjellander1afca732016-02-08 04:46:454 * 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.
henrike@webrtc.org28e20752013-07-10 00:45:369 */
10
Steve Anton10542f22019-01-11 17:11:0011#ifndef MEDIA_ENGINE_WEBRTC_VOICE_ENGINE_H_
12#define MEDIA_ENGINE_WEBRTC_VOICE_ENGINE_H_
henrike@webrtc.org28e20752013-07-10 00:45:3613
14#include <map>
kwiberg686a8ef2016-02-26 11:00:3515#include <memory>
henrike@webrtc.org28e20752013-07-10 00:45:3616#include <string>
17#include <vector>
18
Mirko Bonadei92ea95e2017-09-15 04:47:3119#include "api/audio_codecs/audio_encoder_factory.h"
Steve Anton10542f22019-01-11 17:11:0020#include "api/rtp_receiver_interface.h"
Mirko Bonadeid9708072019-01-25 19:26:4821#include "api/scoped_refptr.h"
Danil Chapovalov4c7112a2019-03-27 17:51:4522#include "api/task_queue/task_queue_factory.h"
Mirko Bonadei92ea95e2017-09-15 04:47:3123#include "call/audio_state.h"
24#include "call/call.h"
Steve Anton220f4be2019-05-30 01:40:5525#include "media/base/media_engine.h"
Steve Anton10542f22019-01-11 17:11:0026#include "media/base/rtp_utils.h"
Mirko Bonadei92ea95e2017-09-15 04:47:3127#include "media/engine/apm_helpers.h"
Mirko Bonadei92ea95e2017-09-15 04:47:3128#include "rtc_base/buffer.h"
Steve Anton10542f22019-01-11 17:11:0029#include "rtc_base/constructor_magic.h"
Sebastian Jansson470a5ea2019-01-23 11:37:4930#include "rtc_base/experiments/audio_allocation_settings.h"
Steve Anton10542f22019-01-11 17:11:0031#include "rtc_base/network_route.h"
Mirko Bonadei92ea95e2017-09-15 04:47:3132#include "rtc_base/task_queue.h"
33#include "rtc_base/thread_checker.h"
henrike@webrtc.org28e20752013-07-10 00:45:3634
henrike@webrtc.org28e20752013-07-10 00:45:3635namespace cricket {
36
henrike@webrtc.org28e20752013-07-10 00:45:3637class AudioDeviceModule;
gyzhou95aa9642016-12-13 22:06:2638class AudioMixer;
Taylor Brandstetter1a018dc2016-03-08 20:37:3939class AudioSource;
henrike@webrtc.org28e20752013-07-10 00:45:3640class WebRtcVoiceMediaChannel;
41
42// WebRtcVoiceEngine is a class to be used with CompositeMediaEngine.
43// It uses the WebRtc VoiceEngine library for audio handling.
Sebastian Jansson84848f22018-11-16 09:40:3644class WebRtcVoiceEngine final : public VoiceEngineInterface {
Jelena Marusicc28a8962015-05-29 13:05:4445 friend class WebRtcVoiceMediaChannel;
Yves Gerey665174f2018-06-19 13:03:0546
henrike@webrtc.org28e20752013-07-10 00:45:3647 public:
ossu29b1a8d2016-06-13 14:34:5148 WebRtcVoiceEngine(
Danil Chapovalov4c7112a2019-03-27 17:51:4549 webrtc::TaskQueueFactory* task_queue_factory,
ossu29b1a8d2016-06-13 14:34:5150 webrtc::AudioDeviceModule* adm,
ossueb1fde42017-05-02 13:46:3051 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& encoder_factory,
gyzhou95aa9642016-12-13 22:06:2652 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory,
peaha9cc40b2017-06-29 15:32:0953 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer,
54 rtc::scoped_refptr<webrtc::AudioProcessing> audio_processing);
Sebastian Jansson84848f22018-11-16 09:40:3655 ~WebRtcVoiceEngine() override;
henrike@webrtc.org28e20752013-07-10 00:45:3656
deadbeefeb02c032017-06-15 15:29:2557 // Does initialization that needs to occur on the worker thread.
Sebastian Jansson84848f22018-11-16 09:40:3658 void Init() override;
deadbeefeb02c032017-06-15 15:29:2559
Sebastian Jansson84848f22018-11-16 09:40:3660 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const override;
61 VoiceMediaChannel* CreateMediaChannel(
62 webrtc::Call* call,
63 const MediaConfig& config,
64 const AudioOptions& options,
65 const webrtc::CryptoOptions& crypto_options) override;
henrike@webrtc.org28e20752013-07-10 00:45:3666
Sebastian Jansson84848f22018-11-16 09:40:3667 const std::vector<AudioCodec>& send_codecs() const override;
68 const std::vector<AudioCodec>& recv_codecs() const override;
69 RtpCapabilities GetCapabilities() const override;
henrike@webrtc.org28e20752013-07-10 00:45:3670
henrike@webrtc.org28e20752013-07-10 00:45:3671 // For tracking WebRtc channels. Needed because we have to pause them
72 // all when switching devices.
73 // May only be called by WebRtcVoiceMediaChannel.
solenberg63b34542015-09-29 13:06:3174 void RegisterChannel(WebRtcVoiceMediaChannel* channel);
75 void UnregisterChannel(WebRtcVoiceMediaChannel* channel);
henrike@webrtc.org28e20752013-07-10 00:45:3676
ivocd66b44d2016-01-15 11:06:3677 // Starts AEC dump using an existing file. A maximum file size in bytes can be
78 // specified. When the maximum file size is reached, logging is stopped and
79 // the file is closed. If max_size_bytes is set to <= 0, no limit will be
80 // used.
Niels Möllere8e4dc42019-06-11 12:04:1681 bool StartAecDump(webrtc::FileWrapper file, int64_t max_size_bytes) override;
wu@webrtc.orga9890802013-12-13 00:21:0382
ivoc797ef122015-10-22 10:25:4183 // Stops AEC dump.
Sebastian Jansson84848f22018-11-16 09:40:3684 void StopAecDump() override;
ivoc797ef122015-10-22 10:25:4185
henrike@webrtc.org28e20752013-07-10 00:45:3686 private:
solenberg63b34542015-09-29 13:06:3187 // Every option that is "set" will be applied. Every option not "set" will be
88 // ignored. This allows us to selectively turn on and off different options
89 // easily at any time.
henrike@webrtc.org28e20752013-07-10 00:45:3690 bool ApplyOptions(const AudioOptions& options);
xians@webrtc.org3cefbc92014-10-10 09:42:5391
solenberg0a617e22015-10-20 22:49:3892 int CreateVoEChannel();
aleloi048cbdd2017-05-29 09:56:2793
Danil Chapovalov4c7112a2019-03-27 17:51:4594 webrtc::TaskQueueFactory* const task_queue_factory_;
Amit Hilbuche27ccf92019-03-26 17:36:5395 std::unique_ptr<rtc::TaskQueue> low_priority_worker_queue_;
aleloi048cbdd2017-05-29 09:56:2796
solenberg5b5129a2016-04-08 12:35:4897 webrtc::AudioDeviceModule* adm();
peahb1c9d1d2017-07-25 22:45:2498 webrtc::AudioProcessing* apm() const;
Fredrik Solenberg2a877972017-12-15 15:42:1599 webrtc::AudioState* audio_state();
henrike@webrtc.org28e20752013-07-10 00:45:36100
Steve Anton220f4be2019-05-30 01:40:55101 std::vector<AudioCodec> CollectCodecs(
ossu20a4b3f2017-04-27 09:08:52102 const std::vector<webrtc::AudioCodecSpec>& specs) const;
ossuc54071d2016-08-17 09:45:41103
solenberg566ef242015-11-06 23:34:49104 rtc::ThreadChecker signal_thread_checker_;
105 rtc::ThreadChecker worker_thread_checker_;
106
Sebastian Jansson470a5ea2019-01-23 11:37:49107 const webrtc::AudioAllocationSettings allocation_settings_;
108
Fredrik Solenberg2a877972017-12-15 15:42:15109 // The audio device module.
solenbergff976312016-03-31 06:28:51110 rtc::scoped_refptr<webrtc::AudioDeviceModule> adm_;
ossu20a4b3f2017-04-27 09:08:52111 rtc::scoped_refptr<webrtc::AudioEncoderFactory> encoder_factory_;
ossu29b1a8d2016-06-13 14:34:51112 rtc::scoped_refptr<webrtc::AudioDecoderFactory> decoder_factory_;
deadbeefeb02c032017-06-15 15:29:25113 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer_;
Fredrik Solenberg2a877972017-12-15 15:42:15114 // The audio processing module.
peaha9cc40b2017-06-29 15:32:09115 rtc::scoped_refptr<webrtc::AudioProcessing> apm_;
henrike@webrtc.org28e20752013-07-10 00:45:36116 // The primary instance of WebRtc VoiceEngine.
solenberg566ef242015-11-06 23:34:49117 rtc::scoped_refptr<webrtc::AudioState> audio_state_;
ossuc54071d2016-08-17 09:45:41118 std::vector<AudioCodec> send_codecs_;
119 std::vector<AudioCodec> recv_codecs_;
solenberg63b34542015-09-29 13:06:31120 std::vector<WebRtcVoiceMediaChannel*> channels_;
solenberg246b8172015-12-08 17:50:23121 bool is_dumping_aec_ = false;
deadbeefeb02c032017-06-15 15:29:25122 bool initialized_ = false;
henrike@webrtc.org28e20752013-07-10 00:45:36123
Alessio Bazzicacc22f512018-08-30 11:01:34124 // Cache received extended_filter_aec, delay_agnostic_aec and experimental_ns
125 // values, and apply them in case they are missing in the audio options.
126 // We need to do this because SetExtraOptions() will revert to defaults for
127 // options which are not provided.
Danil Chapovalov00c718362018-06-15 13:58:38128 absl::optional<bool> extended_filter_aec_;
129 absl::optional<bool> delay_agnostic_aec_;
130 absl::optional<bool> experimental_ns_;
Fredrik Solenberg8f5787a2018-01-11 12:52:30131 // Jitter buffer settings for new streams.
Jakob Ivarsson647d5e62019-03-15 09:37:31132 size_t audio_jitter_buffer_max_packets_ = 200;
Fredrik Solenberg8f5787a2018-01-11 12:52:30133 bool audio_jitter_buffer_fast_accelerate_ = false;
Jakob Ivarsson10403ae2018-11-27 14:45:20134 int audio_jitter_buffer_min_delay_ms_ = 0;
Jakob Ivarsson53eae872019-01-10 14:58:36135 bool audio_jitter_buffer_enable_rtx_handling_ = false;
solenbergc96df772015-10-21 20:01:53136
solenbergff976312016-03-31 06:28:51137 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceEngine);
henrike@webrtc.org28e20752013-07-10 00:45:36138};
139
henrike@webrtc.org28e20752013-07-10 00:45:36140// WebRtcVoiceMediaChannel is an implementation of VoiceMediaChannel that uses
141// WebRtc Voice Engine.
solenberg566ef242015-11-06 23:34:49142class WebRtcVoiceMediaChannel final : public VoiceMediaChannel,
143 public webrtc::Transport {
henrike@webrtc.org28e20752013-07-10 00:45:36144 public:
Fredrik Solenbergb071a192015-09-17 14:42:56145 WebRtcVoiceMediaChannel(WebRtcVoiceEngine* engine,
nisse51542be2016-02-12 10:27:06146 const MediaConfig& config,
Fredrik Solenbergb071a192015-09-17 14:42:56147 const AudioOptions& options,
Benjamin Wrightbfb444c2018-10-15 17:20:24148 const webrtc::CryptoOptions& crypto_options,
Fredrik Solenbergb071a192015-09-17 14:42:56149 webrtc::Call* call);
Fredrik Solenbergaaf8ff22015-05-07 14:05:53150 ~WebRtcVoiceMediaChannel() override;
Fredrik Solenberge444a3d2015-05-07 14:42:08151
solenberg66f43392015-09-09 08:36:22152 const AudioOptions& options() const { return options_; }
Fredrik Solenberge444a3d2015-05-07 14:42:08153
Peter Thatcherc2ee2c82015-08-07 23:05:34154 bool SetSendParameters(const AudioSendParameters& params) override;
155 bool SetRecvParameters(const AudioRecvParameters& params) override;
Taylor Brandstetterdb0cd9e2016-05-16 18:40:30156 webrtc::RtpParameters GetRtpSendParameters(uint32_t ssrc) const override;
Zach Steinba37b4b2018-01-23 23:02:36157 webrtc::RTCError SetRtpSendParameters(
158 uint32_t ssrc,
159 const webrtc::RtpParameters& parameters) override;
Taylor Brandstetterdb0cd9e2016-05-16 18:40:30160 webrtc::RtpParameters GetRtpReceiveParameters(uint32_t ssrc) const override;
161 bool SetRtpReceiveParameters(
162 uint32_t ssrc,
163 const webrtc::RtpParameters& parameters) override;
skvlade0d46372016-04-08 05:59:22164
aleloi84ef6152016-08-04 12:28:21165 void SetPlayout(bool playout) override;
Taylor Brandstetter1a018dc2016-03-08 20:37:39166 void SetSend(bool send) override;
Peter Boström0c4e06b2015-10-07 10:23:21167 bool SetAudioSend(uint32_t ssrc,
168 bool enable,
169 const AudioOptions* options,
Taylor Brandstetter1a018dc2016-03-08 20:37:39170 AudioSource* source) override;
Fredrik Solenbergaaf8ff22015-05-07 14:05:53171 bool AddSendStream(const StreamParams& sp) override;
Peter Boström0c4e06b2015-10-07 10:23:21172 bool RemoveSendStream(uint32_t ssrc) override;
Fredrik Solenbergaaf8ff22015-05-07 14:05:53173 bool AddRecvStream(const StreamParams& sp) override;
Peter Boström0c4e06b2015-10-07 10:23:21174 bool RemoveRecvStream(uint32_t ssrc) override;
Benjamin Wright84583f62018-10-04 21:22:34175
176 // E2EE Frame API
177 // Set a frame decryptor to a particular ssrc that will intercept all
178 // incoming audio payloads and attempt to decrypt them before forwarding the
179 // result.
180 void SetFrameDecryptor(uint32_t ssrc,
181 rtc::scoped_refptr<webrtc::FrameDecryptorInterface>
182 frame_decryptor) override;
183 // Set a frame encryptor to a particular ssrc that will intercept all
184 // outgoing audio payloads frames and attempt to encrypt them and forward the
185 // result to the packetizer.
186 void SetFrameEncryptor(uint32_t ssrc,
187 rtc::scoped_refptr<webrtc::FrameEncryptorInterface>
188 frame_encryptor) override;
189
solenberg2100c0b2017-03-01 19:29:29190 // SSRC=0 will apply the new volume to current and future unsignaled streams.
solenberg4bac9c52015-10-09 09:32:53191 bool SetOutputVolume(uint32_t ssrc, double volume) override;
henrike@webrtc.org28e20752013-07-10 00:45:36192
Ruslan Burakov7ea46052019-02-16 01:07:05193 bool SetBaseMinimumPlayoutDelayMs(uint32_t ssrc, int delay_ms) override;
194 absl::optional<int> GetBaseMinimumPlayoutDelayMs(
195 uint32_t ssrc) const override;
196
Fredrik Solenbergaaf8ff22015-05-07 14:05:53197 bool CanInsertDtmf() override;
solenberg1d63dd02015-12-02 20:35:09198 bool InsertDtmf(uint32_t ssrc, int event, int duration) override;
henrike@webrtc.org28e20752013-07-10 00:45:36199
Amit Hilbuche7a5f7b2019-03-12 18:10:27200 void OnPacketReceived(rtc::CopyOnWriteBuffer packet,
Niels Möllere6933812018-11-05 12:01:41201 int64_t packet_time_us) override;
Amit Hilbuche7a5f7b2019-03-12 18:10:27202 void OnRtcpReceived(rtc::CopyOnWriteBuffer packet,
Niels Möllere6933812018-11-05 12:01:41203 int64_t packet_time_us) override;
Honghai Zhangcc411c02016-03-30 00:27:21204 void OnNetworkRouteChanged(const std::string& transport_name,
Honghai Zhang0e533ef2016-04-19 22:41:36205 const rtc::NetworkRoute& network_route) override;
skvlad7a43d252016-03-22 22:32:27206 void OnReadyToSend(bool ready) override;
Fredrik Solenbergaaf8ff22015-05-07 14:05:53207 bool GetStats(VoiceMediaInfo* info) override;
Fredrik Solenberge444a3d2015-05-07 14:42:08208
solenberg2100c0b2017-03-01 19:29:29209 // SSRC=0 will set the audio sink on the latest unsignaled stream, future or
210 // current. Only one stream at a time will use the sink.
Tommif888bb52015-12-12 00:37:01211 void SetRawAudioSink(
212 uint32_t ssrc,
kwiberg686a8ef2016-02-26 11:00:35213 std::unique_ptr<webrtc::AudioSinkInterface> sink) override;
Tommif888bb52015-12-12 00:37:01214
zhihuang38ede132017-06-15 19:52:32215 std::vector<webrtc::RtpSource> GetSources(uint32_t ssrc) const override;
hbos8d609f62017-04-10 14:39:05216
Fredrik Solenberge444a3d2015-05-07 14:42:08217 // implements Transport interface
stefan1d8a5062015-10-02 10:39:33218 bool SendRtp(const uint8_t* data,
219 size_t len,
220 const webrtc::PacketOptions& options) override {
jbaucheec21bd2016-03-20 13:15:43221 rtc::CopyOnWriteBuffer packet(data, len, kMaxRtpPacketLen);
stefanc1aeaf02015-10-15 14:26:07222 rtc::PacketOptions rtc_options;
223 rtc_options.packet_id = options.packet_id;
Tim Haloun6ca98362018-09-18 00:06:08224 if (DscpEnabled()) {
225 rtc_options.dscp = PreferredDscp();
226 }
Sebastian Jansson03789972018-10-09 16:27:57227 rtc_options.info_signaled_after_sent.included_in_feedback =
228 options.included_in_feedback;
229 rtc_options.info_signaled_after_sent.included_in_allocation =
230 options.included_in_allocation;
stefanc1aeaf02015-10-15 14:26:07231 return VoiceMediaChannel::SendPacket(&packet, rtc_options);
Fredrik Solenberge444a3d2015-05-07 14:42:08232 }
233
pbos2d566682015-09-28 16:59:31234 bool SendRtcp(const uint8_t* data, size_t len) override {
jbaucheec21bd2016-03-20 13:15:43235 rtc::CopyOnWriteBuffer packet(data, len, kMaxRtpPacketLen);
Qingsi Wang6e641e62018-04-12 03:14:17236 rtc::PacketOptions rtc_options;
Tim Haloun6ca98362018-09-18 00:06:08237 if (DscpEnabled()) {
238 rtc_options.dscp = PreferredDscp();
239 }
Tim Haloun648d28a2018-10-18 23:52:22240
Qingsi Wang6e641e62018-04-12 03:14:17241 return VoiceMediaChannel::SendRtcp(&packet, rtc_options);
Fredrik Solenberge444a3d2015-05-07 14:42:08242 }
243
Fredrik Solenberge444a3d2015-05-07 14:42:08244 private:
Fredrik Solenbergb071a192015-09-17 14:42:56245 bool SetOptions(const AudioOptions& options);
Fredrik Solenbergb071a192015-09-17 14:42:56246 bool SetRecvCodecs(const std::vector<AudioCodec>& codecs);
solenberg72e29d22016-03-08 14:35:16247 bool SetSendCodecs(const std::vector<AudioCodec>& codecs);
Taylor Brandstetter1a018dc2016-03-08 20:37:39248 bool SetLocalSource(uint32_t ssrc, AudioSource* source);
Peter Boström0c4e06b2015-10-07 10:23:21249 bool MuteStream(uint32_t ssrc, bool mute);
Fredrik Solenbergb071a192015-09-17 14:42:56250
Fredrik Solenberge444a3d2015-05-07 14:42:08251 WebRtcVoiceEngine* engine() { return engine_; }
kwiberg37b8b112016-11-03 09:46:53252 void ChangePlayout(bool playout);
solenberg0a617e22015-10-20 22:49:38253 int CreateVoEChannel();
solenberg7add0582015-11-20 17:59:34254 bool DeleteVoEChannel(int channel);
deadbeef80346142016-04-27 21:17:10255 bool SetMaxSendBitrate(int bps);
solenbergd53a3f92016-04-14 20:56:37256 void SetupRecording();
solenberg2100c0b2017-03-01 19:29:29257 // Check if 'ssrc' is an unsignaled stream, and if so mark it as not being
258 // unsignaled anymore (i.e. it is now removed, or signaled), and return true.
259 bool MaybeDeregisterUnsignaledRecvStream(uint32_t ssrc);
Fredrik Solenberg4b60c732015-05-07 12:07:48260
solenberg566ef242015-11-06 23:34:49261 rtc::ThreadChecker worker_thread_checker_;
Fredrik Solenberg4b60c732015-05-07 12:07:48262
solenberg566ef242015-11-06 23:34:49263 WebRtcVoiceEngine* const engine_ = nullptr;
Taylor Brandstetter0cd086b2016-04-20 23:23:10264 std::vector<AudioCodec> send_codecs_;
kwiberg1c07c702017-03-27 14:15:49265
266 // TODO(kwiberg): decoder_map_ and recv_codecs_ store the exact same
267 // information, in slightly different formats. Eliminate recv_codecs_.
268 std::map<int, webrtc::SdpAudioFormat> decoder_map_;
henrike@webrtc.org28e20752013-07-10 00:45:36269 std::vector<AudioCodec> recv_codecs_;
kwiberg1c07c702017-03-27 14:15:49270
deadbeef80346142016-04-27 21:17:10271 int max_send_bitrate_bps_ = 0;
henrike@webrtc.org28e20752013-07-10 00:45:36272 AudioOptions options_;
Danil Chapovalov00c718362018-06-15 13:58:38273 absl::optional<int> dtmf_payload_type_;
solenbergffbbcac2016-11-17 13:25:37274 int dtmf_payload_freq_ = -1;
solenberg72e29d22016-03-08 14:35:16275 bool recv_transport_cc_enabled_ = false;
solenberg8189b022016-06-14 19:13:00276 bool recv_nack_enabled_ = false;
solenbergffbbcac2016-11-17 13:25:37277 bool desired_playout_ = false;
solenberg566ef242015-11-06 23:34:49278 bool playout_ = false;
Taylor Brandstetter1a018dc2016-03-08 20:37:39279 bool send_ = false;
solenberg566ef242015-11-06 23:34:49280 webrtc::Call* const call_ = nullptr;
henrike@webrtc.org28e20752013-07-10 00:45:36281
Jiawei Ou55718122018-11-09 21:17:39282 const MediaConfig::Audio audio_config_;
283
solenberg2100c0b2017-03-01 19:29:29284 // Queue of unsignaled SSRCs; oldest at the beginning.
285 std::vector<uint32_t> unsignaled_recv_ssrcs_;
286
Seth Hampson5897a6e2018-04-03 18:16:33287 // This is a stream param that comes from the remote description, but wasn't
288 // signaled with any a=ssrc lines. It holds the information that was signaled
289 // before the unsignaled receive stream is created when the first packet is
290 // received.
291 StreamParams unsignaled_stream_params_;
292
solenberg2100c0b2017-03-01 19:29:29293 // Volume for unsignaled streams, which may be set before the stream exists.
solenberg1ac56142015-10-13 10:58:19294 double default_recv_volume_ = 1.0;
Ruslan Burakov7ea46052019-02-16 01:07:05295
296 // Delay for unsignaled streams, which may be set before the stream exists.
297 int default_recv_base_minimum_delay_ms_ = 0;
298
solenberg2100c0b2017-03-01 19:29:29299 // Sink for latest unsignaled stream - may be set before the stream exists.
kwiberg686a8ef2016-02-26 11:00:35300 std::unique_ptr<webrtc::AudioSinkInterface> default_sink_;
solenberg8093d542015-11-12 14:02:30301 // Default SSRC to use for RTCP receiver reports in case of no signaled
solenberg0a617e22015-10-20 22:49:38302 // send streams. See: https://code.google.com/p/webrtc/issues/detail?id=4740
solenberg8093d542015-11-12 14:02:30303 // and https://code.google.com/p/chromium/issues/detail?id=547661
304 uint32_t receiver_reports_ssrc_ = 0xFA17FA17u;
solenberg1ac56142015-10-13 10:58:19305
solenbergc96df772015-10-21 20:01:53306 class WebRtcAudioSendStream;
307 std::map<uint32_t, WebRtcAudioSendStream*> send_streams_;
solenberg3a941542015-11-16 15:34:50308 std::vector<webrtc::RtpExtension> send_rtp_extensions_;
Steve Antonbb50ce52018-03-26 17:24:32309 std::string mid_;
solenbergc96df772015-10-21 20:01:53310
311 class WebRtcAudioReceiveStream;
solenberg7add0582015-11-20 17:59:34312 std::map<uint32_t, WebRtcAudioReceiveStream*> recv_streams_;
Fredrik Solenberg4b60c732015-05-07 12:07:48313 std::vector<webrtc::RtpExtension> recv_rtp_extensions_;
solenbergc96df772015-10-21 20:01:53314
Danil Chapovalov00c718362018-06-15 13:58:38315 absl::optional<webrtc::AudioSendStream::Config::SendCodecSpec>
ossu20a4b3f2017-04-27 09:08:52316 send_codec_spec_;
solenberg72e29d22016-03-08 14:35:16317
Karl Wiberg08126342018-03-20 18:18:55318 // TODO(kwiberg): Per-SSRC codec pair IDs?
319 const webrtc::AudioCodecPairId codec_pair_id_ =
320 webrtc::AudioCodecPairId::Create();
321
Benjamin Wrightbfb444c2018-10-15 17:20:24322 // Per peer connection crypto options that last for the lifetime of the peer
323 // connection.
324 const webrtc::CryptoOptions crypto_options_;
Benjamin Wright84583f62018-10-04 21:22:34325 // Unsignaled streams have an option to have a frame decryptor set on them.
326 rtc::scoped_refptr<webrtc::FrameDecryptorInterface>
327 unsignaled_frame_decryptor_;
328
solenbergc96df772015-10-21 20:01:53329 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel);
henrike@webrtc.org28e20752013-07-10 00:45:36330};
henrike@webrtc.org28e20752013-07-10 00:45:36331} // namespace cricket
332
Steve Anton10542f22019-01-11 17:11:00333#endif // MEDIA_ENGINE_WEBRTC_VOICE_ENGINE_H_