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

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

Issue 2954903002: Media track ID visibility at BWE level
Patch Set: Media track ID visibility at BWE level Created 3 years, 4 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 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 } 836 }
837 837
838 class WebRtcVoiceMediaChannel::WebRtcAudioSendStream 838 class WebRtcVoiceMediaChannel::WebRtcAudioSendStream
839 : public AudioSource::Sink { 839 : public AudioSource::Sink {
840 public: 840 public:
841 WebRtcAudioSendStream( 841 WebRtcAudioSendStream(
842 int ch, 842 int ch,
843 webrtc::AudioTransport* voe_audio_transport, 843 webrtc::AudioTransport* voe_audio_transport,
844 uint32_t ssrc, 844 uint32_t ssrc,
845 const std::string& c_name, 845 const std::string& c_name,
846 const std::string track_id,
846 const rtc::Optional<webrtc::AudioSendStream::Config::SendCodecSpec>& 847 const rtc::Optional<webrtc::AudioSendStream::Config::SendCodecSpec>&
847 send_codec_spec, 848 send_codec_spec,
848 const std::vector<webrtc::RtpExtension>& extensions, 849 const std::vector<webrtc::RtpExtension>& extensions,
849 int max_send_bitrate_bps, 850 int max_send_bitrate_bps,
850 const rtc::Optional<std::string>& audio_network_adaptor_config, 851 const rtc::Optional<std::string>& audio_network_adaptor_config,
851 webrtc::Call* call, 852 webrtc::Call* call,
852 webrtc::Transport* send_transport, 853 webrtc::Transport* send_transport,
853 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& encoder_factory) 854 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& encoder_factory)
854 : voe_audio_transport_(voe_audio_transport), 855 : voe_audio_transport_(voe_audio_transport),
855 call_(call), 856 call_(call),
856 config_(send_transport), 857 config_(send_transport),
857 send_side_bwe_with_overhead_( 858 send_side_bwe_with_overhead_(
858 webrtc::field_trial::IsEnabled("WebRTC-SendSideBwe-WithOverhead")), 859 webrtc::field_trial::IsEnabled("WebRTC-SendSideBwe-WithOverhead")),
859 max_send_bitrate_bps_(max_send_bitrate_bps), 860 max_send_bitrate_bps_(max_send_bitrate_bps),
860 rtp_parameters_(CreateRtpParametersWithOneEncoding()) { 861 rtp_parameters_(CreateRtpParametersWithOneEncoding()) {
861 RTC_DCHECK_GE(ch, 0); 862 RTC_DCHECK_GE(ch, 0);
862 // TODO(solenberg): Once we're not using FakeWebRtcVoiceEngine anymore: 863 // TODO(solenberg): Once we're not using FakeWebRtcVoiceEngine anymore:
863 // RTC_DCHECK(voe_audio_transport); 864 // RTC_DCHECK(voe_audio_transport);
864 RTC_DCHECK(call); 865 RTC_DCHECK(call);
865 RTC_DCHECK(encoder_factory); 866 RTC_DCHECK(encoder_factory);
866 config_.rtp.ssrc = ssrc; 867 config_.rtp.ssrc = ssrc;
867 config_.rtp.c_name = c_name; 868 config_.rtp.c_name = c_name;
868 config_.voe_channel_id = ch; 869 config_.voe_channel_id = ch;
869 config_.rtp.extensions = extensions; 870 config_.rtp.extensions = extensions;
870 config_.audio_network_adaptor_config = audio_network_adaptor_config; 871 config_.audio_network_adaptor_config = audio_network_adaptor_config;
871 config_.encoder_factory = encoder_factory; 872 config_.encoder_factory = encoder_factory;
873 config_.track_id = track_id;
872 rtp_parameters_.encodings[0].ssrc = rtc::Optional<uint32_t>(ssrc); 874 rtp_parameters_.encodings[0].ssrc = rtc::Optional<uint32_t>(ssrc);
873 875
874 if (send_codec_spec) { 876 if (send_codec_spec) {
875 UpdateSendCodecSpec(*send_codec_spec); 877 UpdateSendCodecSpec(*send_codec_spec);
876 } 878 }
877 879
878 stream_ = call_->CreateAudioSendStream(config_); 880 stream_ = call_->CreateAudioSendStream(config_);
879 } 881 }
880 882
881 ~WebRtcAudioSendStream() override { 883 ~WebRtcAudioSendStream() override {
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after
1863 } 1865 }
1864 1866
1865 // Save the channel to send_streams_, so that RemoveSendStream() can still 1867 // Save the channel to send_streams_, so that RemoveSendStream() can still
1866 // delete the channel in case failure happens below. 1868 // delete the channel in case failure happens below.
1867 webrtc::AudioTransport* audio_transport = 1869 webrtc::AudioTransport* audio_transport =
1868 engine()->voe()->base()->audio_transport(); 1870 engine()->voe()->base()->audio_transport();
1869 1871
1870 rtc::Optional<std::string> audio_network_adaptor_config = 1872 rtc::Optional<std::string> audio_network_adaptor_config =
1871 GetAudioNetworkAdaptorConfig(options_); 1873 GetAudioNetworkAdaptorConfig(options_);
1872 WebRtcAudioSendStream* stream = new WebRtcAudioSendStream( 1874 WebRtcAudioSendStream* stream = new WebRtcAudioSendStream(
1873 channel, audio_transport, ssrc, sp.cname, send_codec_spec_, 1875 channel, audio_transport, ssrc, sp.cname, sp.id, send_codec_spec_,
1874 send_rtp_extensions_, max_send_bitrate_bps_, audio_network_adaptor_config, 1876 send_rtp_extensions_, max_send_bitrate_bps_, audio_network_adaptor_config,
1875 call_, this, engine()->encoder_factory_); 1877 call_, this, engine()->encoder_factory_);
1876 send_streams_.insert(std::make_pair(ssrc, stream)); 1878 send_streams_.insert(std::make_pair(ssrc, stream));
1877 1879
1878 // At this point the stream's local SSRC has been updated. If it is the first 1880 // At this point the stream's local SSRC has been updated. If it is the first
1879 // send stream, make sure that all the receive streams are updated with the 1881 // send stream, make sure that all the receive streams are updated with the
1880 // same SSRC in order to send receiver reports. 1882 // same SSRC in order to send receiver reports.
1881 if (send_streams_.size() == 1) { 1883 if (send_streams_.size() == 1) {
1882 receiver_reports_ssrc_ = ssrc; 1884 receiver_reports_ssrc_ = ssrc;
1883 for (const auto& kv : recv_streams_) { 1885 for (const auto& kv : recv_streams_) {
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
2365 ssrc); 2367 ssrc);
2366 if (it != unsignaled_recv_ssrcs_.end()) { 2368 if (it != unsignaled_recv_ssrcs_.end()) {
2367 unsignaled_recv_ssrcs_.erase(it); 2369 unsignaled_recv_ssrcs_.erase(it);
2368 return true; 2370 return true;
2369 } 2371 }
2370 return false; 2372 return false;
2371 } 2373 }
2372 } // namespace cricket 2374 } // namespace cricket
2373 2375
2374 #endif // HAVE_WEBRTC_VOICE 2376 #endif // HAVE_WEBRTC_VOICE
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698