mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-22 23:25:33 +00:00
Renamed setRemoteCandidate to addRemoteCandidate
This commit is contained in:
@ -44,7 +44,7 @@ MY_ON_RECV_DESCRIPTION_FROM_REMOTE([pc](string sdp) {
|
||||
});
|
||||
|
||||
MY_ON_RECV_CANDIDATE_FROM_REMOTE([pc](string candidate, string mid) {
|
||||
pc->setRemoteCandidate(Candidate(candidate, mid));
|
||||
pc->addRemoteCandidate(Candidate(candidate, mid));
|
||||
});
|
||||
```
|
||||
|
||||
|
@ -50,7 +50,7 @@ public:
|
||||
std::optional<Description> remoteDescription() const;
|
||||
|
||||
void setRemoteDescription(Description description);
|
||||
void setRemoteCandidate(Candidate candidate);
|
||||
void addRemoteCandidate(Candidate candidate);
|
||||
|
||||
std::shared_ptr<DataChannel> createDataChannel(const string &label, const string &protocol = "",
|
||||
const Reliability &reliability = {});
|
||||
|
@ -57,7 +57,7 @@ void PeerConnection::setRemoteDescription(Description description) {
|
||||
mRemoteDescription.emplace(std::move(description));
|
||||
}
|
||||
|
||||
void PeerConnection::setRemoteCandidate(Candidate candidate) {
|
||||
void PeerConnection::addRemoteCandidate(Candidate candidate) {
|
||||
if (!mRemoteDescription || !mIceTransport)
|
||||
throw std::logic_error("Remote candidate set without remote description");
|
||||
|
||||
|
@ -123,7 +123,7 @@ void rtcSetRemoteCandidate(int pc, const char *candidate, const char *mid) {
|
||||
if (it == peerConnectionMap.end())
|
||||
return;
|
||||
|
||||
it->second->setRemoteCandidate(
|
||||
it->second->addRemoteCandidate(
|
||||
Candidate(string(candidate), mid ? make_optional(string(mid)) : nullopt));
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ int main(int argc, char **argv) {
|
||||
pc1->onLocalCandidate([pc2](const optional<Candidate> &candidate) {
|
||||
if (candidate) {
|
||||
cout << "Candidate 1: " << *candidate << endl;
|
||||
pc2->setRemoteCandidate(*candidate);
|
||||
pc2->addRemoteCandidate(*candidate);
|
||||
}
|
||||
});
|
||||
|
||||
@ -50,7 +50,7 @@ int main(int argc, char **argv) {
|
||||
pc2->onLocalCandidate([pc1](const optional<Candidate> &candidate) {
|
||||
if (candidate) {
|
||||
cout << "Candidate 2: " << *candidate << endl;
|
||||
pc1->setRemoteCandidate(*candidate);
|
||||
pc1->addRemoteCandidate(*candidate);
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user