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

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

Issue 1765873002: On WVoMC::SetSendParameters(), figure out send codec settings ONCE, not for each send stream. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 void SetNack(int channel, bool nack_enabled); 225 void SetNack(int channel, bool nack_enabled);
226 bool SetSendCodec(int channel, const webrtc::CodecInst& send_codec); 226 bool SetSendCodec(int channel, const webrtc::CodecInst& send_codec);
227 bool ChangePlayout(bool playout); 227 bool ChangePlayout(bool playout);
228 bool ChangeSend(SendFlags send); 228 bool ChangeSend(SendFlags send);
229 bool ChangeSend(int channel, SendFlags send); 229 bool ChangeSend(int channel, SendFlags send);
230 int CreateVoEChannel(); 230 int CreateVoEChannel();
231 bool DeleteVoEChannel(int channel); 231 bool DeleteVoEChannel(int channel);
232 bool IsDefaultRecvStream(uint32_t ssrc) { 232 bool IsDefaultRecvStream(uint32_t ssrc) {
233 return default_recv_ssrc_ == static_cast<int64_t>(ssrc); 233 return default_recv_ssrc_ == static_cast<int64_t>(ssrc);
234 } 234 }
235 bool SetSendCodecs(int channel, const std::vector<AudioCodec>& codecs); 235 bool SetSendCodecs(int channel);
236 bool SetSendBitrateInternal(int bps); 236 bool SetSendBitrateInternal(int bps);
237 bool HasSendCodec() const {
238 return send_codec_spec_.codec_inst.pltype != -1;
239 }
237 240
238 rtc::ThreadChecker worker_thread_checker_; 241 rtc::ThreadChecker worker_thread_checker_;
239 242
240 WebRtcVoiceEngine* const engine_ = nullptr; 243 WebRtcVoiceEngine* const engine_ = nullptr;
241 std::vector<AudioCodec> recv_codecs_; 244 std::vector<AudioCodec> recv_codecs_;
242 std::vector<AudioCodec> send_codecs_;
243 std::unique_ptr<webrtc::CodecInst> send_codec_;
244 bool send_bitrate_setting_ = false; 245 bool send_bitrate_setting_ = false;
245 int send_bitrate_bps_ = 0; 246 int send_bitrate_bps_ = 0;
246 AudioOptions options_; 247 AudioOptions options_;
247 rtc::Optional<int> dtmf_payload_type_; 248 rtc::Optional<int> dtmf_payload_type_;
248 bool desired_playout_ = false; 249 bool desired_playout_ = false;
249 bool nack_enabled_ = false; 250 bool recv_transport_cc_enabled_ = false;
250 bool transport_cc_enabled_ = false;
251 bool playout_ = false; 251 bool playout_ = false;
252 SendFlags desired_send_ = SEND_NOTHING; 252 SendFlags desired_send_ = SEND_NOTHING;
253 SendFlags send_ = SEND_NOTHING; 253 SendFlags send_ = SEND_NOTHING;
254 webrtc::Call* const call_ = nullptr; 254 webrtc::Call* const call_ = nullptr;
255 255
256 // SSRC of unsignalled receive stream, or -1 if there isn't one. 256 // SSRC of unsignalled receive stream, or -1 if there isn't one.
257 int64_t default_recv_ssrc_ = -1; 257 int64_t default_recv_ssrc_ = -1;
258 // Volume for unsignalled stream, which may be set before the stream exists. 258 // Volume for unsignalled stream, which may be set before the stream exists.
259 double default_recv_volume_ = 1.0; 259 double default_recv_volume_ = 1.0;
260 // Sink for unsignalled stream, which may be set before the stream exists. 260 // Sink for unsignalled stream, which may be set before the stream exists.
261 std::unique_ptr<webrtc::AudioSinkInterface> default_sink_; 261 std::unique_ptr<webrtc::AudioSinkInterface> default_sink_;
262 // Default SSRC to use for RTCP receiver reports in case of no signaled 262 // Default SSRC to use for RTCP receiver reports in case of no signaled
263 // send streams. See: https://code.google.com/p/webrtc/issues/detail?id=4740 263 // send streams. See: https://code.google.com/p/webrtc/issues/detail?id=4740
264 // and https://code.google.com/p/chromium/issues/detail?id=547661 264 // and https://code.google.com/p/chromium/issues/detail?id=547661
265 uint32_t receiver_reports_ssrc_ = 0xFA17FA17u; 265 uint32_t receiver_reports_ssrc_ = 0xFA17FA17u;
266 266
267 class WebRtcAudioSendStream; 267 class WebRtcAudioSendStream;
268 std::map<uint32_t, WebRtcAudioSendStream*> send_streams_; 268 std::map<uint32_t, WebRtcAudioSendStream*> send_streams_;
269 std::vector<webrtc::RtpExtension> send_rtp_extensions_; 269 std::vector<webrtc::RtpExtension> send_rtp_extensions_;
270 270
271 class WebRtcAudioReceiveStream; 271 class WebRtcAudioReceiveStream;
272 std::map<uint32_t, WebRtcAudioReceiveStream*> recv_streams_; 272 std::map<uint32_t, WebRtcAudioReceiveStream*> recv_streams_;
273 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; 273 std::vector<webrtc::RtpExtension> recv_rtp_extensions_;
274 274
275 struct SendCodecSpec {
276 SendCodecSpec() {
277 std::memset(&codec_inst, 0, sizeof(codec_inst));
ossu 2016/03/04 14:40:22 I believe CodecInst could be zero initialized with
the sun 2016/03/04 15:44:03 Yes, unfortunately direct braced init of the field
278 codec_inst.pltype = -1;
279 }
280 bool nack_enabled = false;
281 bool transport_cc_enabled = false;
282 bool enable_codec_fec = false;
283 bool enable_opus_dtx = false;
284 int opus_max_playback_rate = 0;
285 int red_payload_type = -1;
286 int cng_payload_type = -1;
287 int cng_plfreq = -1;
288 webrtc::CodecInst codec_inst;
289 } send_codec_spec_;
290
275 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel); 291 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel);
276 }; 292 };
277 } // namespace cricket 293 } // namespace cricket
278 294
279 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ 295 #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.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698