obs-studio/libobs/CMakeLists.txt
jp9000 62c2b1d74e Simplify media i/o interfaces
Completely revamped the entire media i/o data and handlers.  The
original idea was to have a system that would have connecting media
inputs and outputs, but at a certain point I realized that this was an
unnecessary complexity for what we wanted to do.  (Also, it reminded me
of directshow filters, and I HATE directshow with a passion, and
wouldn't wish it upon my greatest enemy)

Now, audio/video outputs are connected to directly, with better callback
handlers, and will eventually have the ability to automatically handle
conversions such as 4:4:4 to 4:2:0 when connecting to an input that uses
them.  Doing this will allow the video/audio i/o handlers to also
prevent duplicate conversion, as well as make it easier/simple to use.

My true goal for this is to make output and encoder plugins as simple to
create as possible.  I want to be able to be able to create an output
plugin with almost no real hassle of having to worry about image
conversions, media inputs/outputs, etc.  A plugin developer shouldn't
have to handle that sort of stuff when he/she doesn't really need to.

Plugins will be able to simply create a callback via obs_video() and/or
obs_audio(), and they will automatically receive the audio/video data in
the formats requested via a simple callback, without needing to do
almost anything else at all.
2014-01-14 01:58:47 -07:00

91 lines
2 KiB
CMake

if(WIN32)
set(libobs_platform_src
obs-windows.c
util/platform-windows.c)
elseif(APPLE)
set(libobs_platform_src
obs-cocoa.c
util/platform-cocoa.m)
set_source_files_properties(${libobs_platform_src}
PROPERTIES
LANGUAGE C
COMPILE_FLAGS "-fobjc-arc")
add_definitions("-DHAVE_STRTOLL")
find_library(COCOA Cocoa)
mark_as_advanced(COCOA)
include_directories(${COCOA})
link_libraries(${COCOA})
elseif(UNIX)
set(libobs_platform_src
obs-nix.c
util/platform-nix.c)
else()
endif()
option(USE_STATIC_FFMPEG "Link ffmpeg statically (if possible)" false)
if(USE_STATIC_FFMPEG)
set(FFMPEG_STATIC "static")
endif()
find_package(Libavutil REQUIRED ${FFMPEG_STATIC})
include_directories(${LIBAVUTIL_INCLUDE_DIRS})
add_definitions(${LIBAVUTIL_DEFINITIONS})
find_package(Libswresample REQUIRED ${FFMPEG_STATIC})
include_directories(${LIBSWRESAMPLE_INCLUDE_DIRS})
add_definitions(${LIBSWRESAMPLE_DEFINITIONS})
add_library(libobs SHARED
obs.c
obs-display.c
obs-module.c
obs-output.c
obs-scene.c
obs-source.c
obs-video.c
util/base.c
util/bmem.c
util/cf-lexer.c
util/cf-parser.c
util/config-file.c
util/dstr.c
util/lexer.c
util/platform.c
util/text-lookup.c
util/utf8.c
media-io/audio-io.c
media-io/format-conversion.c
media-io/audio-resampler-ffmpeg.c
media-io/video-io.c
graphics/axisang.c
graphics/bounds.c
graphics/effect.c
graphics/effect-parser.c
graphics/graphics.c
graphics/graphics-imports.c
graphics/math-extra.c
graphics/matrix3.c
graphics/matrix4.c
graphics/plane.c
graphics/quat.c
graphics/shader-parser.c
graphics/texture-render.c
graphics/vec2.c
graphics/vec3.c
graphics/vec4.c
callback/calldata.c
callback/proc.c
callback/signal.c
${libobs_platform_src})
set_target_properties(libobs
PROPERTIES OUTPUT_NAME obs)
target_link_libraries(libobs
${LIBAVUTIL_LIBRARIES}
${LIBSWRESAMPLE_LIBRARIES})
obs_add_core_lib(libobs)
obs_add_data_source(/data/libobs/
${obs_SOURCE_DIR}/build/data/libobs/default.effect)