2016-02-23 23:16:51 +00:00
|
|
|
project(obs-ffmpeg)
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
set(obs-ffmpeg_PLATFORM_DEPS
|
|
|
|
w32-pthreads)
|
|
|
|
endif()
|
|
|
|
|
2019-09-22 21:19:10 +00:00
|
|
|
option(ENABLE_FFMPEG_LOGGING "Enables obs-ffmpeg logging" OFF)
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
find_package(FFmpeg REQUIRED
|
|
|
|
COMPONENTS avcodec avfilter avdevice avutil swscale avformat swresample)
|
|
|
|
include_directories(${FFMPEG_INCLUDE_DIRS})
|
|
|
|
|
2019-09-22 21:19:10 +00:00
|
|
|
configure_file(
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/obs-ffmpeg-config.h.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/obs-ffmpeg-config.h")
|
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
|
|
|
set(obs-ffmpeg_config_HEADERS
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/obs-ffmpeg-config.h")
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
set(obs-ffmpeg_HEADERS
|
|
|
|
obs-ffmpeg-formats.h
|
|
|
|
obs-ffmpeg-compat.h
|
2020-03-25 08:07:22 +00:00
|
|
|
ffmpeg-encoded-output.h)
|
2019-07-27 12:47:10 +00:00
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
set(obs-ffmpeg_SOURCES
|
|
|
|
obs-ffmpeg.c
|
2018-02-19 19:54:37 +00:00
|
|
|
obs-ffmpeg-audio-encoders.c
|
2016-05-24 19:53:01 +00:00
|
|
|
obs-ffmpeg-nvenc.c
|
2016-02-23 23:16:51 +00:00
|
|
|
obs-ffmpeg-output.c
|
|
|
|
obs-ffmpeg-mux.c
|
2020-03-25 08:07:22 +00:00
|
|
|
ffmpeg-encoded-output.c
|
2016-02-23 23:16:51 +00:00
|
|
|
obs-ffmpeg-source.c)
|
|
|
|
|
2019-07-27 12:47:10 +00:00
|
|
|
if(UNIX AND NOT APPLE)
|
|
|
|
list(APPEND obs-ffmpeg_SOURCES
|
|
|
|
obs-ffmpeg-vaapi.c)
|
|
|
|
LIST(APPEND obs-ffmpeg_PLATFORM_DEPS
|
|
|
|
${LIBVA_LBRARIES})
|
|
|
|
endif()
|
|
|
|
|
2019-09-22 21:19:10 +00:00
|
|
|
if(ENABLE_FFMPEG_LOGGING)
|
|
|
|
list(APPEND obs-ffmpeg_SOURCES
|
|
|
|
obs-ffmpeg-logging.c)
|
|
|
|
endif()
|
|
|
|
|
2019-07-27 12:47:10 +00:00
|
|
|
if(WIN32)
|
|
|
|
list(APPEND obs-ffmpeg_SOURCES
|
|
|
|
jim-nvenc.c
|
|
|
|
jim-nvenc-helpers.c)
|
|
|
|
list(APPEND obs-ffmpeg_HEADERS
|
|
|
|
jim-nvenc.h)
|
|
|
|
endif()
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
add_library(obs-ffmpeg MODULE
|
2019-09-22 21:19:10 +00:00
|
|
|
${obs-ffmpeg_config_HEADERS}
|
2016-02-23 23:16:51 +00:00
|
|
|
${obs-ffmpeg_HEADERS}
|
|
|
|
${obs-ffmpeg_SOURCES})
|
|
|
|
target_link_libraries(obs-ffmpeg
|
|
|
|
libobs
|
2017-06-29 19:01:10 +00:00
|
|
|
media-playback
|
2016-02-23 23:16:51 +00:00
|
|
|
${obs-ffmpeg_PLATFORM_DEPS}
|
|
|
|
${FFMPEG_LIBRARIES})
|
|
|
|
|
|
|
|
install_obs_plugin_with_data(obs-ffmpeg data)
|
|
|
|
|
|
|
|
add_subdirectory(ffmpeg-mux)
|