Skip to content

Commit a1b926e

Browse files
authoredDec 11, 2024··
chore(webrtc-sys): bump to m125_release (#505)
1 parent 2ba0a2e commit a1b926e

17 files changed

+82
-46
lines changed
 

‎.nanpa/bump-webrtc.kdl

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
patch package="webrtc-sys/build" type="added" "bump libwebrtc to m125"
2+
patch package="webrtc-sys" type="added" "bump libwebrtc to m125"

‎webrtc-sys/include/livekit/audio_device.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
#include <atomic>
2020

2121
#include "api/task_queue/task_queue_factory.h"
22+
#include "api/task_queue/task_queue_base.h"
2223
#include "modules/audio_device/include/audio_device.h"
2324
#include "rtc_base/synchronization/mutex.h"
24-
#include "rtc_base/task_queue.h"
2525
#include "rtc_base/task_utils/repeating_task.h"
2626

2727
namespace livekit {
@@ -119,7 +119,7 @@ class AudioDevice : public webrtc::AudioDeviceModule {
119119
private:
120120
mutable webrtc::Mutex mutex_;
121121
std::vector<int16_t> data_;
122-
std::unique_ptr<rtc::TaskQueue> audio_queue_;
122+
std::unique_ptr<webrtc::TaskQueueBase, webrtc::TaskQueueDeleter> audio_queue_;
123123
webrtc::RepeatingTaskHandle audio_task_;
124124
webrtc::AudioTransport* audio_transport_;
125125
webrtc::TaskQueueFactory* task_queue_factory_;

‎webrtc-sys/include/livekit/audio_track.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "livekit/webrtc.h"
2828
#include "pc/local_audio_source.h"
2929
#include "rtc_base/synchronization/mutex.h"
30-
#include "rtc_base/task_queue.h"
30+
#include "api/task_queue/task_queue_base.h"
3131
#include "rtc_base/task_utils/repeating_task.h"
3232
#include "rtc_base/thread_annotations.h"
3333
#include "rust/cxx.h"
@@ -127,7 +127,7 @@ class AudioTrackSource {
127127

128128
private:
129129
mutable webrtc::Mutex mutex_;
130-
std::unique_ptr<rtc::TaskQueue> audio_queue_;
130+
std::unique_ptr<webrtc::TaskQueueBase, webrtc::TaskQueueDeleter> audio_queue_;
131131
webrtc::RepeatingTaskHandle audio_task_;
132132

133133
std::vector<webrtc::AudioTrackSinkInterface*> sinks_ RTC_GUARDED_BY(mutex_);

‎webrtc-sys/include/livekit/video_decoder_factory.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include "api/video_codecs/video_decoder.h"
2020
#include "api/video_codecs/video_decoder_factory.h"
21+
#include "absl/strings/match.h"
2122

2223
namespace livekit {
2324
class VideoDecoderFactory : public webrtc::VideoDecoderFactory {
@@ -29,8 +30,8 @@ class VideoDecoderFactory : public webrtc::VideoDecoderFactory {
2930
CodecSupport QueryCodecSupport(const webrtc::SdpVideoFormat& format,
3031
bool reference_scaling) const override;
3132

32-
std::unique_ptr<webrtc::VideoDecoder> CreateVideoDecoder(
33-
const webrtc::SdpVideoFormat& format) override;
33+
std::unique_ptr<webrtc::VideoDecoder> Create(
34+
const webrtc::Environment& env, const webrtc::SdpVideoFormat& format) override;
3435

3536
private:
3637
std::vector<std::unique_ptr<webrtc::VideoDecoderFactory>> factories_;

‎webrtc-sys/include/livekit/video_encoder_factory.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ class VideoEncoderFactory : public webrtc::VideoEncoderFactory {
3131
const webrtc::SdpVideoFormat& format,
3232
absl::optional<std::string> scalability_mode) const override;
3333

34-
std::unique_ptr<webrtc::VideoEncoder> CreateVideoEncoder(
35-
const webrtc::SdpVideoFormat& format) override;
34+
std::unique_ptr<webrtc::VideoEncoder> Create(
35+
const webrtc::Environment& env, const webrtc::SdpVideoFormat& format) override;
3636

3737
private:
3838
std::vector<std::unique_ptr<webrtc::VideoEncoderFactory>> factories_;
@@ -47,8 +47,8 @@ class VideoEncoderFactory : public webrtc::VideoEncoderFactory {
4747
const webrtc::SdpVideoFormat& format,
4848
absl::optional<std::string> scalability_mode) const override;
4949

50-
std::unique_ptr<webrtc::VideoEncoder> CreateVideoEncoder(
51-
const webrtc::SdpVideoFormat& format) override;
50+
std::unique_ptr<webrtc::VideoEncoder> Create(
51+
const webrtc::Environment& env, const webrtc::SdpVideoFormat& format) override;
5252

5353
private:
5454
std::unique_ptr<InternalFactory> internal_factory_;

‎webrtc-sys/libwebrtc/.gclient

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
solutions = [
22
{
33
"name": 'src',
4-
"url": 'https://github.com/webrtc-sdk/webrtc.git@m114_release',
4+
"url": 'https://github.com/webrtc-sdk/webrtc.git@m125_release',
55
"custom_deps": {},
66
"deps_file": "DEPS",
77
"managed": False,

‎webrtc-sys/libwebrtc/build_android.sh

+5
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ cd src
7171
git apply "$COMMAND_DIR/patches/ssl_verify_callback_with_native_handle.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
7272
git apply "$COMMAND_DIR/patches/add_deps.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
7373
git apply "$COMMAND_DIR/patches/android_use_libunwind.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
74+
75+
cd third_party
76+
git apply "$COMMAND_DIR/patches/abseil_use_optional.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
77+
cd ..
78+
7479
cd ..
7580

7681
mkdir -p "$ARTIFACTS_DIR/lib"

‎webrtc-sys/libwebrtc/build_ios.sh

+5
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ cd src
8181
# git apply "$COMMAND_DIR/patches/add_licenses.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
8282
git apply "$COMMAND_DIR/patches/ssl_verify_callback_with_native_handle.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
8383
git apply "$COMMAND_DIR/patches/add_deps.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
84+
85+
cd third_party
86+
git apply "$COMMAND_DIR/patches/abseil_use_optional.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
87+
cd ..
88+
8489
cd ..
8590

8691
mkdir -p "$ARTIFACTS_DIR/lib"

‎webrtc-sys/libwebrtc/build_linux.sh

+5
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ cd src
7070
git apply "$COMMAND_DIR/patches/add_licenses.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
7171
git apply "$COMMAND_DIR/patches/ssl_verify_callback_with_native_handle.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
7272
git apply "$COMMAND_DIR/patches/add_deps.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
73+
74+
cd third_party
75+
git apply "$COMMAND_DIR/patches/abseil_use_optional.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
76+
cd ..
77+
7378
cd ..
7479

7580
mkdir -p "$ARTIFACTS_DIR/lib"

‎webrtc-sys/libwebrtc/build_macos.sh

+5
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ cd src
7070
git apply "$COMMAND_DIR/patches/add_licenses.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
7171
git apply "$COMMAND_DIR/patches/ssl_verify_callback_with_native_handle.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
7272
git apply "$COMMAND_DIR/patches/add_deps.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
73+
74+
cd third_party
75+
git apply "$COMMAND_DIR/patches/abseil_use_optional.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
76+
cd ..
77+
7378
cd ..
7479

7580
mkdir -p "$ARTIFACTS_DIR/lib"

‎webrtc-sys/libwebrtc/build_windows.cmd

+5
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ call git apply "%COMMAND_DIR%/patches/add_licenses.patch" -v --ignore-space-chan
5454
call git apply "%COMMAND_DIR%/patches/add_deps.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
5555
call git apply "%COMMAND_DIR%/patches/windows_silence_warnings.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
5656
call git apply "%COMMAND_DIR%/patches/ssl_verify_callback_with_native_handle.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
57+
58+
cd third_party
59+
call git apply "%COMMAND_DIR%/patches/abseil_use_optional.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
60+
cd ..
61+
5762
cd ..
5863

5964
mkdir "%ARTIFACTS_DIR%\lib"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/abseil-cpp/absl/base/options.h b/abseil-cpp/absl/base/options.h
2+
index bd43b6ef0..ab5917e75 100644
3+
--- a/abseil-cpp/absl/base/options.h
4+
+++ b/abseil-cpp/absl/base/options.h
5+
@@ -121,7 +121,7 @@
6+
// absl::optional is a typedef of std::optional, use the feature macro
7+
// ABSL_USES_STD_OPTIONAL.
8+
9+
-#define ABSL_OPTION_USE_STD_OPTIONAL 2
10+
+#define ABSL_OPTION_USE_STD_OPTIONAL 0
11+
12+
13+
// ABSL_OPTION_USE_STD_STRING_VIEW

‎webrtc-sys/src/audio_device.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ int32_t AudioDevice::Init() {
4848
return 0;
4949

5050
audio_queue_ =
51-
std::make_unique<rtc::TaskQueue>(task_queue_factory_->CreateTaskQueue(
52-
"AudioDevice", webrtc::TaskQueueFactory::Priority::NORMAL));
51+
task_queue_factory_->CreateTaskQueue(
52+
"AudioDevice", webrtc::TaskQueueFactory::Priority::NORMAL);
5353

5454
audio_task_ =
55-
webrtc::RepeatingTaskHandle::Start(audio_queue_->Get(), [this]() {
55+
webrtc::RepeatingTaskHandle::Start(audio_queue_.get(), [this]() {
5656
webrtc::MutexLock lock(&mutex_);
5757

5858
if (playing_) {

‎webrtc-sys/src/audio_track.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,11 @@ AudioTrackSource::InternalSource::InternalSource(
153153
buffer_.reserve(queue_size_samples_ + notify_threshold_samples_);
154154

155155
audio_queue_ =
156-
std::make_unique<rtc::TaskQueue>(task_queue_factory->CreateTaskQueue(
157-
"AudioSourceCapture", webrtc::TaskQueueFactory::Priority::NORMAL));
156+
task_queue_factory->CreateTaskQueue(
157+
"AudioSourceCapture", webrtc::TaskQueueFactory::Priority::NORMAL);
158158

159159
audio_task_ = webrtc::RepeatingTaskHandle::Start(
160-
audio_queue_->Get(),
160+
audio_queue_.get(),
161161
[this, samples10ms]() {
162162
webrtc::MutexLock lock(&mutex_);
163163

‎webrtc-sys/src/peer_connection_factory.cpp

+10-17
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "api/audio_codecs/builtin_audio_encoder_factory.h"
2424
#include "api/peer_connection_interface.h"
2525
#include "api/rtc_error.h"
26+
#include "api/enable_media.h"
2627
#include "api/rtc_event_log/rtc_event_log_factory.h"
2728
#include "api/task_queue/default_task_queue_factory.h"
2829
#include "api/video_codecs/builtin_video_decoder_factory.h"
@@ -35,7 +36,6 @@
3536
#include "livekit/video_decoder_factory.h"
3637
#include "livekit/video_encoder_factory.h"
3738
#include "livekit/webrtc.h"
38-
#include "media/engine/webrtc_media_engine.h"
3939
#include "rtc_base/thread.h"
4040
#include "webrtc-sys/src/peer_connection.rs.h"
4141
#include "webrtc-sys/src/peer_connection_factory.rs.h"
@@ -55,32 +55,25 @@ PeerConnectionFactory::PeerConnectionFactory(
5555
dependencies.signaling_thread = rtc_runtime_->signaling_thread();
5656
dependencies.socket_factory = rtc_runtime_->network_thread()->socketserver();
5757
dependencies.task_queue_factory = webrtc::CreateDefaultTaskQueueFactory();
58-
dependencies.event_log_factory = std::make_unique<webrtc::RtcEventLogFactory>(
59-
dependencies.task_queue_factory.get());
60-
dependencies.call_factory = webrtc::CreateCallFactory();
58+
dependencies.event_log_factory = std::make_unique<webrtc::RtcEventLogFactory>();
6159
dependencies.trials = std::make_unique<webrtc::FieldTrialBasedConfig>();
6260

63-
cricket::MediaEngineDependencies media_deps;
64-
media_deps.task_queue_factory = dependencies.task_queue_factory.get();
65-
6661
audio_device_ = rtc_runtime_->worker_thread()->BlockingCall([&] {
6762
return rtc::make_ref_counted<livekit::AudioDevice>(
68-
media_deps.task_queue_factory);
63+
dependencies.task_queue_factory.get());
6964
});
7065

71-
media_deps.adm = audio_device_;
66+
dependencies.adm = audio_device_;
7267

73-
media_deps.video_encoder_factory =
68+
dependencies.video_encoder_factory =
7469
std::move(std::make_unique<livekit::VideoEncoderFactory>());
75-
media_deps.video_decoder_factory =
70+
dependencies.video_decoder_factory =
7671
std::move(std::make_unique<livekit::VideoDecoderFactory>());
77-
media_deps.audio_encoder_factory = webrtc::CreateBuiltinAudioEncoderFactory();
78-
media_deps.audio_decoder_factory = webrtc::CreateBuiltinAudioDecoderFactory();
79-
media_deps.audio_processing = webrtc::AudioProcessingBuilder().Create();
80-
media_deps.trials = dependencies.trials.get();
81-
82-
dependencies.media_engine = cricket::CreateMediaEngine(std::move(media_deps));
72+
dependencies.audio_encoder_factory = webrtc::CreateBuiltinAudioEncoderFactory();
73+
dependencies.audio_decoder_factory = webrtc::CreateBuiltinAudioDecoderFactory();
74+
dependencies.audio_processing = webrtc::AudioProcessingBuilder().Create();
8375

76+
webrtc::EnableMedia(dependencies);
8477
peer_factory_ =
8578
webrtc::CreateModularPeerConnectionFactory(std::move(dependencies));
8679

‎webrtc-sys/src/video_decoder_factory.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include "livekit/video_decoder_factory.h"
1818

19+
#include "api/environment/environment.h"
1920
#include "api/video_codecs/av1_profile.h"
2021
#include "api/video_codecs/sdp_video_format.h"
2122
#include "livekit/objc_video_factory.h"
@@ -69,7 +70,7 @@ std::vector<webrtc::SdpVideoFormat> VideoDecoderFactory::GetSupportedFormats()
6970
formats.push_back(webrtc::SdpVideoFormat(cricket::kAv1CodecName));
7071
formats.push_back(webrtc::SdpVideoFormat(
7172
cricket::kAv1CodecName,
72-
{{webrtc::kAV1FmtpProfile,
73+
{{cricket::kAv1FmtpProfile,
7374
AV1ProfileToString(webrtc::AV1Profile::kProfile1).data()}}));
7475
#endif
7576

@@ -92,17 +93,17 @@ VideoDecoderFactory::CodecSupport VideoDecoderFactory::QueryCodecSupport(
9293
return codec_support;
9394
}
9495

95-
std::unique_ptr<webrtc::VideoDecoder> VideoDecoderFactory::CreateVideoDecoder(
96-
const webrtc::SdpVideoFormat& format) {
96+
std::unique_ptr<webrtc::VideoDecoder> VideoDecoderFactory::Create(
97+
const webrtc::Environment& env, const webrtc::SdpVideoFormat& format) {
9798
for (const auto& factory : factories_) {
9899
for (const auto& supported_format : factory->GetSupportedFormats()) {
99100
if (supported_format.IsSameCodec(format))
100-
return factory->CreateVideoDecoder(format);
101+
return factory->Create(env, format);
101102
}
102103
}
103104

104105
if (absl::EqualsIgnoreCase(format.name, cricket::kVp8CodecName))
105-
return webrtc::VP8Decoder::Create();
106+
return webrtc::CreateVp8Decoder(env);
106107
if (absl::EqualsIgnoreCase(format.name, cricket::kVp9CodecName))
107108
return webrtc::VP9Decoder::Create();
108109
if (absl::EqualsIgnoreCase(format.name, cricket::kH264CodecName))

‎webrtc-sys/src/video_encoder_factory.cpp

+8-7
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include "livekit/video_encoder_factory.h"
1818

19+
#include "api/environment/environment_factory.h"
1920
#include "api/video_codecs/sdp_video_format.h"
2021
#include "api/video_codecs/video_encoder.h"
2122
#include "api/video_codecs/video_encoder_factory_template.h"
@@ -84,20 +85,20 @@ VideoEncoderFactory::InternalFactory::QueryCodecSupport(
8485
}
8586

8687
std::unique_ptr<webrtc::VideoEncoder>
87-
VideoEncoderFactory::InternalFactory::CreateVideoEncoder(
88-
const webrtc::SdpVideoFormat& format) {
88+
VideoEncoderFactory::InternalFactory::Create(
89+
const webrtc::Environment& env, const webrtc::SdpVideoFormat& format) {
8990
for (const auto& factory : factories_) {
9091
for (const auto& supported_format : factory->GetSupportedFormats()) {
9192
if (supported_format.IsSameCodec(format))
92-
return factory->CreateVideoEncoder(format);
93+
return factory->Create(env, format);
9394
}
9495
}
9596

9697
auto original_format =
9798
webrtc::FuzzyMatchSdpVideoFormat(Factory().GetSupportedFormats(), format);
9899

99100
if (original_format) {
100-
return Factory().CreateVideoEncoder(*original_format);
101+
return Factory().Create(env, *original_format);
101102
}
102103

103104
RTC_LOG(LS_ERROR) << "No VideoEncoder found for " << format.name;
@@ -119,12 +120,12 @@ VideoEncoderFactory::CodecSupport VideoEncoderFactory::QueryCodecSupport(
119120
return internal_factory_->QueryCodecSupport(format, scalability_mode);
120121
}
121122

122-
std::unique_ptr<webrtc::VideoEncoder> VideoEncoderFactory::CreateVideoEncoder(
123-
const webrtc::SdpVideoFormat& format) {
123+
std::unique_ptr<webrtc::VideoEncoder> VideoEncoderFactory::Create(
124+
const webrtc::Environment& env, const webrtc::SdpVideoFormat& format) {
124125
std::unique_ptr<webrtc::VideoEncoder> encoder;
125126
if (format.IsCodecInList(internal_factory_->GetSupportedFormats())) {
126127
encoder = std::make_unique<webrtc::SimulcastEncoderAdapter>(
127-
internal_factory_.get(), format);
128+
env, internal_factory_.get(), nullptr, format);
128129
}
129130

130131
return encoder;

0 commit comments

Comments
 (0)
Please sign in to comment.