Merge RTCConfiguration with RTCMediaConstraints in Java/Obj-C wrappers.
The intention of SetConfiguration is that it modifies the configuration, while keeping the constraints passed into CreatePeerConnection. Right now that's now happening. See bug for more explanation. BUG=webrtc:6942 Review-Url: https://codereview.webrtc.org/2603653002 Cr-Commit-Position: refs/heads/master@{#15974}
This commit is contained in:
@ -207,6 +207,7 @@ void PeerConnectionDelegateAdapter::OnIceCandidatesRemoved(
|
||||
NSMutableArray<RTCMediaStream *> *_localStreams;
|
||||
std::unique_ptr<webrtc::PeerConnectionDelegateAdapter> _observer;
|
||||
rtc::scoped_refptr<webrtc::PeerConnectionInterface> _peerConnection;
|
||||
std::unique_ptr<webrtc::MediaConstraints> _nativeConstraints;
|
||||
BOOL _hasStartedRtcEventLog;
|
||||
}
|
||||
|
||||
@ -224,11 +225,11 @@ void PeerConnectionDelegateAdapter::OnIceCandidatesRemoved(
|
||||
}
|
||||
if (self = [super init]) {
|
||||
_observer.reset(new webrtc::PeerConnectionDelegateAdapter(self));
|
||||
std::unique_ptr<webrtc::MediaConstraints> nativeConstraints =
|
||||
constraints.nativeConstraints;
|
||||
_nativeConstraints = constraints.nativeConstraints;
|
||||
CopyConstraintsIntoRtcConfiguration(_nativeConstraints.get(),
|
||||
config.get());
|
||||
_peerConnection =
|
||||
factory.nativeFactory->CreatePeerConnection(*config,
|
||||
nativeConstraints.get(),
|
||||
nullptr,
|
||||
nullptr,
|
||||
_observer.get());
|
||||
@ -282,6 +283,8 @@ void PeerConnectionDelegateAdapter::OnIceCandidatesRemoved(
|
||||
if (!config) {
|
||||
return NO;
|
||||
}
|
||||
CopyConstraintsIntoRtcConfiguration(_nativeConstraints.get(),
|
||||
config.get());
|
||||
return _peerConnection->SetConfiguration(*config);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user