H.264 High 10 on Android TV boxes without a 10-bit hardware decoder (Amlogic S905X4 class: onn 4K Pro, Homatics Box R) started black for over ten seconds and then played choppy: mpv tried MediaCodec first, hit "Could not initialize video chain", and only then fell back to software decode on the GL vo, where the Mali-G31 driver has no GL_EXT_texture_norm16 and pays an integer-texture conversion pass plus lanczos scaling it cannot afford at 1080p. Decide the decoder before mpv creates it. An on_preloaded hook now carries both per-file policies (Dolby Vision P5 reshaping and this one): when the track's codec-profile is High 10 (published at demux by the fork, see the mpv-build pin) and MediaCodecList advertises no hardware AVCProfileHigh10, hwdec is held at `no` and the session goes to the GL vo directly. The hold parks any hwdec write from Dart and restores it for the next file, as the DV P5 hold already did. On a GL vo whose driver lacks norm16 (probed once through a pbuffer EGL context), scale/cscale/dscale drop to bilinear and dither to off for the session, restored when the vo goes back to the plane. Only options still at their mpv defaults are touched, so a user's mpv.conf wins. Paired with the fork's rg8-backed 16-bit plane emulation, the box goes from 13 drops/s and a 13.7 s first frame to 0.7 drops/s and 2.5 s. Devices with norm16 (Shield, Pixel 7) take neither the tier nor the emulation. The native pin moves to edde746/mpv-build@0601b034da, which also picks up the earlier android/linux/windows patch-series squash. close #2065
20 lines
1.1 KiB
Prolog
20 lines
1.1 KiB
Prolog
# JNI exports bind by name (Java_com_edde746_plezy_libmpv_MpvPlayer_native*); keep the names stable.
|
|
-keepclasseswithmembernames class com.edde746.plezy.libmpv.* {
|
|
native <methods>;
|
|
}
|
|
|
|
# jni_utils.cpp caches MpvPlayer with FindClass and resolves these static callbacks
|
|
# with GetStaticMethodID on the native event thread. R8 sees no reference to the
|
|
# class name or the member names, so both must stay alive and un-renamed.
|
|
-keep class com.edde746.plezy.libmpv.MpvPlayer {
|
|
public static void onPropertyChanged(java.lang.String, long, boolean);
|
|
public static void onPropertyChanged(java.lang.String, boolean, long, boolean);
|
|
public static void onPropertyChanged(java.lang.String, long, long, boolean);
|
|
public static void onPropertyChanged(java.lang.String, double, long, boolean);
|
|
public static void onPropertyChanged(java.lang.String, java.lang.String, long, boolean);
|
|
public static void onEvent(int, long, boolean, double, boolean);
|
|
public static void onEndFile(int, long, boolean);
|
|
public static void onLogMessage(java.lang.String, int, java.lang.String);
|
|
public static void onHook(java.lang.String, long);
|
|
}
|