summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/examples
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /third_party/libwebrtc/examples
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/examples')
-rw-r--r--third_party/libwebrtc/examples/androidnativeapi/jni/android_call_client.cc3
-rw-r--r--third_party/libwebrtc/examples/androidvoip/BUILD.gn2
-rw-r--r--third_party/libwebrtc/examples/androidvoip/jni/android_voip_client.cc34
-rw-r--r--third_party/libwebrtc/examples/androidvoip/jni/android_voip_client.h16
-rw-r--r--third_party/libwebrtc/examples/objcnativeapi/objc/objc_call_client.mm3
5 files changed, 25 insertions, 33 deletions
diff --git a/third_party/libwebrtc/examples/androidnativeapi/jni/android_call_client.cc b/third_party/libwebrtc/examples/androidnativeapi/jni/android_call_client.cc
index 40af78cdac..0e895c520b 100644
--- a/third_party/libwebrtc/examples/androidnativeapi/jni/android_call_client.cc
+++ b/third_party/libwebrtc/examples/androidnativeapi/jni/android_call_client.cc
@@ -154,8 +154,7 @@ void AndroidCallClient::CreatePeerConnectionFactory() {
pcf_deps.worker_thread = worker_thread_.get();
pcf_deps.signaling_thread = signaling_thread_.get();
pcf_deps.task_queue_factory = webrtc::CreateDefaultTaskQueueFactory();
- pcf_deps.event_log_factory = std::make_unique<webrtc::RtcEventLogFactory>(
- pcf_deps.task_queue_factory.get());
+ pcf_deps.event_log_factory = std::make_unique<webrtc::RtcEventLogFactory>();
pcf_deps.video_encoder_factory =
std::make_unique<webrtc::InternalEncoderFactory>();
diff --git a/third_party/libwebrtc/examples/androidvoip/BUILD.gn b/third_party/libwebrtc/examples/androidvoip/BUILD.gn
index cea05ea128..d390815406 100644
--- a/third_party/libwebrtc/examples/androidvoip/BUILD.gn
+++ b/third_party/libwebrtc/examples/androidvoip/BUILD.gn
@@ -71,7 +71,7 @@ if (is_android) {
"//api/task_queue:default_task_queue_factory",
"//api/voip:voip_api",
"//api/voip:voip_engine_factory",
- "//rtc_base/third_party/sigslot:sigslot",
+ "//rtc_base/network:received_packet",
"//sdk/android:native_api_audio_device_module",
"//sdk/android:native_api_base",
"//sdk/android:native_api_jni",
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);
});
diff --git a/third_party/libwebrtc/examples/androidvoip/jni/android_voip_client.h b/third_party/libwebrtc/examples/androidvoip/jni/android_voip_client.h
index e2f1c64590..1d9a13b29d 100644
--- a/third_party/libwebrtc/examples/androidvoip/jni/android_voip_client.h
+++ b/third_party/libwebrtc/examples/androidvoip/jni/android_voip_client.h
@@ -23,8 +23,8 @@
#include "api/voip/voip_engine.h"
#include "rtc_base/async_packet_socket.h"
#include "rtc_base/async_udp_socket.h"
+#include "rtc_base/network/received_packet.h"
#include "rtc_base/socket_address.h"
-#include "rtc_base/third_party/sigslot/sigslot.h"
#include "rtc_base/thread.h"
#include "sdk/android/native_api/jni/scoped_java_ref.h"
@@ -40,8 +40,7 @@ namespace webrtc_examples {
// with consistent thread usage requirement with ProcessThread used
// within VoipEngine, as well as providing asynchronicity to the
// caller. AndroidVoipClient is meant to be used by Java through JNI.
-class AndroidVoipClient : public webrtc::Transport,
- public sigslot::has_slots<> {
+class AndroidVoipClient : public webrtc::Transport {
public:
// Returns a pointer to an AndroidVoipClient object. Clients should
// use this factory method to create AndroidVoipClient objects. The
@@ -122,17 +121,10 @@ class AndroidVoipClient : public webrtc::Transport,
const webrtc::PacketOptions& options) override;
bool SendRtcp(rtc::ArrayView<const uint8_t> packet) override;
- // Slots for sockets to connect to.
void OnSignalReadRTPPacket(rtc::AsyncPacketSocket* socket,
- const char* rtp_packet,
- size_t size,
- const rtc::SocketAddress& addr,
- const int64_t& timestamp);
+ const rtc::ReceivedPacket& packet);
void OnSignalReadRTCPPacket(rtc::AsyncPacketSocket* socket,
- const char* rtcp_packet,
- size_t size,
- const rtc::SocketAddress& addr,
- const int64_t& timestamp);
+ const rtc::ReceivedPacket& packet);
private:
AndroidVoipClient(JNIEnv* env,
diff --git a/third_party/libwebrtc/examples/objcnativeapi/objc/objc_call_client.mm b/third_party/libwebrtc/examples/objcnativeapi/objc/objc_call_client.mm
index 996c6a9c7f..2601beed71 100644
--- a/third_party/libwebrtc/examples/objcnativeapi/objc/objc_call_client.mm
+++ b/third_party/libwebrtc/examples/objcnativeapi/objc/objc_call_client.mm
@@ -126,8 +126,7 @@ void ObjCCallClient::CreatePeerConnectionFactory() {
[[RTC_OBJC_TYPE(RTCDefaultVideoDecoderFactory) alloc] init]);
dependencies.audio_processing = webrtc::AudioProcessingBuilder().Create();
webrtc::EnableMedia(dependencies);
- dependencies.event_log_factory =
- std::make_unique<webrtc::RtcEventLogFactory>(dependencies.task_queue_factory.get());
+ dependencies.event_log_factory = std::make_unique<webrtc::RtcEventLogFactory>();
pcf_ = webrtc::CreateModularPeerConnectionFactory(std::move(dependencies));
RTC_LOG(LS_INFO) << "PeerConnectionFactory created: " << pcf_.get();
}