summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-06-02 17:33:11 -0700
committerChris Robinson <[email protected]>2014-06-02 17:33:11 -0700
commitd2c0a43498bf128462859d1a4bd5913b30179aa7 (patch)
treebbffe0d96439aaaa16d34fe41dd74ab3801268c4 /CMakeLists.txt
parent933f51a8bfd1776690cd1cae2e01f35ec3bf3536 (diff)
Add an ffmpeg-based example player
This example shows proper timing and A/V synchronization with an OpenAL stream. Requires the in-progress AL_SOFTX_source_length extension to avoid manually keeping track of the buffer queue length.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt44
1 files changed, 43 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 27ec7209..bc0f51d4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -907,6 +907,10 @@ IF(ALSOFT_EXAMPLES)
IF(SDL_SOUND_FOUND AND CMAKE_VERSION VERSION_LESS "2.8.8")
INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIR} ${SDL_SOUND_INCLUDE_DIR})
ENDIF()
+ FIND_PACKAGE(FFmpeg COMPONENTS AVFORMAT AVCODEC AVUTIL SWSCALE SWRESAMPLE)
+ IF(FFMPEG_FOUND AND CMAKE_VERSION VERSION_LESS "2.8.8")
+ INCLUDE_DIRECTORIES(${FFMPEG_INCLUDE_DIRS})
+ ENDIF()
ENDIF()
ENDIF()
@@ -1088,7 +1092,45 @@ IF(ALSOFT_EXAMPLES)
ARCHIVE DESTINATION "lib${LIB_SUFFIX}"
)
- MESSAGE(STATUS "Building example programs")
+ SET(FFVER_OK FALSE)
+ IF(FFMPEG_FOUND)
+ SET(FFVER_OK TRUE)
+ IF(AVFORMAT_VERSION VERSION_LESS "55.33.100")
+ MESSAGE(STATUS "libavformat is too old! (${AVFORMAT_VERSION}, wanted 55.33.100)")
+ SET(FFVER_OK FALSE)
+ ENDIF()
+ IF(AVCODEC_VERSION VERSION_LESS "55.52.102")
+ MESSAGE(STATUS "libavcodec is too old! (${AVCODEC_VERSION}, wanted 55.52.102)")
+ SET(FFVER_OK FALSE)
+ ENDIF()
+ IF(AVUTIL_VERSION VERSION_LESS "52.66.100")
+ MESSAGE(STATUS "libavutil is too old! (${AVUTIL_VERSION}, wanted 52.66.100)")
+ SET(FFVER_OK FALSE)
+ ENDIF()
+ IF(SWSCALE_VERSION VERSION_LESS "2.5.102")
+ MESSAGE(STATUS "libswscale is too old! (${SWSCALE_VERSION}, wanted 2.5.102)")
+ SET(FFVER_OK FALSE)
+ ENDIF()
+ IF(SWRESAMPLE_VERSION VERSION_LESS "0.18.100")
+ MESSAGE(STATUS "libswresample is too old! (${SWRESAMPLE_VERSION}, wanted 0.18.100)")
+ SET(FFVER_OK FALSE)
+ ENDIF()
+ ENDIF()
+ IF(FFVER_OK AND NOT MSVC)
+ ADD_EXECUTABLE(alffplay examples/alffplay.c)
+ TARGET_LINK_LIBRARIES(alffplay common ex-common ${SDL2_LIBRARY} ${LIBNAME} ${FFMPEG_LIBRARIES})
+ SET_PROPERTY(TARGET alffplay APPEND PROPERTY INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR}
+ ${FFMPEG_INCLUDE_DIRS})
+
+ INSTALL(TARGETS alffplay
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION "lib${LIB_SUFFIX}"
+ ARCHIVE DESTINATION "lib${LIB_SUFFIX}"
+ )
+ MESSAGE(STATUS "Building SDL and FFmpeg example programs")
+ ELSE()
+ MESSAGE(STATUS "Building SDL example programs")
+ ENDIF()
MESSAGE(STATUS "")
ENDIF()
ENDIF()