CMake语法简介(androidstudio中利用CMake开发NDK): http://blog.csdn.net/u013718120/article/details/62883711
FFmpeg之一编译ForAndroid: http://blog.csdn.net/xiaoru5127/article/details/51524795

参考:

[总结]FFMPEG视音频编解码零基础学习方法

Android学习之 在surface上显示YUV 笔记

Android用surface直接显示yuv数据(一)

Android Studio FFMpeg CMakeList.txt, Static Library

# For more information about using CMake with Android Studio, read the
# documentation: https://d.android.com/studio/projects/add-native-code.html cmake_minimum_required(VERSION 3.4.) include_directories(src/main/cpp/include) add_library(avutil-lib STATIC IMPORTED)
set_target_properties(avutil-lib PROPERTIES IMPORTED_LOCATION
${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/lib/libavutil.a) add_library(avcodec-lib STATIC IMPORTED)
set_target_properties(avcodec-lib PROPERTIES IMPORTED_LOCATION
${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/lib/libavcodec.a) add_library(avformat-lib STATIC IMPORTED)
set_target_properties(avformat-lib PROPERTIES IMPORTED_LOCATION
${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/lib/libavformat.a) add_library(x264-lib STATIC IMPORTED)
set_target_properties(x264-lib PROPERTIES IMPORTED_LOCATION
${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/lib/libx264.a) add_library(swresample-lib STATIC IMPORTED)
set_target_properties(swresample-lib PROPERTIES IMPORTED_LOCATION
${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/lib/libswresample.a) add_library(swscale-lib STATIC IMPORTED)
set_target_properties(swscale-lib PROPERTIES IMPORTED_LOCATION
${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/lib/libswscale.a) add_library(mp3lame-lib STATIC IMPORTED)
set_target_properties(mp3lame-lib PROPERTIES IMPORTED_LOCATION
${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/lib/libmp3lame.a) add_library(yuv_static-lib STATIC IMPORTED)
set_target_properties(yuv_static-lib PROPERTIES IMPORTED_LOCATION
${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/lib/libyuv_static.a) find_library(log-lib log)
find_library(m-lib m)
find_library(z-lib z)
find_library(dl-lib dl)
find_library(stdc++-lib stdc++)
find_library(jnigraphics-lib jnigraphics) add_library(net_camera SHARED src/main/cpp/net_camera.cpp) target_link_libraries(net_camera avformat-lib avcodec-lib avutil-lib x264-lib mp3lame-lib
swscale-lib swresample-lib yuv_static-lib ${log-lib} ${m-lib} ${z-lib} ${dl-lib} ${stdc++-lib}
${jnigraphics-lib})
05-19 02:05