Compare commits

...

8 Commits

Author SHA1 Message Date
e4ab5273fc Bumped version to 0.12.3 2021-05-07 21:24:17 +02:00
bf0b3ce1b9 Resolve use of deprecated ::result_type typedef.
Also adds #include <utility> since this file names std::move.

```
         D:\buildtrees\libdatachannel\src\v0.12.0-2d418b9dcd.clean\include\rtc\utils.hpp(35,23): error C4996: 'std::_Weak_result_type<std::_Is_memfunptr<void (__cdecl rtc::impl::PeerConnection::* )(std::weak_ptr<_Ty>)>,void>::result_type': warning STL4007: Many result_type typedefs and all argument_type, first_argument_type, and second_argument_type typedefs are deprecated in C++17. You can define _SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning. [D:\buildtrees\libdatachannel\x64-uwp-dbg\datachannel.vcxproj]
         D:\buildtrees\libdatachannel\src\v0.12.0-2d418b9dcd.clean\include\rtc\utils.hpp(35,23): error C4996: 'std::_Weak_result_type<std::_Is_memfunptr<void (__cdecl rtc::impl::PeerConnection::* )(rtc::Candidate)>,void>::result_type': warning STL4007: Many result_type typedefs and all argument_type, first_argument_type, and second_argument_type typedefs are deprecated in C++17. You can define _SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning. [D:\buildtrees\libdatachannel\x64-uwp-dbg\datachannel.vcxproj]
         D:\buildtrees\libdatachannel\src\v0.12.0-2d418b9dcd.clean\include\rtc\utils.hpp(35,23): error C4996: 'std::_Weak_result_type<std::_Is_memfunptr<bool (__cdecl rtc::impl::PeerConnection::* )(const std::string &) const>,void>::result_type': warning STL4007: Many result_type typedefs and all argument_type, first_argument_type, and second_argument_type typedefs are deprecated in C++17. You can define _SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning. [D:\buildtrees\libdatachannel\x64-uwp-dbg\datachannel.vcxproj]
         D:\buildtrees\libdatachannel\src\v0.12.0-2d418b9dcd.clean\include\rtc\utils.hpp(35,23): error C4996: 'std::_Weak_result_type<std::_Is_memfunptr<void (__cdecl rtc::impl::PeerConnection::* )(rtc::message_ptr)>,void>::result_type': warning STL4007: Many result_type typedefs and all argument_type, first_argument_type, and second_argument_type typedefs are deprecated in C++17. You can define _SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning. [D:\buildtrees\libdatachannel\x64-uwp-dbg\datachannel.vcxproj]
         D:\buildtrees\libdatachannel\src\v0.12.0-2d418b9dcd.clean\include\rtc\utils.hpp(35,23): error C4996: 'std::_Weak_result_type<std::_Is_memfunptr<void (__cdecl rtc::impl::PeerConnection::* )(uint16_t,size_t)>,void>::result_type': warning STL4007: Many result_type typedefs and all argument_type, first_argument_type, and second_argument_type typedefs are deprecated in C++17. You can define _SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning. [D:\buildtrees\libdatachannel\x64-uwp-dbg\datachannel.vcxproj]
```
2021-04-20 09:20:56 +02:00
655175d21e Bumped version to 0.12.2 2021-04-14 12:24:12 +02:00
c85943e916 support finding openssl form homebrew on M1 Macs
homebrew changed its default installation paths for M1 Macs
2021-04-14 12:22:26 +02:00
1cc7910bf1 Made impl::DataChannel destructor virtual 2021-04-13 22:29:25 +02:00
62b435a4aa Fixed compilation warnings 2021-04-10 16:22:05 +02:00
9da756bd12 Updated Jamfile 2021-04-10 10:54:10 +02:00
f5b584f536 Handle empty RTCIceCandidate.candidate as "end of candidates" indicator 2021-04-08 15:10:26 +02:00
6 changed files with 15 additions and 12 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.7) cmake_minimum_required(VERSION 3.7)
project(libdatachannel project(libdatachannel
VERSION 0.12.1 VERSION 0.12.3
LANGUAGES CXX) LANGUAGES CXX)
set(PROJECT_DESCRIPTION "WebRTC Data Channels Library") set(PROJECT_DESCRIPTION "WebRTC Data Channels Library")

