Compare commits

...

3 Commits

Author SHA1 Message Date
Romain Vimont
323549e82f Prevent build from falling back to system libs
Ensure that if a file or function is not found, the build does not
attempt to use system libraries. Falling back could result in using
libraries that are incompatible due to wrong versions or features.

PR #6671 <https://github.com/Genymobile/scrcpy/pull/6671>
2026-02-21 12:24:41 +01:00
Romain Vimont
90d11810e3 Set MediaCodec KEY_LATENCY to the minimum value
The encoder must output a frame as soon as one frame is queued.

Refs <https://developer.android.com/reference/android/media/MediaFormat#KEY_LATENCY>
Refs #6238 comment <https://github.com/Genymobile/scrcpy/issues/6238#issuecomment-3828402687>
PR #6670 <https://github.com/Genymobile/scrcpy/pull/6670>
2026-02-21 12:21:54 +01:00
Romain Vimont
1f19ec4aec Set MediaCodec KEY_PRIORITY to real-time (0)
Refs <https://developer.android.com/reference/android/media/MediaFormat#KEY_PRIORITY>
Refs #6238 comment <https://github.com/Genymobile/scrcpy/issues/6238#issuecomment-3828402687>
PR #6670 <https://github.com/Genymobile/scrcpy/pull/6670>
2026-02-21 12:21:44 +01:00
4 changed files with 16 additions and 3 deletions

View File

@@ -22,9 +22,12 @@ app/deps/libusb.sh linux native static
DEPS_INSTALL_DIR="$PWD/app/deps/work/install/linux-native-static"
ADB_INSTALL_DIR="$PWD/app/deps/work/install/adb-linux"
# Never fall back to system libs
unset PKG_CONFIG_PATH
export PKG_CONFIG_LIBDIR="$DEPS_INSTALL_DIR/lib/pkgconfig"
rm -rf "$LINUX_BUILD_DIR"
meson setup "$LINUX_BUILD_DIR" \
--pkg-config-path="$DEPS_INSTALL_DIR/lib/pkgconfig" \
-Dc_args="-I$DEPS_INSTALL_DIR/include" \
-Dc_link_args="-L$DEPS_INSTALL_DIR/lib" \
--buildtype=release \

View File

@@ -22,9 +22,12 @@ app/deps/libusb.sh macos native static
DEPS_INSTALL_DIR="$PWD/app/deps/work/install/macos-native-static"
ADB_INSTALL_DIR="$PWD/app/deps/work/install/adb-macos"
# Never fall back to system libs
unset PKG_CONFIG_PATH
export PKG_CONFIG_LIBDIR="$DEPS_INSTALL_DIR/lib/pkgconfig"
rm -rf "$MACOS_BUILD_DIR"
meson setup "$MACOS_BUILD_DIR" \
--pkg-config-path="$DEPS_INSTALL_DIR/lib/pkgconfig" \
-Dc_args="-I$DEPS_INSTALL_DIR/include" \
-Dc_link_args="-L$DEPS_INSTALL_DIR/lib" \
--buildtype=release \

View File

@@ -29,9 +29,12 @@ app/deps/libusb.sh $WINXX cross shared
DEPS_INSTALL_DIR="$PWD/app/deps/work/install/$WINXX-cross-shared"
ADB_INSTALL_DIR="$PWD/app/deps/work/install/adb-windows"
# Never fall back to system libs
unset PKG_CONFIG_PATH
export PKG_CONFIG_LIBDIR="$DEPS_INSTALL_DIR/lib/pkgconfig"
rm -rf "$WINXX_BUILD_DIR"
meson setup "$WINXX_BUILD_DIR" \
--pkg-config-path="$DEPS_INSTALL_DIR/lib/pkgconfig" \
-Dc_args="-I$DEPS_INSTALL_DIR/include" \
-Dc_link_args="-L$DEPS_INSTALL_DIR/lib" \
--cross-file=cross_$WINXX.txt \

View File

@@ -264,6 +264,10 @@ public class SurfaceEncoder implements AsyncProcessor {
format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, DEFAULT_I_FRAME_INTERVAL);
// display the very first frame, and recover from bad quality when no new frames
format.setLong(MediaFormat.KEY_REPEAT_PREVIOUS_FRAME_AFTER, REPEAT_FRAME_DELAY_US); // µs
// real-time priority
format.setInteger(MediaFormat.KEY_PRIORITY, 0);
// output 1 frame as soon as 1 frame is queued
format.setInteger(MediaFormat.KEY_LATENCY, 1);
if (maxFps > 0) {
// The key existed privately before Android 10:
// <https://android.googlesource.com/platform/frameworks/base/+/625f0aad9f7a259b6881006ad8710adce57d1384%5E%21/>