Removing unnecessary parameters from CreateXChannel methods.
"bundle_transport_name" is no longer relevant here, and "rtcp_mux_required" is implied by whether or not an RTCP transport is passed in. BUG=None Review-Url: https://codereview.webrtc.org/2689503002 Cr-Commit-Position: refs/heads/master@{#16551}
This commit is contained in:
parent
757146baf1
commit
1a2183d0c3
@ -208,15 +208,13 @@ VoiceChannel* ChannelManager::CreateVoiceChannel(
|
||||
DtlsTransportInternal* rtcp_transport,
|
||||
rtc::Thread* signaling_thread,
|
||||
const std::string& content_name,
|
||||
const std::string* bundle_transport_name,
|
||||
bool rtcp_mux_required,
|
||||
bool srtp_required,
|
||||
const AudioOptions& options) {
|
||||
return worker_thread_->Invoke<VoiceChannel*>(
|
||||
RTC_FROM_HERE,
|
||||
Bind(&ChannelManager::CreateVoiceChannel_w, this, media_controller,
|
||||
rtp_transport, rtcp_transport, signaling_thread, content_name,
|
||||
bundle_transport_name, rtcp_mux_required, srtp_required, options));
|
||||
srtp_required, options));
|
||||
}
|
||||
|
||||
VoiceChannel* ChannelManager::CreateVoiceChannel_w(
|
||||
@ -225,8 +223,6 @@ VoiceChannel* ChannelManager::CreateVoiceChannel_w(
|
||||
DtlsTransportInternal* rtcp_transport,
|
||||
rtc::Thread* signaling_thread,
|
||||
const std::string& content_name,
|
||||
const std::string* bundle_transport_name,
|
||||
bool rtcp_mux_required,
|
||||
bool srtp_required,
|
||||
const AudioOptions& options) {
|
||||
RTC_DCHECK(initialized_);
|
||||
@ -240,7 +236,7 @@ VoiceChannel* ChannelManager::CreateVoiceChannel_w(
|
||||
|
||||
VoiceChannel* voice_channel = new VoiceChannel(
|
||||
worker_thread_, network_thread_, signaling_thread, media_engine_.get(),
|
||||
media_channel, content_name, rtcp_mux_required, srtp_required);
|
||||
media_channel, content_name, rtcp_transport == nullptr, srtp_required);
|
||||
voice_channel->SetCryptoOptions(crypto_options_);
|
||||
|
||||
if (!voice_channel->Init_w(rtp_transport, rtcp_transport, rtp_transport,
|
||||
@ -281,15 +277,13 @@ VideoChannel* ChannelManager::CreateVideoChannel(
|
||||
DtlsTransportInternal* rtcp_transport,
|
||||
rtc::Thread* signaling_thread,
|
||||
const std::string& content_name,
|
||||
const std::string* bundle_transport_name,
|
||||
bool rtcp_mux_required,
|
||||
bool srtp_required,
|
||||
const VideoOptions& options) {
|
||||
return worker_thread_->Invoke<VideoChannel*>(
|
||||
RTC_FROM_HERE,
|
||||
Bind(&ChannelManager::CreateVideoChannel_w, this, media_controller,
|
||||
rtp_transport, rtcp_transport, signaling_thread, content_name,
|
||||
bundle_transport_name, rtcp_mux_required, srtp_required, options));
|
||||
srtp_required, options));
|
||||
}
|
||||
|
||||
VideoChannel* ChannelManager::CreateVideoChannel_w(
|
||||
@ -298,8 +292,6 @@ VideoChannel* ChannelManager::CreateVideoChannel_w(
|
||||
DtlsTransportInternal* rtcp_transport,
|
||||
rtc::Thread* signaling_thread,
|
||||
const std::string& content_name,
|
||||
const std::string* bundle_transport_name,
|
||||
bool rtcp_mux_required,
|
||||
bool srtp_required,
|
||||
const VideoOptions& options) {
|
||||
RTC_DCHECK(initialized_);
|
||||
@ -313,7 +305,7 @@ VideoChannel* ChannelManager::CreateVideoChannel_w(
|
||||
|
||||
VideoChannel* video_channel = new VideoChannel(
|
||||
worker_thread_, network_thread_, signaling_thread, media_channel,
|
||||
content_name, rtcp_mux_required, srtp_required);
|
||||
content_name, rtcp_transport == nullptr, srtp_required);
|
||||
video_channel->SetCryptoOptions(crypto_options_);
|
||||
if (!video_channel->Init_w(rtp_transport, rtcp_transport, rtp_transport,
|
||||
rtcp_transport)) {
|
||||
@ -354,14 +346,11 @@ RtpDataChannel* ChannelManager::CreateRtpDataChannel(
|
||||
DtlsTransportInternal* rtcp_transport,
|
||||
rtc::Thread* signaling_thread,
|
||||
const std::string& content_name,
|
||||
const std::string* bundle_transport_name,
|
||||
bool rtcp_mux_required,
|
||||
bool srtp_required) {
|
||||
return worker_thread_->Invoke<RtpDataChannel*>(
|
||||
RTC_FROM_HERE,
|
||||
Bind(&ChannelManager::CreateRtpDataChannel_w, this, media_controller,
|
||||
rtp_transport, rtcp_transport, signaling_thread, content_name,
|
||||
bundle_transport_name, rtcp_mux_required, srtp_required));
|
||||
RTC_FROM_HERE, Bind(&ChannelManager::CreateRtpDataChannel_w, this,
|
||||
media_controller, rtp_transport, rtcp_transport,
|
||||
signaling_thread, content_name, srtp_required));
|
||||
}
|
||||
|
||||
RtpDataChannel* ChannelManager::CreateRtpDataChannel_w(
|
||||
@ -370,8 +359,6 @@ RtpDataChannel* ChannelManager::CreateRtpDataChannel_w(
|
||||
DtlsTransportInternal* rtcp_transport,
|
||||
rtc::Thread* signaling_thread,
|
||||
const std::string& content_name,
|
||||
const std::string* bundle_transport_name,
|
||||
bool rtcp_mux_required,
|
||||
bool srtp_required) {
|
||||
// This is ok to alloc from a thread other than the worker thread.
|
||||
RTC_DCHECK(initialized_);
|
||||
@ -387,7 +374,7 @@ RtpDataChannel* ChannelManager::CreateRtpDataChannel_w(
|
||||
|
||||
RtpDataChannel* data_channel = new RtpDataChannel(
|
||||
worker_thread_, network_thread_, signaling_thread, media_channel,
|
||||
content_name, rtcp_mux_required, srtp_required);
|
||||
content_name, rtcp_transport == nullptr, srtp_required);
|
||||
data_channel->SetCryptoOptions(crypto_options_);
|
||||
if (!data_channel->Init_w(rtp_transport, rtcp_transport, rtp_transport,
|
||||
rtcp_transport)) {
|
||||
|
||||
@ -93,8 +93,6 @@ class ChannelManager {
|
||||
DtlsTransportInternal* rtcp_transport,
|
||||
rtc::Thread* signaling_thread,
|
||||
const std::string& content_name,
|
||||
const std::string* bundle_transport_name,
|
||||
bool rtcp_mux_required,
|
||||
bool srtp_required,
|
||||
const AudioOptions& options);
|
||||
// Destroys a voice channel created with the Create API.
|
||||
@ -107,8 +105,6 @@ class ChannelManager {
|
||||
DtlsTransportInternal* rtcp_transport,
|
||||
rtc::Thread* signaling_thread,
|
||||
const std::string& content_name,
|
||||
const std::string* bundle_transport_name,
|
||||
bool rtcp_mux_required,
|
||||
bool srtp_required,
|
||||
const VideoOptions& options);
|
||||
// Destroys a video channel created with the Create API.
|
||||
@ -119,8 +115,6 @@ class ChannelManager {
|
||||
DtlsTransportInternal* rtcp_transport,
|
||||
rtc::Thread* signaling_thread,
|
||||
const std::string& content_name,
|
||||
const std::string* bundle_transport_name,
|
||||
bool rtcp_mux_required,
|
||||
bool srtp_required);
|
||||
// Destroys a data channel created with the Create API.
|
||||
void DestroyRtpDataChannel(RtpDataChannel* data_channel);
|
||||
@ -170,8 +164,6 @@ class ChannelManager {
|
||||
DtlsTransportInternal* rtcp_transport,
|
||||
rtc::Thread* signaling_thread,
|
||||
const std::string& content_name,
|
||||
const std::string* bundle_transport_name,
|
||||
bool rtcp_mux_required,
|
||||
bool srtp_required,
|
||||
const AudioOptions& options);
|
||||
void DestroyVoiceChannel_w(VoiceChannel* voice_channel);
|
||||
@ -181,8 +173,6 @@ class ChannelManager {
|
||||
DtlsTransportInternal* rtcp_transport,
|
||||
rtc::Thread* signaling_thread,
|
||||
const std::string& content_name,
|
||||
const std::string* bundle_transport_name,
|
||||
bool rtcp_mux_required,
|
||||
bool srtp_required,
|
||||
const VideoOptions& options);
|
||||
void DestroyVideoChannel_w(VideoChannel* video_channel);
|
||||
@ -192,8 +182,6 @@ class ChannelManager {
|
||||
DtlsTransportInternal* rtcp_transport,
|
||||
rtc::Thread* signaling_thread,
|
||||
const std::string& content_name,
|
||||
const std::string* bundle_transport_name,
|
||||
bool rtcp_mux_required,
|
||||
bool srtp_required);
|
||||
void DestroyRtpDataChannel_w(RtpDataChannel* data_channel);
|
||||
|
||||
|
||||
@ -22,8 +22,7 @@
|
||||
#include "webrtc/pc/channelmanager.h"
|
||||
#include "webrtc/pc/fakemediacontroller.h"
|
||||
|
||||
namespace cricket {
|
||||
const bool kDefaultRtcpMuxRequired = true;
|
||||
namespace {
|
||||
const bool kDefaultSrtpRequired = true;
|
||||
}
|
||||
|
||||
@ -103,18 +102,17 @@ TEST_F(ChannelManagerTest, CreateDestroyChannels) {
|
||||
cricket::CN_AUDIO, cricket::ICE_CANDIDATE_COMPONENT_RTP);
|
||||
cricket::VoiceChannel* voice_channel = cm_->CreateVoiceChannel(
|
||||
&fake_mc_, rtp_transport, nullptr /*rtcp_transport*/,
|
||||
rtc::Thread::Current(), cricket::CN_AUDIO, nullptr,
|
||||
kDefaultRtcpMuxRequired, kDefaultSrtpRequired, AudioOptions());
|
||||
rtc::Thread::Current(), cricket::CN_AUDIO, kDefaultSrtpRequired,
|
||||
AudioOptions());
|
||||
EXPECT_TRUE(voice_channel != nullptr);
|
||||
cricket::VideoChannel* video_channel = cm_->CreateVideoChannel(
|
||||
&fake_mc_, rtp_transport, nullptr /*rtcp_transport*/,
|
||||
rtc::Thread::Current(), cricket::CN_VIDEO, nullptr,
|
||||
kDefaultRtcpMuxRequired, kDefaultSrtpRequired, VideoOptions());
|
||||
rtc::Thread::Current(), cricket::CN_VIDEO, kDefaultSrtpRequired,
|
||||
VideoOptions());
|
||||
EXPECT_TRUE(video_channel != nullptr);
|
||||
cricket::RtpDataChannel* rtp_data_channel = cm_->CreateRtpDataChannel(
|
||||
&fake_mc_, rtp_transport, nullptr /*rtcp_transport*/,
|
||||
rtc::Thread::Current(), cricket::CN_DATA, nullptr,
|
||||
kDefaultRtcpMuxRequired, kDefaultSrtpRequired);
|
||||
rtc::Thread::Current(), cricket::CN_DATA, kDefaultSrtpRequired);
|
||||
EXPECT_TRUE(rtp_data_channel != nullptr);
|
||||
cm_->DestroyVideoChannel(video_channel);
|
||||
cm_->DestroyVoiceChannel(voice_channel);
|
||||
@ -136,18 +134,17 @@ TEST_F(ChannelManagerTest, CreateDestroyChannelsOnThread) {
|
||||
cricket::CN_AUDIO, cricket::ICE_CANDIDATE_COMPONENT_RTP);
|
||||
cricket::VoiceChannel* voice_channel = cm_->CreateVoiceChannel(
|
||||
&fake_mc_, rtp_transport, nullptr /*rtcp_transport*/,
|
||||
rtc::Thread::Current(), cricket::CN_AUDIO, nullptr,
|
||||
kDefaultRtcpMuxRequired, kDefaultSrtpRequired, AudioOptions());
|
||||
rtc::Thread::Current(), cricket::CN_AUDIO, kDefaultSrtpRequired,
|
||||
AudioOptions());
|
||||
EXPECT_TRUE(voice_channel != nullptr);
|
||||
cricket::VideoChannel* video_channel = cm_->CreateVideoChannel(
|
||||
&fake_mc_, rtp_transport, nullptr /*rtcp_transport*/,
|
||||
rtc::Thread::Current(), cricket::CN_VIDEO, nullptr,
|
||||
kDefaultRtcpMuxRequired, kDefaultSrtpRequired, VideoOptions());
|
||||
rtc::Thread::Current(), cricket::CN_VIDEO, kDefaultSrtpRequired,
|
||||
VideoOptions());
|
||||
EXPECT_TRUE(video_channel != nullptr);
|
||||
cricket::RtpDataChannel* rtp_data_channel = cm_->CreateRtpDataChannel(
|
||||
&fake_mc_, rtp_transport, nullptr /*rtcp_transport*/,
|
||||
rtc::Thread::Current(), cricket::CN_DATA, nullptr,
|
||||
kDefaultRtcpMuxRequired, kDefaultSrtpRequired);
|
||||
rtc::Thread::Current(), cricket::CN_DATA, kDefaultSrtpRequired);
|
||||
EXPECT_TRUE(rtp_data_channel != nullptr);
|
||||
cm_->DestroyVideoChannel(video_channel);
|
||||
cm_->DestroyVoiceChannel(voice_channel);
|
||||
|
||||
@ -70,19 +70,16 @@ class RtpSenderReceiverTest : public testing::Test,
|
||||
stream_(MediaStream::Create(kStreamLabel1)) {
|
||||
// Create channels to be used by the RtpSenders and RtpReceivers.
|
||||
channel_manager_.Init();
|
||||
bool rtcp_mux_required = true;
|
||||
bool srtp_required = true;
|
||||
cricket::DtlsTransportInternal* rtp_transport =
|
||||
fake_transport_controller_.CreateDtlsTransport(
|
||||
cricket::CN_AUDIO, cricket::ICE_CANDIDATE_COMPONENT_RTP);
|
||||
voice_channel_ = channel_manager_.CreateVoiceChannel(
|
||||
&fake_media_controller_, rtp_transport, nullptr, rtc::Thread::Current(),
|
||||
cricket::CN_AUDIO, nullptr, rtcp_mux_required, srtp_required,
|
||||
cricket::AudioOptions());
|
||||
cricket::CN_AUDIO, srtp_required, cricket::AudioOptions());
|
||||
video_channel_ = channel_manager_.CreateVideoChannel(
|
||||
&fake_media_controller_, rtp_transport, nullptr, rtc::Thread::Current(),
|
||||
cricket::CN_VIDEO, nullptr, rtcp_mux_required, srtp_required,
|
||||
cricket::VideoOptions());
|
||||
cricket::CN_VIDEO, srtp_required, cricket::VideoOptions());
|
||||
voice_channel_->Enable(true);
|
||||
video_channel_->Enable(true);
|
||||
voice_media_channel_ = media_engine_->GetVoiceChannel(0);
|
||||
|
||||
@ -1733,8 +1733,8 @@ bool WebRtcSession::CreateVoiceChannel(const cricket::ContentInfo* content,
|
||||
|
||||
voice_channel_.reset(channel_manager_->CreateVoiceChannel(
|
||||
media_controller_, rtp_dtls_transport, rtcp_dtls_transport,
|
||||
transport_controller_->signaling_thread(), content->name,
|
||||
bundle_transport, require_rtcp_mux, SrtpRequired(), audio_options_));
|
||||
transport_controller_->signaling_thread(), content->name, SrtpRequired(),
|
||||
audio_options_));
|
||||
if (!voice_channel_) {
|
||||
transport_controller_->DestroyDtlsTransport(
|
||||
transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP);
|
||||
@ -1775,8 +1775,8 @@ bool WebRtcSession::CreateVideoChannel(const cricket::ContentInfo* content,
|
||||
|
||||
video_channel_.reset(channel_manager_->CreateVideoChannel(
|
||||
media_controller_, rtp_dtls_transport, rtcp_dtls_transport,
|
||||
transport_controller_->signaling_thread(), content->name,
|
||||
bundle_transport, require_rtcp_mux, SrtpRequired(), video_options_));
|
||||
transport_controller_->signaling_thread(), content->name, SrtpRequired(),
|
||||
video_options_));
|
||||
|
||||
if (!video_channel_) {
|
||||
transport_controller_->DestroyDtlsTransport(
|
||||
@ -1841,7 +1841,7 @@ bool WebRtcSession::CreateDataChannel(const cricket::ContentInfo* content,
|
||||
rtp_data_channel_.reset(channel_manager_->CreateRtpDataChannel(
|
||||
media_controller_, rtp_dtls_transport, rtcp_dtls_transport,
|
||||
transport_controller_->signaling_thread(), content->name,
|
||||
bundle_transport, require_rtcp_mux, SrtpRequired()));
|
||||
SrtpRequired()));
|
||||
|
||||
if (!rtp_data_channel_) {
|
||||
transport_controller_->DestroyDtlsTransport(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user