Fix the 'SetConfiguration(RTCConfiguration::use_media_transport)' setting.
In the past, it would incorrectly set up a state for 'use_media_transport' (i.e. it could say "use_media_transport" is true, but jseptransportcontroller wouldn't know about that). Also, removes unnecessary field (unused). Bug: webrtc:9719 Change-Id: I7e5c0ce81b3b70f63c49d661d95b95b5bcbb0c68 Reviewed-on: https://webrtc-review.googlesource.com/c/106960 Reviewed-by: Steve Anton <steveanton@webrtc.org> Reviewed-by: Anton Sukhanov <sukhanov@webrtc.org> Commit-Queue: Peter Slatala <psla@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25263}
This commit is contained in:

committed by
Commit Bot

parent
28c437c105
commit
97fc11fb86
@ -378,6 +378,15 @@ void JsepTransportController::SetActiveResetSrtpParams(
|
||||
}
|
||||
}
|
||||
|
||||
void JsepTransportController::SetMediaTransportFactory(
|
||||
MediaTransportFactory* media_transport_factory) {
|
||||
RTC_DCHECK(media_transport_factory == config_.media_transport_factory ||
|
||||
jsep_transports_by_name_.empty())
|
||||
<< "You can only call SetMediaTransportFactory before "
|
||||
"JsepTransportController created its first transport.";
|
||||
config_.media_transport_factory = media_transport_factory;
|
||||
}
|
||||
|
||||
std::unique_ptr<cricket::DtlsTransportInternal>
|
||||
JsepTransportController::CreateDtlsTransport(const std::string& transport_name,
|
||||
bool rtcp) {
|
||||
|
@ -167,6 +167,12 @@ class JsepTransportController : public sigslot::has_slots<> {
|
||||
|
||||
void SetActiveResetSrtpParams(bool active_reset_srtp_params);
|
||||
|
||||
// Allows to overwrite the settings from config. You may set or reset the
|
||||
// media transport factory on the jsep transport controller, as long as you
|
||||
// did not call 'GetMediaTransport' or 'MaybeCreateJsepTransport'. Once Jsep
|
||||
// transport is created, you can't change this setting.
|
||||
void SetMediaTransportFactory(MediaTransportFactory* media_transport_factory);
|
||||
|
||||
// All of these signals are fired on the signaling thread.
|
||||
|
||||
// If any transport failed => failed,
|
||||
|
@ -2981,6 +2981,9 @@ bool PeerConnection::SetConfiguration(const RTCConfiguration& configuration,
|
||||
}
|
||||
|
||||
transport_controller_->SetIceConfig(ParseIceConfig(modified_config));
|
||||
transport_controller_->SetMediaTransportFactory(
|
||||
modified_config.use_media_transport ? factory_->media_transport_factory()
|
||||
: nullptr);
|
||||
|
||||
if (configuration_.active_reset_srtp_params !=
|
||||
modified_config.active_reset_srtp_params) {
|
||||
|
@ -927,7 +927,10 @@ class PeerConnection : public PeerConnectionInternal,
|
||||
MediaTransportInterface* GetMediaTransport(const std::string& mid) {
|
||||
auto media_transport = transport_controller_->GetMediaTransport(mid);
|
||||
RTC_DCHECK(configuration_.use_media_transport ==
|
||||
(media_transport != nullptr));
|
||||
(media_transport != nullptr))
|
||||
<< "configuration_.use_media_transport="
|
||||
<< configuration_.use_media_transport
|
||||
<< ", (media_transport != nullptr)=" << (media_transport != nullptr);
|
||||
return media_transport;
|
||||
}
|
||||
|
||||
@ -1043,10 +1046,6 @@ class PeerConnection : public PeerConnectionInternal,
|
||||
// List of content names for which the remote side triggered an ICE restart.
|
||||
std::set<std::string> pending_ice_restarts_;
|
||||
|
||||
// Optional media transport for sending / receiving encoded frames.
|
||||
// If available, media transport will be used instead of RTP / SRTP.
|
||||
std::unique_ptr<MediaTransportFactory> media_transport_factory_;
|
||||
|
||||
std::unique_ptr<WebRtcSessionDescriptionFactory> webrtc_session_desc_factory_;
|
||||
|
||||
// Member variables for caching global options.
|
||||
|
Reference in New Issue
Block a user