cmake: Redesign for future features

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2020-03-16 20:37:31 +01:00
parent aa3c5557a9
commit 6f2b50b0ad
3 changed files with 609 additions and 262 deletions

View file

@ -50,6 +50,10 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/.git")
endif() endif()
endif() endif()
# Policies
cmake_policy(PUSH)
cmake_policy(SET CMP0074 NEW)
# Define Project # Define Project
project( project(
StreamFX StreamFX
@ -69,7 +73,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/clang" "${CMAKE_CURRENT
# CMake Modules # CMake Modules
include("util") include("util")
if (EXISTS "${CMAKE_SOURCE_DIR}/cmake/Clang/Clang.cmake") if(EXISTS "${CMAKE_SOURCE_DIR}/cmake/Clang/Clang.cmake")
include("Clang") include("Clang")
set(HAVE_CLANG ON) set(HAVE_CLANG ON)
endif() endif()
@ -91,17 +95,17 @@ else()
endif() endif()
# All Warnings, Extra Warnings, Pedantic # All Warnings, Extra Warnings, Pedantic
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# using Clang # using Clang
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-missing-braces -Wmissing-field-initializers -Wno-c++98-compat-pedantic -Wold-style-cast -Wno-documentation -Wno-documentation-unknown-command -Wno-covered-switch-default -Wno-switch-enum") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-missing-braces -Wmissing-field-initializers -Wno-c++98-compat-pedantic -Wold-style-cast -Wno-documentation -Wno-documentation-unknown-command -Wno-covered-switch-default -Wno-switch-enum")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-missing-braces -Wmissing-field-initializers -Wno-c++98-compat-pedantic -Wold-style-cast -Wno-documentation -Wno-documentation-unknown-command -Wno-covered-switch-default -Wno-switch-enum") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-missing-braces -Wmissing-field-initializers -Wno-c++98-compat-pedantic -Wold-style-cast -Wno-documentation -Wno-documentation-unknown-command -Wno-covered-switch-default -Wno-switch-enum")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# GCC: -fpermissive is required as GCC does not allow the same template to be in different namespaces. # GCC: -fpermissive is required as GCC does not allow the same template to be in different namespaces.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wpedantic -fpermissive -Wno-long-long -Wno-missing-braces -Wmissing-field-initializers") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wpedantic -fpermissive -Wno-long-long -Wno-missing-braces -Wmissing-field-initializers")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wpedantic -fpermissive -Wno-long-long -Wno-missing-braces -Wmissing-field-initializers") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wpedantic -fpermissive -Wno-long-long -Wno-missing-braces -Wmissing-field-initializers")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
# using Intel C++ # using Intel C++
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(MSVC_EXTRA_FLAGS "/wd4061 /wd4100 /wd4180 /wd4201 /wd4464 /wd4505 /wd4514 /wd4571 /wd4623 /wd4625 /wd4626 /wd4710 /wd4774 /wd4820 /wd5026 /wd5027 /wd5045") set(MSVC_EXTRA_FLAGS "/wd4061 /wd4100 /wd4180 /wd4201 /wd4464 /wd4505 /wd4514 /wd4571 /wd4623 /wd4625 /wd4626 /wd4710 /wd4774 /wd4820 /wd5026 /wd5027 /wd5045")
# Force to always compile with W4 # Force to always compile with W4
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
@ -190,17 +194,30 @@ else()
endif() endif()
endif() endif()
# Features
set(${PropertyPrefix}ENABLE_ENCODER_FFMPEG TRUE CACHE BOOL "Enable FFmpeg Encoder")
set(${PropertyPrefix}ENABLE_FILTER_BLUR TRUE CACHE BOOL "Enable Blur Filter")
set(${PropertyPrefix}ENABLE_FILTER_COLOR_GRADE TRUE CACHE BOOL "Enable Color Grade Filter")
set(${PropertyPrefix}ENABLE_FILTER_DISPLACEMENT TRUE CACHE BOOL "Enable Displacement Filter")
set(${PropertyPrefix}ENABLE_FILTER_DYNAMIC_MASK TRUE CACHE BOOL "Enable Dynamic Mask Filter")
set(${PropertyPrefix}ENABLE_FILTER_SDF_EFFECTS TRUE CACHE BOOL "Enable SDF Effects Filter")
set(${PropertyPrefix}ENABLE_FILTER_SHADER TRUE CACHE BOOL "Enable Shader Filter")
set(${PropertyPrefix}ENABLE_FILTER_TRANSFORM TRUE CACHE BOOL "Enable Transform Filter")
set(${PropertyPrefix}ENABLE_SOURCE_MIRROR TRUE CACHE BOOL "Enable Mirror Source")
set(${PropertyPrefix}ENABLE_SOURCE_SHADER TRUE CACHE BOOL "Enable Shader Source")
set(${PropertyPrefix}ENABLE_TRANSITION_SHADER TRUE CACHE BOOL "Enable Shader Transition")
################################################################################ ################################################################################
# CMake / Compiler Dependencies # CMake / Compiler Dependencies
################################################################################ ################################################################################
# Configure Version Header # Configure Version Header
configure_file( configure_file(
"${PROJECT_SOURCE_DIR}/cmake/version.hpp.in" "cmake/version.hpp.in"
"${PROJECT_BINARY_DIR}/source/version.hpp" "${PROJECT_BINARY_DIR}/source/version.hpp"
) )
configure_file( configure_file(
"${PROJECT_SOURCE_DIR}/cmake/module.cpp.in" "cmake/module.cpp.in"
"${PROJECT_BINARY_DIR}/source/module.cpp" "${PROJECT_BINARY_DIR}/source/module.cpp"
) )
@ -222,7 +239,7 @@ if(WIN32)
get_filename_component(ISS_SOURCE_DIR "${PROJECT_SOURCE_DIR}" ABSOLUTE) get_filename_component(ISS_SOURCE_DIR "${PROJECT_SOURCE_DIR}" ABSOLUTE)
file(TO_NATIVE_PATH "${ISS_SOURCE_DIR}" ISS_SOURCE_DIR) file(TO_NATIVE_PATH "${ISS_SOURCE_DIR}" ISS_SOURCE_DIR)
configure_file( configure_file(
"${PROJECT_SOURCE_DIR}/cmake/installer.iss.in" "cmake/installer.iss.in"
"${PROJECT_BINARY_DIR}/installer.iss" "${PROJECT_BINARY_DIR}/installer.iss"
) )
@ -234,7 +251,7 @@ if(WIN32)
set(PROJECT_LEGAL_TRADEMARKS_2 "") set(PROJECT_LEGAL_TRADEMARKS_2 "")
configure_file( configure_file(
"${PROJECT_SOURCE_DIR}/cmake/version.rc.in" "cmake/version.rc.in"
"${PROJECT_BINARY_DIR}/cmake/version.rc" "${PROJECT_BINARY_DIR}/cmake/version.rc"
@ONLY @ONLY
) )
@ -267,8 +284,121 @@ elseif(${PropertyPrefix}OBS_DOWNLOAD)
include("${libobs_SOURCE_DIR}/cmake/LibObs/LibObsConfig.cmake") include("${libobs_SOURCE_DIR}/cmake/LibObs/LibObsConfig.cmake")
endif() endif()
# Load FFmpeg ################################################################################
if(NOT ${PropertyPrefix}OBS_NATIVE) # Code
################################################################################
set(PROJECT_DATA_LOCALE )
set(PROJECT_DATA_EFFECTS )
set(PROJECT_DATA_SHADERS )
set(PROJECT_LIBRARIES )
set(PROJECT_LIBRARIES_DELAYED )
set(PROJECT_TEMPLATES )
set(PROJECT_PUBLIC )
set(PROJECT_PRIVATE_GENERATED )
set(PROJECT_PRIVATE_SOURCE )
set(PROJECT_DEFINES )
## OBS Studio
if(${PropertyPrefix}OBS_NATIVE)
list(APPEND PROJECT_LIBRARIES
libobs
)
elseif(${PropertyPrefix}OBS_REFERENCE)
list(APPEND PROJECT_INCLUDE_DIRS
"${OBS_STUDIO_DIR}/libobs"
)
list(APPEND PROJECT_LIBRARIES
"${LIBOBS_LIB}"
)
elseif(${PropertyPrefix}OBS_PACKAGE)
list(APPEND PROJECT_INCLUDE_DIRS
"${OBS_STUDIO_DIR}/include"
)
list(APPEND PROJECT_LIBRARIES
libobs
)
elseif(${PropertyPrefix}OBS_DOWNLOAD)
list(APPEND PROJECT_LIBRARIES
libobs
)
endif()
## Data & Source
list(APPEND PROJECT_DATA
"data/locale/en-US.ini"
"data/effects/mipgen.effect"
"data/effects/pack-unpack.effect"
)
list(APPEND PROJECT_TEMPLATES
"cmake/version.hpp.in"
"cmake/module.cpp.in"
)
if(WIN32)
list(APPEND PROJECT_TEMPLATES
"cmake/installer.iss.in"
"cmake/version.rc.in"
)
endif()
list(APPEND PROJECT_PRIVATE_SOURCE
# Plugin
"source/plugin.hpp"
"source/plugin.cpp"
"source/strings.hpp"
"source/utility.hpp"
"source/utility.cpp"
"source/util-event.hpp"
"source/util-threadpool.cpp"
"source/util-threadpool.hpp"
# Graphics
"source/gfx/gfx-source-texture.hpp"
"source/gfx/gfx-source-texture.cpp"
# OBS
"source/obs/gs/gs-helper.hpp"
"source/obs/gs/gs-helper.cpp"
"source/obs/gs/gs-effect.hpp"
"source/obs/gs/gs-effect.cpp"
"source/obs/gs/gs-effect-parameter.hpp"
"source/obs/gs/gs-effect-parameter.cpp"
"source/obs/gs/gs-effect-pass.hpp"
"source/obs/gs/gs-effect-pass.cpp"
"source/obs/gs/gs-effect-technique.hpp"
"source/obs/gs/gs-effect-technique.cpp"
"source/obs/gs/gs-indexbuffer.hpp"
"source/obs/gs/gs-indexbuffer.cpp"
"source/obs/gs/gs-limits.hpp"
"source/obs/gs/gs-mipmapper.hpp"
"source/obs/gs/gs-mipmapper.cpp"
"source/obs/gs/gs-rendertarget.hpp"
"source/obs/gs/gs-rendertarget.cpp"
"source/obs/gs/gs-sampler.hpp"
"source/obs/gs/gs-sampler.cpp"
"source/obs/gs/gs-texture.hpp"
"source/obs/gs/gs-texture.cpp"
"source/obs/gs/gs-vertex.hpp"
"source/obs/gs/gs-vertex.cpp"
"source/obs/gs/gs-vertexbuffer.hpp"
"source/obs/gs/gs-vertexbuffer.cpp"
"source/obs/obs-signal-handler.hpp"
"source/obs/obs-signal-handler.cpp"
"source/obs/obs-source.hpp"
"source/obs/obs-source.cpp"
"source/obs/obs-source-factory.hpp"
"source/obs/obs-source-factory.cpp"
"source/obs/obs-source-tracker.hpp"
"source/obs/obs-source-tracker.cpp"
"source/obs/obs-tools.hpp"
"source/obs/obs-tools.cpp"
)
list(APPEND PROJECT_PRIVATE_GENERATED
"${PROJECT_BINARY_DIR}/source/module.cpp"
"${PROJECT_BINARY_DIR}/source/version.hpp"
)
## Feature - FFmpeg Encoder
if(${PropertyPrefix}ENABLE_ENCODER_FFMPEG)
if(NOT ${PropertyPrefix}OBS_NATIVE)
find_path( find_path(
FFmpegPath "libavcodec/avcodec.h" FFmpegPath "libavcodec/avcodec.h"
HINTS HINTS
@ -293,207 +423,232 @@ if(NOT ${PropertyPrefix}OBS_NATIVE)
bin bin
include include
) )
endif() endif()
find_package(FFmpeg REQUIRED COMPONENTS avutil avcodec swscale) find_package(FFmpeg REQUIRED COMPONENTS avutil avcodec swscale)
################################################################################ list(APPEND PROJECT_PRIVATE_SOURCE
# Code # FFmpeg
################################################################################ "source/ffmpeg/avframe-queue.cpp"
set(PROJECT_DATA_LOCALE "source/ffmpeg/avframe-queue.hpp"
"${PROJECT_SOURCE_DIR}/data/locale/en-US.ini" "source/ffmpeg/swscale.hpp"
) "source/ffmpeg/swscale.cpp"
set(PROJECT_DATA_EFFECTS "source/ffmpeg/tools.hpp"
"${PROJECT_SOURCE_DIR}/data/effects/channel-mask.effect" "source/ffmpeg/tools.cpp"
"${PROJECT_SOURCE_DIR}/data/effects/color-conversion.effect" "source/ffmpeg/hwapi/base.hpp"
"${PROJECT_SOURCE_DIR}/data/effects/color-grade.effect" "source/ffmpeg/hwapi/base.cpp"
"${PROJECT_SOURCE_DIR}/data/effects/displace.effect" "source/ffmpeg/hwapi/d3d11.hpp"
"${PROJECT_SOURCE_DIR}/data/effects/mask.effect" "source/ffmpeg/hwapi/d3d11.cpp"
"${PROJECT_SOURCE_DIR}/data/effects/mipgen.effect"
# Blur # Encoders
"${PROJECT_SOURCE_DIR}/data/effects/blur/box.effect" "source/encoders/ffmpeg-encoder.hpp"
"${PROJECT_SOURCE_DIR}/data/effects/blur/box-linear.effect" "source/encoders/ffmpeg-encoder.cpp"
"${PROJECT_SOURCE_DIR}/data/effects/blur/dual-filtering.effect"
"${PROJECT_SOURCE_DIR}/data/effects/blur/gaussian.effect"
"${PROJECT_SOURCE_DIR}/data/effects/blur/gaussian-linear.effect"
# Signed Distance Field # Encoders/Codecs
"${PROJECT_SOURCE_DIR}/data/effects/sdf/sdf-producer.effect" "source/encoders/codecs/hevc.hpp"
"${PROJECT_SOURCE_DIR}/data/effects/sdf/sdf-consumer.effect" "source/encoders/codecs/hevc.cpp"
) "source/encoders/codecs/h264.hpp"
set(PROJECT_DATA_SHADERS "source/encoders/codecs/h264.cpp"
"${PROJECT_SOURCE_DIR}/data/examples/shaders/filter/drunk.effect" "source/encoders/codecs/prores.hpp"
"${PROJECT_SOURCE_DIR}/data/examples/shaders/filter/example.effect" "source/encoders/codecs/prores.cpp"
"${PROJECT_SOURCE_DIR}/data/examples/shaders/filter/example_displace_by_texture.effect"
"${PROJECT_SOURCE_DIR}/data/examples/shaders/source/example.effect"
)
set(PROJECT_DATA
${PROJECT_DATA_LOCALE}
${PROJECT_DATA_EFFECTS}
${PROJECT_DATA_SHADERS}
)
set(PROJECT_LIBRARIES # Encoders/Handlers
) "source/encoders/handlers/handler.hpp"
"source/encoders/handlers/handler.cpp"
set(PROJECT_TEMPLATES "source/encoders/handlers/debug_handler.hpp"
"${PROJECT_SOURCE_DIR}/cmake/version.hpp.in" "source/encoders/handlers/debug_handler.cpp"
"${PROJECT_SOURCE_DIR}/cmake/module.cpp.in" "source/encoders/handlers/prores_aw_handler.hpp"
"${PROJECT_SOURCE_DIR}/cmake/DownloadProject.cmake" "source/encoders/handlers/prores_aw_handler.cpp"
"${PROJECT_SOURCE_DIR}/cmake/DownloadProject.CMakeLists.cmake.in" "source/encoders/handlers/nvenc_shared.hpp"
"${PROJECT_SOURCE_DIR}/cmake/util.cmake" "source/encoders/handlers/nvenc_shared.cpp"
) "source/encoders/handlers/nvenc_h264_handler.hpp"
if(WIN32) "source/encoders/handlers/nvenc_h264_handler.cpp"
list(APPEND PROJECT_TEMPLATES "source/encoders/handlers/nvenc_hevc_handler.hpp"
"${PROJECT_SOURCE_DIR}/cmake/installer.iss.in" "source/encoders/handlers/nvenc_hevc_handler.cpp"
"${PROJECT_SOURCE_DIR}/cmake/version.rc.in" )
list(APPEND PROJECT_LIBRARIES
${FFMPEG_LIBRARIES}
)
list(APPEND PROJECT_INCLUDE_DIRS
${FFMPEG_INCLUDE_DIRS}
)
list(APPEND PROJECT_DEFINITIONS
ENABLE_ENCODER_FFMPEG
) )
endif() endif()
set(PROJECT_PUBLIC ## Feature - Blur Filter
) if(${PropertyPrefix}ENABLE_FILTER_BLUR)
set(PROJECT_PRIVATE_GENERATED list(APPEND PROJECT_DATA
"${PROJECT_BINARY_DIR}/source/module.cpp" "data/effects/mask.effect"
"${PROJECT_BINARY_DIR}/source/version.hpp" "data/effects/blur/box.effect"
) "data/effects/blur/box-linear.effect"
set(PROJECT_PRIVATE_SOURCE "data/effects/blur/dual-filtering.effect"
# Plugin "data/effects/blur/gaussian.effect"
"${PROJECT_SOURCE_DIR}/source/plugin.hpp" "data/effects/blur/gaussian-linear.effect"
"${PROJECT_SOURCE_DIR}/source/plugin.cpp" )
"${PROJECT_SOURCE_DIR}/source/strings.hpp" list (APPEND PROJECT_PRIVATE_SOURCE
"${PROJECT_SOURCE_DIR}/source/utility.hpp" "source/gfx/blur/gfx-blur-base.hpp"
"${PROJECT_SOURCE_DIR}/source/utility.cpp" "source/gfx/blur/gfx-blur-base.cpp"
"${PROJECT_SOURCE_DIR}/source/util-event.hpp" "source/gfx/blur/gfx-blur-box.hpp"
"${PROJECT_SOURCE_DIR}/source/util-threadpool.cpp" "source/gfx/blur/gfx-blur-box.cpp"
"${PROJECT_SOURCE_DIR}/source/util-threadpool.hpp" "source/gfx/blur/gfx-blur-box-linear.hpp"
"source/gfx/blur/gfx-blur-box-linear.cpp"
"source/gfx/blur/gfx-blur-dual-filtering.hpp"
"source/gfx/blur/gfx-blur-dual-filtering.cpp"
"source/gfx/blur/gfx-blur-gaussian.hpp"
"source/gfx/blur/gfx-blur-gaussian.cpp"
"source/gfx/blur/gfx-blur-gaussian-linear.hpp"
"source/gfx/blur/gfx-blur-gaussian-linear.cpp"
"source/filters/filter-blur.hpp"
"source/filters/filter-blur.cpp"
)
list(APPEND PROJECT_DEFINITIONS
ENABLE_FILTER_BLUR
)
endif()
# Graphics ## Features - Color Grade Filter
"${PROJECT_SOURCE_DIR}/source/gfx/gfx-source-texture.hpp" if(${PropertyPrefix}ENABLE_FILTER_COLOR_GRADE)
"${PROJECT_SOURCE_DIR}/source/gfx/gfx-source-texture.cpp" list(APPEND PROJECT_DATA
# Graphics/Blur "data/effects/color-grade.effect"
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-base.hpp" )
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-base.cpp" list (APPEND PROJECT_PRIVATE_SOURCE
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-box.hpp" "source/filters/filter-color-grade.hpp"
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-box.cpp" "source/filters/filter-color-grade.cpp"
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-box-linear.hpp" )
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-box-linear.cpp" list(APPEND PROJECT_DEFINITIONS
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-dual-filtering.hpp" ENABLE_FILTER_COLOR_GRADE
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-dual-filtering.cpp" )
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-gaussian.hpp" endif()
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-gaussian.cpp"
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-gaussian-linear.hpp"
"${PROJECT_SOURCE_DIR}/source/gfx/blur/gfx-blur-gaussian-linear.cpp"
# Graphics/Shader
"${PROJECT_SOURCE_DIR}/source/gfx/shader/gfx-shader.hpp"
"${PROJECT_SOURCE_DIR}/source/gfx/shader/gfx-shader.cpp"
"${PROJECT_SOURCE_DIR}/source/gfx/shader/gfx-shader-param.hpp"
"${PROJECT_SOURCE_DIR}/source/gfx/shader/gfx-shader-param.cpp"
"${PROJECT_SOURCE_DIR}/source/gfx/shader/gfx-shader-param-audio.hpp"
"${PROJECT_SOURCE_DIR}/source/gfx/shader/gfx-shader-param-audio.cpp"
"${PROJECT_SOURCE_DIR}/source/gfx/shader/gfx-shader-param-basic.hpp"
"${PROJECT_SOURCE_DIR}/source/gfx/shader/gfx-shader-param-basic.cpp"
"${PROJECT_SOURCE_DIR}/source/gfx/shader/gfx-shader-param-matrix.hpp"
"${PROJECT_SOURCE_DIR}/source/gfx/shader/gfx-shader-param-matrix.cpp"
"${PROJECT_SOURCE_DIR}/source/gfx/shader/gfx-shader-param-texture.hpp"
"${PROJECT_SOURCE_DIR}/source/gfx/shader/gfx-shader-param-texture.cpp"
# OBS ## Features - Displacement Filter
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-helper.hpp" if(${PropertyPrefix}ENABLE_FILTER_DISPLACEMENT)
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-helper.cpp" list(APPEND PROJECT_DATA
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-effect.hpp" "data/effects/displace.effect"
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-effect.cpp" )
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-effect-parameter.hpp" list (APPEND PROJECT_PRIVATE_SOURCE
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-effect-parameter.cpp" "source/filters/filter-displacement.hpp"
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-effect-pass.hpp" "source/filters/filter-displacement.cpp"
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-effect-pass.cpp" )
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-effect-technique.hpp" list(APPEND PROJECT_DEFINITIONS
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-effect-technique.cpp" ENABLE_FILTER_DISPLACEMENT
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-indexbuffer.hpp" )
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-indexbuffer.cpp" endif()
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-limits.hpp"
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-mipmapper.hpp"
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-mipmapper.cpp"
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-rendertarget.hpp"
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-rendertarget.cpp"
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-sampler.hpp"
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-sampler.cpp"
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-texture.hpp"
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-texture.cpp"
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-vertex.hpp"
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-vertex.cpp"
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-vertexbuffer.hpp"
"${PROJECT_SOURCE_DIR}/source/obs/gs/gs-vertexbuffer.cpp"
"${PROJECT_SOURCE_DIR}/source/obs/obs-signal-handler.hpp"
"${PROJECT_SOURCE_DIR}/source/obs/obs-signal-handler.cpp"
"${PROJECT_SOURCE_DIR}/source/obs/obs-source.hpp"
"${PROJECT_SOURCE_DIR}/source/obs/obs-source.cpp"
"${PROJECT_SOURCE_DIR}/source/obs/obs-source-factory.hpp"
"${PROJECT_SOURCE_DIR}/source/obs/obs-source-factory.cpp"
"${PROJECT_SOURCE_DIR}/source/obs/obs-source-tracker.hpp"
"${PROJECT_SOURCE_DIR}/source/obs/obs-source-tracker.cpp"
"${PROJECT_SOURCE_DIR}/source/obs/obs-tools.hpp"
"${PROJECT_SOURCE_DIR}/source/obs/obs-tools.cpp"
# Sources ## Features - Dynamic Mask Filter
"${PROJECT_SOURCE_DIR}/source/sources/source-mirror.hpp" if(${PropertyPrefix}ENABLE_FILTER_DYNAMIC_MASK)
"${PROJECT_SOURCE_DIR}/source/sources/source-mirror.cpp" list(APPEND PROJECT_DATA
"${PROJECT_SOURCE_DIR}/source/sources/source-shader.hpp" "data/effects/channel-mask.effect"
"${PROJECT_SOURCE_DIR}/source/sources/source-shader.cpp" )
list(APPEND PROJECT_PRIVATE_SOURCE
"source/filters/filter-dynamic-mask.hpp"
"source/filters/filter-dynamic-mask.cpp"
)
list(APPEND PROJECT_DEFINITIONS
ENABLE_FILTER_DYNAMIC_MASK
)
endif()
# Filters ## Features - SDF Effects Filter
"${PROJECT_SOURCE_DIR}/source/filters/filter-blur.hpp" if(${PropertyPrefix}ENABLE_FILTER_SDF_EFFECTS)
"${PROJECT_SOURCE_DIR}/source/filters/filter-blur.cpp" list(APPEND PROJECT_DATA
"${PROJECT_SOURCE_DIR}/source/filters/filter-color-grade.hpp" "data/effects/sdf/sdf-producer.effect"
"${PROJECT_SOURCE_DIR}/source/filters/filter-color-grade.cpp" "data/effects/sdf/sdf-consumer.effect"
"${PROJECT_SOURCE_DIR}/source/filters/filter-displacement.hpp" )
"${PROJECT_SOURCE_DIR}/source/filters/filter-displacement.cpp" list(APPEND PROJECT_PRIVATE_SOURCE
"${PROJECT_SOURCE_DIR}/source/filters/filter-dynamic-mask.hpp" "source/filters/filter-sdf-effects.hpp"
"${PROJECT_SOURCE_DIR}/source/filters/filter-dynamic-mask.cpp" "source/filters/filter-sdf-effects.cpp"
"${PROJECT_SOURCE_DIR}/source/filters/filter-sdf-effects.hpp" )
"${PROJECT_SOURCE_DIR}/source/filters/filter-sdf-effects.cpp" list(APPEND PROJECT_DEFINITIONS
#"${PROJECT_SOURCE_DIR}/source/filters/filter-shader.hpp" ENABLE_FILTER_SDF_EFFECTS
#"${PROJECT_SOURCE_DIR}/source/filters/filter-shader.cpp" )
"${PROJECT_SOURCE_DIR}/source/filters/filter-transform.hpp" endif()
"${PROJECT_SOURCE_DIR}/source/filters/filter-transform.cpp"
# Transitions ## Features - Shader Filter
if(${PropertyPrefix}ENABLE_FILTER_SHADER)
set(REQUIRE_SHADER_CODE ON)
list(APPEND PROJECT_DATA
"data/examples/shaders/filter/drunk.effect"
"data/examples/shaders/filter/example.effect"
"data/examples/shaders/filter/example_displace_by_texture.effect"
)
list(APPEND PROJECT_PRIVATE_SOURCE
# "source/filters/filter-shader.hpp"
# "source/filters/filter-shader.cpp"
)
list(APPEND PROJECT_DEFINITIONS
ENABLE_FILTER_SHADER
)
endif()
# FFmpeg ## Features - Transform Filter
"${PROJECT_SOURCE_DIR}/source/ffmpeg/avframe-queue.cpp" if(${PropertyPrefix}ENABLE_FILTER_TRANSFORM)
"${PROJECT_SOURCE_DIR}/source/ffmpeg/avframe-queue.hpp" list(APPEND PROJECT_PRIVATE_SOURCE
"${PROJECT_SOURCE_DIR}/source/ffmpeg/swscale.hpp" "source/filters/filter-transform.hpp"
"${PROJECT_SOURCE_DIR}/source/ffmpeg/swscale.cpp" "source/filters/filter-transform.cpp"
"${PROJECT_SOURCE_DIR}/source/ffmpeg/tools.hpp" )
"${PROJECT_SOURCE_DIR}/source/ffmpeg/tools.cpp" list(APPEND PROJECT_DEFINITIONS
"${PROJECT_SOURCE_DIR}/source/ffmpeg/hwapi/base.hpp" ENABLE_FILTER_TRANSFORM
"${PROJECT_SOURCE_DIR}/source/ffmpeg/hwapi/base.cpp" )
"${PROJECT_SOURCE_DIR}/source/ffmpeg/hwapi/d3d11.hpp" endif()
"${PROJECT_SOURCE_DIR}/source/ffmpeg/hwapi/d3d11.cpp"
# Encoders ## Features - Mirror Source
"${PROJECT_SOURCE_DIR}/source/encoders/ffmpeg-encoder.hpp" if(${PropertyPrefix}ENABLE_SOURCE_MIRROR)
"${PROJECT_SOURCE_DIR}/source/encoders/ffmpeg-encoder.cpp" list(APPEND PROJECT_PRIVATE_SOURCE
# Encoders/Codecs "source/sources/source-mirror.hpp"
"${PROJECT_SOURCE_DIR}/source/encoders/codecs/hevc.hpp" "source/sources/source-mirror.cpp"
"${PROJECT_SOURCE_DIR}/source/encoders/codecs/hevc.cpp" )
"${PROJECT_SOURCE_DIR}/source/encoders/codecs/h264.hpp" list(APPEND PROJECT_DEFINITIONS
"${PROJECT_SOURCE_DIR}/source/encoders/codecs/h264.cpp" ENABLE_SOURCE_MIRROR
"${PROJECT_SOURCE_DIR}/source/encoders/codecs/prores.hpp" )
"${PROJECT_SOURCE_DIR}/source/encoders/codecs/prores.cpp" endif()
# Encoders/Handlers
"${PROJECT_SOURCE_DIR}/source/encoders/handlers/handler.hpp" ## Features - Shader Source
"${PROJECT_SOURCE_DIR}/source/encoders/handlers/handler.cpp" if(${PropertyPrefix}ENABLE_SOURCE_SHADER)
"${PROJECT_SOURCE_DIR}/source/encoders/handlers/debug_handler.hpp" set(REQUIRE_SHADER_CODE ON)
"${PROJECT_SOURCE_DIR}/source/encoders/handlers/debug_handler.cpp" list(APPEND PROJECT_DATA
"${PROJECT_SOURCE_DIR}/source/encoders/handlers/prores_aw_handler.hpp" "data/examples/shaders/source/example.effect"
"${PROJECT_SOURCE_DIR}/source/encoders/handlers/prores_aw_handler.cpp" )
"${PROJECT_SOURCE_DIR}/source/encoders/handlers/nvenc_shared.hpp" list(APPEND PROJECT_PRIVATE_SOURCE
"${PROJECT_SOURCE_DIR}/source/encoders/handlers/nvenc_shared.cpp" "source/sources/source-shader.hpp"
"${PROJECT_SOURCE_DIR}/source/encoders/handlers/nvenc_h264_handler.hpp" "source/sources/source-shader.cpp"
"${PROJECT_SOURCE_DIR}/source/encoders/handlers/nvenc_h264_handler.cpp" )
"${PROJECT_SOURCE_DIR}/source/encoders/handlers/nvenc_hevc_handler.hpp" list(APPEND PROJECT_DEFINITIONS
"${PROJECT_SOURCE_DIR}/source/encoders/handlers/nvenc_hevc_handler.cpp" ENABLE_SOURCE_SHADER
) )
endif()
## Features - Shader Transition
if(${PropertyPrefix}ENABLE_TRANSITION_SHADER)
set(REQUIRE_SHADER_CODE ON)
list(APPEND PROJECT_DATA
)
list(APPEND PROJECT_PRIVATE_SOURCE
# "source/transitions/transition-shader.hpp"
# "source/transitions/transition-shader.cpp"
)
list(APPEND PROJECT_DEFINITIONS
ENABLE_TRANSITION_SHADER
)
endif()
## Parts
if(REQUIRE_SHADER_CODE)
list(APPEND PROJECT_PRIVATE_SOURCE
"source/gfx/shader/gfx-shader.hpp"
"source/gfx/shader/gfx-shader.cpp"
"source/gfx/shader/gfx-shader-param.hpp"
"source/gfx/shader/gfx-shader-param.cpp"
"source/gfx/shader/gfx-shader-param-audio.hpp"
"source/gfx/shader/gfx-shader-param-audio.cpp"
"source/gfx/shader/gfx-shader-param-basic.hpp"
"source/gfx/shader/gfx-shader-param-basic.cpp"
"source/gfx/shader/gfx-shader-param-matrix.hpp"
"source/gfx/shader/gfx-shader-param-matrix.cpp"
"source/gfx/shader/gfx-shader-param-texture.hpp"
"source/gfx/shader/gfx-shader-param-texture.cpp"
)
endif()
set(PROJECT_PRIVATE set(PROJECT_PRIVATE
${PROJECT_DATA} ${PROJECT_DATA}
@ -540,44 +695,29 @@ target_include_directories(${PROJECT_NAME}
PRIVATE PRIVATE
"${PROJECT_BINARY_DIR}/source" "${PROJECT_BINARY_DIR}/source"
"${PROJECT_SOURCE_DIR}/source" "${PROJECT_SOURCE_DIR}/source"
${FFMPEG_INCLUDE_DIRS} ${PROJECT_INCLUDE_DIRS}
) )
# OBS Studio
if(${PropertyPrefix}OBS_NATIVE)
target_link_libraries(${PROJECT_NAME}
libobs
)
elseif(${PropertyPrefix}OBS_REFERENCE)
target_include_directories(${PROJECT_NAME}
PRIVATE
"${OBS_STUDIO_DIR}/libobs"
)
target_link_libraries(${PROJECT_NAME}
"${LIBOBS_LIB}"
)
elseif(${PropertyPrefix}OBS_PACKAGE)
target_include_directories(${PROJECT_NAME}
PRIVATE
"${OBS_STUDIO_DIR}/include"
)
target_link_libraries(${PROJECT_NAME}
libobs
)
elseif(${PropertyPrefix}OBS_DOWNLOAD)
target_link_libraries(${PROJECT_NAME}
libobs
)
endif()
# Link Libraries # Link Libraries
target_link_libraries(${PROJECT_NAME} target_link_libraries(${PROJECT_NAME}
${PROJECT_LIBRARIES} ${PROJECT_LIBRARIES}
${FFMPEG_LIBRARIES}
) )
if(WIN32)
foreach(DELAYLOAD ${PROJECT_LIBRARIES_DELAYED})
get_target_property(_lf ${PROJECT_NAME} LINK_FLAGS)
if (NOT _lf)
set(_lf "")
endif()
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "${_lf} /DELAYLOAD:${DELAYLOAD}")
endforeach()
endif()
# Definitions # Definitions
if (WIN32) target_compile_definitions(${PROJECT_NAME}
PRIVATE
${PROJECT_DEFINITIONS}
)
if(WIN32)
target_compile_definitions(${PROJECT_NAME} target_compile_definitions(${PROJECT_NAME}
PRIVATE PRIVATE
_CRT_SECURE_NO_WARNINGS _CRT_SECURE_NO_WARNINGS
@ -674,7 +814,7 @@ else()
endif() endif()
install( install(
DIRECTORY "${PROJECT_SOURCE_DIR}/data/" DIRECTORY "data/"
DESTINATION "./data/obs-plugins/${PROJECT_NAME}/" DESTINATION "./data/obs-plugins/${PROJECT_NAME}/"
) )
@ -693,3 +833,5 @@ else()
WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}" WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}"
) )
endif() endif()
cmake_policy(POP)

View file

@ -0,0 +1,139 @@
uniform float4x4 ViewProj;
uniform texture2d image;
uniform int size;
sampler_state pixelSampler {
Filter = Point;
AddressU = Clamp;
AddressV = Clamp;
};
struct VertData {
float4 pos : POSITION;
float2 uv : TEXCOORD0;
};
VertData vertex_program(VertData vd)
{
vd.pos = mul(float4(vd.pos.xyz, 1.0), ViewProj);
return vd;
}
// -------------------------------------------------------------------------------- //
// Helpers
// -------------------------------------------------------------------------------- //
uint get_selector(VertData vd, int width) {
return uint(vd.uv.x * size * width) % width;
}
// -------------------------------------------------------------------------------- //
// Pack/Unpack RG/GR
// -------------------------------------------------------------------------------- //
float4 _PackRG(VertData vd) : TARGET {
if (get_selector(vd, 2) == 0) {
return float4(image.Sample(pixelSampler, vd.uv).r, 0., 0., 1.);
} else {
return float4(image.Sample(pixelSampler, vd.uv).g, 0., 0., 1.);
}
}
technique PackRG { pass { vertex_shader = vertex_program(vd); pixel_shader = _PackRG(vd); } }
float4 _PackGR(VertData vd) : TARGET {
if (get_selector(vd, 2) == 0) {
return float4(image.Sample(pixelSampler, vd.uv).g, 0., 0., 1.);
} else {
return float4(image.Sample(pixelSampler, vd.uv).r, 0., 0., 1.);
}
}
technique PackGR { pass { vertex_shader = vertex_program(vd); pixel_shader = _PackGR(vd); } }
// -------------------------------------------------------------------------------- //
// Pack/Unpack RGB/BGR
// -------------------------------------------------------------------------------- //
float4 _PackRGB(VertData vd) : TARGET {
uint select = get_selector(vd, 3);
if (select == 0) {
return float4(image.Sample(pixelSampler, vd.uv).r, 0., 0., 1.);
} else if (select == 1) {
return float4(image.Sample(pixelSampler, vd.uv).g, 0., 0., 1.);
} else {
return float4(image.Sample(pixelSampler, vd.uv).b, 0., 0., 1.);
}
}
technique PackRGB { pass { vertex_shader = vertex_program(vd); pixel_shader = _PackRGB(vd); } }
float4 _PackBGR(VertData vd) : TARGET {
uint select = get_selector(vd, 3);
if (select == 0) {
return float4(image.Sample(pixelSampler, vd.uv).b, 0., 0., 1.);
} else if (select == 1) {
return float4(image.Sample(pixelSampler, vd.uv).g, 0., 0., 1.);
} else {
return float4(image.Sample(pixelSampler, vd.uv).r, 0., 0., 1.);
}
return float4(0., 0., 0., 0.);
}
technique PackBGR { pass { vertex_shader = vertex_program(vd); pixel_shader = _PackBGR(vd); } }
// -------------------------------------------------------------------------------- //
// Pack/Unpack RGBA/ABGR
// -------------------------------------------------------------------------------- //
float4 _PackRGBA(VertData vd) : TARGET {
uint select = get_selector(vd, 4);
if (select == 0) {
return float4(image.Sample(pixelSampler, vd.uv).r, 0., 0., 1.);
} else if (select == 1) {
return float4(image.Sample(pixelSampler, vd.uv).g, 0., 0., 1.);
} else if (select == 2) {
return float4(image.Sample(pixelSampler, vd.uv).b, 0., 0., 1.);
} else {
return float4(image.Sample(pixelSampler, vd.uv).a, 0., 0., 1.);
}
}
technique PackRGBA { pass { vertex_shader = vertex_program(vd); pixel_shader = _PackRGBA(vd); } }
float4 _PackABGR(VertData vd) : TARGET {
uint select = get_selector(vd, 4);
if (select == 0) {
return float4(image.Sample(pixelSampler, vd.uv).a, 0., 0., 1.);
} else if (select == 1) {
return float4(image.Sample(pixelSampler, vd.uv).b, 0., 0., 1.);
} else if (select == 1) {
return float4(image.Sample(pixelSampler, vd.uv).g, 0., 0., 1.);
} else {
return float4(image.Sample(pixelSampler, vd.uv).r, 0., 0., 1.);
}
}
technique PackABGR { pass { vertex_shader = vertex_program(vd); pixel_shader = _PackABGR(vd); } }
// -------------------------------------------------------------------------------- //
// Pack/Unpack ARGB/BGRA
// -------------------------------------------------------------------------------- //
float4 _PackARGB(VertData vd) : TARGET {
uint select = get_selector(vd, 4);
if (select == 0) {
return float4(image.Sample(pixelSampler, vd.uv).a, 0., 0., 1.);
} else if (select == 1) {
return float4(image.Sample(pixelSampler, vd.uv).r, 0., 0., 1.);
} else if (select == 2) {
return float4(image.Sample(pixelSampler, vd.uv).g, 0., 0., 1.);
} else {
return float4(image.Sample(pixelSampler, vd.uv).b, 0., 0., 1.);
}
}
technique PackARGB { pass { vertex_shader = vertex_program(vd); pixel_shader = _PackARGB(vd); } }
float4 _PackBGRA(VertData vd) : TARGET {
uint select = get_selector(vd, 4);
if (select == 0) {
return float4(image.Sample(pixelSampler, vd.uv).b, 0., 0., 1.);
} else if (select == 1) {
return float4(image.Sample(pixelSampler, vd.uv).g, 0., 0., 1.);
} else if (select == 1) {
return float4(image.Sample(pixelSampler, vd.uv).r, 0., 0., 1.);
} else {
return float4(image.Sample(pixelSampler, vd.uv).a, 0., 0., 1.);
}
}
technique PackBGRA { pass { vertex_shader = vertex_program(vd); pixel_shader = _PackBGRA(vd); } }

View file

@ -24,16 +24,36 @@
#include "encoders/ffmpeg-encoder.hpp" #include "encoders/ffmpeg-encoder.hpp"
#ifdef ENABLE_FILTER_BLUR
#include "filters/filter-blur.hpp" #include "filters/filter-blur.hpp"
#endif
#ifdef ENABLE_FILTER_COLOR_GRADE
#include "filters/filter-color-grade.hpp" #include "filters/filter-color-grade.hpp"
#endif
#ifdef ENABLE_FILTER_DISPLACEMENT
#include "filters/filter-displacement.hpp" #include "filters/filter-displacement.hpp"
#endif
#ifdef ENABLE_FILTER_DYNAMIC_MASK
#include "filters/filter-dynamic-mask.hpp" #include "filters/filter-dynamic-mask.hpp"
#endif
#ifdef ENABLE_FILTER_SDF_EFFECTS
#include "filters/filter-sdf-effects.hpp" #include "filters/filter-sdf-effects.hpp"
#include "filters/filter-transform.hpp" #endif
#ifdef ENABLE_FILTER_SHADER
//#include "filters/filter-shader.hpp" //#include "filters/filter-shader.hpp"
#endif
#ifdef ENABLE_FILTER_TRANSFORM
#include "filters/filter-transform.hpp"
#endif
#ifdef ENABLE_SOURCE_MIRROR
#include "sources/source-mirror.hpp" #include "sources/source-mirror.hpp"
#endif
#ifdef ENABLE_SOURCE_SHADER
#include "sources/source-shader.hpp" #include "sources/source-shader.hpp"
#endif
#ifdef ENABLE_TRANSITION_SHADER
//#include "transitions/source-shader.hpp"
#endif
static std::shared_ptr<util::threadpool> global_threadpool; static std::shared_ptr<util::threadpool> global_threadpool;
@ -46,23 +66,46 @@ try {
// Initialize Source Tracker // Initialize Source Tracker
obs::source_tracker::initialize(); obs::source_tracker::initialize();
// Encoders // Encoders
#ifdef ENABLE_ENCODER_FFMPEG
encoder::ffmpeg::ffmpeg_manager::initialize(); encoder::ffmpeg::ffmpeg_manager::initialize();
#endif
// Filters // Filters
#ifdef ENABLE_FILTER_BLUR
filter::blur::blur_factory::initialize(); filter::blur::blur_factory::initialize();
#endif
#ifdef ENABLE_FILTER_COLOR_GRADE
filter::color_grade::color_grade_factory::initialize(); filter::color_grade::color_grade_factory::initialize();
#endif
#ifdef ENABLE_FILTER_DISPLACEMENT
filter::displacement::displacement_factory::initialize(); filter::displacement::displacement_factory::initialize();
#endif
#ifdef ENABLE_FILTER_DYNAMIC_MASK
filter::dynamic_mask::dynamic_mask_factory::initialize(); filter::dynamic_mask::dynamic_mask_factory::initialize();
#endif
#ifdef ENABLE_FILTER_SDF_EFFECTS
filter::sdf_effects::sdf_effects_factory::initialize(); filter::sdf_effects::sdf_effects_factory::initialize();
//filter::shader::shader_factory::initialize(); #endif
#ifdef ENABLE_FILTER_SHADER
//filter::shader::shader_factory::initialize();
#endif
#ifdef ENABLE_FILTER_TRANSFORM
filter::transform::transform_factory::initialize(); filter::transform::transform_factory::initialize();
#endif
// Sources // Sources
#ifdef ENABLE_SOURCE_MIRROR
source::mirror::mirror_factory::initialize(); source::mirror::mirror_factory::initialize();
#endif
#ifdef ENABLE_SOURCE_SHADER
source::shader::shader_factory::initialize(); source::shader::shader_factory::initialize();
#endif
// Transitions // Transitions
#ifdef ENABLE_TRANSITION_SHADER
//transition::shader::shader_factory::initialize();
#endif
return true; return true;
} catch (...) { } catch (...) {
@ -75,22 +118,45 @@ try {
LOG_INFO("Unloading Version %s", STREAMFX_VERSION_STRING); LOG_INFO("Unloading Version %s", STREAMFX_VERSION_STRING);
// Transitions // Transitions
#ifdef ENABLE_TRANSITION_SHADER
//transition::shader::shader_factory::finalize();
#endif
// Sources // Sources
#ifdef ENABLE_SOURCE_MIRROR
source::mirror::mirror_factory::finalize(); source::mirror::mirror_factory::finalize();
#endif
#ifdef ENABLE_SOURCE_SHADER
source::shader::shader_factory::finalize(); source::shader::shader_factory::finalize();
#endif
// Filters // Filters
#ifdef ENABLE_FILTER_BLUR
filter::blur::blur_factory::finalize(); filter::blur::blur_factory::finalize();
#endif
#ifdef ENABLE_FILTER_COLOR_GRADE
filter::color_grade::color_grade_factory::finalize(); filter::color_grade::color_grade_factory::finalize();
#endif
#ifdef ENABLE_FILTER_DISPLACEMENT
filter::displacement::displacement_factory::finalize(); filter::displacement::displacement_factory::finalize();
#endif
#ifdef ENABLE_FILTER_DYNAMIC_MASK
filter::dynamic_mask::dynamic_mask_factory::finalize(); filter::dynamic_mask::dynamic_mask_factory::finalize();
#endif
#ifdef ENABLE_FILTER_SDF_EFFECTS
filter::sdf_effects::sdf_effects_factory::finalize(); filter::sdf_effects::sdf_effects_factory::finalize();
//filter::shader::shader_factory::finalize(); #endif
#ifdef ENABLE_FILTER_SHADER
//filter::shader::shader_factory::finalize();
#endif
#ifdef ENABLE_FILTER_TRANSFORM
filter::transform::transform_factory::finalize(); filter::transform::transform_factory::finalize();
#endif
// Encoders // Encoders
#ifdef ENABLE_ENCODER_FFMPEG
encoder::ffmpeg::ffmpeg_manager::finalize(); encoder::ffmpeg::ffmpeg_manager::finalize();
#endif
// Finalize Source Tracker // Finalize Source Tracker
obs::source_tracker::finalize(); obs::source_tracker::finalize();