Add 16 KB page support for decoder extensions on Android 15
We need to rebuild any native components of the app to prevent crashes on devices with 16 KB page support. Tested on a device that supports 16 KB pages and runs Android 15, as well as on older Android devices. Issue: androidx/media#1685 PiperOrigin-RevId: 684488244
This commit is contained in:
parent
6acddfeee6
commit
2640ebd58f
@ -145,6 +145,8 @@
|
||||
* Fix user info removal for URLs that contain encoded @ characters
|
||||
([#1138](https://github.com/androidx/media/pull/1138)).
|
||||
* Decoder Extensions (FFmpeg, VP9, AV1, etc.):
|
||||
* Add 16 KB page support for decoder extensions on Android 15
|
||||
([#1685](https://github.com/androidx/media/issues/1685)).
|
||||
* MIDI extension:
|
||||
* Leanback extension:
|
||||
* Cast Extension:
|
||||
|
@ -27,6 +27,14 @@ android {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(Internal: b/372449691): Remove packagingOptions once AGP is updated
|
||||
// to version 8.5.1 or higher.
|
||||
packagingOptions {
|
||||
jniLibs {
|
||||
useLegacyPackaging true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Configure the native build only if libgav1 is present to avoid gradle sync
|
||||
|
@ -61,3 +61,7 @@ target_link_libraries(gav1JNI
|
||||
PRIVATE libgav1_static
|
||||
PRIVATE ${android_log_lib})
|
||||
|
||||
# Enable 16 KB ELF alignment.
|
||||
target_link_options(gav1JNI
|
||||
PRIVATE "-Wl,-z,max-page-size=16384")
|
||||
|
||||
|
@ -13,7 +13,17 @@
|
||||
// limitations under the License.
|
||||
apply from: "$gradle.ext.androidxMediaSettingsDir/common_library_config.gradle"
|
||||
|
||||
android.namespace = 'androidx.media3.decoder.ffmpeg'
|
||||
android {
|
||||
namespace 'androidx.media3.decoder.ffmpeg'
|
||||
|
||||
// TODO(Internal: b/372449691): Remove packagingOptions once AGP is updated
|
||||
// to version 8.5.1 or higher.
|
||||
packagingOptions {
|
||||
jniLibs {
|
||||
useLegacyPackaging true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Configure the native build only if ffmpeg is present to avoid gradle sync
|
||||
// failures if ffmpeg hasn't been built according to the README instructions.
|
||||
|
@ -56,3 +56,7 @@ target_link_libraries(ffmpegJNI
|
||||
if(ANDROID_ABI STREQUAL "arm64-v8a")
|
||||
target_link_options(ffmpegJNI PRIVATE "-Wl,-Bsymbolic")
|
||||
endif()
|
||||
|
||||
# Enable 16 KB ELF alignment.
|
||||
target_link_options(ffmpegJNI
|
||||
PRIVATE "-Wl,-z,max-page-size=16384")
|
||||
|
@ -23,6 +23,14 @@ android {
|
||||
}
|
||||
androidTest.assets.srcDir '../test_data/src/test/assets'
|
||||
}
|
||||
|
||||
// TODO(Internal: b/372449691): Remove packagingOptions once AGP is updated
|
||||
// to version 8.5.1 or higher.
|
||||
packagingOptions {
|
||||
jniLibs {
|
||||
useLegacyPackaging true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -35,4 +35,6 @@ LOCAL_CFLAGS += -D_REENTRANT -DPIC -DU_COMMON_IMPLEMENTATION -fPIC -DHAVE_SYS_PA
|
||||
LOCAL_CFLAGS += -O3 -funroll-loops -finline-functions -DFLAC__NO_ASM '-DFLAC__HAS_OGG=0'
|
||||
|
||||
LOCAL_LDLIBS := -llog -lz -lm
|
||||
# Enable 16 KB ELF alignment.
|
||||
LOCAL_LDFLAGS += "-Wl,-z,max-page-size=16384"
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
@ -27,6 +27,14 @@ android {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(Internal: b/372449691): Remove packagingOptions once AGP is updated
|
||||
// to version 8.5.1 or higher.
|
||||
packagingOptions {
|
||||
jniLibs {
|
||||
useLegacyPackaging true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Configure the native build only if libiamf is present to avoid gradle sync
|
||||
|
@ -44,3 +44,7 @@ target_link_libraries(iamfJNI
|
||||
PRIVATE android
|
||||
PRIVATE iamf
|
||||
PRIVATE ${android_log_lib})
|
||||
|
||||
# Enable 16 KB ELF alignment.
|
||||
target_link_options(iamfJNI
|
||||
PRIVATE "-Wl,-z,max-page-size=16384")
|
||||
|
@ -23,6 +23,14 @@ android {
|
||||
}
|
||||
androidTest.assets.srcDir '../test_data/src/test/assets'
|
||||
}
|
||||
|
||||
// TODO(Internal: b/372449691): Remove packagingOptions once AGP is updated
|
||||
// to version 8.5.1 or higher.
|
||||
packagingOptions {
|
||||
jniLibs {
|
||||
useLegacyPackaging true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -30,4 +30,6 @@ LOCAL_CPP_EXTENSION := .cc
|
||||
LOCAL_SRC_FILES := opus_jni.cc
|
||||
LOCAL_LDLIBS := -llog -lz -lm
|
||||
LOCAL_STATIC_LIBRARIES := libopus
|
||||
# Enable 16 KB ELF alignment.
|
||||
LOCAL_LDFLAGS += "-Wl,-z,max-page-size=16384"
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
@ -23,6 +23,14 @@ android {
|
||||
}
|
||||
androidTest.assets.srcDir '../test_data/src/test/assets'
|
||||
}
|
||||
|
||||
// TODO(Internal: b/372449691): Remove packagingOptions once AGP is updated
|
||||
// to version 8.5.1 or higher.
|
||||
packagingOptions {
|
||||
jniLibs {
|
||||
useLegacyPackaging true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -32,6 +32,8 @@ LOCAL_SRC_FILES := vpx_jni.cc
|
||||
LOCAL_LDLIBS := -llog -lz -lm -landroid
|
||||
LOCAL_SHARED_LIBRARIES := libvpx
|
||||
LOCAL_STATIC_LIBRARIES := cpufeatures
|
||||
# Enable 16 KB ELF alignment.
|
||||
LOCAL_LDFLAGS += "-Wl,-z,max-page-size=16384"
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
$(call import-module,android/cpufeatures)
|
||||
|
Loading…
x
Reference in New Issue
Block a user