Add native self-hosted instance connection to fluxer_desktop
Trimmed monorepo checkout (fluxer_desktop + packages/voice_engine_v2 + tools/ci) with a "Connect to a Different Server" menu item and popout that lets the desktop app switch to any self-hosted Fluxer instance, plus fixes for well-known discovery on single-domain self-hosted deployments and a false-positive ERR_ABORTED on same-origin client redirects during the switch. Defaults to chat.fluxr.chat and uses an isolated userData directory from the official build.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
solutions = [
|
||||
{
|
||||
"name": 'src',
|
||||
"url": 'https://github.com/webrtc-sdk/webrtc.git@m144_release',
|
||||
"custom_deps": {},
|
||||
"deps_file": "DEPS",
|
||||
"managed": False,
|
||||
},
|
||||
]
|
||||
@@ -0,0 +1,12 @@
|
||||
.cipd
|
||||
src
|
||||
.gclient_*
|
||||
depot_tools
|
||||
ninja
|
||||
|
||||
# builds
|
||||
win-*
|
||||
mac-*
|
||||
linux-*
|
||||
android-*
|
||||
ios-*
|
||||
@@ -0,0 +1,28 @@
|
||||
This directory can contain a checkout of WebRTC. The build scripts
|
||||
here will install dependencies, checkout the version that LiveKit
|
||||
currently uses, apply some patches to it, and build it. For example to
|
||||
do a Linux debug build on x64:
|
||||
|
||||
```sh
|
||||
$ ./build-linux.sh --arch x64 --profile release
|
||||
```
|
||||
|
||||
After running this, `linux-x64-debug/lib/libwebrtc.a` should
|
||||
exist. This can be rerun to rebuild it, but will complain about
|
||||
patches not applying as they have already been applied.
|
||||
|
||||
If something goes wrong it may be helpful to consult the [WebRTC native
|
||||
development documentation](https://webrtc.googlesource.com/src/+/main/docs/native-code/development/).
|
||||
|
||||
# Building LiveKit Rust SDK with custom WebRTC checkout
|
||||
|
||||
Add the following environment variable to `/.config/config.toml`, to
|
||||
specify use of a custom WebRTC build:
|
||||
|
||||
```toml
|
||||
[env]
|
||||
LK_CUSTOM_WEBRTC = { value = "webrtc-sys/libwebrtc/linux-x64-release", relative = true }
|
||||
```
|
||||
|
||||
Note that `linux-x64-debug` should be replaced with the artifact
|
||||
directory appropriate for your configuration.
|
||||
Vendored
+2767
File diff suppressed because it is too large
Load Diff
Vendored
Executable
+159
@@ -0,0 +1,159 @@
|
||||
#!/bin/bash
|
||||
# Exit immediately if any command fails. This ensures CI properly reports build
|
||||
# failures instead of continuing to create empty/broken artifacts.
|
||||
set -e
|
||||
|
||||
# Copyright 2023 LiveKit, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
arch=""
|
||||
profile="release"
|
||||
|
||||
while [ "$#" -gt 0 ]; do
|
||||
case "$1" in
|
||||
--arch)
|
||||
arch="$2"
|
||||
if [ "$arch" != "arm" ] && [ "$arch" != "x64" ] && [ "$arch" != "arm64" ]; then
|
||||
echo "Error: Invalid value for --arch. Must be 'arm', 'x64' or 'arm64'."
|
||||
exit 1
|
||||
fi
|
||||
shift 2
|
||||
;;
|
||||
--profile)
|
||||
profile="$2"
|
||||
if [ "$profile" != "debug" ] && [ "$profile" != "release" ]; then
|
||||
echo "Error: Invalid value for --profile. Must be 'debug' or 'release'."
|
||||
exit 1
|
||||
fi
|
||||
shift 2
|
||||
;;
|
||||
*)
|
||||
echo "Error: Unknown argument '$1'"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$arch" ]; then
|
||||
echo "Error: --arch must be set."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Building LiveKit WebRTC - Android"
|
||||
echo "Arch: $arch"
|
||||
echo "Profile: $profile"
|
||||
|
||||
if [ ! -e "$(pwd)/depot_tools" ]
|
||||
then
|
||||
git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||
fi
|
||||
|
||||
export COMMAND_DIR=$(cd $(dirname $0); pwd)
|
||||
export PATH="$(pwd)/depot_tools:$PATH"
|
||||
export OUTPUT_DIR="$(pwd)/src/out-$arch-$profile"
|
||||
export ARTIFACTS_DIR="$(pwd)/android-$arch-$profile"
|
||||
|
||||
if [ ! -e "$(pwd)/src" ]
|
||||
then
|
||||
gclient sync -D --no-history
|
||||
fi
|
||||
|
||||
cd src
|
||||
git apply "$COMMAND_DIR/patches/add_licenses.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
|
||||
git apply "$COMMAND_DIR/patches/fix_license_json_parsing.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
|
||||
git apply "$COMMAND_DIR/patches/ssl_verify_callback_with_native_handle.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
|
||||
git apply "$COMMAND_DIR/patches/add_deps.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
|
||||
git apply "$COMMAND_DIR/patches/android_use_libunwind.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
|
||||
git apply "$COMMAND_DIR/patches/external_audio_source.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
|
||||
# livekit prefixed jni
|
||||
git apply "$COMMAND_DIR/patches/jni_prefix.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
|
||||
|
||||
cd third_party/libyuv
|
||||
git apply "$COMMAND_DIR/patches/disable_sme_for_libyuv.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
|
||||
|
||||
cd ../../..
|
||||
|
||||
mkdir -p "$ARTIFACTS_DIR/lib"
|
||||
|
||||
debug="false"
|
||||
if [ "$profile" = "debug" ]; then
|
||||
debug="true"
|
||||
fi
|
||||
|
||||
# Note: use_clang_modules=false is required to avoid C++ module compilation issues.
|
||||
# Without this flag, the build may fail partway through, resulting in missing
|
||||
# artifacts like libwebrtc.jar.
|
||||
args="is_debug=$debug \
|
||||
is_java_debug=$debug \
|
||||
target_os=\"android\" \
|
||||
target_cpu=\"$arch\" \
|
||||
rtc_enable_protobuf=false \
|
||||
treat_warnings_as_errors=false \
|
||||
rtc_include_tests=false \
|
||||
rtc_build_tools=false \
|
||||
rtc_build_examples=false \
|
||||
rtc_libvpx_build_vp9=false \
|
||||
is_component_build=false \
|
||||
enable_stripping=true \
|
||||
rtc_use_h264=false \
|
||||
rtc_use_h265=true \
|
||||
rtc_use_pipewire=false \
|
||||
symbol_level=0 \
|
||||
enable_iterator_debugging=false \
|
||||
android_package_prefix=\"livekit\" \
|
||||
use_custom_libcxx=false \
|
||||
use_clang_modules=false \
|
||||
use_rtti=true"
|
||||
|
||||
if [ "$debug" = "true" ]; then
|
||||
args="${args} is_asan=true is_lsan=true";
|
||||
fi
|
||||
|
||||
# generate ninja files
|
||||
gn gen "$OUTPUT_DIR" --root="src" --args="${args}"
|
||||
|
||||
# build shared library
|
||||
autoninja -C "$OUTPUT_DIR" :default \
|
||||
sdk/android:native_api \
|
||||
sdk/android:libwebrtc \
|
||||
sdk/android:libjingle_peerconnection_so
|
||||
|
||||
# make libwebrtc.a
|
||||
# don't include nasm
|
||||
ar -rc "$ARTIFACTS_DIR/lib/libwebrtc.a" `find "$OUTPUT_DIR/obj" -name '*.o' -not -path "*/third_party/nasm/*"`
|
||||
|
||||
# License generation is optional - may fail with some Python versions
|
||||
# Use vpython3 from depot_tools for consistent Python version
|
||||
vpython3 "./src/tools_webrtc/libs/generate_licenses.py" \
|
||||
--target :default "$OUTPUT_DIR" "$OUTPUT_DIR" || echo "Warning: License generation failed (non-critical)"
|
||||
|
||||
cp "$OUTPUT_DIR/obj/webrtc.ninja" "$ARTIFACTS_DIR"
|
||||
cp "$OUTPUT_DIR/libjingle_peerconnection_so.so" "$ARTIFACTS_DIR/lib"
|
||||
cp "$OUTPUT_DIR/args.gn" "$ARTIFACTS_DIR"
|
||||
|
||||
cp "$OUTPUT_DIR/LICENSE.md" "$ARTIFACTS_DIR"
|
||||
|
||||
mkdir -p "$COMMAND_DIR/prefixed-jni/libs"
|
||||
cp "$OUTPUT_DIR/lib.java/sdk/android/libwebrtc.jar" "$COMMAND_DIR/prefixed-jni/libs/classes.jar"
|
||||
cd "$COMMAND_DIR/prefixed-jni" && ./gradlew shadowJar
|
||||
cp "$COMMAND_DIR/prefixed-jni/build/libs/prefixed-jni-all.jar" "$ARTIFACTS_DIR/libwebrtc.jar"
|
||||
|
||||
cd ..
|
||||
|
||||
cp "src/sdk/android/AndroidManifest.xml" "$ARTIFACTS_DIR"
|
||||
|
||||
cd src
|
||||
find . -name "*.h" -print | cpio -pd "$ARTIFACTS_DIR/include"
|
||||
find . -name "*.inc" -print | cpio -pd "$ARTIFACTS_DIR/include"
|
||||
+168
@@ -0,0 +1,168 @@
|
||||
#!/bin/bash
|
||||
# Exit immediately if any command fails. This ensures CI properly reports build
|
||||
# failures instead of continuing to create empty/broken artifacts.
|
||||
set -e
|
||||
|
||||
# Copyright 2023 LiveKit, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
arch=""
|
||||
profile="release"
|
||||
environment="device"
|
||||
|
||||
while [ "$#" -gt 0 ]; do
|
||||
case "$1" in
|
||||
--arch)
|
||||
arch="$2"
|
||||
if [ "$arch" != "arm64" ]; then
|
||||
echo "Error: Invalid value for --arch. Must 'arm64'."
|
||||
exit 1
|
||||
fi
|
||||
shift 2
|
||||
;;
|
||||
--environment)
|
||||
environment="$2"
|
||||
if [ "$environment" != "device" ] && [ "$environment" != "simulator" ]; then
|
||||
echo "Error: Invalid value for --environment. Must be 'device' or 'simulator'."
|
||||
exit 1
|
||||
fi
|
||||
shift 2
|
||||
;;
|
||||
--profile)
|
||||
profile="$2"
|
||||
if [ "$profile" != "debug" ] && [ "$profile" != "release" ]; then
|
||||
echo "Error: Invalid value for --profile. Must be 'debug' or 'release'."
|
||||
exit 1
|
||||
fi
|
||||
shift 2
|
||||
;;
|
||||
*)
|
||||
echo "Error: Unknown argument '$1'"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$arch" ]; then
|
||||
echo "Error: --arch must be set."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Building LiveKit WebRTC - iOS"
|
||||
echo "Arch: $arch"
|
||||
echo "Profile: $profile"
|
||||
echo "Environment: $environment"
|
||||
|
||||
if [ ! -e "$(pwd)/depot_tools" ]
|
||||
then
|
||||
git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||
fi
|
||||
|
||||
export COMMAND_DIR=$(cd $(dirname $0); pwd)
|
||||
export PATH="$(pwd)/depot_tools:$PATH"
|
||||
|
||||
export OUTPUT_DIR="$(pwd)/src/out-$arch-$profile"
|
||||
export ARTIFACTS_DIR="$(pwd)/ios-$environment-$arch-$profile"
|
||||
|
||||
if [ ! -e "$(pwd)/src" ]
|
||||
then
|
||||
gclient sync -D --no-history
|
||||
fi
|
||||
|
||||
cd src
|
||||
|
||||
# Apply patches only if not already applied (check with --reverse --check)
|
||||
apply_patch_if_needed() {
|
||||
local patch="$1"
|
||||
if git apply --reverse --check "$patch" 2>/dev/null; then
|
||||
echo "Patch already applied: $(basename "$patch")"
|
||||
else
|
||||
echo "Applying patch: $(basename "$patch")"
|
||||
git apply "$patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn || true
|
||||
fi
|
||||
}
|
||||
|
||||
apply_patch_if_needed "$COMMAND_DIR/patches/add_licenses.patch"
|
||||
apply_patch_if_needed "$COMMAND_DIR/patches/fix_license_json_parsing.patch"
|
||||
apply_patch_if_needed "$COMMAND_DIR/patches/ssl_verify_callback_with_native_handle.patch"
|
||||
apply_patch_if_needed "$COMMAND_DIR/patches/add_deps.patch"
|
||||
apply_patch_if_needed "$COMMAND_DIR/patches/external_audio_source.patch"
|
||||
|
||||
cd ..
|
||||
|
||||
mkdir -p "$ARTIFACTS_DIR/lib"
|
||||
|
||||
debug="false"
|
||||
if [ "$profile" = "debug" ]; then
|
||||
debug="true"
|
||||
fi
|
||||
|
||||
# generate ninja files
|
||||
# Note: use_clang_modules=false is required to avoid libc++ header incompatibility
|
||||
# with Xcode 26.0. When enabled, C++ module compilation fails with errors like
|
||||
# "unknown type name 'size_t'" due to conflicts between WebRTC's bundled libc++
|
||||
# headers and the iOS SDK headers.
|
||||
gn gen "$OUTPUT_DIR" --root="src" \
|
||||
--args="is_debug=$debug \
|
||||
enable_dsyms=$debug \
|
||||
target_os=\"ios\" \
|
||||
target_cpu=\"$arch\" \
|
||||
target_environment=\"$environment\" \
|
||||
treat_warnings_as_errors=false \
|
||||
ios_enable_code_signing=false \
|
||||
rtc_enable_protobuf=false \
|
||||
rtc_include_tests=false \
|
||||
rtc_build_examples=false \
|
||||
rtc_build_tools=false \
|
||||
rtc_libvpx_build_vp9=false \
|
||||
is_component_build=false \
|
||||
enable_stripping=true \
|
||||
rtc_enable_symbol_export=true \
|
||||
rtc_enable_objc_symbol_export=false \
|
||||
rtc_use_h264=false \
|
||||
use_custom_libcxx=false \
|
||||
use_clang_modules=false \
|
||||
clang_use_chrome_plugins=false \
|
||||
use_rtti=true \
|
||||
use_lld=false"
|
||||
|
||||
# build static library
|
||||
ninja -C "$OUTPUT_DIR" :default \
|
||||
api/audio_codecs:builtin_audio_decoder_factory \
|
||||
api/task_queue:default_task_queue_factory \
|
||||
sdk:native_api \
|
||||
sdk:default_codec_factory_objc \
|
||||
pc:peer_connection \
|
||||
sdk:videocapture_objc \
|
||||
sdk:framework_objc
|
||||
|
||||
# make libwebrtc.a
|
||||
# don't include nasm
|
||||
ar -rc "$ARTIFACTS_DIR/lib/libwebrtc.a" `find "$OUTPUT_DIR/obj" -name '*.o' -not -path "*/third_party/nasm/*"`
|
||||
|
||||
# License generation - may fail locally due to GN warnings breaking JSON parsing
|
||||
# Use vpython3 from depot_tools for consistent Python version
|
||||
vpython3 "./src/tools_webrtc/libs/generate_licenses.py" \
|
||||
--target :webrtc "$OUTPUT_DIR" "$OUTPUT_DIR" || echo "Warning: License generation failed"
|
||||
|
||||
cp "$OUTPUT_DIR/obj/webrtc.ninja" "$ARTIFACTS_DIR"
|
||||
cp "$OUTPUT_DIR/obj/modules/desktop_capture/desktop_capture.ninja" "$ARTIFACTS_DIR" 2>/dev/null || true
|
||||
cp "$OUTPUT_DIR/args.gn" "$ARTIFACTS_DIR"
|
||||
|
||||
cp "$OUTPUT_DIR/LICENSE.md" "$ARTIFACTS_DIR"
|
||||
|
||||
cd src
|
||||
find . -name "*.h" -print | cpio -pd "$ARTIFACTS_DIR/include"
|
||||
find . -name "*.inc" -print | cpio -pd "$ARTIFACTS_DIR/include"
|
||||
+159
@@ -0,0 +1,159 @@
|
||||
#!/bin/bash
|
||||
# Exit immediately if any command fails. This ensures CI properly reports build
|
||||
# failures instead of continuing to create empty/broken artifacts.
|
||||
set -e
|
||||
|
||||
# Copyright 2023 LiveKit, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
arch=""
|
||||
profile="release"
|
||||
|
||||
while [ "$#" -gt 0 ]; do
|
||||
case "$1" in
|
||||
--arch)
|
||||
arch="$2"
|
||||
if [ "$arch" != "x64" ] && [ "$arch" != "arm64" ]; then
|
||||
echo "Error: Invalid value for --arch. Must be 'x64' or 'arm64'."
|
||||
exit 1
|
||||
fi
|
||||
shift 2
|
||||
;;
|
||||
--profile)
|
||||
profile="$2"
|
||||
if [ "$profile" != "debug" ] && [ "$profile" != "release" ]; then
|
||||
echo "Error: Invalid value for --profile. Must be 'debug' or 'release'."
|
||||
exit 1
|
||||
fi
|
||||
shift 2
|
||||
;;
|
||||
*)
|
||||
echo "Error: Unknown argument '$1'"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$arch" ]; then
|
||||
echo "Error: --arch must be set."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Building LiveKit WebRTC - Linux"
|
||||
echo "Arch: $arch"
|
||||
echo "Profile: $profile"
|
||||
|
||||
if [ ! -e "$(pwd)/depot_tools" ]
|
||||
then
|
||||
git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||
fi
|
||||
|
||||
export COMMAND_DIR=$(cd $(dirname $0); pwd)
|
||||
export PATH="$(pwd)/depot_tools:$PATH"
|
||||
export OUTPUT_DIR="$(pwd)/src/out-$arch-$profile"
|
||||
export ARTIFACTS_DIR="$(pwd)/linux-$arch-$profile"
|
||||
|
||||
if [ ! -e "$(pwd)/src" ]
|
||||
then
|
||||
gclient sync -D --no-history
|
||||
fi
|
||||
|
||||
cd src
|
||||
git apply "$COMMAND_DIR/patches/add_licenses.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
|
||||
git apply "$COMMAND_DIR/patches/fix_license_json_parsing.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
|
||||
git apply "$COMMAND_DIR/patches/ssl_verify_callback_with_native_handle.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
|
||||
git apply "$COMMAND_DIR/patches/add_deps.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
|
||||
git apply "$COMMAND_DIR/patches/fix_desktop_capture_compile.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
|
||||
git apply "$COMMAND_DIR/patches/external_audio_source.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
|
||||
|
||||
# Disable CREL (compact relocations). Chromium's build enables experimental
|
||||
# CREL via -Wa,--crel which causes segfaults on aarch64-linux (and is known
|
||||
# broken on arm32 and s390x too).
|
||||
# See: https://crbug.com/376278218
|
||||
# See: https://github.com/zed-industries/zed/pull/51433#discussion_r2944567608
|
||||
git -C build apply "$COMMAND_DIR/patches/disable_crel.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
|
||||
|
||||
cd third_party
|
||||
|
||||
git apply "$COMMAND_DIR/patches/david_disable_gun_source_macro.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
|
||||
|
||||
cd libyuv
|
||||
|
||||
git apply "$COMMAND_DIR/patches/disable_sme_for_libyuv.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
|
||||
|
||||
cd ../../..
|
||||
|
||||
mkdir -p "$ARTIFACTS_DIR/lib"
|
||||
|
||||
python3 "./src/build/linux/sysroot_scripts/install-sysroot.py" --arch="$arch"
|
||||
|
||||
debug="false"
|
||||
if [ "$profile" = "debug" ]; then
|
||||
debug="true"
|
||||
fi
|
||||
|
||||
# Note: use_clang_modules=false is required to avoid C++ module compilation issues.
|
||||
# Without this flag, the build may fail partway through, resulting in missing
|
||||
# or incomplete artifacts.
|
||||
args="is_debug=$debug \
|
||||
target_os=\"linux\" \
|
||||
target_cpu=\"$arch\" \
|
||||
rtc_enable_protobuf=false \
|
||||
treat_warnings_as_errors=false \
|
||||
use_llvm_libatomic=false \
|
||||
use_custom_libcxx=false \
|
||||
use_custom_libcxx_for_host=false \
|
||||
use_clang_modules=false \
|
||||
rtc_include_tests=false \
|
||||
rtc_build_tools=false \
|
||||
rtc_build_examples=false \
|
||||
rtc_libvpx_build_vp9=true \
|
||||
enable_libaom=true \
|
||||
is_component_build=false \
|
||||
enable_stripping=true \
|
||||
ffmpeg_branding=\"Chrome\" \
|
||||
rtc_use_h264=true \
|
||||
rtc_use_h265=true \
|
||||
rtc_use_pipewire=true \
|
||||
symbol_level=0 \
|
||||
enable_iterator_debugging=false \
|
||||
use_rtti=true \
|
||||
rtc_use_x11=true"
|
||||
|
||||
# generate ninja files
|
||||
gn gen "$OUTPUT_DIR" --root="src" --args="${args}"
|
||||
|
||||
# build static library
|
||||
ninja -C "$OUTPUT_DIR" :default
|
||||
|
||||
# make libwebrtc.a
|
||||
# don't include nasm
|
||||
ar -rc "$ARTIFACTS_DIR/lib/libwebrtc.a" `find "$OUTPUT_DIR/obj" -name '*.o' -not -path "*/third_party/nasm/*"`
|
||||
src/third_party/llvm-build/Release+Asserts/bin/llvm-objcopy --redefine-syms="$COMMAND_DIR/boringssl_prefix_symbols.txt" "$ARTIFACTS_DIR/lib/libwebrtc.a"
|
||||
|
||||
# License generation is optional - may fail with some Python versions
|
||||
# Use vpython3 from depot_tools for consistent Python version
|
||||
vpython3 "./src/tools_webrtc/libs/generate_licenses.py" \
|
||||
--target :default "$OUTPUT_DIR" "$OUTPUT_DIR" || echo "Warning: License generation failed (non-critical)"
|
||||
|
||||
cp "$OUTPUT_DIR/obj/webrtc.ninja" "$ARTIFACTS_DIR"
|
||||
cp "$OUTPUT_DIR/obj/modules/desktop_capture/desktop_capture.ninja" "$ARTIFACTS_DIR"
|
||||
cp "$OUTPUT_DIR/args.gn" "$ARTIFACTS_DIR"
|
||||
|
||||
cp "$OUTPUT_DIR/LICENSE.md" "$ARTIFACTS_DIR"
|
||||
|
||||
cd src
|
||||
find . -name "*.h" -print | cpio -pd "$ARTIFACTS_DIR/include"
|
||||
find . -name "*.inc" -print | cpio -pd "$ARTIFACTS_DIR/include"
|
||||
+163
@@ -0,0 +1,163 @@
|
||||
#!/bin/bash
|
||||
# Exit immediately if any command fails. This ensures CI properly reports build
|
||||
# failures instead of continuing to create empty/broken artifacts.
|
||||
set -e
|
||||
|
||||
# Copyright 2023 LiveKit, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
arch=""
|
||||
profile="release"
|
||||
|
||||
while [ "$#" -gt 0 ]; do
|
||||
case "$1" in
|
||||
--arch)
|
||||
arch="$2"
|
||||
if [ "$arch" != "x64" ] && [ "$arch" != "arm64" ]; then
|
||||
echo "Error: Invalid value for --arch. Must be 'x64' or 'arm64'."
|
||||
exit 1
|
||||
fi
|
||||
shift 2
|
||||
;;
|
||||
--profile)
|
||||
profile="$2"
|
||||
if [ "$profile" != "debug" ] && [ "$profile" != "release" ]; then
|
||||
echo "Error: Invalid value for --profile. Must be 'debug' or 'release'."
|
||||
exit 1
|
||||
fi
|
||||
shift 2
|
||||
;;
|
||||
*)
|
||||
echo "Error: Unknown argument '$1'"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$arch" ]; then
|
||||
echo "Error: --arch must be set."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Building LiveKit WebRTC - MacOS"
|
||||
echo "Arch: $arch"
|
||||
echo "Profile: $profile"
|
||||
|
||||
if [ ! -e "$(pwd)/depot_tools" ]
|
||||
then
|
||||
git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||
fi
|
||||
|
||||
export COMMAND_DIR=$(cd $(dirname $0); pwd)
|
||||
export PATH="$(pwd)/depot_tools:$PATH"
|
||||
export OUTPUT_DIR="$(pwd)/src/out-$arch-$profile"
|
||||
export ARTIFACTS_DIR="$(pwd)/mac-$arch-$profile"
|
||||
|
||||
if [ ! -e "$(pwd)/src" ]
|
||||
then
|
||||
gclient sync -D --no-history
|
||||
fi
|
||||
|
||||
cd src
|
||||
|
||||
# Apply patches only if not already applied (check with --reverse --check)
|
||||
apply_patch_if_needed() {
|
||||
local patch="$1"
|
||||
if git apply --reverse --check "$patch" 2>/dev/null; then
|
||||
echo "Patch already applied: $(basename "$patch")"
|
||||
else
|
||||
echo "Applying patch: $(basename "$patch")"
|
||||
git apply "$patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn || true
|
||||
fi
|
||||
}
|
||||
|
||||
apply_patch_if_needed "$COMMAND_DIR/patches/add_licenses.patch"
|
||||
apply_patch_if_needed "$COMMAND_DIR/patches/fix_license_json_parsing.patch"
|
||||
apply_patch_if_needed "$COMMAND_DIR/patches/ssl_verify_callback_with_native_handle.patch"
|
||||
apply_patch_if_needed "$COMMAND_DIR/patches/add_deps.patch"
|
||||
apply_patch_if_needed "$COMMAND_DIR/patches/external_audio_source.patch"
|
||||
|
||||
cd ..
|
||||
|
||||
mkdir -p "$ARTIFACTS_DIR/lib"
|
||||
|
||||
debug="false"
|
||||
if [ "$profile" = "debug" ]; then
|
||||
debug="true"
|
||||
fi
|
||||
|
||||
# generate ninja files
|
||||
# Note: use_clang_modules=false is required to avoid libc++ header incompatibility
|
||||
# with Xcode 26.0. When enabled, C++ module compilation fails with errors like
|
||||
# "unknown type name 'size_t'" due to conflicts between WebRTC's bundled libc++
|
||||
# headers and the macOS SDK headers.
|
||||
gn gen "$OUTPUT_DIR" --root="src" \
|
||||
--args="is_debug=$debug \
|
||||
enable_dsyms=$debug \
|
||||
target_os=\"mac\" \
|
||||
target_cpu=\"$arch\" \
|
||||
mac_deployment_target=\"10.15\" \
|
||||
mac_min_system_version=\"10.15\" \
|
||||
treat_warnings_as_errors=false \
|
||||
rtc_enable_protobuf=false \
|
||||
rtc_include_tests=false \
|
||||
rtc_build_examples=false \
|
||||
rtc_build_tools=false \
|
||||
rtc_libvpx_build_vp9=true \
|
||||
enable_libaom=true \
|
||||
is_component_build=false \
|
||||
enable_stripping=true \
|
||||
rtc_enable_symbol_export=true \
|
||||
rtc_enable_objc_symbol_export=false \
|
||||
rtc_include_dav1d_in_internal_decoder_factory = true \
|
||||
rtc_use_h264=true \
|
||||
rtc_use_h265=true \
|
||||
use_custom_libcxx=false \
|
||||
use_clang_modules=false \
|
||||
clang_use_chrome_plugins=false \
|
||||
use_rtti=true \
|
||||
use_lld=false \
|
||||
rtc_include_internal_audio_device=true"
|
||||
|
||||
# build static library
|
||||
ninja -C "$OUTPUT_DIR" :default \
|
||||
api/audio_codecs:builtin_audio_decoder_factory \
|
||||
api/task_queue:default_task_queue_factory \
|
||||
sdk:native_api \
|
||||
sdk:default_codec_factory_objc \
|
||||
pc:peer_connection \
|
||||
sdk:videocapture_objc \
|
||||
sdk:mac_framework_objc \
|
||||
desktop_capture_objc \
|
||||
modules/audio_device:audio_device
|
||||
|
||||
# make libwebrtc.a
|
||||
# don't include nasm
|
||||
ar -rc "$ARTIFACTS_DIR/lib/libwebrtc.a" `find "$OUTPUT_DIR/obj" -name '*.o' -not -path "*/third_party/nasm/*"`
|
||||
|
||||
# License generation - may fail locally due to GN warnings breaking JSON parsing
|
||||
# Use vpython3 from depot_tools for consistent Python version
|
||||
vpython3 "./src/tools_webrtc/libs/generate_licenses.py" \
|
||||
--target :webrtc "$OUTPUT_DIR" "$OUTPUT_DIR" || echo "Warning: License generation failed"
|
||||
|
||||
cp "$OUTPUT_DIR/obj/webrtc.ninja" "$ARTIFACTS_DIR"
|
||||
cp "$OUTPUT_DIR/obj/modules/desktop_capture/desktop_capture.ninja" "$ARTIFACTS_DIR" 2>/dev/null || true
|
||||
cp "$OUTPUT_DIR/args.gn" "$ARTIFACTS_DIR"
|
||||
|
||||
cp "$OUTPUT_DIR/LICENSE.md" "$ARTIFACTS_DIR"
|
||||
|
||||
cd src
|
||||
find . -name "*.h" -print | cpio -pd "$ARTIFACTS_DIR/include"
|
||||
find . -name "*.inc" -print | cpio -pd "$ARTIFACTS_DIR/include"
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
@echo off
|
||||
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
set arch=
|
||||
set profile=release
|
||||
|
||||
:arg_loop
|
||||
if "%1" == "" goto end_arg_loop
|
||||
if "%1" == "--arch" (
|
||||
set "arch=%2"
|
||||
shift & shift & goto arg_loop
|
||||
)
|
||||
if "%1" == "--profile" (
|
||||
set "profile=%2"
|
||||
shift & shift & goto arg_loop
|
||||
)
|
||||
echo Error: Unknown argument '%1'
|
||||
exit /b 1
|
||||
:end_arg_loop
|
||||
|
||||
if not "!arch!" == "x64" if not "!arch!" == "arm64" (
|
||||
echo Error: Invalid value for --arch. Must be 'x64' or 'arm64'.
|
||||
exit /b 1
|
||||
)
|
||||
if not "!profile!" == "debug" if not "!profile!" == "release" (
|
||||
echo Error: Invalid value for --profile. Must be 'debug' or 'release'.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo "Building LiveKit WebRTC - Windows"
|
||||
echo "Arch: !arch!"
|
||||
echo "Profile: !profile!"
|
||||
|
||||
if not exist depot_tools (
|
||||
git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||
)
|
||||
|
||||
set COMMAND_DIR=%~dp0
|
||||
set PATH=%cd%\depot_tools;%PATH%
|
||||
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
|
||||
set GYP_GENERATORS=ninja,msvs-ninja
|
||||
set GYP_MSVS_VERSION=2022
|
||||
set OUTPUT_DIR=src\out-!arch!-!profile!
|
||||
set ARTIFACTS_DIR=%cd%\win-!arch!-!profile!
|
||||
set vs2019_install=C:\Program Files\Microsoft Visual Studio\2022\Enterprise
|
||||
|
||||
if not exist src (
|
||||
call gclient.bat sync -D --with_branch_heads --with_tags
|
||||
)
|
||||
|
||||
cd src
|
||||
call git apply "%COMMAND_DIR%/patches/add_licenses.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
|
||||
call git apply "%COMMAND_DIR%/patches/add_deps.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
|
||||
call git apply "%COMMAND_DIR%/patches/windows_silence_warnings.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
|
||||
call git apply "%COMMAND_DIR%/patches/ssl_verify_callback_with_native_handle.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
|
||||
call git apply "%COMMAND_DIR%/patches/external_audio_source.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
|
||||
|
||||
copy ".vpython3" "..\"
|
||||
|
||||
cd ..
|
||||
|
||||
mkdir "%ARTIFACTS_DIR%\lib"
|
||||
|
||||
set "debug=false"
|
||||
if "!profile!" == "debug" (
|
||||
set "debug=true"
|
||||
)
|
||||
|
||||
rem generate ninja for release
|
||||
call gn.bat gen %OUTPUT_DIR% --root="src" ^
|
||||
--args="is_debug=!debug! is_clang=true target_cpu=\"!arch!\" use_custom_libcxx=false rtc_libvpx_build_vp9=true enable_libaom=true rtc_include_tests=false rtc_build_examples=false rtc_build_tools=false is_component_build=false rtc_enable_protobuf=false rtc_use_h264=true ffmpeg_branding=\"Chrome\" symbol_level=0 enable_iterator_debugging=false"
|
||||
|
||||
rem build
|
||||
ninja.exe -C %OUTPUT_DIR% :default
|
||||
|
||||
rem copy static library for release build
|
||||
copy "%OUTPUT_DIR%\obj\webrtc.lib" "%ARTIFACTS_DIR%\lib"
|
||||
|
||||
rem generate license
|
||||
call python3 "%cd%\src\tools_webrtc\libs\generate_licenses.py" ^
|
||||
--target :default %OUTPUT_DIR% %OUTPUT_DIR%
|
||||
|
||||
copy "%OUTPUT_DIR%\obj\webrtc.ninja" "%ARTIFACTS_DIR%"
|
||||
copy "%OUTPUT_DIR%\obj\modules\desktop_capture\desktop_capture.ninja" "%ARTIFACTS_DIR%"
|
||||
copy "%OUTPUT_DIR%\args.gn" "%ARTIFACTS_DIR%"
|
||||
copy "%OUTPUT_DIR%\LICENSE.md" "%ARTIFACTS_DIR%"
|
||||
|
||||
rem copy header
|
||||
xcopy src\*.h "%ARTIFACTS_DIR%\include" /C /S /I /F /H
|
||||
xcopy src\*.inc "%ARTIFACTS_DIR%\include" /C /S /I /F /H
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
diff --git a/BUILD.gn b/BUILD.gn
|
||||
index ca8d8faa61..13e07a2f28 100644
|
||||
--- a/BUILD.gn
|
||||
+++ b/BUILD.gn
|
||||
@@ -24,6 +24,9 @@
|
||||
import("//build/config/linux/pkg_config.gni")
|
||||
import("//build/config/sanitizers/sanitizers.gni")
|
||||
import("webrtc.gni")
|
||||
+import("//third_party/libaom/options.gni")
|
||||
+
|
||||
+
|
||||
if (rtc_enable_protobuf) {
|
||||
import("//third_party/protobuf/proto_library.gni")
|
||||
}
|
||||
@@ -331,6 +334,10 @@ config("common_config") {
|
||||
defines += [ "WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE" ]
|
||||
}
|
||||
|
||||
+ if (enable_libaom) {
|
||||
+ defines += [ "RTC_USE_LIBAOM_AV1_ENCODER" ]
|
||||
+ }
|
||||
+
|
||||
if (rtc_libvpx_build_vp9) {
|
||||
defines += [ "RTC_ENABLE_VP9" ]
|
||||
}
|
||||
@@ -565,6 +572,10 @@ if (!build_with_chromium) {
|
||||
"pc:rtc_pc",
|
||||
"sdk",
|
||||
"video",
|
||||
+ "//third_party/zlib",
|
||||
+ "rtc_base:log_sinks",
|
||||
+ "media:rtc_simulcast_encoder_adapter",
|
||||
+ "api/crypto:frame_crypto_transformer",
|
||||
]
|
||||
|
||||
if (rtc_include_builtin_audio_codecs) {
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
diff --git a/tools_webrtc/libs/generate_licenses.py b/tools_webrtc/libs/generate_licenses.py
|
||||
index d945b43..5f3e457 100755
|
||||
--- a/tools_webrtc/libs/generate_licenses.py
|
||||
+++ b/tools_webrtc/libs/generate_licenses.py
|
||||
@@ -86,6 +86,18 @@ LIB_TO_LICENSES_DICT = {
|
||||
# Compile time dependencies, no license needed:
|
||||
'ow2_asm': [],
|
||||
'jdk': [],
|
||||
+
|
||||
+ 'ffmpeg':[
|
||||
+ 'third_party/ffmpeg/COPYING.GPLv2',
|
||||
+ 'third_party/ffmpeg/COPYING.GPLv3',
|
||||
+ 'third_party/ffmpeg/COPYING.LGPLv2.1',
|
||||
+ 'third_party/ffmpeg/COPYING.LGPLv3'
|
||||
+ ],
|
||||
+ 'openh264': ['third_party/openh264/src/LICENSE'],
|
||||
+ 'catapult': [],
|
||||
+ 'google_benchmark': [],
|
||||
+ 'googletest': [],
|
||||
+ 'vinn': [],
|
||||
}
|
||||
|
||||
# Third_party library _regex_ to licences mapping. Keys are regular expression
|
||||
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
--- src/buildtools/third_party/libunwind/BUILD.gn 2023-07-10 10:19:16
|
||||
+++ src/buildtools/third_party/libunwind/BUILD.gn 2023-07-10 10:19:23
|
||||
@@ -21,7 +21,7 @@ config("libunwind_config") {
|
||||
|
||||
# TODO(crbug.com/40273848): Move this build file to third_party/libc++/BUILD.gn once submodule migration is done
|
||||
source_set("libunwind") {
|
||||
- visibility = [ "//buildtools/third_party/libc++abi" ]
|
||||
+ visibility = [ "//buildtools/third_party/libc++abi", "//build/config:common_deps" ]
|
||||
if (is_android) {
|
||||
visibility += [ "//services/tracing/public/cpp" ]
|
||||
}
|
||||
--- src/build/config/BUILD.gn 2023-07-10 10:23:49
|
||||
+++ src/build/config/BUILD.gn 2023-07-10 10:23:54
|
||||
@@ -296,6 +296,8 @@ group("common_deps") {
|
||||
|
||||
if (use_custom_libcxx) {
|
||||
public_deps += [ "//buildtools/third_party/libc++" ]
|
||||
+ } else {
|
||||
+ public_deps += [ "//buildtools/third_party/libunwind" ]
|
||||
}
|
||||
|
||||
if (use_llvm_libatomic) {
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
diff --git a/dav1d/BUILD.gn b/dav1d/BUILD.gn
|
||||
index 9348e15c3c..f34db7ff98 100644
|
||||
--- a/dav1d/BUILD.gn
|
||||
+++ b/dav1d/BUILD.gn
|
||||
@@ -101,7 +101,7 @@ if (is_win) {
|
||||
dav1d_copts += [ "-D_DARWIN_C_SOURCE" ]
|
||||
}
|
||||
if (is_linux || is_chromeos || is_android || current_os == "aix") {
|
||||
- if (!is_clang) {
|
||||
+ if (!is_clang && (current_cpu == "x86" || current_cpu == "x64")) {
|
||||
dav1d_copts += [ "-D_GNU_SOURCE" ]
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn
|
||||
index c09c9677b..3cfce80a1 100644
|
||||
--- a/config/compiler/BUILD.gn
|
||||
+++ b/config/compiler/BUILD.gn
|
||||
@@ -721,14 +721,6 @@ config("compiler") {
|
||||
} else {
|
||||
cflags += [ "-ffp-contract=off" ]
|
||||
}
|
||||
-
|
||||
- # Enable ELF CREL (see crbug.com/357878242) for all platforms that use ELF.
|
||||
- # TODO(crbug.com/376278218): This causes segfault on Linux ARM builds.
|
||||
- # It also causes segfault on Linux s390x:
|
||||
- # https://github.com/llvm/llvm-project/issues/149511
|
||||
- if (is_linux && use_lld && current_cpu != "arm" && current_cpu != "s390x") {
|
||||
- cflags += [ "-Wa,--crel,--allow-experimental-crel" ]
|
||||
- }
|
||||
}
|
||||
|
||||
# C11/C++11 compiler flags setup.
|
||||
fluxer_desktop/native/webrtc-sender/vendor/webrtc-sys/libwebrtc/patches/disable_sme_for_libyuv.patch
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
diff --git a/libyuv.gni b/libyuv.gni
|
||||
index 3334df70..9859a121 100644
|
||||
--- a/libyuv.gni
|
||||
+++ b/libyuv.gni
|
||||
@@ -24,7 +24,7 @@ declare_args() {
|
||||
# errors on Fuchsia, macOS, and compilation errors on Windows.
|
||||
# TODO: bug 359006069 - Remove the restriction after the linker and
|
||||
# compilation errors are fixed.
|
||||
- libyuv_use_sme = current_cpu == "arm64" && (is_linux || is_android)
|
||||
+ libyuv_use_sme = false
|
||||
libyuv_use_msa =
|
||||
(current_cpu == "mips64el" || current_cpu == "mipsel") && mips_use_msa
|
||||
libyuv_use_mmi =
|
||||
Vendored
+142
@@ -0,0 +1,142 @@
|
||||
diff --git a/api/media_stream_interface.h b/api/media_stream_interface.h
|
||||
index fb1cc4e58e..85062ba60e 100644
|
||||
--- a/api/media_stream_interface.h
|
||||
+++ b/api/media_stream_interface.h
|
||||
@@ -267,6 +267,11 @@ class RTC_EXPORT AudioSourceInterface : public MediaSourceInterface {
|
||||
// (for some of the settings this approach is broken, e.g. setting
|
||||
// audio network adaptation on the source is the wrong layer of abstraction).
|
||||
virtual const AudioOptions options() const;
|
||||
+
|
||||
+ // Returns true if this source delivers audio externally (via AddSink),
|
||||
+ // bypassing the ADM/AudioState audio distribution path.
|
||||
+ // When true, AudioSendStream should not register with AudioState.
|
||||
+ virtual bool is_external_source() const { return false; }
|
||||
};
|
||||
|
||||
// Interface of the audio processor used by the audio track to collect
|
||||
diff --git a/audio/audio_send_stream.cc b/audio/audio_send_stream.cc
|
||||
index 76156ce830..10b59d3ff6 100644
|
||||
--- a/audio/audio_send_stream.cc
|
||||
+++ b/audio/audio_send_stream.cc
|
||||
@@ -373,8 +373,13 @@ void AudioSendStream::Start() {
|
||||
}
|
||||
channel_send_->StartSend();
|
||||
sending_ = true;
|
||||
- audio_state()->AddSendingStream(this, encoder_sample_rate_hz_,
|
||||
- encoder_num_channels_);
|
||||
+ // Only register with AudioState if not using external source.
|
||||
+ // External sources (like NativeAudioSource) deliver audio directly via AddSink,
|
||||
+ // so we don't want AudioState to also send device audio to this stream.
|
||||
+ if (!config_.external_source) {
|
||||
+ audio_state()->AddSendingStream(this, encoder_sample_rate_hz_,
|
||||
+ encoder_num_channels_);
|
||||
+ }
|
||||
}
|
||||
|
||||
void AudioSendStream::Stop() {
|
||||
@@ -386,7 +391,10 @@ void AudioSendStream::Stop() {
|
||||
RemoveBitrateObserver();
|
||||
channel_send_->StopSend();
|
||||
sending_ = false;
|
||||
- audio_state()->RemoveSendingStream(this);
|
||||
+ // Only unregister if we registered (when not using external source).
|
||||
+ if (!config_.external_source) {
|
||||
+ audio_state()->RemoveSendingStream(this);
|
||||
+ }
|
||||
}
|
||||
|
||||
void AudioSendStream::SendAudioData(std::unique_ptr<AudioFrame> audio_frame) {
|
||||
diff --git a/call/audio_send_stream.h b/call/audio_send_stream.h
|
||||
index 84341b5cb1..9359777bc9 100644
|
||||
--- a/call/audio_send_stream.h
|
||||
+++ b/call/audio_send_stream.h
|
||||
@@ -178,6 +178,12 @@ class AudioSendStream : public AudioSender {
|
||||
// An optional frame transformer used by insertable streams to transform
|
||||
// encoded frames.
|
||||
scoped_refptr<webrtc::FrameTransformerInterface> frame_transformer;
|
||||
+
|
||||
+ // When true, this stream uses an external audio source (not ADM).
|
||||
+ // AudioState will NOT send device-captured audio to this stream.
|
||||
+ // Audio is delivered directly via the source's AddSink mechanism.
|
||||
+ // This prevents mixing of device audio with externally-sourced audio.
|
||||
+ bool external_source = false;
|
||||
};
|
||||
|
||||
virtual ~AudioSendStream() = default;
|
||||
diff --git a/media/base/audio_source.h b/media/base/audio_source.h
|
||||
index 04a7d19dfa..9f513f3c75 100644
|
||||
--- a/media/base/audio_source.h
|
||||
+++ b/media/base/audio_source.h
|
||||
@@ -49,6 +49,10 @@ class AudioSource {
|
||||
// to the source at a time.
|
||||
virtual void SetSink(Sink* sink) = 0;
|
||||
|
||||
+ // Returns true if this source delivers audio externally (bypassing ADM).
|
||||
+ // When true, AudioSendStream should not register with AudioState.
|
||||
+ virtual bool is_external_source() const { return false; }
|
||||
+
|
||||
protected:
|
||||
virtual ~AudioSource() {}
|
||||
};
|
||||
diff --git a/media/engine/webrtc_voice_engine.cc b/media/engine/webrtc_voice_engine.cc
|
||||
index 762f9d584c..4ce07ddc9d 100644
|
||||
--- a/media/engine/webrtc_voice_engine.cc
|
||||
+++ b/media/engine/webrtc_voice_engine.cc
|
||||
@@ -1017,6 +1017,14 @@ class WebRtcVoiceSendChannel::WebRtcAudioSendStream : public AudioSource::Sink {
|
||||
RTC_DCHECK(source_ == source);
|
||||
return;
|
||||
}
|
||||
+
|
||||
+ // Check if this is an external audio source (delivers audio via AddSink).
|
||||
+ // If so, mark the config so AudioState doesn't send device audio to this
|
||||
+ // stream. This must be done before UpdateSendState() calls Start().
|
||||
+ if (source->is_external_source() && !config_.external_source) {
|
||||
+ config_.external_source = true;
|
||||
+ stream_->Reconfigure(config_, nullptr);
|
||||
+ }
|
||||
source->SetSink(this);
|
||||
source_ = source;
|
||||
UpdateSendState();
|
||||
diff --git a/pc/rtp_sender.cc b/pc/rtp_sender.cc
|
||||
index d5edbbf0ed..c14ddfe868 100644
|
||||
--- a/pc/rtp_sender.cc
|
||||
+++ b/pc/rtp_sender.cc
|
||||
@@ -786,6 +786,13 @@ void AudioRtpSender::SetSend() {
|
||||
RTC_DCHECK_RUN_ON(signaling_thread_);
|
||||
RTC_DCHECK(!stopped_);
|
||||
RTC_DCHECK(can_send_track());
|
||||
+
|
||||
+ // Propagate is_external_source from AudioSourceInterface to the sink adapter.
|
||||
+ // This ensures the voice engine knows not to mix ADM audio with external sources.
|
||||
+ if (audio_track()->GetSource() && audio_track()->GetSource()->is_external_source()) {
|
||||
+ sink_adapter_->set_is_external_source(true);
|
||||
+ }
|
||||
+
|
||||
if (!media_channel_) {
|
||||
RTC_LOG(LS_ERROR) << "SetAudioSend: No audio channel exists.";
|
||||
return;
|
||||
diff --git a/pc/rtp_sender.h b/pc/rtp_sender.h
|
||||
index eaffd4ef0f..d0489df9e7 100644
|
||||
--- a/pc/rtp_sender.h
|
||||
+++ b/pc/rtp_sender.h
|
||||
@@ -307,6 +307,12 @@ class LocalAudioSinkAdapter : public AudioTrackSinkInterface,
|
||||
LocalAudioSinkAdapter();
|
||||
virtual ~LocalAudioSinkAdapter();
|
||||
|
||||
+ // Set whether the original AudioSourceInterface is an external source.
|
||||
+ // This propagates the is_external_source state from AudioSourceInterface
|
||||
+ // to this AudioSource adapter.
|
||||
+ void set_is_external_source(bool value) { is_external_source_ = value; }
|
||||
+ bool is_external_source() const override { return is_external_source_; }
|
||||
+
|
||||
private:
|
||||
// AudioSinkInterface implementation.
|
||||
void OnData(const void* audio_data,
|
||||
@@ -337,6 +343,7 @@ class LocalAudioSinkAdapter : public AudioTrackSinkInterface,
|
||||
// Critical section protecting `sink_`.
|
||||
Mutex lock_;
|
||||
int num_preferred_channels_ = -1;
|
||||
+ bool is_external_source_ = false;
|
||||
};
|
||||
|
||||
class AudioRtpSender : public DtmfProviderInterface, public RtpSenderBase {
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
|
||||
index 070257f072..61fd0c8f3b 100644
|
||||
--- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
|
||||
+++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
|
||||
@@ -71,10 +71,10 @@ constexpr int CursorMetaSize(int w, int h) {
|
||||
w * h * kCursorBpp);
|
||||
}
|
||||
|
||||
-constexpr PipeWireVersion kDmaBufModifierMinVersion = {.major = 0,
|
||||
+const PipeWireVersion kDmaBufModifierMinVersion = {.major = 0,
|
||||
.minor = 3,
|
||||
.micro = 33};
|
||||
-constexpr PipeWireVersion kDropSingleModifierMinVersion = {.major = 0,
|
||||
+const PipeWireVersion kDropSingleModifierMinVersion = {.major = 0,
|
||||
.minor = 3,
|
||||
.micro = 40};
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
diff --git a/tools_webrtc/libs/generate_licenses.py b/tools_webrtc/libs/generate_licenses.py
|
||||
--- a/tools_webrtc/libs/generate_licenses.py
|
||||
+++ b/tools_webrtc/libs/generate_licenses.py
|
||||
@@ -211,6 +211,12 @@ class LicenseBuilder:
|
||||
|
||||
def _get_third_party_libraries(self, buildfile_dir, target):
|
||||
license_json = LicenseBuilder._run_gn(buildfile_dir, target)
|
||||
+ # Strip any non-JSON content (e.g., GN warnings) before the actual JSON.
|
||||
+ # GN may output warnings before the JSON when certain build args trigger
|
||||
+ # deprecation notices.
|
||||
+ json_start = license_json.find('{')
|
||||
+ if json_start > 0:
|
||||
+ license_json = license_json[json_start:]
|
||||
try:
|
||||
output = json.loads(license_json)
|
||||
except:
|
||||
+317
@@ -0,0 +1,317 @@
|
||||
diff --git a/modules/video_coding/codecs/test/android_codec_factory_helper.cc b/modules/video_coding/codecs/test/android_codec_factory_helper.cc
|
||||
index f6a5046210..4ce5a79d25 100644
|
||||
--- a/modules/video_coding/codecs/test/android_codec_factory_helper.cc
|
||||
+++ b/modules/video_coding/codecs/test/android_codec_factory_helper.cc
|
||||
@@ -54,9 +54,9 @@ void InitializeAndroidObjects() {
|
||||
std::unique_ptr<VideoEncoderFactory> CreateAndroidEncoderFactory() {
|
||||
JNIEnv* env = AttachCurrentThreadIfNeeded();
|
||||
ScopedJavaLocalRef<jclass> factory_class =
|
||||
- GetClass(env, "org/webrtc/HardwareVideoEncoderFactory");
|
||||
+ GetClass(env, "livekit/org/webrtc/HardwareVideoEncoderFactory");
|
||||
jmethodID factory_constructor = env->GetMethodID(
|
||||
- factory_class.obj(), "<init>", "(Lorg/webrtc/EglBase$Context;ZZ)V");
|
||||
+ factory_class.obj(), "<init>", "(Llivekit/org/webrtc/EglBase$Context;ZZ)V");
|
||||
ScopedJavaLocalRef<jobject> factory_object =
|
||||
ScopedJavaLocalRef<jobject>::Adopt(
|
||||
env, env->NewObject(factory_class.obj(), factory_constructor,
|
||||
@@ -69,9 +69,9 @@ std::unique_ptr<VideoEncoderFactory> CreateAndroidEncoderFactory() {
|
||||
std::unique_ptr<VideoDecoderFactory> CreateAndroidDecoderFactory() {
|
||||
JNIEnv* env = AttachCurrentThreadIfNeeded();
|
||||
ScopedJavaLocalRef<jclass> factory_class =
|
||||
- GetClass(env, "org/webrtc/HardwareVideoDecoderFactory");
|
||||
+ GetClass(env, "livekit/org/webrtc/HardwareVideoDecoderFactory");
|
||||
jmethodID factory_constructor = env->GetMethodID(
|
||||
- factory_class.obj(), "<init>", "(Lorg/webrtc/EglBase$Context;)V");
|
||||
+ factory_class.obj(), "<init>", "(Llivekit/org/webrtc/EglBase$Context;)V");
|
||||
ScopedJavaLocalRef<jobject> factory_object =
|
||||
ScopedJavaLocalRef<jobject>::Adopt(
|
||||
env, env->NewObject(factory_class.obj(), factory_constructor,
|
||||
diff --git a/sdk/android/BUILD.gn b/sdk/android/BUILD.gn
|
||||
index 8ce74e2c8c..2e88760d0a 100644
|
||||
--- a/sdk/android/BUILD.gn
|
||||
+++ b/sdk/android/BUILD.gn
|
||||
@@ -1446,11 +1446,13 @@ if (current_os == "linux" || is_android) {
|
||||
generate_jni("generated_environment_jni") {
|
||||
sources = [ "api/org/webrtc/Environment.java" ]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_metrics_jni") {
|
||||
sources = [ "api/org/webrtc/Metrics.java" ]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
# Generated JNI for public JNI targets, matching order of targets
|
||||
@@ -1464,6 +1466,7 @@ if (current_os == "linux" || is_android) {
|
||||
"src/java/org/webrtc/JniCommon.java",
|
||||
]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_video_jni") {
|
||||
@@ -1493,11 +1496,13 @@ if (current_os == "linux" || is_android) {
|
||||
"src/java/org/webrtc/WrappedNativeI420Buffer.java",
|
||||
]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_video_egl_jni") {
|
||||
sources = [ "src/java/org/webrtc/EglBase10Impl.java" ]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_libvpx_vp8_jni") {
|
||||
@@ -1507,6 +1512,7 @@ if (current_os == "linux" || is_android) {
|
||||
]
|
||||
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_libvpx_vp9_jni") {
|
||||
@@ -1516,18 +1522,21 @@ if (current_os == "linux" || is_android) {
|
||||
]
|
||||
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_libaom_av1_encoder_jni") {
|
||||
sources = [ "api/org/webrtc/LibaomAv1Encoder.java" ]
|
||||
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_dav1d_jni") {
|
||||
sources = [ "api/org/webrtc/Dav1dDecoder.java" ]
|
||||
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_swcodecs_jni") {
|
||||
@@ -1537,11 +1546,13 @@ if (current_os == "linux" || is_android) {
|
||||
]
|
||||
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_rtcerror_jni") {
|
||||
sources = [ "src/java/org/webrtc/RtcError.java" ]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_peerconnection_jni") {
|
||||
@@ -1585,11 +1596,13 @@ if (current_os == "linux" || is_android) {
|
||||
"api/org/webrtc/TurnCustomizer.java",
|
||||
]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_java_audio_jni") {
|
||||
sources = [ "api/org/webrtc/audio/JavaAudioDeviceModule.java" ]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_builtin_audio_codecs_jni") {
|
||||
@@ -1598,6 +1611,7 @@ if (current_os == "linux" || is_android) {
|
||||
"api/org/webrtc/BuiltinAudioEncoderFactoryFactory.java",
|
||||
]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
# Generated JNI for native API targets
|
||||
@@ -1609,17 +1623,20 @@ if (current_os == "linux" || is_android) {
|
||||
"src/java/org/webrtc/WebRtcClassLoader.java",
|
||||
]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
# Generated JNI for internal targets.
|
||||
|
||||
generate_jni("generated_logging_jni") {
|
||||
sources = [ "src/java/org/webrtc/JNILogging.java" ]
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_audio_device_module_base_jni") {
|
||||
sources = [ "src/java/org/webrtc/audio/WebRtcAudioManager.java" ]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
|
||||
generate_jni("generated_java_audio_device_module_native_jni") {
|
||||
@@ -1628,6 +1645,7 @@ if (current_os == "linux" || is_android) {
|
||||
"src/java/org/webrtc/audio/WebRtcAudioTrack.java",
|
||||
]
|
||||
namespace = "webrtc::jni"
|
||||
+ package_prefix = android_package_prefix
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/sdk/android/api/org/webrtc/PeerConnectionFactory.java b/sdk/android/api/org/webrtc/PeerConnectionFactory.java
|
||||
index 01679ad12b..7b8545902d 100644
|
||||
--- a/sdk/android/api/org/webrtc/PeerConnectionFactory.java
|
||||
+++ b/sdk/android/api/org/webrtc/PeerConnectionFactory.java
|
||||
@@ -88,7 +88,7 @@ public class PeerConnectionFactory {
|
||||
private String fieldTrials = "";
|
||||
private boolean enableInternalTracer;
|
||||
private NativeLibraryLoader nativeLibraryLoader = new NativeLibrary.DefaultLoader();
|
||||
- private String nativeLibraryName = "jingle_peerconnection_so";
|
||||
+ private String nativeLibraryName = "lkjingle_peerconnection_so";
|
||||
@Nullable private Loggable loggable;
|
||||
@Nullable private Severity loggableSeverity;
|
||||
|
||||
diff --git a/sdk/android/src/jni/jni_helpers.h b/sdk/android/src/jni/jni_helpers.h
|
||||
index d86c8fa4ad..30f307a2ca 100644
|
||||
--- a/sdk/android/src/jni/jni_helpers.h
|
||||
+++ b/sdk/android/src/jni/jni_helpers.h
|
||||
@@ -29,10 +29,10 @@
|
||||
// boundary. crbug.com/655248
|
||||
#define JNI_FUNCTION_DECLARATION(rettype, name, ...) \
|
||||
__attribute__((force_align_arg_pointer)) extern "C" JNIEXPORT rettype \
|
||||
- JNICALL Java_org_webrtc_##name(__VA_ARGS__)
|
||||
+ JNICALL Java_livekit_org_webrtc_##name(__VA_ARGS__)
|
||||
#else
|
||||
#define JNI_FUNCTION_DECLARATION(rettype, name, ...) \
|
||||
- extern "C" JNIEXPORT rettype JNICALL Java_org_webrtc_##name(__VA_ARGS__)
|
||||
+ extern "C" JNIEXPORT rettype JNICALL Java_livekit_org_webrtc_##name(__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
namespace webrtc {
|
||||
diff --git a/sdk/android/src/jni/simulcast_video_encoder.cc b/sdk/android/src/jni/simulcast_video_encoder.cc
|
||||
index 6d4ba5b3b6..48d3cb3541 100644
|
||||
--- a/sdk/android/src/jni/simulcast_video_encoder.cc
|
||||
+++ b/sdk/android/src/jni/simulcast_video_encoder.cc
|
||||
@@ -15,7 +15,14 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
// (VideoEncoderFactory primary, VideoEncoderFactory fallback, VideoCodecInfo info)
|
||||
-JNIEXPORT jlong JNICALL Java_org_webrtc_SimulcastVideoEncoder_nativeCreateEncoder(JNIEnv *env, jclass klass, jlong webrtcEnvRef, jobject primary, jobject fallback, jobject info) {
|
||||
+JNI_FUNCTION_DECLARATION(jlong,
|
||||
+ SimulcastVideoEncoder_nativeCreateEncoder,
|
||||
+ JNIEnv *env,
|
||||
+ jclass klass,
|
||||
+ jlong webrtcEnvRef,
|
||||
+ jobject primary,
|
||||
+ jobject fallback,
|
||||
+ jobject info) {
|
||||
RTC_LOG(LS_INFO) << "Create simulcast video encoder";
|
||||
auto info_ref = JavaParamRef<jobject>::CreateLeaky(env, info);
|
||||
SdpVideoFormat format = VideoCodecInfoToSdpVideoFormat(env, info_ref);
|
||||
diff --git a/tools_webrtc/android/build_aar.py b/tools_webrtc/android/build_aar.py
|
||||
index 2fbce97c60..130b3d5fa7 100755
|
||||
--- a/tools_webrtc/android/build_aar.py
|
||||
+++ b/tools_webrtc/android/build_aar.py
|
||||
@@ -254,7 +254,7 @@ def BuildAar(build_dir,
|
||||
Collect(aar_file, build_dir, arch, unstripped)
|
||||
|
||||
license_dir = os.path.dirname(os.path.realpath(output_file))
|
||||
- GenerateLicenses(license_dir, build_dir, archs)
|
||||
+ #GenerateLicenses(license_dir, build_dir, archs)
|
||||
|
||||
|
||||
def main():
|
||||
diff --git a/webrtc.gni b/webrtc.gni
|
||||
index 468ba33b01..ca81ce298c 100644
|
||||
--- a/webrtc.gni
|
||||
+++ b/webrtc.gni
|
||||
@@ -241,6 +241,10 @@ declare_args() {
|
||||
# hasn't been registered.
|
||||
rtc_strict_field_trials = ""
|
||||
|
||||
+ if (is_android) {
|
||||
+ android_package_prefix = "livekit"
|
||||
+ }
|
||||
+
|
||||
# If different from "", symbols exported with RTC_OBJC_EXPORT will be prefixed
|
||||
# with this string.
|
||||
# See the definition of RTC_OBJC_TYPE_PREFIX in the code.
|
||||
diff --git a/third_party/jni_zero/BUILD.gn b/third_party/jni_zero/BUILD.gn
|
||||
index 7056bdd033c1..2b97de476de7 100644
|
||||
--- a/third_party/jni_zero/BUILD.gn
|
||||
+++ b/third_party/jni_zero/BUILD.gn
|
||||
@@ -17,6 +17,7 @@ generate_jni("generate_jni") {
|
||||
":*",
|
||||
"//components/cronet/android/*",
|
||||
]
|
||||
+ package_prefix = "livekit"
|
||||
}
|
||||
|
||||
generate_jar_jni("system_jni") {
|
||||
diff --git a/third_party/jni_zero/codegen/header_common.py b/third_party/jni_zero/codegen/header_common.py
|
||||
index 338cd748079f..be2577281a91 100644
|
||||
--- a/third_party/jni_zero/codegen/header_common.py
|
||||
+++ b/third_party/jni_zero/codegen/header_common.py
|
||||
@@ -12,7 +12,8 @@ def class_accessors(sb, java_classes, module_name):
|
||||
for java_class in java_classes:
|
||||
if java_class in (java_types.OBJECT_CLASS, java_types.STRING_CLASS):
|
||||
continue
|
||||
- escaped_name = java_class.to_cpp()
|
||||
+ escaped_name = java_class.class_without_prefix.to_cpp()
|
||||
+ print("header accessor: ", escaped_name)
|
||||
# #ifdef needed when multple .h files are #included that common classes.
|
||||
sb(f"""\
|
||||
#ifndef {escaped_name}_clazz_defined
|
||||
@@ -44,7 +45,7 @@ def class_accessor_expression(java_class):
|
||||
if java_class == java_types.STRING_CLASS:
|
||||
return 'jni_zero::g_string_class'
|
||||
|
||||
- return f'{java_class.to_cpp()}_clazz(env)'
|
||||
+ return f'{java_class.class_without_prefix.to_cpp()}_clazz(env)'
|
||||
|
||||
|
||||
def header_preamble(script_name,
|
||||
@@ -53,7 +54,7 @@ def header_preamble(script_name,
|
||||
user_includes=None,
|
||||
header_guard=None):
|
||||
if header_guard is None:
|
||||
- header_guard = f'{java_class.to_cpp()}_JNI'
|
||||
+ header_guard = f'{java_class.class_without_prefix.to_cpp()}_JNI'
|
||||
sb = []
|
||||
sb.append(f"""\
|
||||
// This file was generated by
|
||||
diff --git a/third_party/jni_zero/jni_zero.gni b/third_party/jni_zero/jni_zero.gni
|
||||
index 71826b906d10..22d8eaf6e232 100644
|
||||
--- a/third_party/jni_zero/jni_zero.gni
|
||||
+++ b/third_party/jni_zero/jni_zero.gni
|
||||
@@ -123,7 +123,7 @@ template("_invoke_jni_zero") {
|
||||
# namespace: Registration functions will be wrapped into this. (optional)
|
||||
# priority_java_targets: List of java targets that, if using multiplexing,
|
||||
# will always be placed first in the sequential switch numbers. (optional)
|
||||
-#
|
||||
+# package_prefix: package prefix to add to jni
|
||||
# Example
|
||||
# generate_jni_registration("chrome_jni_registration") {
|
||||
# java_targets = [ ":chrome_public_apk" ]
|
||||
@@ -327,6 +327,7 @@ template("generate_jni_impl") {
|
||||
"deps",
|
||||
"metadata",
|
||||
"public_deps",
|
||||
+ "package_prefix",
|
||||
])
|
||||
if (!defined(public_deps)) {
|
||||
public_deps = []
|
||||
@@ -421,7 +422,9 @@ template("generate_jni_impl") {
|
||||
if (defined(invoker.split_name)) {
|
||||
args += [ "--split-name=${invoker.split_name}" ]
|
||||
}
|
||||
-
|
||||
+ if (defined(package_prefix)) {
|
||||
+ args += [ "--package-prefix=${package_prefix}" ]
|
||||
+ }
|
||||
foreach(_name, _input_names) {
|
||||
_name =
|
||||
string_replace(get_path_info(_name, "name"), "\$", "__") + "_jni.h"
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
diff --git a/rtc_base/boringssl_certificate.cc b/rtc_base/boringssl_certificate.cc
|
||||
index a4f919fbbe..fe3beeaed9 100644
|
||||
--- a/rtc_base/boringssl_certificate.cc
|
||||
+++ b/rtc_base/boringssl_certificate.cc
|
||||
@@ -252,6 +252,12 @@ BoringSSLCertificate::BoringSSLCertificate(
|
||||
RTC_DCHECK(cert_buffer_ != nullptr);
|
||||
}
|
||||
|
||||
+BoringSSLCertificate::BoringSSLCertificate(
|
||||
+ bssl::UniquePtr<CRYPTO_BUFFER> cert_buffer, SSL* ssl)
|
||||
+ : cert_buffer_(std::move(cert_buffer)), ssl_(ssl) {
|
||||
+ RTC_DCHECK(cert_buffer_ != nullptr);
|
||||
+}
|
||||
+
|
||||
std::unique_ptr<BoringSSLCertificate> BoringSSLCertificate::Generate(
|
||||
OpenSSLKeyPair* key_pair,
|
||||
const SSLIdentityParams& params) {
|
||||
diff --git a/rtc_base/boringssl_certificate.h b/rtc_base/boringssl_certificate.h
|
||||
index b5a18d0843..53759fd064 100644
|
||||
--- a/rtc_base/boringssl_certificate.h
|
||||
+++ b/rtc_base/boringssl_certificate.h
|
||||
@@ -34,6 +34,7 @@ namespace webrtc {
|
||||
class BoringSSLCertificate final : public SSLCertificate {
|
||||
public:
|
||||
explicit BoringSSLCertificate(bssl::UniquePtr<CRYPTO_BUFFER> cert_buffer);
|
||||
+ BoringSSLCertificate(bssl::UniquePtr<CRYPTO_BUFFER> cert_buffer, SSL* ssl);
|
||||
|
||||
static std::unique_ptr<BoringSSLCertificate> Generate(
|
||||
OpenSSLKeyPair* key_pair,
|
||||
@@ -66,6 +67,10 @@ class BoringSSLCertificate final : public SSLCertificate {
|
||||
private:
|
||||
// A handle to the DER encoded certificate data.
|
||||
bssl::UniquePtr<CRYPTO_BUFFER> cert_buffer_;
|
||||
+ SSL* ssl_ = nullptr;
|
||||
+
|
||||
+ public:
|
||||
+ SSL* ssl() const { return ssl_; }
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
diff --git a/rtc_base/openssl_adapter.cc b/rtc_base/openssl_adapter.cc
|
||||
index b80e665d78..1f3dd28795 100644
|
||||
--- a/rtc_base/openssl_adapter.cc
|
||||
+++ b/rtc_base/openssl_adapter.cc
|
||||
@@ -846,7 +846,7 @@ enum ssl_verify_result_t OpenSSLAdapter::SSLVerifyInternal(SSL* ssl,
|
||||
std::vector<std::unique_ptr<SSLCertificate>> certs;
|
||||
for (size_t i = 0; i < sk_CRYPTO_BUFFER_num(chain); ++i) {
|
||||
certs.emplace_back(new BoringSSLCertificate(
|
||||
- bssl::UpRef(sk_CRYPTO_BUFFER_value(chain, i))));
|
||||
+ bssl::UpRef(sk_CRYPTO_BUFFER_value(chain, i)), ssl));
|
||||
}
|
||||
|
||||
SSLCertChain cert_chain(std::move(certs));
|
||||
@@ -932,7 +932,7 @@ int OpenSSLAdapter::SSLVerifyInternal(int previous_status,
|
||||
RTC_LOG(LS_ERROR) << "Failed to allocate CRYPTO_BUFFER.";
|
||||
return previous_status;
|
||||
}
|
||||
- certs.emplace_back(new BoringSSLCertificate(std::move(crypto_buffer)));
|
||||
+ certs.emplace_back(new BoringSSLCertificate(std::move(crypto_buffer), ssl));
|
||||
#else
|
||||
certs.emplace_back(new OpenSSLCertificate(x509_cert));
|
||||
#endif
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
|
||||
index 8048ec5e8..4e00f7e53 100644
|
||||
--- a/build/config/compiler/BUILD.gn
|
||||
+++ b/build/config/compiler/BUILD.gn
|
||||
@@ -1424,6 +1424,9 @@ config("default_warnings") {
|
||||
# gethostbyname. Fires mostly in non-Chromium code. We probably
|
||||
# want to remove this define eventually.
|
||||
"_WINSOCK_DEPRECATED_NO_WARNINGS",
|
||||
+
|
||||
+ "_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS",
|
||||
+ "_SILENCE_ALL_CXX20_DEPRECATION_WARNINGS",
|
||||
]
|
||||
if (!is_clang) {
|
||||
# TODO(thakis): Remove this once
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
plugins {
|
||||
id 'java-library'
|
||||
id 'com.github.johnrengelman.shadow' version '7.1.2'
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_7
|
||||
targetCompatibility = JavaVersion.VERSION_1_7
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api files("libs/classes.jar")
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
|
||||
}
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
|
||||
|
||||
task relocateShadowJar(type: ConfigureShadowRelocation) {
|
||||
target = tasks.shadowJar
|
||||
prefix = "livekit" // Default value is "shadow"
|
||||
}
|
||||
tasks.shadowJar.dependsOn tasks.relocateShadowJar
|
||||
BIN
Binary file not shown.
+6
@@ -0,0 +1,6 @@
|
||||
#Thu Apr 29 14:50:17 JST 2021
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
Vendored
Executable
+172
@@ -0,0 +1,172 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=$(save "$@")
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user