|
@@ -189,13 +189,14 @@ void PeerConnection::setLocalDescription(Description::Type type) {
|
|
|
|
|
|
auto iceTransport = initIceTransport();
|
|
|
|
|
|
- Description localDescription = iceTransport->getLocalDescription(type);
|
|
|
- processLocalDescription(std::move(localDescription));
|
|
|
+ Description local = iceTransport->getLocalDescription(type);
|
|
|
+ processLocalDescription(std::move(local));
|
|
|
|
|
|
changeSignalingState(newSignalingState);
|
|
|
|
|
|
- if (mGatheringState == GatheringState::New)
|
|
|
- iceTransport->gatherLocalCandidates();
|
|
|
+ if (mGatheringState == GatheringState::New) {
|
|
|
+ iceTransport->gatherLocalCandidates(localBundleMid());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void PeerConnection::setRemoteDescription(Description description) {
|
|
@@ -1145,6 +1146,11 @@ void PeerConnection::processRemoteCandidate(Candidate candidate) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+string PeerConnection::localBundleMid() const {
|
|
|
+ std::lock_guard lock(mLocalDescriptionMutex);
|
|
|
+ return mLocalDescription ? mLocalDescription->bundleMid() : "0";
|
|
|
+}
|
|
|
+
|
|
|
void PeerConnection::triggerDataChannel(weak_ptr<DataChannel> weakDataChannel) {
|
|
|
auto dataChannel = weakDataChannel.lock();
|
|
|
if (!dataChannel)
|