Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

worker: Do not use references for async callbacks #1274

Merged
merged 2 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog


### NEXT

* worker: Do not use references for async callbacks ([PR #1274](https://github.com/versatica/mediasoup/pull/1274)).


### 3.13.12

* worker: Disable `RtcLogger` usage if not enabled ([PR #1264](https://github.com/versatica/mediasoup/pull/1264)).
Expand Down
2 changes: 1 addition & 1 deletion worker/include/RTC/SenderBandwidthEstimator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ namespace RTC
public:
void TransportConnected();
void TransportDisconnected();
void RtpPacketSent(SentInfo& sentInfo);
void RtpPacketSent(const SentInfo& sentInfo);
jmillan marked this conversation as resolved.
Show resolved Hide resolved
void ReceiveRtcpTransportFeedback(const RTC::RTCP::FeedbackRtpTransportPacket* feedback);
void EstimateAvailableBitrate(CummulativeResult& cummulativeResult);
void UpdateRtt(float rtt);
Expand Down
2 changes: 1 addition & 1 deletion worker/include/RTC/TransportCongestionControlClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace RTC
void TransportDisconnected();
void InsertPacket(webrtc::RtpPacketSendInfo& packetInfo);
webrtc::PacedPacketInfo GetPacingInfo();
void PacketSent(webrtc::RtpPacketSendInfo& packetInfo, int64_t nowMs);
void PacketSent(const webrtc::RtpPacketSendInfo& packetInfo, int64_t nowMs);
void ReceiveEstimatedBitrate(uint32_t bitrate);
void ReceiveRtcpReceiverReport(RTC::RTCP::ReceiverReportPacket* packet, float rtt, int64_t nowMs);
void ReceiveRtcpTransportFeedback(const RTC::RTCP::FeedbackRtpTransportPacket* feedback);
Expand Down
2 changes: 1 addition & 1 deletion worker/src/RTC/SenderBandwidthEstimator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace RTC
this->cummulativeResult.Reset();
}

void SenderBandwidthEstimator::RtpPacketSent(SentInfo& sentInfo)
void SenderBandwidthEstimator::RtpPacketSent(const SentInfo& sentInfo)
{
MS_TRACE();

Expand Down
12 changes: 6 additions & 6 deletions worker/src/RTC/Transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2493,7 +2493,7 @@ namespace RTC
sentInfo.sendingAtMs = DepLibUV::GetTimeMs();

auto* cb = new onSendCallback(
[tccClientWeakPtr, &packetInfo, senderBweWeakPtr, &sentInfo](bool sent)
[tccClientWeakPtr, packetInfo, senderBweWeakPtr, sentInfo](bool sent)
{
if (sent)
{
Expand All @@ -2517,7 +2517,7 @@ namespace RTC
SendRtpPacket(consumer, packet, cb);
#else
const auto* cb = new onSendCallback(
[tccClientWeakPtr, &packetInfo](bool sent)
[tccClientWeakPtr, packetInfo](bool sent)
{
if (sent)
{
Expand Down Expand Up @@ -2582,7 +2582,7 @@ namespace RTC
sentInfo.sendingAtMs = DepLibUV::GetTimeMs();

auto* cb = new onSendCallback(
[tccClientWeakPtr, &packetInfo, senderBweWeakPtr, &sentInfo](bool sent)
[tccClientWeakPtr, packetInfo, senderBweWeakPtr, sentInfo](bool sent)
{
if (sent)
{
Expand All @@ -2606,7 +2606,7 @@ namespace RTC
SendRtpPacket(consumer, packet, cb);
#else
const auto* cb = new onSendCallback(
[tccClientWeakPtr, &packetInfo](bool sent)
[tccClientWeakPtr, packetInfo](bool sent)
{
if (sent)
{
Expand Down Expand Up @@ -2982,7 +2982,7 @@ namespace RTC
sentInfo.sendingAtMs = DepLibUV::GetTimeMs();

auto* cb = new onSendCallback(
[tccClientWeakPtr, &packetInfo, senderBweWeakPtr, &sentInfo](bool sent)
[tccClientWeakPtr, packetInfo, senderBweWeakPtr, sentInfo](bool sent)
{
if (sent)
{
Expand All @@ -3006,7 +3006,7 @@ namespace RTC
SendRtpPacket(nullptr, packet, cb);
#else
const auto* cb = new onSendCallback(
[tccClientWeakPtr, &packetInfo](bool sent)
[tccClientWeakPtr, packetInfo](bool sent)
{
if (sent)
{
Expand Down
3 changes: 2 additions & 1 deletion worker/src/RTC/TransportCongestionControlClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ namespace RTC
return this->rtpTransportControllerSend->packet_sender()->GetPacingInfo();
}

void TransportCongestionControlClient::PacketSent(webrtc::RtpPacketSendInfo& packetInfo, int64_t nowMs)
void TransportCongestionControlClient::PacketSent(
const webrtc::RtpPacketSendInfo& packetInfo, int64_t nowMs)
{
MS_TRACE();

Expand Down