123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- # For more information about using CMake with Android Studio, read the
- # documentation: https://d.android.com/studio/projects/add-native-code.html
- # Sets the minimum version of CMake required to build the native library.
- cmake_minimum_required(VERSION 3.4.1)
- # Creates and names a library, sets it as either STATIC
- # or SHARED, and provides the relative paths to its source code.
- # You can define multiple libraries, and CMake builds them for you.
- # Gradle automatically packages shared libraries with your APK.
- set(SRC_FFMPEG
- src/main/cpp/ffmpeg/cmdutils.c
- src/main/cpp/ffmpeg/ffmpeg.c
- src/main/cpp/ffmpeg/ffmpeg_filter.c
- src/main/cpp/ffmpeg/ffmpeg_opt.c
- src/main/cpp/ffmpeg_cmd.c
- src/main/cpp/ffmpeg/ffprobe.c
- src/main/cpp/ffmpeg/ffmpeg_hw.c)
- set(SRC_VISUALIZER
- src/main/cpp/visualizer/fft.cpp
- src/main/cpp/visualizer/fixed_fft.cpp
- src/main/cpp/visualizer/frank_visualizer.cpp
- src/main/cpp/visualizer/frank_visualizer_jni.cpp
- src/main/cpp/visualizer/window.cpp)
- set(SRC_METADATA
- src/main/cpp/metadata/media_retriever.cpp
- src/main/cpp/metadata/media_retriever_jni.cpp
- src/main/cpp/metadata/metadata_util.c
- src/main/cpp/metadata/ffmpeg_media_retriever.c)
- set(SRC_FFPLAYER ffplayer)
- add_library( # Sets the name of the library.
- media-handle
- # Sets the library as a shared library.
- SHARED
- # Provides a relative path to your source file(s).
- ${SRC_FFMPEG}
- ${SRC_VISUALIZER}
- ${SRC_METADATA}
- # ${SRC_FFPLAYER}
- src/main/cpp/video_filter.c
- src/main/cpp/ffprobe_cmd.cpp
- src/main/cpp/video_cutting.cpp
- src/main/cpp/yuv/yuv_converter.cpp
- src/main/cpp/pcm/pcm_process.cpp
- src/main/cpp/media_transcode.cpp
- src/main/cpp/ff_audio_resample.cpp
- src/main/cpp/common_media_jni.cpp
- src/main/cpp/ff_audio_player.cpp
- src/main/cpp/audio_player_jni.cpp
- src/main/cpp/ff_rtmp_pusher.cpp
- src/main/cpp/ffmpeg_pusher_jni.cpp
- )
- add_library( ffmpeg
- SHARED
- IMPORTED )
- set_target_properties( ffmpeg
- PROPERTIES IMPORTED_LOCATION
- ../../../../libs/${CMAKE_ANDROID_ARCH_ABI}/libffmpeg.so )
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
- include_directories(src/main/cpp)
- include_directories(src/main/cpp/ffmpeg)
- include_directories(src/main/cpp/include)
- include_directories(src/main/cpp/metadata)
- include_directories(ffplayer)
- if(${CMAKE_ANDROID_ARCH_ABI} MATCHES "armeabi-v7a")
- include_directories(src/main/cpp/include/armeabi-v7a)
- message("This is armeabi-v7a")
- elseif(${CMAKE_ANDROID_ARCH_ABI} MATCHES "arm64-v8a")
- include_directories(src/main/cpp/include/arm64-v8a)
- message("This is arm64-v8a")
- endif()
- find_library( # Sets the name of the path variable.
- log-lib
- log )
- target_link_libraries( # Specifies the target library.
- media-handle
- ffmpeg
- -landroid #native_window
- -ljnigraphics #bitmap
- -lOpenSLES #openSLES
- # Links the target library to the log library
- # included in the NDK.
- ${log-lib} )
|