Skip to content

Commit

Permalink
Upgrade to 124.0.6367.60 version (#95)
Browse files Browse the repository at this point in the history
- remove obsolete `fix_deprecated.patch`
- add `enable_safe_libstdcxx = true` patch for Linux
- fix iOS and Android scalability mode patches

Co-authored-by: evdokimovs <[email protected]>
Co-authored-by: Zenichi Amano <[email protected]>
Co-authored-by: rogurotus <[email protected]>
  • Loading branch information
4 people authored Apr 29, 2024
1 parent dcfa59a commit 521dce7
Show file tree
Hide file tree
Showing 11 changed files with 185 additions and 71 deletions.
4 changes: 2 additions & 2 deletions VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ CCACHE_VERSION=4.8.3

# WebRTC doesn't have its own versioning, so we use Chromium versions:
# https://chromiumdash.appspot.com/releases
WEBRTC_VERSION=123.0.6312.122
WEBRTC_VERSION=124.0.6367.60
# Look for the concrete revision for WebRTC in:
# https://chromium.googlesource.com/chromium/src/+/refs/tags/<WEBRTC_VERSION>/DEPS
WEBRTC_COMMIT=41b1493ddb5d98e9125d5cb002fd57ce76ebd8a7
WEBRTC_COMMIT=93e9ac6285bceef08e4c44c221ec57e8f7995b2f

PACKAGE_NAMES= \
linux-arm64 \
Expand Down
1 change: 0 additions & 1 deletion build.windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ Exec { gclient sync --with_branch_heads -r $WEBRTC_COMMIT }
Exec { git apply --ignore-space-change -v $PATCH_DIR\add_licenses.patch }
Exec { git apply --ignore-space-change -v $PATCH_DIR\4k.patch }
Exec { git apply --ignore-space-change -v $PATCH_DIR\webrtc_voice_engine.patch }
Exec { git apply --ignore-space-change -v $PATCH_DIR\fix_deprecated.patch }
Exec { git apply --ignore-space-change -v $PATCH_DIR\win_dynamic_crt.patch }
Exec { git apply --ignore-space-change -v $PATCH_DIR\windows_fix_abseil.patch }
Pop-Location
Expand Down
1 change: 1 addition & 0 deletions build/android/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ patch: common-patch
patch -p2 < $(PATCH_DIR)/android_version.patch && \
patch -p2 < $(PATCH_DIR)/android_use_libunwind.patch && \
patch -p2 < $(PATCH_DIR)/enable_android_scalability_mode.patch && \
patch -p2 < $(PATCH_DIR)/linux_fix_enable_safe_libstdcxx.patch && \
$(SCRIPTS_DIR)/generate_android_version.sh $(SRC_DIR) $(WEBRTC_COMMIT) $(WEBRTC_VERSION)


Expand Down
1 change: 0 additions & 1 deletion build/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ common-patch:
echo "apply patches ..." \
&& cd $(SRC_DIR) \
&& patch -p1 < $(PATCH_DIR)/nacl_armv6_2.patch \
&& patch -p2 < $(PATCH_DIR)/fix_deprecated.patch \
&& patch -p2 < $(PATCH_DIR)/add_licenses.patch \
&& patch -p2 < $(PATCH_DIR)/4k.patch

Expand Down
3 changes: 2 additions & 1 deletion build/linux-arm64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ patch: common-patch
cd $(SRC_DIR) && \
patch -p2 < $(PATCH_DIR)/4k_linux.patch && \
patch -p2 < $(PATCH_DIR)/disable_use_hermetic_xcode_on_linux.patch && \
patch -p2 < $(PATCH_DIR)/linux_clang_optional.patch
patch -p2 < $(PATCH_DIR)/linux_clang_optional.patch && \
patch -p2 < $(PATCH_DIR)/linux_fix_enable_safe_libstdcxx.patch

.PHONY: build
build: download patch
Expand Down
3 changes: 2 additions & 1 deletion build/linux-x64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ patch: common-patch
cd $(SRC_DIR) && \
patch -p2 < $(PATCH_DIR)/4k_linux.patch && \
patch -p2 < $(PATCH_DIR)/disable_use_hermetic_xcode_on_linux.patch && \
patch -p2 < $(PATCH_DIR)/linux_clang_optional.patch
patch -p2 < $(PATCH_DIR)/linux_clang_optional.patch && \
patch -p2 < $(PATCH_DIR)/linux_fix_enable_safe_libstdcxx.patch

.PHONY: build
build: download patch
Expand Down
4 changes: 2 additions & 2 deletions instrumentisto-libwebrtc-bin.podspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Pod::Spec.new do |spec|
spec.name = "instrumentisto-libwebrtc-bin"
spec.version = "123.0.6312.122"
spec.version = "124.0.6367.60"
spec.summary = "Pre-compiled `libwebrtc` library for Darwin used by Medea Flutter-WebRTC."

spec.homepage = "https://github.com/instrumentisto/libwebrtc-bin"
spec.license = { :type => 'BSD', :file => 'WebRTC.xcframework/LICENSE.md' }
spec.author = { 'Instrumentisto Team' => '[email protected]' }
spec.ios.deployment_target = '10.0'

spec.source = { :http => "https://github.com/instrumentisto/libwebrtc-bin/releases/download/123.0.6312.122/libwebrtc-ios.zip" }
spec.source = { :http => "https://github.com/instrumentisto/libwebrtc-bin/releases/download/124.0.6367.60/libwebrtc-ios.zip" }
spec.vendored_frameworks = "WebRTC.xcframework"

spec.pod_target_xcconfig = {
Expand Down
42 changes: 21 additions & 21 deletions patch/enable_android_scalability_mode.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/src/sdk/android/BUILD.gn b/src/sdk/android/BUILD.gn
index 9aae8b9..496f791 100644
index 593ed36..eab1b0e 100644
--- a/src/sdk/android/BUILD.gn
+++ b/src/sdk/android/BUILD.gn
@@ -191,6 +191,8 @@ if (is_android) {
@@ -192,6 +192,8 @@ if (is_android) {
"api/org/webrtc/CapturerObserver.java",
"api/org/webrtc/EncodedImage.java",
"api/org/webrtc/VideoCodecInfo.java",
Expand All @@ -11,7 +11,7 @@ index 9aae8b9..496f791 100644
"api/org/webrtc/VideoCodecStatus.java",
"api/org/webrtc/VideoDecoder.java",
"api/org/webrtc/VideoDecoderFactory.java",
@@ -1305,6 +1307,8 @@ if (current_os == "linux" || is_android) {
@@ -1319,6 +1321,8 @@ if (current_os == "linux" || is_android) {
"api/org/webrtc/JavaI420Buffer.java",
"api/org/webrtc/TimestampAligner.java",
"api/org/webrtc/VideoCodecInfo.java",
Expand All @@ -22,7 +22,7 @@ index 9aae8b9..496f791 100644
"api/org/webrtc/VideoDecoderFactory.java",
diff --git a/src/sdk/android/api/org/webrtc/CodecSupport.java b/src/sdk/android/api/org/webrtc/CodecSupport.java
new file mode 100644
index 0000000..18c0616
index 0000000..6100236
--- /dev/null
+++ b/src/sdk/android/api/org/webrtc/CodecSupport.java
@@ -0,0 +1,12 @@
Expand All @@ -40,7 +40,7 @@ index 0000000..18c0616
+}
diff --git a/src/sdk/android/api/org/webrtc/CodecSupportUtils.java b/src/sdk/android/api/org/webrtc/CodecSupportUtils.java
new file mode 100644
index 0000000..5aa4e6d
index 0000000..41545de
--- /dev/null
+++ b/src/sdk/android/api/org/webrtc/CodecSupportUtils.java
@@ -0,0 +1,13 @@
Expand Down Expand Up @@ -162,26 +162,27 @@ index 9ca8311..1fcffe7 100644
@CalledByNative("Encoding")
Double getScaleResolutionDownBy() {
diff --git a/src/sdk/android/api/org/webrtc/SoftwareVideoEncoderFactory.java b/src/sdk/android/api/org/webrtc/SoftwareVideoEncoderFactory.java
index 7f4c457..98ac43a 100644
index ad19b4c..ad754ed 100644
--- a/src/sdk/android/api/org/webrtc/SoftwareVideoEncoderFactory.java
+++ b/src/sdk/android/api/org/webrtc/SoftwareVideoEncoderFactory.java
@@ -50,9 +50,17 @@ public class SoftwareVideoEncoderFactory implements VideoEncoderFactory {
@@ -49,6 +49,11 @@ public class SoftwareVideoEncoderFactory implements VideoEncoderFactory {
return nativeGetSupportedCodecs(nativeFactory).toArray(new VideoCodecInfo[0]);
}

+@Override
+ @Override
+ public CodecSupport queryCodecSupport(VideoCodecInfo format, String scalability_mode) {
+ return nativeQueryCodecSupport(nativeFactory, format, scalability_mode);
+ }
+
private static native long nativeCreateFactory();

private static native long nativeCreateEncoder(long factory, VideoCodecInfo videoCodecInfo);
private static native boolean nativeIsSupported(long factory, VideoCodecInfo info);
@@ -56,4 +61,6 @@ public class SoftwareVideoEncoderFactory implements VideoEncoderFactory {
private static native long nativeCreate(long factory, long webrtcEnvRef, VideoCodecInfo info);

private static native List<VideoCodecInfo> nativeGetSupportedCodecs(long factory);
+
+ private static native CodecSupport nativeQueryCodecSupport(long factory, VideoCodecInfo format, String scalability_mode);
+
}
diff --git a/src/sdk/android/api/org/webrtc/VideoCodecInfo.java b/src/sdk/android/api/org/webrtc/VideoCodecInfo.java
index 4f97cf7..715ec6c 100644
Expand Down Expand Up @@ -568,15 +569,14 @@ index 6e711e8..d7d885f 100644

jboolean JNI_SoftwareVideoDecoderFactory_IsSupported(
JNIEnv* env,

diff --git a/src/sdk/android/src/jni/software_video_encoder_factory.cc b/src/sdk/android/src/jni/software_video_encoder_factory.cc
index 4b86960..10fa403 100644
index bcd4c1d..7ba74c0 100644
--- a/src/sdk/android/src/jni/software_video_encoder_factory.cc
+++ b/src/sdk/android/src/jni/software_video_encoder_factory.cc
@@ -8,19 +8,30 @@
* be found in the AUTHORS file in the root of the source tree.
@@ -9,19 +9,30 @@
*/

#include "api/environment/environment.h"
-#include "api/video_codecs/builtin_video_encoder_factory.h"
#include "api/video_codecs/video_encoder.h"
#include "sdk/android/generated_swcodecs_jni/SoftwareVideoEncoderFactory_jni.h"
Expand Down Expand Up @@ -605,8 +605,8 @@ index 4b86960..10fa403 100644
+ video_encoder_factory.release());
}

static jlong JNI_SoftwareVideoEncoderFactory_CreateEncoder(
@@ -49,5 +60,29 @@ JNI_SoftwareVideoEncoderFactory_GetSupportedCodecs(JNIEnv* env,
jboolean JNI_SoftwareVideoEncoderFactory_IsSupported(
@@ -55,5 +66,29 @@ JNI_SoftwareVideoEncoderFactory_GetSupportedCodecs(JNIEnv* env,
&webrtc::jni::SdpVideoFormatToVideoCodecInfo);
}

Expand Down Expand Up @@ -637,7 +637,7 @@ index 4b86960..10fa403 100644
} // namespace jni
} // namespace webrtc
diff --git a/src/sdk/android/src/jni/video_codec_info.cc b/src/sdk/android/src/jni/video_codec_info.cc
index a218a1d..f64f753 100644
index a218a1d..c5d4cf3 100644
--- a/src/sdk/android/src/jni/video_codec_info.cc
+++ b/src/sdk/android/src/jni/video_codec_info.cc
@@ -13,15 +13,36 @@
Expand Down Expand Up @@ -691,7 +691,7 @@ index a218a1d..f64f753 100644

} // namespace jni
diff --git a/src/sdk/android/src/jni/video_encoder_factory_wrapper.cc b/src/sdk/android/src/jni/video_encoder_factory_wrapper.cc
index 7df129b..91d9d9d 100644
index 78aa145..42b63f5 100644
--- a/src/sdk/android/src/jni/video_encoder_factory_wrapper.cc
+++ b/src/sdk/android/src/jni/video_encoder_factory_wrapper.cc
@@ -14,6 +14,7 @@
Expand All @@ -702,7 +702,7 @@ index 7df129b..91d9d9d 100644
#include "sdk/android/native_api/jni/class_loader.h"
#include "sdk/android/native_api/jni/java_types.h"
#include "sdk/android/src/jni/video_codec_info.h"
@@ -126,5 +127,27 @@ VideoEncoderFactoryWrapper::GetEncoderSelector() const {
@@ -127,5 +128,27 @@ VideoEncoderFactoryWrapper::GetEncoderSelector() const {
return std::make_unique<VideoEncoderSelectorWrapper>(jni, selector);
}

Expand Down Expand Up @@ -731,10 +731,10 @@ index 7df129b..91d9d9d 100644
} // namespace jni
} // namespace webrtc
diff --git a/src/sdk/android/src/jni/video_encoder_factory_wrapper.h b/src/sdk/android/src/jni/video_encoder_factory_wrapper.h
index bf6d1e3..d0845c7 100644
index 9b383a8..4aeb0db 100644
--- a/src/sdk/android/src/jni/video_encoder_factory_wrapper.h
+++ b/src/sdk/android/src/jni/video_encoder_factory_wrapper.h
@@ -40,6 +40,9 @@ class VideoEncoderFactoryWrapper : public VideoEncoderFactory {
@@ -41,6 +41,9 @@ class VideoEncoderFactoryWrapper : public VideoEncoderFactory {

std::unique_ptr<EncoderSelectorInterface> GetEncoderSelector() const override;

Expand Down
Loading

0 comments on commit 521dce7

Please sign in to comment.