0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
obs-studio/plugins/obs-ffmpeg/CMakeLists.txt
derrod 5e183ff9a7 obs-ffmpeg: use avcodec_find_best_pix_fmt_of_list
The built-in format selector failed in certain cases like UtVideo now
using a differently packeg RGB format. FFmpeg has a format selection
functionality built-in that does pick the correct format however
(avcodec_find_best_pix_fmt_of_list), so we can simply use that instead.
2019-10-17 08:07:27 +02:00

67 lines
1.4 KiB
CMake

project(obs-ffmpeg)
if(MSVC)
set(obs-ffmpeg_PLATFORM_DEPS
w32-pthreads)
endif()
option(ENABLE_FFMPEG_LOGGING "Enables obs-ffmpeg logging" OFF)
find_package(FFmpeg REQUIRED
COMPONENTS avcodec avfilter avdevice avutil swscale avformat swresample)
include_directories(${FFMPEG_INCLUDE_DIRS})
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")
set(obs-ffmpeg_HEADERS
obs-ffmpeg-formats.h
obs-ffmpeg-compat.h)
set(obs-ffmpeg_SOURCES
obs-ffmpeg.c
obs-ffmpeg-audio-encoders.c
obs-ffmpeg-nvenc.c
obs-ffmpeg-output.c
obs-ffmpeg-mux.c
obs-ffmpeg-source.c)
if(UNIX AND NOT APPLE)
list(APPEND obs-ffmpeg_SOURCES
obs-ffmpeg-vaapi.c)
LIST(APPEND obs-ffmpeg_PLATFORM_DEPS
${LIBVA_LBRARIES})
endif()
if(ENABLE_FFMPEG_LOGGING)
list(APPEND obs-ffmpeg_SOURCES
obs-ffmpeg-logging.c)
endif()
if(WIN32)
list(APPEND obs-ffmpeg_SOURCES
jim-nvenc.c
jim-nvenc-helpers.c)
list(APPEND obs-ffmpeg_HEADERS
jim-nvenc.h)
endif()
add_library(obs-ffmpeg MODULE
${obs-ffmpeg_config_HEADERS}
${obs-ffmpeg_HEADERS}
${obs-ffmpeg_SOURCES})
target_link_libraries(obs-ffmpeg
libobs
media-playback
${obs-ffmpeg_PLATFORM_DEPS}
${FFMPEG_LIBRARIES})
install_obs_plugin_with_data(obs-ffmpeg data)
add_subdirectory(ffmpeg-mux)