From 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:33 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- third_party/libwebrtc/examples/BUILD.gn | 2 +- .../libwebrtc/examples/androidnativeapi/BUILD.gn | 2 +- .../androidnativeapi/jni/android_call_client.cc | 13 ++++--------- .../examples/objcnativeapi/objc/objc_call_client.mm | 18 +++++++----------- .../peerconnection/client/peer_connection_client.cc | 1 + .../libwebrtc/examples/stunserver/stunserver_main.cc | 3 ++- 6 files changed, 16 insertions(+), 23 deletions(-) (limited to 'third_party/libwebrtc/examples') diff --git a/third_party/libwebrtc/examples/BUILD.gn b/third_party/libwebrtc/examples/BUILD.gn index 458205cea7..4ace29bb7e 100644 --- a/third_party/libwebrtc/examples/BUILD.gn +++ b/third_party/libwebrtc/examples/BUILD.gn @@ -489,6 +489,7 @@ if (is_ios || (is_mac && target_cpu != "x86")) { ] deps = [ + "../api:enable_media", "../api:libjingle_peerconnection_api", "../api:scoped_refptr", "../api:sequence_checker", @@ -496,7 +497,6 @@ if (is_ios || (is_mac && target_cpu != "x86")) { "../api/audio_codecs:builtin_audio_encoder_factory", "../api/rtc_event_log:rtc_event_log_factory", "../api/task_queue:default_task_queue_factory", - "../media:rtc_audio_video", "../modules/audio_processing", "../modules/audio_processing:api", "../pc:libjingle_peerconnection", diff --git a/third_party/libwebrtc/examples/androidnativeapi/BUILD.gn b/third_party/libwebrtc/examples/androidnativeapi/BUILD.gn index e0eb6d8b24..d1088b3e61 100644 --- a/third_party/libwebrtc/examples/androidnativeapi/BUILD.gn +++ b/third_party/libwebrtc/examples/androidnativeapi/BUILD.gn @@ -47,6 +47,7 @@ if (is_android) { deps = [ ":generated_jni", + "../../api:enable_media_with_defaults", "../../api:scoped_refptr", "../../api:sequence_checker", "../../rtc_base:ssl", @@ -56,7 +57,6 @@ if (is_android) { "//api/task_queue:default_task_queue_factory", "//media:rtc_audio_video", "//media:rtc_internal_video_codecs", - "//media:rtc_media_engine_defaults", "//modules/utility", "//pc:libjingle_peerconnection", "//sdk/android:native_api_base", 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 2713a563cd..40af78cdac 100644 --- a/third_party/libwebrtc/examples/androidnativeapi/jni/android_call_client.cc +++ b/third_party/libwebrtc/examples/androidnativeapi/jni/android_call_client.cc @@ -13,6 +13,7 @@ #include #include +#include "api/enable_media_with_defaults.h" #include "api/peer_connection_interface.h" #include "api/rtc_event_log/rtc_event_log_factory.h" #include "api/task_queue/default_task_queue_factory.h" @@ -20,7 +21,6 @@ #include "media/engine/internal_decoder_factory.h" #include "media/engine/internal_encoder_factory.h" #include "media/engine/webrtc_media_engine.h" -#include "media/engine/webrtc_media_engine_defaults.h" #include "sdk/android/native_api/jni/java_types.h" #include "sdk/android/native_api/video/wrapper.h" @@ -154,19 +154,14 @@ 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.call_factory = webrtc::CreateCallFactory(); pcf_deps.event_log_factory = std::make_unique( pcf_deps.task_queue_factory.get()); - cricket::MediaEngineDependencies media_deps; - media_deps.task_queue_factory = pcf_deps.task_queue_factory.get(); - media_deps.video_encoder_factory = + pcf_deps.video_encoder_factory = std::make_unique(); - media_deps.video_decoder_factory = + pcf_deps.video_decoder_factory = std::make_unique(); - webrtc::SetMediaEngineDefaults(&media_deps); - pcf_deps.media_engine = cricket::CreateMediaEngine(std::move(media_deps)); - RTC_LOG(LS_INFO) << "Media engine created: " << pcf_deps.media_engine.get(); + EnableMediaWithDefaults(pcf_deps); pcf_ = CreateModularPeerConnectionFactory(std::move(pcf_deps)); RTC_LOG(LS_INFO) << "PeerConnectionFactory created: " << pcf_.get(); 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 90bcfcc35b..996c6a9c7f 100644 --- a/third_party/libwebrtc/examples/objcnativeapi/objc/objc_call_client.mm +++ b/third_party/libwebrtc/examples/objcnativeapi/objc/objc_call_client.mm @@ -20,10 +20,10 @@ #include "api/audio_codecs/builtin_audio_decoder_factory.h" #include "api/audio_codecs/builtin_audio_encoder_factory.h" +#include "api/enable_media.h" #include "api/peer_connection_interface.h" #include "api/rtc_event_log/rtc_event_log_factory.h" #include "api/task_queue/default_task_queue_factory.h" -#include "media/engine/webrtc_media_engine.h" #include "modules/audio_processing/include/audio_processing.h" #include "sdk/objc/native/api/video_capturer.h" #include "sdk/objc/native/api/video_decoder_factory.h" @@ -118,18 +118,14 @@ void ObjCCallClient::CreatePeerConnectionFactory() { dependencies.worker_thread = worker_thread_.get(); dependencies.signaling_thread = signaling_thread_.get(); dependencies.task_queue_factory = webrtc::CreateDefaultTaskQueueFactory(); - cricket::MediaEngineDependencies media_deps; - media_deps.task_queue_factory = dependencies.task_queue_factory.get(); - media_deps.audio_encoder_factory = webrtc::CreateBuiltinAudioEncoderFactory(); - media_deps.audio_decoder_factory = webrtc::CreateBuiltinAudioDecoderFactory(); - media_deps.video_encoder_factory = webrtc::ObjCToNativeVideoEncoderFactory( + dependencies.audio_encoder_factory = webrtc::CreateBuiltinAudioEncoderFactory(); + dependencies.audio_decoder_factory = webrtc::CreateBuiltinAudioDecoderFactory(); + dependencies.video_encoder_factory = webrtc::ObjCToNativeVideoEncoderFactory( [[RTC_OBJC_TYPE(RTCDefaultVideoEncoderFactory) alloc] init]); - media_deps.video_decoder_factory = webrtc::ObjCToNativeVideoDecoderFactory( + dependencies.video_decoder_factory = webrtc::ObjCToNativeVideoDecoderFactory( [[RTC_OBJC_TYPE(RTCDefaultVideoDecoderFactory) alloc] init]); - media_deps.audio_processing = webrtc::AudioProcessingBuilder().Create(); - dependencies.media_engine = cricket::CreateMediaEngine(std::move(media_deps)); - RTC_LOG(LS_INFO) << "Media engine created: " << dependencies.media_engine.get(); - dependencies.call_factory = webrtc::CreateCallFactory(); + dependencies.audio_processing = webrtc::AudioProcessingBuilder().Create(); + webrtc::EnableMedia(dependencies); dependencies.event_log_factory = std::make_unique(dependencies.task_queue_factory.get()); pcf_ = webrtc::CreateModularPeerConnectionFactory(std::move(dependencies)); diff --git a/third_party/libwebrtc/examples/peerconnection/client/peer_connection_client.cc b/third_party/libwebrtc/examples/peerconnection/client/peer_connection_client.cc index 48d5bb6545..488d2f04ed 100644 --- a/third_party/libwebrtc/examples/peerconnection/client/peer_connection_client.cc +++ b/third_party/libwebrtc/examples/peerconnection/client/peer_connection_client.cc @@ -16,6 +16,7 @@ #include "rtc_base/checks.h" #include "rtc_base/logging.h" #include "rtc_base/net_helpers.h" +#include "rtc_base/thread.h" namespace { diff --git a/third_party/libwebrtc/examples/stunserver/stunserver_main.cc b/third_party/libwebrtc/examples/stunserver/stunserver_main.cc index 8180069bf0..ecf6c81ff1 100644 --- a/third_party/libwebrtc/examples/stunserver/stunserver_main.cc +++ b/third_party/libwebrtc/examples/stunserver/stunserver_main.cc @@ -29,7 +29,8 @@ int main(int argc, char* argv[]) { return 1; } - rtc::Thread* pthMain = rtc::Thread::Current(); + rtc::Thread* pthMain = rtc::ThreadManager::Instance()->WrapCurrentThread(); + RTC_DCHECK(pthMain); rtc::AsyncUDPSocket* server_socket = rtc::AsyncUDPSocket::Create(pthMain->socketserver(), server_addr); -- cgit v1.2.3