mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-10-15 00:09:39 +08:00
[perf] exclude optional libaom from default builds
This commit is contained in:
+6
-1
@@ -56,12 +56,17 @@ the desktop-compatible `DisplayN`, `control_audio`, `mouse`, `keyboard`,
|
||||
|
||||
## Video codecs
|
||||
|
||||
Every iOS build includes VideoToolbox, OpenH264, dav1d, libaom, and SVT-AV1. H.264 uses
|
||||
Every iOS build includes VideoToolbox, OpenH264, dav1d, and SVT-AV1. H.264 uses
|
||||
VideoToolbox by default; choose software processing under **设置 → 视频编解码 →
|
||||
处理方式** (Settings → Video codec → Processing mode) to use OpenH264 for H.264.
|
||||
The change takes effect on the next connection. AV1 encoding uses SVT-AV1 and AV1 decoding
|
||||
uses dav1d; VideoToolbox AV1 hardware decoding is currently unsupported.
|
||||
|
||||
The unused libaom backends are excluded by default. To include them for development,
|
||||
set the `MINIRTC_ENABLE_AOM` environment variable (or Xcode user-defined build setting)
|
||||
to `true`. This includes libaom in the merged native archive without changing the
|
||||
AV1 factories' choice of SVT-AV1 and dav1d.
|
||||
|
||||
## Physical-device test checklist
|
||||
|
||||
Run the app from Xcode on a physical device and connect to a current desktop
|
||||
|
||||
@@ -8,6 +8,11 @@ REPO_DIR="${IOS_DIR:h:h}"
|
||||
MINIRTC_DIR="${REPO_DIR}/deps/submodules/minirtc"
|
||||
CONFIG_NAME="${CONFIGURATION:-Debug}"
|
||||
MODE="${CONFIG_NAME:l}"
|
||||
MINIRTC_ENABLE_AOM="${MINIRTC_ENABLE_AOM:-false}"
|
||||
if [[ "${MINIRTC_ENABLE_AOM}" != "true" && "${MINIRTC_ENABLE_AOM}" != "false" ]]; then
|
||||
print -u2 "MINIRTC_ENABLE_AOM must be true or false."
|
||||
exit 64
|
||||
fi
|
||||
|
||||
# Keep iOS dependencies isolated from desktop Xmake packages. Besides avoiding
|
||||
# cross-project cache collisions, this guarantees every archive is compiled
|
||||
@@ -85,7 +90,7 @@ fi
|
||||
# Still configure on every invocation: Xmake must see manifest edits and restore
|
||||
# the iOS configuration if MiniRTC was built standalone for another platform.
|
||||
CONFIG_SIGNATURE="$(print -r -- "${XMAKE_BIN}" "${XMAKE_DEVELOPER_DIR}" \
|
||||
"${MODE}" "${ARCH_NAME}" "16.0" "${XMAKE_PKG_INSTALLDIR}"
|
||||
"${MODE}" "${ARCH_NAME}" "16.0" "${XMAKE_PKG_INSTALLDIR}" "${MINIRTC_ENABLE_AOM}"
|
||||
run_xmake --version | sed -n '1p'
|
||||
DEVELOPER_DIR="${XMAKE_DEVELOPER_DIR}" xcodebuild -version
|
||||
DEVELOPER_DIR="${XMAKE_DEVELOPER_DIR}" xcrun --sdk iphoneos --show-sdk-path
|
||||
@@ -112,7 +117,8 @@ configure_xmake() {
|
||||
(
|
||||
cd "${MINIRTC_DIR}"
|
||||
configure_xmake "${MINIRTC_DIR}" "${MINIRTC_BUILD_DIR}" \
|
||||
--as="${XMAKE_TOOLCHAIN_BIN}/clang" --USE_CUDA=false
|
||||
--as="${XMAKE_TOOLCHAIN_BIN}/clang" --USE_CUDA=false \
|
||||
--MINIRTC_ENABLE_AOM="${MINIRTC_ENABLE_AOM}"
|
||||
run_xmake b -P "${MINIRTC_DIR}" minirtc
|
||||
)
|
||||
|
||||
@@ -146,8 +152,11 @@ REQUIRED_LINKS=(
|
||||
nice glib-2.0 gobject-2.0 gmodule-2.0 gio-2.0 gthread-2.0 intl
|
||||
gupnp-igd-1.6 gupnp-1.6 gssdp-1.6 soup-3.0 nghttp2 sqlite3 psl xml2
|
||||
ffi pcre2-8 pcre2-posix z ssl crypto srtp2 openfec opus yuv kcp
|
||||
datachannel usrsctp openh264 dav1d aom SvtAv1Enc
|
||||
datachannel usrsctp openh264 dav1d SvtAv1Enc
|
||||
)
|
||||
if [[ "${MINIRTC_ENABLE_AOM}" == "true" ]]; then
|
||||
REQUIRED_LINKS+=(aom)
|
||||
fi
|
||||
DEPENDENCY_ARCHIVES=()
|
||||
|
||||
for link_name in "${REQUIRED_LINKS[@]}"; do
|
||||
|
||||
@@ -67,6 +67,7 @@ elif args[0] == "show":
|
||||
''')
|
||||
self.env = dict(os.environ, PATH=f"{self.bin}:{os.environ['PATH']}",
|
||||
XMAKE_BIN=str(self.bin / "xmake"), CONFIGURATION="Release",
|
||||
MINIRTC_ENABLE_AOM="false",
|
||||
CURRENT_ARCH="arm64", DEVELOPER_DIR=subprocess.check_output(
|
||||
["xcode-select", "-p"], text=True).strip())
|
||||
self.output = self.ios / "Vendor/iphoneos/Release/libCrossDeskMiniRTC.a"
|
||||
@@ -132,6 +133,22 @@ elif args[0] == "show":
|
||||
self.run_build()
|
||||
self.assertTrue(all("-c" in args for args in self.config_calls()))
|
||||
|
||||
def test_aom_is_only_required_and_merged_when_enabled(self):
|
||||
self.run_build()
|
||||
manifest = Path(str(self.output) + ".inputs.sha256")
|
||||
self.assertNotIn("libaom.a", manifest.read_text())
|
||||
original = self.output.read_bytes()
|
||||
self.env["MINIRTC_ENABLE_AOM"] = "true"
|
||||
result = self.run_build(success=False)
|
||||
self.assertIn("Unable to resolve static dependency libaom.a", result.stderr)
|
||||
self.assertEqual(self.output.read_bytes(), original)
|
||||
shutil.copy2(self.archive, self.library_dir / "libaom.a")
|
||||
self.run_build()
|
||||
self.assertIn("libaom.a", manifest.read_text())
|
||||
self.env["MINIRTC_ENABLE_AOM"] = "false"
|
||||
self.run_build()
|
||||
self.assertNotIn("libaom.a", manifest.read_text())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Vendored
+1
-1
Submodule deps/submodules/minirtc updated: 32b689b170...f169a696cb
@@ -131,6 +131,7 @@ PipeWire 不属于强制运行时依赖:程序在运行时检测宿主系统
|
||||
--USE_DRM=true/false: 在 Linux 上启用 DRM 捕获,默认不启用
|
||||
--CROSSDESK_PORTABLE=true/false: 构建便携版本,默认不启用
|
||||
--CROSSDESK_VERSION=xxx: 指定 CrossDesk 的版本
|
||||
--MINIRTC_ENABLE_AOM=true/false: 编译可选 libaom 后端,默认不启用;AV1 仍使用 SVT-AV1 / dav1d
|
||||
|
||||
# 示例
|
||||
xmake f --CROSSDESK_VERSION=1.4.3 --USE_CUDA=true
|
||||
|
||||
Reference in New Issue
Block a user