Prompt Title: cmake编译ijkplayer

Created 1 year ago
Votes 0
Views 67 times
IT
0

Prompt Detail:

如果没有找到CMakeLists.txt.template文件,可以尝试使用以下命令在ijkplayer/android目录下生成:

bash
curl https://raw.githubusercontent.com/Bilibili/ijkplayer/master/android/CMakeLists.txt.template -o CMakeLists.txt.template

或者手动创建一个CMakeLists.txt.template文件,并复制以下内容:

bash
cmake_minimum_required(VERSION 3.4.1) # Set the C++ standard set(CMAKE_CXX_STANDARD 11) # Set the build type set(CMAKE_BUILD_TYPE Release) # Set the path to your NDK set(NDK /path/to/ndk) # Set the target architecture set(TARGET_ARCH_ABI arm64-v8a) # Set the path to your cross-compiler toolchain file set(CMAKE_TOOLCHAIN_FILE ${NDK}/build/cmake/android.toolchain.cmake) # Set the path to your Android SDK set(ANDROID_SDK /path/to/sdk) # Set the target SDK version set(ANDROID_PLATFORM android-29) # Set the minimum SDK version set(ANDROID_MIN_SDK_VERSION 21) # Set the path to your SDL2 include directory set(SDL2_INCLUDE_DIRS /path/to/SDL2/include) # Set the path to your SDL2 library directory set(SDL2_LIBRARIES /path/to/SDL2/lib) # Set the path to your OpenSSL include directory set(OPENSSL_INCLUDE_DIR /path/to/openssl/include) # Set the path to your OpenSSL library directory set(OPENSSL_LIBRARIES /path/to/openssl/lib) # Set the path to your FFmpeg include directory set(FFMPEG_INCLUDE_DIRS /path/to/ffmpeg/include) # Set the path to your FFmpeg library directory set(FFMPEG_LIBRARIES /path/to/ffmpeg/lib) # Set the path to your yasm executable set(YASM_EXECUTABLE /path/to/yasm) # Add the ijkplayer source files file(GLOB_RECURSE IJKPLAYER_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../ijksdl/*.c ${CMAKE_CURRENT_SOURCE_DIR}/../fftools/*.c ${CMAKE_CURRENT_SOURCE_DIR}/../ijkyuv/*.c ${CMAKE_CURRENT_SOURCE_DIR}/../ijkaac/*.c ${CMAKE_CURRENT_SOURCE_DIR}/../ijksoundtouch/*.c ${CMAKE_CURRENT_SOURCE_DIR}/../ijkavformat/*.c ${CMAKE_CURRENT_SOURCE_DIR}/../ijkavutil/*.c ${CMAKE_CURRENT_SOURCE_DIR}/../ijkplayer/*.c) # Include the ijkplayer headers include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_SOURCE_DIR}/../ijksdl ${CMAKE_CURRENT_SOURCE_DIR}/../fftools ${CMAKE_CURRENT_SOURCE_DIR}/../ijkyuv ${CMAKE_CURRENT_SOURCE_DIR}/../ijkaac ${CMAKE_CURRENT_SOURCE_DIR}/../ijksoundtouch ${CMAKE_CURRENT_SOURCE_DIR}/../ijkavformat ${CMAKE_CURRENT_SOURCE_DIR}/../ijkavutil ) # Build the ijkplayer library add_library( ijkplayer SHARED ${IJKPLAYER_SOURCE_FILES} ) # Link the ijkplayer library target_link_libraries( ijkplayer ${SDL2_LIBRARIES} ${OPENSSL_LIBRARIES} ${FFMPEG_LIBRARIES} android log z )

需要根据实际情况修改相应的路径和编译参数。

avatar
test
Shared 19 prompts
Created 1 year ago

Leave a Comment