mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-22 15:15:28 +00:00
Use ptrs, optionals and variants from rtc namespace
This commit is contained in:
@ -43,7 +43,7 @@ struct PeerConnection;
|
||||
struct RTC_CPP_EXPORT DataChannelInit {
|
||||
Reliability reliability = {};
|
||||
bool negotiated = false;
|
||||
std::optional<uint16_t> id = nullopt;
|
||||
optional<uint16_t> id = nullopt;
|
||||
string protocol = "";
|
||||
};
|
||||
|
||||
@ -85,10 +85,10 @@ public:
|
||||
bool hasLocalDescription() const;
|
||||
bool hasRemoteDescription() const;
|
||||
bool hasMedia() const;
|
||||
std::optional<Description> localDescription() const;
|
||||
std::optional<Description> remoteDescription() const;
|
||||
std::optional<string> localAddress() const;
|
||||
std::optional<string> remoteAddress() const;
|
||||
optional<Description> localDescription() const;
|
||||
optional<Description> remoteDescription() const;
|
||||
optional<string> localAddress() const;
|
||||
optional<string> remoteAddress() const;
|
||||
bool getSelectedCandidatePair(Candidate *local, Candidate *remote);
|
||||
|
||||
void setLocalDescription(Description::Type type = Description::Type::Unspec);
|
||||
@ -96,11 +96,10 @@ public:
|
||||
void setRemoteDescription(Description description);
|
||||
void addRemoteCandidate(Candidate candidate);
|
||||
|
||||
std::shared_ptr<DataChannel> createDataChannel(string label, DataChannelInit init = {});
|
||||
|
||||
shared_ptr<DataChannel> createDataChannel(string label, DataChannelInit init = {});
|
||||
void onDataChannel(std::function<void(std::shared_ptr<DataChannel> dataChannel)> callback);
|
||||
|
||||
std::shared_ptr<Track> addTrack(Description::Media description);
|
||||
shared_ptr<Track> addTrack(Description::Media description);
|
||||
void onTrack(std::function<void(std::shared_ptr<Track> track)> callback);
|
||||
|
||||
void onLocalDescription(std::function<void(Description description)> callback);
|
||||
@ -113,7 +112,7 @@ public:
|
||||
void clearStats();
|
||||
size_t bytesSent();
|
||||
size_t bytesReceived();
|
||||
std::optional<std::chrono::milliseconds> rtt();
|
||||
optional<std::chrono::milliseconds> rtt();
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
Reference in New Issue
Block a user