diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /third_party/libwebrtc/examples/androidvoip/jni/android_voip_client.cc | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | third_party/libwebrtc/examples/androidvoip/jni/android_voip_client.cc | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/third_party/libwebrtc/examples/androidvoip/jni/android_voip_client.cc b/third_party/libwebrtc/examples/androidvoip/jni/android_voip_client.cc index 8a0a3badb9..69327990e0 100644 --- a/third_party/libwebrtc/examples/androidvoip/jni/android_voip_client.cc +++ b/third_party/libwebrtc/examples/androidvoip/jni/android_voip_client.cc @@ -313,8 +313,10 @@ void AndroidVoipClient::StartSession(JNIEnv* env) { /*isSuccessful=*/false); return; } - rtp_socket_->SignalReadPacket.connect( - this, &AndroidVoipClient::OnSignalReadRTPPacket); + rtp_socket_->RegisterReceivedPacketCallback( + [&](rtc::AsyncPacketSocket* socket, const rtc::ReceivedPacket& packet) { + OnSignalReadRTPPacket(socket, packet); + }); rtcp_socket_.reset(rtc::AsyncUDPSocket::Create(voip_thread_->socketserver(), rtcp_local_address_)); @@ -324,8 +326,10 @@ void AndroidVoipClient::StartSession(JNIEnv* env) { /*isSuccessful=*/false); return; } - rtcp_socket_->SignalReadPacket.connect( - this, &AndroidVoipClient::OnSignalReadRTCPPacket); + rtcp_socket_->RegisterReceivedPacketCallback( + [&](rtc::AsyncPacketSocket* socket, const rtc::ReceivedPacket& packet) { + OnSignalReadRTCPPacket(socket, packet); + }); Java_VoipClient_onStartSessionCompleted(env_, j_voip_client_, /*isSuccessful=*/true); } @@ -467,12 +471,11 @@ void AndroidVoipClient::ReadRTPPacket(const std::vector<uint8_t>& packet_copy) { RTC_CHECK(result == webrtc::VoipResult::kOk); } -void AndroidVoipClient::OnSignalReadRTPPacket(rtc::AsyncPacketSocket* socket, - const char* rtp_packet, - size_t size, - const rtc::SocketAddress& addr, - const int64_t& timestamp) { - std::vector<uint8_t> packet_copy(rtp_packet, rtp_packet + size); +void AndroidVoipClient::OnSignalReadRTPPacket( + rtc::AsyncPacketSocket* socket, + const rtc::ReceivedPacket& packet) { + std::vector<uint8_t> packet_copy(packet.payload().begin(), + packet.payload().end()); voip_thread_->PostTask([this, packet_copy = std::move(packet_copy)] { ReadRTPPacket(packet_copy); }); @@ -492,12 +495,11 @@ void AndroidVoipClient::ReadRTCPPacket( RTC_CHECK(result == webrtc::VoipResult::kOk); } -void AndroidVoipClient::OnSignalReadRTCPPacket(rtc::AsyncPacketSocket* socket, - const char* rtcp_packet, - size_t size, - const rtc::SocketAddress& addr, - const int64_t& timestamp) { - std::vector<uint8_t> packet_copy(rtcp_packet, rtcp_packet + size); +void AndroidVoipClient::OnSignalReadRTCPPacket( + rtc::AsyncPacketSocket* socket, + const rtc::ReceivedPacket& packet) { + std::vector<uint8_t> packet_copy(packet.payload().begin(), + packet.payload().end()); voip_thread_->PostTask([this, packet_copy = std::move(packet_copy)] { ReadRTCPPacket(packet_copy); }); |