Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(646)

Side by Side Diff: webrtc/media/engine/webrtcvoiceengine.h

Issue 2685893002: Support N unsignaled audio streams (Closed)
Patch Set: comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // Check if 'ssrc' is an unsignaled stream, and if so mark it as not being
240 // unsignaled anymore (i.e. it is now removed, or signaled).
Taylor Brandstetter 2017/02/17 10:34:46 nit: add "and return true"
the sun 2017/02/17 11:22:47 Done.
241 bool MaybeDeregisterUnsignaledRecvStream(uint32_t ssrc);
242 242
243 rtc::ThreadChecker worker_thread_checker_; 243 rtc::ThreadChecker worker_thread_checker_;
244 244
245 WebRtcVoiceEngine* const engine_ = nullptr; 245 WebRtcVoiceEngine* const engine_ = nullptr;
246 std::vector<AudioCodec> send_codecs_; 246 std::vector<AudioCodec> send_codecs_;
247 std::vector<AudioCodec> recv_codecs_; 247 std::vector<AudioCodec> recv_codecs_;
248 int max_send_bitrate_bps_ = 0; 248 int max_send_bitrate_bps_ = 0;
249 AudioOptions options_; 249 AudioOptions options_;
250 rtc::Optional<int> dtmf_payload_type_; 250 rtc::Optional<int> dtmf_payload_type_;
251 int dtmf_payload_freq_ = -1; 251 int dtmf_payload_freq_ = -1;
252 bool recv_transport_cc_enabled_ = false; 252 bool recv_transport_cc_enabled_ = false;
253 bool recv_nack_enabled_ = false; 253 bool recv_nack_enabled_ = false;
254 bool desired_playout_ = false; 254 bool desired_playout_ = false;
255 bool playout_ = false; 255 bool playout_ = false;
256 bool send_ = false; 256 bool send_ = false;
257 webrtc::Call* const call_ = nullptr; 257 webrtc::Call* const call_ = nullptr;
258 webrtc::Call::Config::BitrateConfig bitrate_config_; 258 webrtc::Call::Config::BitrateConfig bitrate_config_;
259 259
260 // SSRC of unsignalled receive stream, or -1 if there isn't one. 260 // Queue of unsignaled SSRCs; oldest at the beginning.
261 int64_t default_recv_ssrc_ = -1; 261 std::vector<uint32_t> unsignaled_recv_ssrcs_;
262 // Volume for unsignalled stream, which may be set before the stream exists. 262
263 // Volume for unsignaled streams, which may be set before the stream exists.
263 double default_recv_volume_ = 1.0; 264 double default_recv_volume_ = 1.0;
264 // Sink for unsignalled stream, which may be set before the stream exists. 265 // Sink for latest unsignaled stream - may be set before the stream exists.
265 std::unique_ptr<webrtc::AudioSinkInterface> default_sink_; 266 std::unique_ptr<webrtc::AudioSinkInterface> default_sink_;
266 // Default SSRC to use for RTCP receiver reports in case of no signaled 267 // 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 268 // 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 269 // and https://code.google.com/p/chromium/issues/detail?id=547661
269 uint32_t receiver_reports_ssrc_ = 0xFA17FA17u; 270 uint32_t receiver_reports_ssrc_ = 0xFA17FA17u;
270 271
271 class WebRtcAudioSendStream; 272 class WebRtcAudioSendStream;
272 std::map<uint32_t, WebRtcAudioSendStream*> send_streams_; 273 std::map<uint32_t, WebRtcAudioSendStream*> send_streams_;
273 std::vector<webrtc::RtpExtension> send_rtp_extensions_; 274 std::vector<webrtc::RtpExtension> send_rtp_extensions_;
274 275
275 class WebRtcAudioReceiveStream; 276 class WebRtcAudioReceiveStream;
276 std::map<uint32_t, WebRtcAudioReceiveStream*> recv_streams_; 277 std::map<uint32_t, WebRtcAudioReceiveStream*> recv_streams_;
277 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; 278 std::vector<webrtc::RtpExtension> recv_rtp_extensions_;
278 279
279 webrtc::AudioSendStream::Config::SendCodecSpec send_codec_spec_; 280 webrtc::AudioSendStream::Config::SendCodecSpec send_codec_spec_;
280 281
281 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel); 282 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel);
282 }; 283 };
283 } // namespace cricket 284 } // namespace cricket
284 285
285 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ 286 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/media/engine/webrtcvoiceengine.cc » ('j') | webrtc/media/engine/webrtcvoiceengine_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698