Fix the FFmpeg extension build
Since gradle 4.0, CMake imported libraries are bundled in the APK, so manually bundling them causes a duplication which breaks the build. Issue: #7906 PiperOrigin-RevId: 332012375
This commit is contained in:
parent
52826c860f
commit
fe2bc7ba71
@ -13,13 +13,6 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle"
|
apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle"
|
||||||
|
|
||||||
android {
|
|
||||||
sourceSets.main {
|
|
||||||
// The directory from which to pick the ffmpeg binaries.
|
|
||||||
jniLibs.srcDir 'src/main/libs'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Configure the native build only if ffmpeg is present to avoid gradle sync
|
// 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.
|
// failures if ffmpeg hasn't been built according to the README instructions.
|
||||||
if (project.file('src/main/jni/ffmpeg').exists()) {
|
if (project.file('src/main/jni/ffmpeg').exists()) {
|
||||||
|
@ -7,7 +7,6 @@ project(libffmpeg_jni C CXX)
|
|||||||
|
|
||||||
set(ffmpeg_location "${CMAKE_CURRENT_SOURCE_DIR}/ffmpeg")
|
set(ffmpeg_location "${CMAKE_CURRENT_SOURCE_DIR}/ffmpeg")
|
||||||
set(ffmpeg_binaries "${ffmpeg_location}/android-libs/${ANDROID_ABI}")
|
set(ffmpeg_binaries "${ffmpeg_location}/android-libs/${ANDROID_ABI}")
|
||||||
set(ffmpeg_output_dir "${CMAKE_CURRENT_SOURCE_DIR}/../libs/${ANDROID_ABI}")
|
|
||||||
|
|
||||||
foreach(ffmpeg_lib avutil swresample avcodec)
|
foreach(ffmpeg_lib avutil swresample avcodec)
|
||||||
set(ffmpeg_lib_filename lib${ffmpeg_lib}.so)
|
set(ffmpeg_lib_filename lib${ffmpeg_lib}.so)
|
||||||
@ -20,7 +19,6 @@ foreach(ffmpeg_lib avutil swresample avcodec)
|
|||||||
${ffmpeg_lib} PROPERTIES
|
${ffmpeg_lib} PROPERTIES
|
||||||
IMPORTED_LOCATION
|
IMPORTED_LOCATION
|
||||||
${ffmpeg_lib_file_path})
|
${ffmpeg_lib_file_path})
|
||||||
file(COPY ${ffmpeg_lib_file_path} DESTINATION ${ffmpeg_output_dir})
|
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
include_directories(${ffmpeg_location})
|
include_directories(${ffmpeg_location})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user