OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
172 const webrtc::RtpParameters& parameters) override; | 172 const webrtc::RtpParameters& parameters) override; |
173 | 173 |
174 void SetPlayout(bool playout) override; | 174 void SetPlayout(bool playout) override; |
175 void SetSend(bool send) override; | 175 void SetSend(bool send) override; |
176 bool SetAudioSend(uint32_t ssrc, | 176 bool SetAudioSend(uint32_t ssrc, |
177 bool enable, | 177 bool enable, |
178 const AudioOptions* options, | 178 const AudioOptions* options, |
179 AudioSource* source) override; | 179 AudioSource* source) override; |
180 bool AddSendStream(const StreamParams& sp) override; | 180 bool AddSendStream(const StreamParams& sp) override; |
181 bool RemoveSendStream(uint32_t ssrc) override; | 181 bool RemoveSendStream(uint32_t ssrc) override; |
182 bool AddRecvStream(const StreamParams& sp) override; | 182 bool AddRecvStream(const StreamParams& sp) override; |
Taylor Brandstetter
2017/02/17 08:36:14
It would be good to document this new behavior in
the sun
2017/02/17 10:10:57
Not sure that's the right place. Above OnPacketRec
Taylor Brandstetter
2017/02/17 10:34:46
I realize now I was thinking of "SetOutputVolume".
the sun
2017/02/17 11:22:47
Done.
| |
183 bool RemoveRecvStream(uint32_t ssrc) override; | 183 bool RemoveRecvStream(uint32_t ssrc) override; |
184 bool GetActiveStreams(AudioInfo::StreamList* actives) override; | 184 bool GetActiveStreams(AudioInfo::StreamList* actives) override; |
185 int GetOutputLevel() override; | 185 int GetOutputLevel() override; |
186 bool SetOutputVolume(uint32_t ssrc, double volume) override; | 186 bool SetOutputVolume(uint32_t ssrc, double volume) override; |
187 | 187 |
188 bool CanInsertDtmf() override; | 188 bool CanInsertDtmf() override; |
189 bool InsertDtmf(uint32_t ssrc, int event, int duration) override; | 189 bool InsertDtmf(uint32_t ssrc, int event, int duration) override; |
190 | 190 |
191 void OnPacketReceived(rtc::CopyOnWriteBuffer* packet, | 191 void OnPacketReceived(rtc::CopyOnWriteBuffer* packet, |
192 const rtc::PacketTime& packet_time) override; | 192 const rtc::PacketTime& packet_time) override; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 bool SetSendCodecs(const std::vector<AudioCodec>& codecs); | 226 bool SetSendCodecs(const std::vector<AudioCodec>& codecs); |
227 bool SetLocalSource(uint32_t ssrc, AudioSource* source); | 227 bool SetLocalSource(uint32_t ssrc, AudioSource* source); |
228 bool MuteStream(uint32_t ssrc, bool mute); | 228 bool MuteStream(uint32_t ssrc, bool mute); |
229 | 229 |
230 WebRtcVoiceEngine* engine() { return engine_; } | 230 WebRtcVoiceEngine* engine() { return engine_; } |
231 int GetLastEngineError() { return engine()->GetLastEngineError(); } | 231 int GetLastEngineError() { return engine()->GetLastEngineError(); } |
232 int GetOutputLevel(int channel); | 232 int GetOutputLevel(int channel); |
233 void ChangePlayout(bool playout); | 233 void ChangePlayout(bool playout); |
234 int CreateVoEChannel(); | 234 int CreateVoEChannel(); |
235 bool DeleteVoEChannel(int channel); | 235 bool DeleteVoEChannel(int channel); |
236 bool IsDefaultRecvStream(uint32_t ssrc) { | |
237 return default_recv_ssrc_ == static_cast<int64_t>(ssrc); | |
238 } | |
239 bool SetMaxSendBitrate(int bps); | 236 bool SetMaxSendBitrate(int bps); |
240 bool ValidateRtpParameters(const webrtc::RtpParameters& parameters); | 237 bool ValidateRtpParameters(const webrtc::RtpParameters& parameters); |
241 void SetupRecording(); | 238 void SetupRecording(); |
239 bool TryDeregisterUnsignaledRecvStream(uint32_t ssrc); | |
Taylor Brandstetter
2017/02/17 08:36:14
nit: "Try" sounds like something that might fail.
the sun
2017/02/17 10:10:57
"Maybe" is fine with me.
| |
242 | 240 |
243 rtc::ThreadChecker worker_thread_checker_; | 241 rtc::ThreadChecker worker_thread_checker_; |
244 | 242 |
245 WebRtcVoiceEngine* const engine_ = nullptr; | 243 WebRtcVoiceEngine* const engine_ = nullptr; |
246 std::vector<AudioCodec> send_codecs_; | 244 std::vector<AudioCodec> send_codecs_; |
247 std::vector<AudioCodec> recv_codecs_; | 245 std::vector<AudioCodec> recv_codecs_; |
248 int max_send_bitrate_bps_ = 0; | 246 int max_send_bitrate_bps_ = 0; |
249 AudioOptions options_; | 247 AudioOptions options_; |
250 rtc::Optional<int> dtmf_payload_type_; | 248 rtc::Optional<int> dtmf_payload_type_; |
251 int dtmf_payload_freq_ = -1; | 249 int dtmf_payload_freq_ = -1; |
252 bool recv_transport_cc_enabled_ = false; | 250 bool recv_transport_cc_enabled_ = false; |
253 bool recv_nack_enabled_ = false; | 251 bool recv_nack_enabled_ = false; |
254 bool desired_playout_ = false; | 252 bool desired_playout_ = false; |
255 bool playout_ = false; | 253 bool playout_ = false; |
256 bool send_ = false; | 254 bool send_ = false; |
257 webrtc::Call* const call_ = nullptr; | 255 webrtc::Call* const call_ = nullptr; |
258 webrtc::Call::Config::BitrateConfig bitrate_config_; | 256 webrtc::Call::Config::BitrateConfig bitrate_config_; |
259 | 257 |
260 // SSRC of unsignalled receive stream, or -1 if there isn't one. | 258 // Queue of unsignaled SSRCs; oldest at the beginning. |
261 int64_t default_recv_ssrc_ = -1; | 259 std::vector<uint32_t> unsignaled_recv_ssrcs_; |
262 // Volume for unsignalled stream, which may be set before the stream exists. | 260 |
261 // Volume for unsignaled stream, which may be set before the stream exists. | |
Taylor Brandstetter
2017/02/17 08:36:14
nit: "stream(s)" now?
the sun
2017/02/17 10:10:57
Done.
| |
263 double default_recv_volume_ = 1.0; | 262 double default_recv_volume_ = 1.0; |
264 // Sink for unsignalled stream, which may be set before the stream exists. | 263 // Sink for unsignaled stream, which may be set before the stream exists. |
265 std::unique_ptr<webrtc::AudioSinkInterface> default_sink_; | 264 std::unique_ptr<webrtc::AudioSinkInterface> default_sink_; |
266 // Default SSRC to use for RTCP receiver reports in case of no signaled | 265 // Default SSRC to use for RTCP receiver reports in case of no signaled |
267 // send streams. See: https://code.google.com/p/webrtc/issues/detail?id=4740 | 266 // send streams. See: https://code.google.com/p/webrtc/issues/detail?id=4740 |
268 // and https://code.google.com/p/chromium/issues/detail?id=547661 | 267 // and https://code.google.com/p/chromium/issues/detail?id=547661 |
269 uint32_t receiver_reports_ssrc_ = 0xFA17FA17u; | 268 uint32_t receiver_reports_ssrc_ = 0xFA17FA17u; |
270 | 269 |
271 class WebRtcAudioSendStream; | 270 class WebRtcAudioSendStream; |
272 std::map<uint32_t, WebRtcAudioSendStream*> send_streams_; | 271 std::map<uint32_t, WebRtcAudioSendStream*> send_streams_; |
273 std::vector<webrtc::RtpExtension> send_rtp_extensions_; | 272 std::vector<webrtc::RtpExtension> send_rtp_extensions_; |
274 | 273 |
275 class WebRtcAudioReceiveStream; | 274 class WebRtcAudioReceiveStream; |
276 std::map<uint32_t, WebRtcAudioReceiveStream*> recv_streams_; | 275 std::map<uint32_t, WebRtcAudioReceiveStream*> recv_streams_; |
277 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; | 276 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; |
278 | 277 |
279 webrtc::AudioSendStream::Config::SendCodecSpec send_codec_spec_; | 278 webrtc::AudioSendStream::Config::SendCodecSpec send_codec_spec_; |
280 | 279 |
281 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel); | 280 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel); |
282 }; | 281 }; |
283 } // namespace cricket | 282 } // namespace cricket |
284 | 283 |
285 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ | 284 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ |
OLD | NEW |