View File

@ -12,9 +12,12 @@ feature.compose <gnutls>on
lib libdatachannel lib libdatachannel
: # sources : # sources
[ glob ./src/*.cpp ] [ glob ./src/*.cpp ]
[ glob ./src/impl/*.cpp ]
: # requirements : # requirements
<cxxstd>17 <cxxstd>17
<include>./include
<include>./include/rtc <include>./include/rtc
<include>./src
<define>RTC_ENABLE_MEDIA=0 <define>RTC_ENABLE_MEDIA=0
<define>RTC_ENABLE_WEBSOCKET=0 <define>RTC_ENABLE_WEBSOCKET=0
<define>USE_NICE=0 <define>USE_NICE=0
@ -143,7 +146,7 @@ rule make_libjuice_openssl ( targets * : sources * : properties * )
{ {
# on macOS, default to pick up openssl from the homebrew installation # on macOS, default to pick up openssl from the homebrew installation
# brew install openssl # brew install openssl
OPENSSL_INCLUDE = /usr/local/opt/openssl/include ; OPENSSL_INCLUDE = /opt/homebrew/opt/openssl /usr/local/opt/openssl/include ;
} }
if $(OPENSSL_INCLUDE) != "" if $(OPENSSL_INCLUDE) != ""
@ -191,7 +194,7 @@ rule openssl-lib-path ( properties * )
{ {
# on macOS, default to pick up openssl from the homebrew installation # on macOS, default to pick up openssl from the homebrew installation
# brew install openssl # brew install openssl
OPENSSL_LIB = /usr/local/opt/openssl/lib ; OPENSSL_LIB = /opt/homebrew/opt/openssl/lib /usr/local/opt/openssl/lib ;
} }
else if <target-os>windows in $(properties) && $(OPENSSL_LIB) = "" else if <target-os>windows in $(properties) && $(OPENSSL_LIB) = ""
{ {
@ -217,7 +220,7 @@ rule openssl-include-path ( properties * )
{ {
# on macOS, default to pick up openssl from the homebrew installation # on macOS, default to pick up openssl from the homebrew installation
# brew install openssl # brew install openssl
OPENSSL_INCLUDE = /usr/local/opt/openssl/include ; OPENSSL_INCLUDE = /opt/homebrew/opt/openssl/include /usr/local/opt/openssl/include ;
} }
else if <target-os>windows in $(properties) && $(OPENSSL_INCLUDE) = "" else if <target-os>windows in $(properties) && $(OPENSSL_INCLUDE) = ""
{ {

View File

@ -118,7 +118,7 @@ function createPeerConnection(ws, id) {
pc.onconnectionstatechange = () => console.log(`Connection state: ${pc.connectionState}`); pc.onconnectionstatechange = () => console.log(`Connection state: ${pc.connectionState}`);
pc.onicegatheringstatechange = () => console.log(`Gathering state: ${pc.iceGatheringState}`); pc.onicegatheringstatechange = () => console.log(`Gathering state: ${pc.iceGatheringState}`);
pc.onicecandidate = (e) => { pc.onicecandidate = (e) => {
if (e.candidate) { if (e.candidate && e.candidate.candidate) {
// Send candidate // Send candidate
sendLocalCandidate(ws, id, e.candidate); sendLocalCandidate(ws, id, e.candidate);
} }

View File

@ -22,6 +22,7 @@
#include <functional> #include <functional>
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <utility>
namespace rtc { namespace rtc {
@ -32,11 +33,10 @@ template <class... Ts> overloaded(Ts...) -> overloaded<Ts...>;
// weak_ptr bind helper // weak_ptr bind helper
template <typename F, typename T, typename... Args> auto weak_bind(F &&f, T *t, Args &&..._args) { template <typename F, typename T, typename... Args> auto weak_bind(F &&f, T *t, Args &&..._args) {
return [bound = std::bind(f, t, _args...), weak_this = t->weak_from_this()](auto &&...args) { return [bound = std::bind(f, t, _args...), weak_this = t->weak_from_this()](auto &&...args) {
using result_type = typename decltype(bound)::result_type;
if (auto shared_this = weak_this.lock()) if (auto shared_this = weak_this.lock())
return bound(args...); return bound(args...);
else else
return static_cast<result_type>(false); return static_cast<decltype(bound(args...))>(false);
}; };
} }

View File

@ -36,7 +36,7 @@ struct PeerConnection;
struct DataChannel : Channel, std::enable_shared_from_this<DataChannel> { struct DataChannel : Channel, std::enable_shared_from_this<DataChannel> {
DataChannel(weak_ptr<PeerConnection> pc, uint16_t stream, string label, string protocol, DataChannel(weak_ptr<PeerConnection> pc, uint16_t stream, string label, string protocol,
Reliability reliability); Reliability reliability);
~DataChannel(); virtual ~DataChannel();
void close(); void close();
void remoteClose(); void remoteClose();

View File

@ -189,7 +189,7 @@ shared_ptr<DtlsTransport> PeerConnection::initDtlsTransport() {
auto certificate = mCertificate.get(); auto certificate = mCertificate.get();
auto lower = std::atomic_load(&mIceTransport); auto lower = std::atomic_load(&mIceTransport);
auto verifierCallback = weak_bind(&PeerConnection::checkFingerprint, this, _1); auto verifierCallback = weak_bind(&PeerConnection::checkFingerprint, this, _1);
auto stateChangeCallback = auto dtlsStateChangeCallback =
[this, weak_this = weak_from_this()](DtlsTransport::State transportState) { [this, weak_this = weak_from_this()](DtlsTransport::State transportState) {
auto shared_this = weak_this.lock(); auto shared_this = weak_this.lock();
if (!shared_this) if (!shared_this)
@ -224,7 +224,7 @@ shared_ptr<DtlsTransport> PeerConnection::initDtlsTransport() {
// DTLS-SRTP // DTLS-SRTP
transport = std::make_shared<DtlsSrtpTransport>( transport = std::make_shared<DtlsSrtpTransport>(
lower, certificate, config.mtu, verifierCallback, lower, certificate, config.mtu, verifierCallback,
weak_bind(&PeerConnection::forwardMedia, this, _1), stateChangeCallback); weak_bind(&PeerConnection::forwardMedia, this, _1), dtlsStateChangeCallback);
#else #else
PLOG_WARNING << "Ignoring media support (not compiled with media support)"; PLOG_WARNING << "Ignoring media support (not compiled with media support)";
#endif #endif
@ -233,7 +233,7 @@ shared_ptr<DtlsTransport> PeerConnection::initDtlsTransport() {
if (!transport) { if (!transport) {
// DTLS only // DTLS only
transport = std::make_shared<DtlsTransport>(lower, certificate, config.mtu, transport = std::make_shared<DtlsTransport>(lower, certificate, config.mtu,
verifierCallback, stateChangeCallback); verifierCallback, dtlsStateChangeCallback);
} }
std::atomic_store(&mDtlsTransport, transport); std::atomic_store(&mDtlsTransport, transport);
@ -738,7 +738,7 @@ void PeerConnection::validateRemoteDescription(const Description &description) {
} }
void PeerConnection::processLocalDescription(Description description) { void PeerConnection::processLocalDescription(Description description) {
const size_t localSctpPort = DEFAULT_SCTP_PORT; const uint16_t localSctpPort = DEFAULT_SCTP_PORT;
const size_t localMaxMessageSize = const size_t localMaxMessageSize =
config.maxMessageSize.value_or(DEFAULT_LOCAL_MAX_MESSAGE_SIZE); config.maxMessageSize.value_or(DEFAULT_LOCAL_MAX_MESSAGE_SIZE);