Projects
Multimedia
libdatachannel
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 9
View file
_service
Changed
@@ -1,7 +1,7 @@ <services> <service name="obs_scm"> <param name="filename">libdatachannel</param> - <param name="revision">c6696d157b5612df2a741d9a03b192b47ab6cefb</param> + <param name="revision">8e330edebfe766b44f59be427e0454fd18964d4e</param> <param name="scm">git</param> <param name="submodules">disable</param> <param name="url">https://github.com/paullouisageneau/libdatachannel.git</param>
View file
_service:obs_scm:libdatachannel-0.24.3.obscpio/CMakeLists.txt -> _service:obs_scm:libdatachannel-0.24.4.obscpio/CMakeLists.txt
Changed
@@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.13) project(libdatachannel - VERSION 0.24.3 + VERSION 0.24.4 LANGUAGES CXX) set(PROJECT_DESCRIPTION "C/C++ WebRTC network library featuring Data Channels, Media Transport, and WebSockets")
View file
_service:obs_scm:libdatachannel-0.24.3.obscpio/include/rtc/rtc.h -> _service:obs_scm:libdatachannel-0.24.4.obscpio/include/rtc/rtc.h
Changed
@@ -448,20 +448,20 @@ // Get all available payload types for given codec and stores them in buffer, does nothing if // buffer is NULL -int rtcGetTrackPayloadTypesForCodec(int tr, const char *ccodec, int *buffer, int size); +RTC_C_EXPORT int rtcGetTrackPayloadTypesForCodec(int tr, const char *ccodec, int *buffer, int size); // Get all SSRCs for given track -int rtcGetSsrcsForTrack(int tr, uint32_t *buffer, int count); +RTC_C_EXPORT int rtcGetSsrcsForTrack(int tr, uint32_t *buffer, int count); // Get CName for SSRC -int rtcGetCNameForSsrc(int tr, uint32_t ssrc, char *cname, int cnameSize); +RTC_C_EXPORT int rtcGetCNameForSsrc(int tr, uint32_t ssrc, char *cname, int cnameSize); // Get all SSRCs for given media type in given SDP -int rtcGetSsrcsForType(const char *mediaType, const char *sdp, uint32_t *buffer, int bufferSize); +RTC_C_EXPORT int rtcGetSsrcsForType(const char *mediaType, const char *sdp, uint32_t *buffer, int bufferSize); // Set SSRC for given media type in given SDP -int rtcSetSsrcForType(const char *mediaType, const char *sdp, char *buffer, const int bufferSize, - rtcSsrcForTypeInit *init); +RTC_C_EXPORT int rtcSetSsrcForType(const char *mediaType, const char *sdp, char *buffer, const int bufferSize, + rtcSsrcForTypeInit *init); // For backward compatibility, do not use RTC_C_EXPORT RTC_DEPRECATED int rtcSetNeedsToSendRtcpSr(int id);
View file
_service:obs_scm:libdatachannel-0.24.3.obscpio/include/rtc/version.h -> _service:obs_scm:libdatachannel-0.24.4.obscpio/include/rtc/version.h
Changed
@@ -3,7 +3,7 @@ #define RTC_VERSION_MAJOR 0 #define RTC_VERSION_MINOR 24 -#define RTC_VERSION_PATCH 3 -#define RTC_VERSION "0.24.3" +#define RTC_VERSION_PATCH 4 +#define RTC_VERSION "0.24.4" #endif
View file
_service:obs_scm:libdatachannel-0.24.3.obscpio/src/av1rtppacketizer.cpp -> _service:obs_scm:libdatachannel-0.24.4.obscpio/src/av1rtppacketizer.cpp
Changed
@@ -63,6 +63,10 @@ return obus; } + size_t startIndex = index; + bool hasExtension = (data.at(index) & obuHasExtensionMask) != byte(0); + size_t headerSize = obuHeaderSize + (hasExtension ? 1 : 0); + if ((data.at(index) & obuHasExtensionMask) != byte(0)) { index++; } @@ -86,8 +90,16 @@ } } - obus.emplace_back(data.begin() + index, - data.begin() + index + obuHeaderSize + leb128Size + obuLength); + size_t payloadStart = startIndex + headerSize + leb128Size; + binary obu; + obu.reserve(headerSize + obuLength); + obu.push_back(data.at(startIndex) & ~obuHasSizeMask); + if (hasExtension) + obu.push_back(data.at(startIndex + 1)); + if (payloadStart + obuLength <= data.size()) + obu.insert(obu.end(), data.begin() + payloadStart, + data.begin() + payloadStart + obuLength); + obus.push_back(std::move(obu)); index += obuHeaderSize + leb128Size + obuLength; }
View file
_service:obs_scm:libdatachannel-0.24.3.obscpio/src/impl/dtlstransport.cpp -> _service:obs_scm:libdatachannel-0.24.4.obscpio/src/impl/dtlstransport.cpp
Changed
@@ -660,7 +660,7 @@ auto bufMin = std::min(len, size_t(message->size())); std::memcpy(buf, message->data(), bufMin); - return int(len); + return int(bufMin); } // Closed @@ -946,13 +946,14 @@ if (demuxMessage(message)) continue; - BIO_write(mInBio, message->data(), int(message->size())); - + bool incomingWritten = false; if (state() == State::Connecting) { // Continue the handshake int ret, err; { std::lock_guard lock(mSslMutex); + BIO_write(mInBio, message->data(), int(message->size())); + incomingWritten = true; ret = SSL_do_handshake(mSsl); err = SSL_get_error(mSsl, ret); } @@ -975,6 +976,8 @@ int ret, err; { std::lock_guard lock(mSslMutex); + if (!incomingWritten) + BIO_write(mInBio, message->data(), int(message->size())); ret = SSL_read(mSsl, buffer, bufferSize); err = SSL_get_error(mSsl, ret); }
View file
_service:obs_scm:libdatachannel-0.24.3.obscpio/src/impl/icetransport.cpp -> _service:obs_scm:libdatachannel-0.24.4.obscpio/src/impl/icetransport.cpp
Changed
@@ -13,6 +13,7 @@ #include "utils.hpp" #include <algorithm> +#include <future> #include <iostream> #include <random> #include <sstream> @@ -666,6 +667,27 @@ nice_agent_attach_recv(mNiceAgent.get(), mStreamId, 1, g_main_loop_get_context(MainLoop->get()), NULL, NULL); + // Synchronize with the libnice main loop thread BEFORE freeing the + // stream's rx buffer (nice_agent_remove_stream below) or `this`. The + // detach above prevents new dispatches, but a callback (e.g. + // RecvCallback) may already be running on the main loop thread with + // `this` as userData and `buf` pointing into libnice's stream rx buffer. + // Post a barrier task to the main context and wait for it to run; GLib + // dispatches sources serially on that thread, so once our task runs no + // callback can still be using `this` or the rx buffer. + { + std::promise<void> barrier; + auto future = barrier.get_future(); + g_main_context_invoke_full( + g_main_loop_get_context(MainLoop->get()), G_PRIORITY_HIGH, + (gpointer data) -> gboolean { + static_cast<std::promise<void> *>(data)->set_value(); + return G_SOURCE_REMOVE; + }, + &barrier, NULL); + future.wait(); + } + nice_agent_remove_stream(mNiceAgent.get(), mStreamId); mNiceAgent.reset();
View file
_service:obs_scm:libdatachannel-0.24.3.obscpio/src/impl/tcpserver.cpp -> _service:obs_scm:libdatachannel-0.24.4.obscpio/src/impl/tcpserver.cpp
Changed
@@ -56,11 +56,11 @@ mInterrupter.process(pfd0); - if (pfd1.revents & POLLNVAL || pfd1.revents & POLLERR) { - throw std::runtime_error("Error while waiting for socket connection"); + if (pfd1.revents & POLLNVAL) { + throw std::runtime_error("Invalid socket"); } - if (pfd1.revents & POLLIN) { + if (pfd1.revents & POLLIN || pfd1.revents & POLLERR) { struct sockaddr_storage addr; socklen_t addrlen = sizeof(addr); socket_t incomingSock = ::accept(mSock, (struct sockaddr *)&addr, &addrlen);
View file
_service:obs_scm:libdatachannel-0.24.3.obscpio/src/impl/tlstransport.cpp -> _service:obs_scm:libdatachannel-0.24.4.obscpio/src/impl/tlstransport.cpp
Changed
@@ -746,16 +746,19 @@ return; message_ptr message = std::move(*next); - if (message->size() > 0) - BIO_write(mInBio, message->data(), int(message->size())); // Input - else + if (message->size() == 0) { recv(message); // Pass zero-sized messages through + continue; + } + bool incomingWritten = false; if (state() == State::Connecting) { // Continue the handshake int ret, err; { std::lock_guard lock(mSslMutex); + BIO_write(mInBio, message->data(), int(message->size())); + incomingWritten = true; ret = SSL_do_handshake(mSsl); err = SSL_get_error(mSsl, ret); flushOutput(); @@ -773,6 +776,8 @@ while (true) { { std::lock_guard lock(mSslMutex); + if (!incomingWritten) + BIO_write(mInBio, message->data(), int(message->size())); ret = SSL_read(mSsl, buffer, bufferSize); err = SSL_get_error(mSsl, ret); flushOutput(); // SSL_read() can also cause write operations
View file
_service:obs_scm:libdatachannel.obsinfo
Changed
@@ -1,4 +1,4 @@ name: libdatachannel -version: 0.24.3 -mtime: 1778359897 -commit: c6696d157b5612df2a741d9a03b192b47ab6cefb +version: 0.24.4 +mtime: 1780910010 +commit: 8e330edebfe766b44f59be427e0454fd18964d4e
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.