2020-08-07 13:14:40 +08:00
diff --git a/CMakeModules/FindFFMPEG.cmake b/CMakeModules/FindFFMPEG.cmake
index 4f77e5a..151762f 100644
--- a/CMakeModules/FindFFMPEG.cmake
+++ b/CMakeModules/FindFFMPEG.cmake
@@ -21,6 +21,14 @@ FIND_PATH(
SWSCALE_INCLUDE_DIR libswscale/swscale.h
/usr/include /usr/local/include /opt/local/include
)
+FIND_PATH(
+ AVDEVICE_INCLUDE_DIR libavdevice/avdevice.h
+ /usr/include /usr/local/include /opt/local/include
+)
+FIND_PATH(
+ SWRESAMPLE_INCLUDE_DIR libswresample/swresample.h
+ /usr/include /usr/local/include /opt/local/include
+)
# Find Library files
FIND_LIBRARY(
@@ -43,15 +51,28 @@ FIND_LIBRARY(
NAMES swscale
PATH /usr/lib /usr/local/lib /opt/local/lib
)
+FIND_LIBRARY(
+ AVDEVICE_LIBRARY
+ NAMES avdevice
+ PATH /usr/lib /usr/local/lib /opt/local/lib
+)
+FIND_LIBRARY(
+ SWRESAMPLE_LIBRARY
+ NAMES swresample
+ PATH /usr/lib /usr/local/lib /opt/local/lib
+)
IF( EXISTS "${AVUTIL_INCLUDE_DIR}/libavutil/pixdesc.h" )
SET( AVUTIL_HAVE_PIXDESC TRUE)
endif()
IF(AVCODEC_INCLUDE_DIR AND AVFORMAT_INCLUDE_DIR AND AVUTIL_INCLUDE_DIR AND SWSCALE_INCLUDE_DIR AND AVCODEC_LIBRARY AND AVFORMAT_LIBRARY AND AVUTIL_LIBRARY AND SWSCALE_LIBRARY AND AVUTIL_HAVE_PIXDESC)
+ IF (WIN32)
2020-10-21 01:59:20 +08:00
+ SET(AVFORMAT_LIBRARY ${AVFORMAT_LIBRARY} Ws2_32 Secur32 Bcrypt strmiids mfplat mfuuid)
2020-08-07 13:14:40 +08:00
+ ENDIF()
SET(FFMPEG_FOUND TRUE)
- SET(FFMPEG_LIBRARIES ${AVCODEC_LIBRARY} ${AVFORMAT_LIBRARY} ${AVUTIL_LIBRARY} ${SWSCALE_LIBRARY})
- SET(FFMPEG_INCLUDE_DIRS ${AVCODEC_INCLUDE_DIR} ${AVFORMAT_INCLUDE_DIR} ${AVUTIL_INCLUDE_DIR} ${SWSCALE_INCLUDE_DIR})
+ SET(FFMPEG_LIBRARIES ${AVFORMAT_LIBRARY} ${AVDEVICE_LIBRARY} ${AVCODEC_LIBRARY} ${AVUTIL_LIBRARY} ${SWSCALE_LIBRARY} ${SWRESAMPLE_LIBRARY})
+ SET(FFMPEG_INCLUDE_DIRS ${AVCODEC_INCLUDE_DIR} ${AVFORMAT_INCLUDE_DIR} ${AVUTIL_INCLUDE_DIR} ${SWSCALE_INCLUDE_DIR} ${AVDEVICE_INCLUDE_DIR} ${SWRESAMPLE_INCLUDE_DIR})
include(CheckCXXSourceCompiles)