From 50c85608c3cc548d3b59cc93036832eb172312a8 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 3 Sep 2023 12:09:33 +0200 Subject: [PATCH 01/66] cmake: Initial work towards component-ification The old fake component system is starting to be very annoying to work with, as it doesn't properly split things apart. The new system should aid with this significantly, and make errors easier to spot. --- CMakeLists.txt | 1199 ++++++++++++++++++++++++++---------------------- 1 file changed, 646 insertions(+), 553 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 90b9b6e046..c616cb6ee9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -425,8 +425,10 @@ if(D_PLATFORM_MAC) ) endif() +set_property(GLOBAL PROPERTY AUTOGEN_SOURCE_GROUP "User-Interface Files/Generated") + ################################################################################ -# Components +# Components (Old System) ################################################################################ # Component resolving: @@ -1608,326 +1610,387 @@ if((CMAKE_C_COMPILER_ID STREQUAL "GNU") endif() ################################################################################ -# Register Library +# Helpers ################################################################################ +define_property(TARGET PROPERTY COMPONENT_LABEL) +define_property(TARGET PROPERTY COMPONENT_NAME) +define_property(TARGET PROPERTY COMPONENT_OPTION) +define_property(TARGET PROPERTY COMPONENT_DEPENDS) + +function(streamfx_add_library TARGET_NAME TARGET_TYPE) + add_library(${TARGET_NAME} ${TARGET_TYPE}) + + set_target_properties(${TARGET_NAME} PROPERTIES + # Always generate position independent code. + POSITION_INDEPENDENT_CODE ON + + # Set C++ Standard and Extensions + C_STANDARD 17 + C_STANDARD_REQUIRED ON + CXX_STANDARD 17 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS OFF + + # Remove prefix from generated files. + PREFIX "" + IMPORT_PREFIX "" + ) + if(D_PLATFORM_MAC) + set_target_properties(${TARGET_NAME} PROPERTIES + # @rpath in installed binaries + INSTALL_RPATH "@executable_path/../Frameworks/;@loader_path/../Frameworks/;@loader_path/../Resources/" + ) + if(STANDALONE) + set_target_properties(${TARGET_NAME} PROPERTIES + # @rpath in built binaries + BUILD_WITH_INSTALL_RPATH ON + ) + endif() + endif() -# Combine all variables that matter. -set(PROJECT_FILES - # Always exist - ${PROJECT_DATA} - ${PROJECT_PRIVATE_GENERATED} - ${PROJECT_PRIVATE_SOURCE} - ${PROJECT_TEMPLATES} - # UI-only (empty if not enabled) - ${PROJECT_UI} - ${PROJECT_UI_SOURCE} - # Media - ${PROJECT_MEDIA} -) - -# Set source groups for IDE generators. -source_group(TREE "${PROJECT_SOURCE_DIR}/data" PREFIX "Data" FILES ${PROJECT_DATA}) -source_group(TREE "${PROJECT_SOURCE_DIR}/source" PREFIX "Source" FILES ${PROJECT_PRIVATE_SOURCE} ${PROJECT_UI_SOURCE}) -source_group(TREE "${PROJECT_BINARY_DIR}/generated" PREFIX "Source" FILES ${PROJECT_PRIVATE_GENERATED}) -source_group(TREE "${PROJECT_SOURCE_DIR}/templates" PREFIX "Templates" FILES ${PROJECT_TEMPLATES}) -source_group(TREE "${PROJECT_SOURCE_DIR}/ui" PREFIX "User Interface" FILES ${PROJECT_UI}) -source_group(TREE "${PROJECT_SOURCE_DIR}/media" PREFIX "Media" FILES ${PROJECT_MEDIA}) - -# Prevent unwanted files from being built as source. -set_source_files_properties(${PROJECT_DATA} ${PROJECT_TEMPLATES} ${PROJECT_UI} ${PROJECT_MEDIA} PROPERTIES - HEADER_FILE_ONLY ON -) - -# Prevent non-UI files from being Qt'd -if(Qt5_Found OR Qt6_FOUND) - set_source_files_properties(${PROJECT_DATA} ${PROJECT_TEMPLATES} ${PROJECT_MEDIA} ${PROJECT_PRIVATE_GENERATED} ${PROJECT_PRIVATE_SOURCE} PROPERTIES - SKIP_AUTOGEN ON - SKIP_AUTOMOC ON - SKIP_AUTORCC ON - SKIP_AUTOUIC ON + target_compile_definitions(${TARGET_NAME} PRIVATE + __STDC_WANT_LIB_EXT1__=1 ) -endif() - -# Register the library -add_library(${PROJECT_NAME} MODULE ${PROJECT_FILES}) # We are a module for libOBS. -target_link_libraries(${PROJECT_NAME} PRIVATE ${PROJECT_LIBRARIES}) -target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_INCLUDE_DIRS}) -target_compile_definitions(${PROJECT_NAME} PRIVATE ${PROJECT_DEFINITIONS}) -# Always generate position independent code. -set_target_properties(${PROJECT_NAME} PROPERTIES - POSITION_INDEPENDENT_CODE ON -) + # C/C++ Compiler Adjustments + if(D_PLATFORM_WINDOWS AND ((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))) + # MSVC/ClangCL -# Set C++ Standard and Extensions -set_target_properties(${PROJECT_NAME} PROPERTIES - C_STANDARD 17 - C_STANDARD_REQUIRED ON - CXX_STANDARD 17 - CXX_STANDARD_REQUIRED ON - CXX_EXTENSIONS OFF -) -target_compile_definitions(${PROJECT_NAME} PRIVATE - __STDC_WANT_LIB_EXT1__=1 -) + # - Dynamically link Microsoft C/C++ Redistributable. + target_compile_options(${TARGET_NAME} PRIVATE + $<$:/MD> + $<$:/MDd> + $<$:/MD> + $<$:/MD> + $<$:/MD> + ) -# Link-Time/Interprocedural Optimization -if(${PREFIX}ENABLE_LTO) - set_target_properties(${PROJECT_NAME} PROPERTIES - INTERPROCEDURAL_OPTIMIZATION ON - ) -endif() - -# C/C++ Compiler Adjustments -if(D_PLATFORM_WINDOWS AND ((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))) - # MSVC/ClangCL - message(STATUS "Applying custom flags for MSVC style build.") - - # - Dynamically link Microsoft C/C++ Redistributable. - target_compile_options(${PROJECT_NAME} PRIVATE - $<$:/MD> - $<$:/MDd> - $<$:/MD> - $<$:/MD> - $<$:/MD> - ) - - # - Treat Warnings as Errors - target_compile_options(${PROJECT_NAME} PRIVATE "/Wall") - # - Explicitly disable treating all Warnings as Errors - target_compile_options(${PROJECT_NAME} PRIVATE "/WX-") - - # - Disable useless warnings - set(DISABLED_WARNINGS - # Don't warn about unused variables, parameters, labels, functions, or typedefs. - "4100" - "4101" - "4102" - "4505" - "4514" - "5245" - # Don't warn about unreferenced variables or parameters which are assigned/initialized. - "4189" - # Don't warn about not-explicitly-handled enumeration identifiers - "4061" - # Ignore automatic padding warnings. - "4820" - # Ignore assignment/move/copy being implicit '= delete;'. - "4623" - "4625" - "4626" - "5026" - "5027" - # Relative include paths are fine. - "4464" - # Buggy warning: printf expects string literal - "4774" - # Buggy warning: subobject initialization should be wrapped in braces - "5246" - # Ignore undefined, unused or unreferenced pre-processor macros - "4688" - # Ignore non-inlined functions - "4710" - # Ignore Spectre mitigation insertions - "5045" - # Ignore inserted padding. - "4324" - ) - foreach(WARN ${DISABLED_WARNINGS}) - target_compile_options(${PROJECT_NAME} PRIVATE "/wd${WARN}") - endforeach() + # - Treat Warnings as Errors + target_compile_options(${TARGET_NAME} PRIVATE "/Wall") + + # - Explicitly disable treating all Warnings as Errors + target_compile_options(${TARGET_NAME} PRIVATE "/WX-") + + # - Disable useless warnings + set(DISABLED_WARNINGS + # Don't warn about unused variables, parameters, labels, functions, or typedefs. + "4100" + "4101" + "4102" + "4505" + "4514" + "5245" + # Don't warn about unreferenced variables or parameters which are assigned/initialized. + "4189" + # Don't warn about not-explicitly-handled enumeration identifiers + "4061" + # Ignore automatic padding warnings. + "4820" + # Ignore assignment/move/copy being implicit '= delete;'. + "4623" + "4625" + "4626" + "5026" + "5027" + # Relative include paths are fine. + "4464" + # Buggy warning: printf expects string literal + "4774" + # Buggy warning: subobject initialization should be wrapped in braces + "5246" + # Ignore undefined, unused or unreferenced pre-processor macros + "4688" + # Ignore non-inlined functions + "4710" + # Ignore Spectre mitigation insertions + "5045" + # Ignore inserted padding. + "4324" + ) + foreach(WARN ${DISABLED_WARNINGS}) + target_compile_options(${TARGET_NAME} PRIVATE "/wd${WARN}") + endforeach() - # - Require enabled instruction sets. - if(D_PLATFORM_ARCH_X86) - if(${PREFIX}TARGET_X86_64_V4) - target_compile_options(${PROJECT_NAME} PRIVATE "/arch:AVX512") - message(STATUS "Targeting x86-64-v4.") - elseif(${PREFIX}TARGET_X86_64_V3) - target_compile_options(${PROJECT_NAME} PRIVATE "/arch:AVX2") - message(STATUS "Targeting x86-64-v3.") - elseif(${PREFIX}TARGET_X86_64_V2_EX) - target_compile_options(${PROJECT_NAME} PRIVATE "/arch:AVX") - message(STATUS "Targeting extended x86-64-v2.") - elseif(${PREFIX}TARGET_X86_64_V2) - target_compile_options(${PROJECT_NAME} PRIVATE "/d2archSSE42") - message(STATUS "Targeting x86-64-v2.") - elseif(${PREFIX}TARGET_X86_64) - #target_compile_options(${PROJECT_NAME} PRIVATE "/arch:SSE2") - message(STATUS "Targeting x86-64.") + # - Require enabled instruction sets. + if(D_PLATFORM_ARCH_X86) + if(${PREFIX}TARGET_X86_64_V4) + target_compile_options(${TARGET_NAME} PRIVATE "/arch:AVX512") + elseif(${PREFIX}TARGET_X86_64_V3) + target_compile_options(${TARGET_NAME} PRIVATE "/arch:AVX2") + elseif(${PREFIX}TARGET_X86_64_V2_EX) + target_compile_options(${TARGET_NAME} PRIVATE "/arch:AVX") + elseif(${PREFIX}TARGET_X86_64_V2) + target_compile_options(${TARGET_NAME} PRIVATE "/d2archSSE42") + elseif(${PREFIX}TARGET_X86_64) + #target_compile_options(${TARGET_NAME} PRIVATE "/arch:SSE2") + endif() endif() - endif() - # - Use fast unordered math if possible. - if(${PREFIX}ENABLE_FASTMATH) - target_compile_options(${PROJECT_NAME} PRIVATE "/fp:fast") - else() - target_compile_options(${PROJECT_NAME} PRIVATE "/fp:precise") - if(MSVC_VERSION GREATER 1930) - # Keep original behavior in VS2022 and up. - target_compile_options(${PROJECT_NAME} PRIVATE "/fp:contract") + # - Use fast unordered math if possible. + if(${PREFIX}ENABLE_FASTMATH) + target_compile_options(${TARGET_NAME} PRIVATE "/fp:fast") + else() + target_compile_options(${TARGET_NAME} PRIVATE "/fp:precise") + if(MSVC_VERSION GREATER 1930) + # Keep original behavior in VS2022 and up. + target_compile_options(${TARGET_NAME} PRIVATE "/fp:contract") + endif() endif() - endif() - - # - Disable incremental builds - target_compile_options(${PROJECT_NAME} PRIVATE "/INCREMENTAL:NO") - # - Enable C++ exceptions with SEH exceptions. - target_compile_options(${PROJECT_NAME} PRIVATE "/EHa") - - # - Enable multi-processor compiling. - target_compile_options(${PROJECT_NAME} PRIVATE "/MP") - - # - Enable updated __cplusplus macro - target_compile_options(${PROJECT_NAME} PRIVATE "/Zc:__cplusplus") - - # - Generic Optimizations for Release/RelWithDebInfo/MinSizeRel - set(FLAGS - "/OPT:REF" - "/OPT:ICF=3" - "/GL" - "/Gy" - "/GF" - "/Ox" - "/Ob3" - ) - foreach(FLAG ${FLAGS}) - target_compile_options(${PROJECT_NAME} PRIVATE "$<$:${FLAG}>") - endforeach() -elseif(D_PLATFORM_LINUX AND ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))) - # GCC/Clang - message(STATUS "Applying custom flags for GCC/Clang style build.") - - # - Enable all warnings. - target_compile_options(${PROJECT_NAME} PRIVATE "-Wall") - target_compile_options(${PROJECT_NAME} PRIVATE "-Wextra") - - # - Disable useless warnings - set(DISABLED_WARNINGS - # Don't warn about unused variables, parameters, labels, functions, or typedefs. - "unused-function" - "unused-label" - "unused-local-typedefs" - "unused-parameter" - "unused-result" - "unused-const-variable" - "unused-variable" - "unused-value" - # Don't warn about unreferenced variables or parameters which are assigned/initialized. - "unused-but-set-parameter" - "unused-but-set-variable" - # Don't warn about not-explicitly-handled enumeration identifiers - "switch" - # Ignore automatic padding warnings. - "padded" - # Ignore implicit '= delete;'. - # Ignore extra arguments for printf - "format-extra-args" - # Ignore undefined, unused or unreferenced pre-processor macros - "unused-macros" - ) - foreach(WARN ${DISABLED_WARNINGS}) - target_compile_options(${PROJECT_NAME} PRIVATE "-Wno-${WARN}") - endforeach() - - # - Require enabled instruction sets. - if(${PREFIX}TARGET_NATIVE) - target_compile_options(${PROJECT_NAME} PRIVATE - "-march=native" + # - Disable incremental builds + target_compile_options(${TARGET_NAME} PRIVATE "/INCREMENTAL:NO") + + # - Enable C++ exceptions with SEH exceptions. + target_compile_options(${TARGET_NAME} PRIVATE "/EHa") + + # - Enable multi-processor compiling. + target_compile_options(${TARGET_NAME} PRIVATE "/MP") + + # - Enable updated __cplusplus macro + target_compile_options(${TARGET_NAME} PRIVATE "/Zc:__cplusplus") + elseif(D_PLATFORM_LINUX AND ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))) + # GCC/Clang + + # - Enable all warnings. + target_compile_options(${TARGET_NAME} PRIVATE "-Wall") + target_compile_options(${TARGET_NAME} PRIVATE "-Wextra") + + # - Disable useless warnings + set(DISABLED_WARNINGS + # Don't warn about unused variables, parameters, labels, functions, or typedefs. + "unused-function" + "unused-label" + "unused-local-typedefs" + "unused-parameter" + "unused-result" + "unused-const-variable" + "unused-variable" + "unused-value" + # Don't warn about unreferenced variables or parameters which are assigned/initialized. + "unused-but-set-parameter" + "unused-but-set-variable" + # Don't warn about not-explicitly-handled enumeration identifiers + "switch" + # Ignore automatic padding warnings. + "padded" + # Ignore implicit '= delete;'. + # Ignore extra arguments for printf + "format-extra-args" + # Ignore undefined, unused or unreferenced pre-processor macros + "unused-macros" ) - message(WARNING "Targeting native architecture. Binaries will not be distributable to other systems!") - elseif(D_PLATFORM_ARCH_X86) - if(${PREFIX}TARGET_X86_64_V4) - target_compile_options(${PROJECT_NAME} PRIVATE - "-march=x86-64-v4" - ) - message(STATUS "Targeting x86-64-v4.") - elseif(${PREFIX}TARGET_X86_64_V3) - target_compile_options(${PROJECT_NAME} PRIVATE - "-march=x86-64-v3" - ) - message(STATUS "Targeting x86-64-v3.") - elseif(${PREFIX}TARGET_X86_64_V2_EX) - target_compile_options(${PROJECT_NAME} PRIVATE - "-march=x86-64-v2" - "-mavx" - "-mbmi2" - "-mbmi" - "-mfma" - "-mf16c" - "-mmovbe" - "-mpclmul" - "-mpopcnt" - ) - message(STATUS "Targeting extended x86-64-v2.") - elseif(${PREFIX}TARGET_X86_64_V2) - target_compile_options(${PROJECT_NAME} PRIVATE - "-march=x86-64-v2" - ) - message(STATUS "Targeting x86-64-v2.") - elseif(${PREFIX}TARGET_X86_64) - target_compile_options(${PROJECT_NAME} PRIVATE - "-march=x86-64" + foreach(WARN ${DISABLED_WARNINGS}) + target_compile_options(${TARGET_NAME} PRIVATE "-Wno-${WARN}") + endforeach() + + # - Require enabled instruction sets. + if(${PREFIX}TARGET_NATIVE) + target_compile_options(${TARGET_NAME} PRIVATE + "-march=native" ) - message(STATUS "Targeting x86-64.") + elseif(D_PLATFORM_ARCH_X86) + if(${PREFIX}TARGET_X86_64_V4) + target_compile_options(${TARGET_NAME} PRIVATE + "-march=x86-64-v4" + ) + elseif(${PREFIX}TARGET_X86_64_V3) + target_compile_options(${TARGET_NAME} PRIVATE + "-march=x86-64-v3" + ) + elseif(${PREFIX}TARGET_X86_64_V2_EX) + target_compile_options(${TARGET_NAME} PRIVATE + "-march=x86-64-v2" + "-mavx" + "-mbmi2" + "-mbmi" + "-mfma" + "-mf16c" + "-mmovbe" + "-mpclmul" + "-mpopcnt" + ) + elseif(${PREFIX}TARGET_X86_64_V2) + target_compile_options(${TARGET_NAME} PRIVATE + "-march=x86-64-v2" + ) + elseif(${PREFIX}TARGET_X86_64) + target_compile_options(${TARGET_NAME} PRIVATE + "-march=x86-64" + ) + endif() + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_compile_options(${TARGET_NAME} PRIVATE + "-mtune=generic" + ) + else() + target_compile_options(${TARGET_NAME} PRIVATE + "-mtune=x86-64" + ) + endif() endif() - if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - target_compile_options(${PROJECT_NAME} PRIVATE - "-mtune=generic" - ) + + # - Use fast unordered math if possible. + if(${PREFIX}ENABLE_FASTMATH) + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_compile_options(${TARGET_NAME} PRIVATE + "-ffast-math" + ) + else() + target_compile_options(${TARGET_NAME} PRIVATE + "-ffp-model=fast" + ) + endif() else() - target_compile_options(${PROJECT_NAME} PRIVATE - "-mtune=x86-64" + target_compile_options(${TARGET_NAME} PRIVATE + "-ffp-model=precise" ) endif() - endif() - # - Use fast unordered math if possible. - if(${PREFIX}ENABLE_FASTMATH) - if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - target_compile_options(${PROJECT_NAME} PRIVATE - "-ffast-math" - ) - else() - target_compile_options(${PROJECT_NAME} PRIVATE - "-ffp-model=fast" + # - Don't export by default, require attributes. + # add_compile_options("-fvisibility=hidden") + elseif(D_PLATFORM_MAC AND (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")) + # AppleClang + + # - Enable most useful warnings. + target_compile_options(${TARGET_NAME} PRIVATE "-Wall") + target_compile_options(${TARGET_NAME} PRIVATE "-Wextra") + + # - Require enabled instruction sets. + if(${PREFIX}TARGET_NATIVE) + target_compile_options(${TARGET_NAME} PRIVATE + "-march=native" ) + message(WARNING "Targeting native architecture. Binaries will not be distributable to other systems!") endif() - else() - target_compile_options(${PROJECT_NAME} PRIVATE - "-ffp-model=precise" - ) - endif() - - # - Don't export by default, require attributes. - # add_compile_options("-fvisibility=hidden") -elseif(D_PLATFORM_MAC AND (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")) - # AppleClang - message(STATUS "Applying custom flags for AppleClang style build.") - # - Enable most useful warnings. - target_compile_options(${PROJECT_NAME} PRIVATE "-Wall") - target_compile_options(${PROJECT_NAME} PRIVATE "-Wextra") + # - Use fast unordered math if possible. + # FIXME: Appears to not be supported. - # - Require enabled instruction sets. - if(${PREFIX}TARGET_NATIVE) - target_compile_options(${PROJECT_NAME} PRIVATE - "-march=native" - ) - message(WARNING "Targeting native architecture. Binaries will not be distributable to other systems!") + # - Don't export by default, require attributes. + # add_compile_options("-fvisibility=hidden") endif() + + # Enable Qt if needed + set_target_properties(${TARGET_NAME} PROPERTIES + AUTOUIC ON + AUTOUIC_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_SOURCE_DIR}/ui" + AUTOMOC ON + AUTORCC ON + AUTOGEN_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated" + ) + + # Extras: Clang + #is_feature_enabled(CLANG T_CHECK) + #if(T_CHECK) + # generate_compile_commands_json( + # TARGETS ${TARGET_NAME} + # ) + # clang_tidy( + # TARGETS ${TARGET_NAME} + # VERSION 14.0.0 + # ) + # clang_format( + # TARGETS ${TARGET_NAME} + # DEPENDENCY + # VERSION 14.0.0 + # ) + #endif() +endfunction() - # - Use fast unordered math if possible. - # FIXME: Appears to not be supported. +set(${PREFIX}COMPONENTS "") +function(streamfx_add_component COMPONENT_NAME) + # Sanitize the component name by trimming whitespace. + string(REGEX REPLACE "^[ \t]+" "" COMPONENT_NAME "${COMPONENT_NAME}") + string(REGEX REPLACE "[ \t]+$" "" COMPONENT_NAME "${COMPONENT_NAME}") + + # Generate a sanitized version of the component name for use in targets and options. + string(REGEX REPLACE "[^a-zA-Z0-9_-]+" "_" COMPONENT_SANITIZED_NAME "${COMPONENT_NAME}") + string(REGEX REPLACE "_[_]+" "_" COMPONENT_SANITIZED_NAME "${COMPONENT_SANITIZED_NAME}") + + # Convert the sanitized version to upper case. + string(TOUPPER "${COMPONENT_SANITIZED_NAME}" COMPONENT_OPTION_NAME) + set(COMPONENT_OPTION "${PREFIX}COMPONENT_${COMPONENT_OPTION_NAME}" PARENT_SCOPE) + + # Define the necessary targets. + set(COMPONENT_TARGET "${PROJECT_NAME}_${COMPONENT_SANITIZED_NAME}") + set(COMPONENT_TARGET "${PROJECT_NAME}_${COMPONENT_SANITIZED_NAME}" PARENT_SCOPE) + set(COMPONENT_ALIAS "${PROJECT_NAME}::${COMPONENT_SANITIZED_NAME}") + set(COMPONENT_ALIAS "${PROJECT_NAME}::${COMPONENT_SANITIZED_NAME}" PARENT_SCOPE) + + streamfx_add_library(${COMPONENT_TARGET} STATIC) + add_library(${COMPONENT_ALIAS} ALIAS ${COMPONENT_TARGET}) + set_target_properties(${COMPONENT_TARGET} PROPERTIES + COMPONENT_LABEL "${COMPONENT_LABEL}" + COMPONENT_NAME "${COMPONENT_ALIAS}" + COMPONENT_OPTION "${COMPONENT_OPTION_NAME}" + ) + + # Register the component globally. + list(APPEND ${PREFIX}COMPONENTS "${COMPONENT_TARGET}") + + # Allow disabling this component. + set(${PREFIX}COMPONENT_${COMPONENT_OPTION_NAME} CACHE BOOL "Enable the ${COMPONENT_NAME} component?") + + # Add files in common places. + file(GLOB_RECURSE TEMPLATES FOLLOW_SYMLINKS CONFIGURE_DEPENDS "templates/*") + source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/templates" PREFIX "Templates" FILES ${TEMPLATES}) + + file(GLOB_RECURSE SOURCE_PRIVATE FOLLOW_SYMLINKS CONFIGURE_DEPENDS "ui/*") + source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/ui" PREFIX "User-Interface Files" FILES ${UI_PRIVATE}) + + file(GLOB_RECURSE SOURCE_PRIVATE FOLLOW_SYMLINKS CONFIGURE_DEPENDS "source/*") + source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/source" PREFIX "Private Files" FILES ${SOURCE_PRIVATE}) + file(GLOB_RECURSE GENERATED_PRIVATE FOLLOW_SYMLINKS CONFIGURE_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/source/*") + source_group(TREE "${CMAKE_CURRENT_BINARY_DIR}/source" PREFIX "Private Files/Generated" FILES ${GENERATED_PRIVATE}) + + file(GLOB_RECURSE SOURCE_PUBLIC FOLLOW_SYMLINKS CONFIGURE_DEPENDS "include/*") + source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/include" PREFIX "Public Files" FILES ${SOURCE_PUBLIC}) + file(GLOB_RECURSE GENERATED_PUBLIC FOLLOW_SYMLINKS CONFIGURE_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/include/*") + source_group(TREE "${CMAKE_CURRENT_BINARY_DIR}/include" PREFIX "Public Files/Generated" FILES ${GENERATED_PUBLIC}) + + target_sources(${COMPONENT_TARGET} + PRIVATE + ${TEMPLATES} + ${UI_PRIVATE} + ${SOURCE_PRIVATE} + ${GENERATED_PRIVATE} + PUBLIC + ${SOURCE_PUBLIC} + ${GENERATED_PUBLIC} + ) + + # Ignore data only files. + set_source_files_properties( + ${TEMPLATES} + ${UI_PRIVATE} + PROPERTIES + HEADER_FILE_ONLY ON + ) + + set_source_files_properties( + ${TEMPLATES} + ${SOURCE_PRIVATE} + ${GENERATED_PRIVATE} + ${SOURCE_PUBLIC} + ${GENERATED_PUBLIC} + PROPERTIES + SKIP_AUTOGEN ON + SKIP_AUTOMOC ON + SKIP_AUTORCC ON + SKIP_AUTOUIC ON + ) +endfunction() - # - Don't export by default, require attributes. - # add_compile_options("-fvisibility=hidden") -endif() +# Use this to add a dependency on another component, +function(streamfx_add_component_dependency COMPONENT_NAME) + -# Remove prefix on other platforms. -set_target_properties(${PROJECT_NAME} PROPERTIES - PREFIX "" - IMPORT_PREFIX "" -) +endfunction() + +################################################################################ +# Register Library +################################################################################ +streamfx_add_library(${PROJECT_NAME} MODULE) # We are a module for libOBS. # Set file version set_target_properties(${PROJECT_NAME} PROPERTIES @@ -1937,17 +2000,6 @@ set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${PROJECT_VERSION} ) -# Enable Qt if needed -if(Qt5_FOUND OR Qt6_FOUND) - set_target_properties(${PROJECT_NAME} PROPERTIES - AUTOUIC ON - AUTOUIC_SEARCH_PATHS "${PROJECT_SOURCE_DIR};${PROJECT_SOURCE_DIR}/ui" - AUTOMOC ON - AUTORCC ON - AUTOGEN_BUILD_DIR "${PROJECT_BINARY_DIR}/generated" - ) -endif() - # Windows exclusive changes if(D_PLATFORM_WINDOWS) foreach(DELAYLOAD ${PROJECT_LIBRARIES_DELAYED}) @@ -2013,259 +2065,300 @@ if(D_PLATFORM_MAC) endif() ################################################################################ -# Extra Tools -################################################################################ - -# Clang -is_feature_enabled(CLANG T_CHECK) -if(T_CHECK) - generate_compile_commands_json( - TARGETS ${PROJECT_NAME} - ) - clang_tidy( - TARGETS ${PROJECT_NAME} - VERSION 14.0.0 - ) - clang_format( - TARGETS ${PROJECT_NAME} - DEPENDENCY - VERSION 14.0.0 - ) -endif() - -################################################################################ -# Installation +# Add Core ################################################################################ +streamfx_add_library(${PROJECT_NAME}_Core STATIC EXCLUDE_FROM_ALL) +add_library(${PROJECT_NAME}::Core ALIAS ${PROJECT_NAME}_Core) +target_link_libraries(${PROJECT_NAME} PRIVATE ${PROJECT_NAME}::Core) -if(STANDALONE) - if(STRUCTURE_UNIFIED) - install( - DIRECTORY "data/" - DESTINATION "data/" - FILE_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - DIRECTORY_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - ) - - if(D_PLATFORM_WINDOWS) - install( - TARGETS ${PROJECT_NAME} - RUNTIME DESTINATION "bin/windows-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX - LIBRARY DESTINATION "bin/windows-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX - PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - ) - if(MSVC) - install( - FILES $ - DESTINATION "bin/windows-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" - COMPONENT StreamFX - OPTIONAL - ) - endif() - - # Dependency: AOM - if(HAVE_AOM AND AOM_BINARY AND D_PLATFORM_WINDOWS) - install( - FILES ${AOM_BINARY} - DESTINATION "data/" COMPONENT StreamFX - ) - endif() - elseif(D_PLATFORM_LINUX) - install( - TARGETS ${PROJECT_NAME} - RUNTIME DESTINATION "bin/linux-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX - LIBRARY DESTINATION "bin/linux-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX - PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - ) - elseif(D_PLATFORM_MAC) - install( - TARGETS ${PROJECT_NAME} - RUNTIME DESTINATION "bin/mac-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX - LIBRARY DESTINATION "bin/mac-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX - PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - ) - endif() - - install( - FILES LICENSE - DESTINATION "LICENSE" - COMPONENT StreamFX - ) - install( - FILES icon.png - DESTINATION "icon.png" - COMPONENT StreamFX - ) - elseif(D_PLATFORM_WINDOWS) - install( - TARGETS ${PROJECT_NAME} - RUNTIME DESTINATION "obs-plugins/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX - LIBRARY DESTINATION "obs-plugins/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX - ) - install( - DIRECTORY "data/" - DESTINATION "data/obs-plugins/${PROJECT_NAME}/" - ) - if(MSVC) - install( - FILES $ - DESTINATION "obs-plugins/${D_PLATFORM_BITS}bit/" - OPTIONAL - ) - endif() +# Combine all variables that matter. +set(PROJECT_FILES + # Always exist + ${PROJECT_DATA} + ${PROJECT_PRIVATE_GENERATED} + ${PROJECT_PRIVATE_SOURCE} + ${PROJECT_TEMPLATES} + # UI-only (empty if not enabled) + ${PROJECT_UI} + ${PROJECT_UI_SOURCE} + # Media + ${PROJECT_MEDIA} +) - # Dependency: AOM - if(HAVE_AOM AND AOM_BINARY) - install( - FILES "${AOM_BINARY}" - DESTINATION "data/obs-plugins/${PROJECT_NAME}/" COMPONENT StreamFX - ) - endif() - elseif(D_PLATFORM_LINUX) - if(STRUCTURE_PACKAGEMANAGER) - install( - TARGETS ${PROJECT_NAME} - RUNTIME DESTINATION "lib/obs-plugins/" COMPONENT StreamFX - LIBRARY DESTINATION "lib/obs-plugins/" COMPONENT StreamFX - PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - ) - install( - DIRECTORY "data/" - DESTINATION "share/obs/obs-plugins/${PROJECT_NAME}" - COMPONENT StreamFX - FILE_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - DIRECTORY_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - ) - else() - install( - TARGETS ${PROJECT_NAME} - RUNTIME DESTINATION "plugins/${PROJECT_NAME}/bin/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX - LIBRARY DESTINATION "plugins/${PROJECT_NAME}/bin/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX - PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - ) - install( - DIRECTORY "data/" - DESTINATION "plugins/${PROJECT_NAME}/data/" - COMPONENT StreamFX - FILE_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - DIRECTORY_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - ) - endif() - elseif(D_PLATFORM_MAC) - if(STRUCTURE_BUNDLE) - install( - TARGETS ${PROJECT_NAME} - RUNTIME DESTINATION "." COMPONENT StreamFX - LIBRARY DESTINATION "." COMPONENT StreamFX - BUNDLE DESTINATION "." COMPONENT StreamFX - PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - ) - else() - install( - TARGETS ${PROJECT_NAME} - RUNTIME DESTINATION "${PROJECT_NAME}/bin/" COMPONENT StreamFX - LIBRARY DESTINATION "${PROJECT_NAME}/bin/" COMPONENT StreamFX - PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - ) - install( - DIRECTORY "data/" - DESTINATION "${PROJECT_NAME}/data/" - COMPONENT StreamFX - FILE_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - DIRECTORY_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - ) - endif() - endif() -else() - if(COMMAND setup_plugin_target) - setup_plugin_target(${PROJECT_NAME}) - # Seems like we lost the ability to customize which directoy resources are in, and instead are forced to use '/data'. +# Set source groups for IDE generators. +source_group(TREE "${PROJECT_SOURCE_DIR}/data" PREFIX "Data" FILES ${PROJECT_DATA}) +source_group(TREE "${PROJECT_SOURCE_DIR}/source" PREFIX "Source" FILES ${PROJECT_PRIVATE_SOURCE} ${PROJECT_UI_SOURCE}) +source_group(TREE "${PROJECT_BINARY_DIR}/generated" PREFIX "Source" FILES ${PROJECT_PRIVATE_GENERATED}) +source_group(TREE "${PROJECT_SOURCE_DIR}/templates" PREFIX "Templates" FILES ${PROJECT_TEMPLATES}) +source_group(TREE "${PROJECT_SOURCE_DIR}/ui" PREFIX "User Interface" FILES ${PROJECT_UI}) +source_group(TREE "${PROJECT_SOURCE_DIR}/media" PREFIX "Media" FILES ${PROJECT_MEDIA}) - if(HAVE_AOM AND AOM_BINARY) # Dependency: AOM - add_target_resource(${PROJECT_NAME} "${AOM_BINARY}" "obs-plugins/${PROJECT_NAME}") - endif() - elseif(COMMAND install_obs_plugin_with_data) - install_obs_plugin_with_data(${PROJECT_NAME} data) +# Prevent unwanted files from being built as source. +set_source_files_properties(${PROJECT_DATA} ${PROJECT_TEMPLATES} ${PROJECT_UI} ${PROJECT_MEDIA} PROPERTIES + HEADER_FILE_ONLY ON +) - if(HAVE_AOM AND AOM_BINARY) # Dependency: AOM - install( - FILES "${AOM_BINARY}" - DESTINATION "${OBS_DATA_DESTINATION}/obs-plugins/${PROJECT_NAME}" - ) - add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E copy - "${AOM_BINARY}" - "${OBS_DATA_DESTINATION}/obs-plugins/${PROJECT_NAME}" - VERBATIM) - endif() - endif() +# Prevent non-UI files from being Qt'd +if(Qt5_Found OR Qt6_FOUND) + set_source_files_properties(${PROJECT_DATA} ${PROJECT_TEMPLATES} ${PROJECT_MEDIA} ${PROJECT_PRIVATE_GENERATED} ${PROJECT_PRIVATE_SOURCE} PROPERTIES + SKIP_AUTOGEN ON + SKIP_AUTOMOC ON + SKIP_AUTORCC ON + SKIP_AUTOUIC ON + ) endif() +# Register the library +target_sources(${PROJECT_NAME}_Core PRIVATE ${PROJECT_FILES}) +target_link_libraries(${PROJECT_NAME}_Core PRIVATE ${PROJECT_LIBRARIES}) +target_include_directories(${PROJECT_NAME}_Core PRIVATE ${PROJECT_INCLUDE_DIRS}) +target_compile_definitions(${PROJECT_NAME}_Core PRIVATE ${PROJECT_DEFINITIONS}) + ################################################################################ -# Packaging +# Components ################################################################################ - -if(STANDALONE) - # Packaging - if(NOT PACKAGE_SUFFIX) - set(_PACKAGE_SUFFIX_OVERRIDE "${_VERSION_THIN}") - else() - set(_PACKAGE_SUFFIX_OVERRIDE "${PACKAGE_SUFFIX}") - endif() - set(_PACKAGE_FULL_NAME "${PACKAGE_PREFIX}/${PACKAGE_NAME}-${_PACKAGE_SUFFIX_OVERRIDE}") - - if(STRUCTURE_UNIFIED) - add_custom_target( - PACKAGE_ZIP - ${CMAKE_COMMAND} -E tar cfv "${_PACKAGE_FULL_NAME}.obs" --format=zip -- - "." - WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}" - ) - else() - add_custom_target( - PACKAGE_7Z - ${CMAKE_COMMAND} -E tar cfv "${_PACKAGE_FULL_NAME}.7z" --format=7zip -- - "." - WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}" - ) - add_custom_target( - PACKAGE_ZIP - ${CMAKE_COMMAND} -E tar cfv "${_PACKAGE_FULL_NAME}.zip" --format=zip -- - "." - WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}" - ) - - # Windows - if(D_PLATFORM_WINDOWS) - ## Installer (InnoSetup) - get_filename_component(ISS_FILES_DIR "${CMAKE_INSTALL_PREFIX}" ABSOLUTE) - file(TO_NATIVE_PATH "${ISS_FILES_DIR}" ISS_FILES_DIR) - - get_filename_component(ISS_PACKAGE_DIR "${PACKAGE_PREFIX}" ABSOLUTE) - file(TO_NATIVE_PATH "${ISS_PACKAGE_DIR}" ISS_PACKAGE_DIR) - - get_filename_component(ISS_SOURCE_DIR "${PROJECT_SOURCE_DIR}" ABSOLUTE) - file(TO_NATIVE_PATH "${ISS_SOURCE_DIR}" ISS_SOURCE_DIR) - - get_filename_component(ISS_MSVCHELPER_PATH "${msvc-redist-helper_BUILD_DIR}" ABSOLUTE) - file(TO_NATIVE_PATH "${ISS_MSVCHELPER_PATH}" ISS_MSVCHELPER_PATH) - - configure_file( - "templates/windows/installer.iss.in" - "installer.iss" - ) - endif() - - # Apple MacOS - if(D_PLATFORM_MAC) - # .pkg Installer - set(PACKAGES_PATH_NAME "${PROJECT_NAME}") - if(STRUCTURE_BUNDLE) - set(PACKAGES_PATH_NAME "${PACKAGES_PATH_NAME}.plugin") - endif() - configure_file( - "templates/macos/installer.pkgproj.in" - "installer.pkgproj" - ) - endif() - endif() -endif() +# As the above monolithic approach started to show its weaknesses, it was time +# for an improved system which suffers under less issues. This new component +# system should address the main necessary parts, + +file(GLOB COMPONENTS RELATIVE ${PROJECT_SOURCE_DIR} CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/components/*) +foreach(COMPONENT ${COMPONENTS}) + add_subdirectory(${COMPONENT} EXCLUDE_FROM_ALL) +endforeach() + +# ################################################################################ +# # Installation +# ################################################################################ + +# if(STANDALONE) +# if(STRUCTURE_UNIFIED) +# install( +# DIRECTORY "data/" +# DESTINATION "data/" +# FILE_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE +# DIRECTORY_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE +# ) + +# if(D_PLATFORM_WINDOWS) +# install( +# TARGETS ${PROJECT_NAME} +# RUNTIME DESTINATION "bin/windows-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX +# LIBRARY DESTINATION "bin/windows-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX +# PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE +# ) +# if(MSVC) +# install( +# FILES $ +# DESTINATION "bin/windows-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" +# COMPONENT StreamFX +# OPTIONAL +# ) +# endif() + +# # Dependency: AOM +# if(HAVE_AOM AND AOM_BINARY AND D_PLATFORM_WINDOWS) +# install( +# FILES ${AOM_BINARY} +# DESTINATION "data/" COMPONENT StreamFX +# ) +# endif() +# elseif(D_PLATFORM_LINUX) +# install( +# TARGETS ${PROJECT_NAME} +# RUNTIME DESTINATION "bin/linux-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX +# LIBRARY DESTINATION "bin/linux-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX +# PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE +# ) +# elseif(D_PLATFORM_MAC) +# install( +# TARGETS ${PROJECT_NAME} +# RUNTIME DESTINATION "bin/mac-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX +# LIBRARY DESTINATION "bin/mac-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX +# PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE +# ) +# endif() + +# install( +# FILES LICENSE +# DESTINATION "LICENSE" +# COMPONENT StreamFX +# ) +# install( +# FILES icon.png +# DESTINATION "icon.png" +# COMPONENT StreamFX +# ) +# elseif(D_PLATFORM_WINDOWS) +# install( +# TARGETS ${PROJECT_NAME} +# RUNTIME DESTINATION "obs-plugins/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX +# LIBRARY DESTINATION "obs-plugins/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX +# ) +# install( +# DIRECTORY "data/" +# DESTINATION "data/obs-plugins/${PROJECT_NAME}/" +# ) +# if(MSVC) +# install( +# FILES $ +# DESTINATION "obs-plugins/${D_PLATFORM_BITS}bit/" +# OPTIONAL +# ) +# endif() + +# # Dependency: AOM +# if(HAVE_AOM AND AOM_BINARY) +# install( +# FILES "${AOM_BINARY}" +# DESTINATION "data/obs-plugins/${PROJECT_NAME}/" COMPONENT StreamFX +# ) +# endif() +# elseif(D_PLATFORM_LINUX) +# if(STRUCTURE_PACKAGEMANAGER) +# install( +# TARGETS ${PROJECT_NAME} +# RUNTIME DESTINATION "lib/obs-plugins/" COMPONENT StreamFX +# LIBRARY DESTINATION "lib/obs-plugins/" COMPONENT StreamFX +# PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE +# ) +# install( +# DIRECTORY "data/" +# DESTINATION "share/obs/obs-plugins/${PROJECT_NAME}" +# COMPONENT StreamFX +# FILE_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE +# DIRECTORY_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE +# ) +# else() +# install( +# TARGETS ${PROJECT_NAME} +# RUNTIME DESTINATION "plugins/${PROJECT_NAME}/bin/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX +# LIBRARY DESTINATION "plugins/${PROJECT_NAME}/bin/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX +# PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE +# ) +# install( +# DIRECTORY "data/" +# DESTINATION "plugins/${PROJECT_NAME}/data/" +# COMPONENT StreamFX +# FILE_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE +# DIRECTORY_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE +# ) +# endif() +# elseif(D_PLATFORM_MAC) +# if(STRUCTURE_BUNDLE) +# install( +# TARGETS ${PROJECT_NAME} +# RUNTIME DESTINATION "." COMPONENT StreamFX +# LIBRARY DESTINATION "." COMPONENT StreamFX +# BUNDLE DESTINATION "." COMPONENT StreamFX +# PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE +# ) +# else() +# install( +# TARGETS ${PROJECT_NAME} +# RUNTIME DESTINATION "${PROJECT_NAME}/bin/" COMPONENT StreamFX +# LIBRARY DESTINATION "${PROJECT_NAME}/bin/" COMPONENT StreamFX +# PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE +# ) +# install( +# DIRECTORY "data/" +# DESTINATION "${PROJECT_NAME}/data/" +# COMPONENT StreamFX +# FILE_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE +# DIRECTORY_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE +# ) +# endif() +# endif() +# else() +# if(COMMAND setup_plugin_target) +# setup_plugin_target(${PROJECT_NAME}) +# # Seems like we lost the ability to customize which directoy resources are in, and instead are forced to use '/data'. + +# if(HAVE_AOM AND AOM_BINARY) # Dependency: AOM +# add_target_resource(${PROJECT_NAME} "${AOM_BINARY}" "obs-plugins/${PROJECT_NAME}") +# endif() +# elseif(COMMAND install_obs_plugin_with_data) +# install_obs_plugin_with_data(${PROJECT_NAME} data) + +# if(HAVE_AOM AND AOM_BINARY) # Dependency: AOM +# install( +# FILES "${AOM_BINARY}" +# DESTINATION "${OBS_DATA_DESTINATION}/obs-plugins/${PROJECT_NAME}" +# ) +# add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD +# COMMAND "${CMAKE_COMMAND}" -E copy +# "${AOM_BINARY}" +# "${OBS_DATA_DESTINATION}/obs-plugins/${PROJECT_NAME}" +# VERBATIM) +# endif() +# endif() +# endif() + +# ################################################################################ +# # Packaging +# ################################################################################ + +# if(STANDALONE) +# # Packaging +# if(NOT PACKAGE_SUFFIX) +# set(_PACKAGE_SUFFIX_OVERRIDE "${_VERSION_THIN}") +# else() +# set(_PACKAGE_SUFFIX_OVERRIDE "${PACKAGE_SUFFIX}") +# endif() +# set(_PACKAGE_FULL_NAME "${PACKAGE_PREFIX}/${PACKAGE_NAME}-${_PACKAGE_SUFFIX_OVERRIDE}") + +# if(STRUCTURE_UNIFIED) +# add_custom_target( +# PACKAGE_ZIP +# ${CMAKE_COMMAND} -E tar cfv "${_PACKAGE_FULL_NAME}.obs" --format=zip -- +# "." +# WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}" +# ) +# else() +# add_custom_target( +# PACKAGE_7Z +# ${CMAKE_COMMAND} -E tar cfv "${_PACKAGE_FULL_NAME}.7z" --format=7zip -- +# "." +# WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}" +# ) +# add_custom_target( +# PACKAGE_ZIP +# ${CMAKE_COMMAND} -E tar cfv "${_PACKAGE_FULL_NAME}.zip" --format=zip -- +# "." +# WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}" +# ) + +# # Windows +# if(D_PLATFORM_WINDOWS) +# ## Installer (InnoSetup) +# get_filename_component(ISS_FILES_DIR "${CMAKE_INSTALL_PREFIX}" ABSOLUTE) +# file(TO_NATIVE_PATH "${ISS_FILES_DIR}" ISS_FILES_DIR) + +# get_filename_component(ISS_PACKAGE_DIR "${PACKAGE_PREFIX}" ABSOLUTE) +# file(TO_NATIVE_PATH "${ISS_PACKAGE_DIR}" ISS_PACKAGE_DIR) + +# get_filename_component(ISS_SOURCE_DIR "${PROJECT_SOURCE_DIR}" ABSOLUTE) +# file(TO_NATIVE_PATH "${ISS_SOURCE_DIR}" ISS_SOURCE_DIR) + +# get_filename_component(ISS_MSVCHELPER_PATH "${msvc-redist-helper_BUILD_DIR}" ABSOLUTE) +# file(TO_NATIVE_PATH "${ISS_MSVCHELPER_PATH}" ISS_MSVCHELPER_PATH) + +# configure_file( +# "templates/windows/installer.iss.in" +# "installer.iss" +# ) +# endif() + +# # Apple MacOS +# if(D_PLATFORM_MAC) +# # .pkg Installer +# set(PACKAGES_PATH_NAME "${PROJECT_NAME}") +# if(STRUCTURE_BUNDLE) +# set(PACKAGES_PATH_NAME "${PACKAGES_PATH_NAME}.plugin") +# endif() +# configure_file( +# "templates/macos/installer.pkgproj.in" +# "installer.pkgproj" +# ) +# endif() +# endif() +# endif() From 25ba51df129e55ba2504846b48cd57ba2b6fc3bb Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 3 Sep 2023 12:09:57 +0200 Subject: [PATCH 02/66] code: Throw an error on nullptr for util::library::load --- source/util/util-library.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/util/util-library.cpp b/source/util/util-library.cpp index 7c733e9c31..100cc9847b 100644 --- a/source/util/util-library.cpp +++ b/source/util/util-library.cpp @@ -102,6 +102,10 @@ std::shared_ptr<::streamfx::util::library> streamfx::util::library::load(std::st std::shared_ptr<::streamfx::util::library> streamfx::util::library::load(obs_module_t* instance) { + if (!instance) { + throw std::runtime_error("Can't load nullptr as a library."); + } + // Get an absolute path to the module. auto path = std::filesystem::absolute(std::filesystem::u8path(obs_get_module_binary_path(instance))); From 9021274297e5207fa388974686b06d4612b45875 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 3 Sep 2023 13:28:08 +0200 Subject: [PATCH 03/66] cmake: Fix up missing linked objects in component system We should always link the whole object, even if nothing is needed by the module itself. --- CMakeLists.txt | 101 +++++++++++++++++++++++++++------------------- source/plugin.cpp | 2 + 2 files changed, 61 insertions(+), 42 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c616cb6ee9..94701b0b42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -874,21 +874,6 @@ configure_file( ) LIST(APPEND PROJECT_TEMPLATES "templates/module.cpp.in") LIST(APPEND PROJECT_PRIVATE_GENERATED "${PROJECT_BINARY_DIR}/generated/module.cpp") - -if(D_PLATFORM_WINDOWS) # Windows Support - set(PROJECT_PRODUCT_NAME "${PROJECT_FULL_NAME}") - set(PROJECT_COMPANY_NAME "${PROJECT_AUTHORS}") - set(PROJECT_COPYRIGHT "${PROJECT_AUTHORS} © ${PROJECT_COPYRIGHT_YEARS}") - set(PROJECT_LEGAL_TRADEMARKS_1 "") - set(PROJECT_LEGAL_TRADEMARKS_2 "") - - configure_file( - "templates/windows/version.rc.in" - "generated/version.rc" - ) - LIST(APPEND PROJECT_PRIVATE_GENERATED "${PROJECT_BINARY_DIR}/generated/version.rc") -endif() - # Minimum Dependencies list(APPEND PROJECT_LIBRARIES OBS::libobs) @@ -1918,6 +1903,7 @@ function(streamfx_add_component COMPONENT_NAME) set(COMPONENT_ALIAS "${PROJECT_NAME}::${COMPONENT_SANITIZED_NAME}" PARENT_SCOPE) streamfx_add_library(${COMPONENT_TARGET} STATIC) + target_link_libraries(${COMPONENT_TARGET} PUBLIC ${PROJECT_NAME}::Core) add_library(${COMPONENT_ALIAS} ALIAS ${COMPONENT_TARGET}) set_target_properties(${COMPONENT_TARGET} PROPERTIES COMPONENT_LABEL "${COMPONENT_LABEL}" @@ -1982,9 +1968,10 @@ function(streamfx_add_component COMPONENT_NAME) endfunction() # Use this to add a dependency on another component, -function(streamfx_add_component_dependency COMPONENT_NAME) - - +function(streamfx_add_component_dependency _NAME) + get_target_property(DEPENDS ${COMPONENT_TARGET} COMPONENT_DEPENDS) + list(APPEND DEPENDS "${_NAME}") + set_target_properties(${COMPONENT_TARGET} PROPERTIES COMPONENT_DEPENDS "${DEPENDS}") endfunction() ################################################################################ @@ -1992,6 +1979,30 @@ endfunction() ################################################################################ streamfx_add_library(${PROJECT_NAME} MODULE) # We are a module for libOBS. +target_include_directories(${PROJECT_NAME} PRIVATE + "source" + "include" + "${PROJECT_BINARY_DIR}/generated" +) + +if(D_PLATFORM_WINDOWS) # Windows Support + set(PROJECT_PRODUCT_NAME "${PROJECT_FULL_NAME}") + set(PROJECT_COMPANY_NAME "${PROJECT_AUTHORS}") + set(PROJECT_COPYRIGHT "${PROJECT_AUTHORS} © ${PROJECT_COPYRIGHT_YEARS}") + set(PROJECT_LEGAL_TRADEMARKS_1 "") + set(PROJECT_LEGAL_TRADEMARKS_2 "") + + configure_file( + "templates/windows/version.rc.in" + "generated/version.rc" + ) + target_sources(${PROJECT_NAME} + PRIVATE + "templates/windows/version.rc.in" + "${PROJECT_BINARY_DIR}/generated/version.rc" + ) +endif() + # Set file version set_target_properties(${PROJECT_NAME} PROPERTIES MACHO_COMPATIBILITY_VERSION ${_VERSION_MAJOR}.${_VERSION_MINOR} @@ -2069,7 +2080,6 @@ endif() ################################################################################ streamfx_add_library(${PROJECT_NAME}_Core STATIC EXCLUDE_FROM_ALL) add_library(${PROJECT_NAME}::Core ALIAS ${PROJECT_NAME}_Core) -target_link_libraries(${PROJECT_NAME} PRIVATE ${PROJECT_NAME}::Core) # Combine all variables that matter. set(PROJECT_FILES @@ -2126,11 +2136,18 @@ foreach(COMPONENT ${COMPONENTS}) add_subdirectory(${COMPONENT} EXCLUDE_FROM_ALL) endforeach() +################################################################################ +# Resolve Components +################################################################################ +target_link_libraries(${PROJECT_NAME} PUBLIC $) + + + # ################################################################################ # # Installation # ################################################################################ -# if(STANDALONE) +if(STANDALONE) # if(STRUCTURE_UNIFIED) # install( # DIRECTORY "data/" @@ -2268,30 +2285,30 @@ endforeach() # ) # endif() # endif() -# else() -# if(COMMAND setup_plugin_target) -# setup_plugin_target(${PROJECT_NAME}) -# # Seems like we lost the ability to customize which directoy resources are in, and instead are forced to use '/data'. +else() + if(COMMAND setup_plugin_target) + setup_plugin_target(${PROJECT_NAME}) + # Seems like we lost the ability to customize which directoy resources are in, and instead are forced to use '/data'. -# if(HAVE_AOM AND AOM_BINARY) # Dependency: AOM -# add_target_resource(${PROJECT_NAME} "${AOM_BINARY}" "obs-plugins/${PROJECT_NAME}") -# endif() -# elseif(COMMAND install_obs_plugin_with_data) -# install_obs_plugin_with_data(${PROJECT_NAME} data) + if(HAVE_AOM AND AOM_BINARY) # Dependency: AOM + add_target_resource(${PROJECT_NAME} "${AOM_BINARY}" "obs-plugins/${PROJECT_NAME}") + endif() + elseif(COMMAND install_obs_plugin_with_data) + install_obs_plugin_with_data(${PROJECT_NAME} data) -# if(HAVE_AOM AND AOM_BINARY) # Dependency: AOM -# install( -# FILES "${AOM_BINARY}" -# DESTINATION "${OBS_DATA_DESTINATION}/obs-plugins/${PROJECT_NAME}" -# ) -# add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD -# COMMAND "${CMAKE_COMMAND}" -E copy -# "${AOM_BINARY}" -# "${OBS_DATA_DESTINATION}/obs-plugins/${PROJECT_NAME}" -# VERBATIM) -# endif() -# endif() -# endif() + if(HAVE_AOM AND AOM_BINARY) # Dependency: AOM + install( + FILES "${AOM_BINARY}" + DESTINATION "${OBS_DATA_DESTINATION}/obs-plugins/${PROJECT_NAME}" + ) + add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E copy + "${AOM_BINARY}" + "${OBS_DATA_DESTINATION}/obs-plugins/${PROJECT_NAME}" + VERBATIM) + endif() + endif() +endif() # ################################################################################ # # Packaging diff --git a/source/plugin.cpp b/source/plugin.cpp index ea304a2e9c..168fe4fb1b 100644 --- a/source/plugin.cpp +++ b/source/plugin.cpp @@ -112,6 +112,8 @@ MODULE_EXPORT bool obs_module_load(void) } } +MODULE_EXPORT void obs_module_post_load(void) {} + MODULE_EXPORT void obs_module_unload(void) { try { From f26565cf1ef33258c2c2cf3bac0f68185105244f Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 3 Sep 2023 13:51:16 +0200 Subject: [PATCH 04/66] cmake: Remove clang integration, as it breaks on the new system --- CMakeLists.txt | 63 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 94701b0b42..fc919a1669 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -323,9 +323,6 @@ set(${PREFIX}ENABLE_FRONTEND ON CACHE BOOL "Enable Frontend code.") set(${PREFIX}ENABLE_UPDATER ON CACHE BOOL "Enable automatic update checks.") ## Code Related -if(COMMAND clang_format) - set(${PREFIX}ENABLE_CLANG OFF CACHE BOOL "Enable Clang integration for supported compilers.") -endif() set(${PREFIX}ENABLE_PROFILING OFF CACHE BOOL "Enable CPU and GPU performance tracking, which has a non-zero overhead at all times. Do not enable this for release builds.") ## Compile/Link Related @@ -1863,23 +1860,6 @@ function(streamfx_add_library TARGET_NAME TARGET_TYPE) AUTORCC ON AUTOGEN_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated" ) - - # Extras: Clang - #is_feature_enabled(CLANG T_CHECK) - #if(T_CHECK) - # generate_compile_commands_json( - # TARGETS ${TARGET_NAME} - # ) - # clang_tidy( - # TARGETS ${TARGET_NAME} - # VERSION 14.0.0 - # ) - # clang_format( - # TARGETS ${TARGET_NAME} - # DEPENDENCY - # VERSION 14.0.0 - # ) - #endif() endfunction() set(${PREFIX}COMPONENTS "") @@ -1906,7 +1886,8 @@ function(streamfx_add_component COMPONENT_NAME) target_link_libraries(${COMPONENT_TARGET} PUBLIC ${PROJECT_NAME}::Core) add_library(${COMPONENT_ALIAS} ALIAS ${COMPONENT_TARGET}) set_target_properties(${COMPONENT_TARGET} PROPERTIES - COMPONENT_LABEL "${COMPONENT_LABEL}" + PROJECT_LABNEL "${COMPONENT_ALIAS}" + COMPONENT_LABEL "${COMPONENT_NAME}" COMPONENT_NAME "${COMPONENT_ALIAS}" COMPONENT_OPTION "${COMPONENT_OPTION_NAME}" ) @@ -2133,7 +2114,7 @@ target_compile_definitions(${PROJECT_NAME}_Core PRIVATE ${PROJECT_DEFINITIONS}) file(GLOB COMPONENTS RELATIVE ${PROJECT_SOURCE_DIR} CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/components/*) foreach(COMPONENT ${COMPONENTS}) - add_subdirectory(${COMPONENT} EXCLUDE_FROM_ALL) + add_subdirectory(${COMPONENT} "${PROJECT_BINARY_DIR}/${COMPONENT}" EXCLUDE_FROM_ALL) endforeach() ################################################################################ @@ -2141,7 +2122,45 @@ endforeach() ################################################################################ target_link_libraries(${PROJECT_NAME} PUBLIC $) +foreach(COMPONENT ${${PREFIX}COMPONENTS}) + # If the component doesn't exist, skip it. + if(NOT TARGET ${COMPONENT}) + message(WARNING "Encountered invalid component '${COMPONENT}' in list of all components.") + continue() + endif() + + get_target_property(_NAME PROPERTY COMPONENT_LABEL) + # If the component is disabled, skip it. + get_target_property(_OPTION PROPERTY COMPONENT_OPTION) + if(NOT ${_OPTION}) + message(STATUS "[${_NAME}] Disabled by developer.") + continue() + elseif(${_OPTION}_DISABLED) + message(STATUS "[${_NAME}] Disabled by build script.") + continue() + endif() + + # Test if all dependencies are valid. + set(_HASDEPENDENCY ON) + get_target_property(_DEPENDS PROPERTY COMPONENT_DEPENDS) + foreach(_DEPEND ${_DEPENDS}) + get_target_property(_DNAME PROPERTY COMPONENT_LABEL) + get_target_property(_DOPTION PROPERTY COMPONENT_OPTION) + if((NOT ${_DOPTION}) OR (${_DOPTION}_DISABLED)) + message(STATUS "[${_NAME}] Missing or disabled dependency on '${_DNAME}'.") + set(_HASDEPENDENCY OFF) + continue() + endif() + endforeach() + if(NOT _HASDEPENDENCY) + message(STATUS "[${_NAME}] Unable to fulfill some dependencies, disabling...") + continue() + endif() + + # Finally if everything is correct, do things. + target_link_libraries(${PROJECT_NAME} PUBLIC $) +endforeach() # ################################################################################ # # Installation From d82d3901e4c48bb35ccf5281b51728a8470801e4 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 3 Sep 2023 13:54:12 +0200 Subject: [PATCH 05/66] cmake: Remove remnants of AOM AV1 --- CMakeLists.txt | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fc919a1669..1abc3ad8d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2190,14 +2190,6 @@ if(STANDALONE) # OPTIONAL # ) # endif() - -# # Dependency: AOM -# if(HAVE_AOM AND AOM_BINARY AND D_PLATFORM_WINDOWS) -# install( -# FILES ${AOM_BINARY} -# DESTINATION "data/" COMPONENT StreamFX -# ) -# endif() # elseif(D_PLATFORM_LINUX) # install( # TARGETS ${PROJECT_NAME} @@ -2241,14 +2233,6 @@ if(STANDALONE) # OPTIONAL # ) # endif() - -# # Dependency: AOM -# if(HAVE_AOM AND AOM_BINARY) -# install( -# FILES "${AOM_BINARY}" -# DESTINATION "data/obs-plugins/${PROJECT_NAME}/" COMPONENT StreamFX -# ) -# endif() # elseif(D_PLATFORM_LINUX) # if(STRUCTURE_PACKAGEMANAGER) # install( @@ -2308,24 +2292,8 @@ else() if(COMMAND setup_plugin_target) setup_plugin_target(${PROJECT_NAME}) # Seems like we lost the ability to customize which directoy resources are in, and instead are forced to use '/data'. - - if(HAVE_AOM AND AOM_BINARY) # Dependency: AOM - add_target_resource(${PROJECT_NAME} "${AOM_BINARY}" "obs-plugins/${PROJECT_NAME}") - endif() elseif(COMMAND install_obs_plugin_with_data) install_obs_plugin_with_data(${PROJECT_NAME} data) - - if(HAVE_AOM AND AOM_BINARY) # Dependency: AOM - install( - FILES "${AOM_BINARY}" - DESTINATION "${OBS_DATA_DESTINATION}/obs-plugins/${PROJECT_NAME}" - ) - add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E copy - "${AOM_BINARY}" - "${OBS_DATA_DESTINATION}/obs-plugins/${PROJECT_NAME}" - VERBATIM) - endif() endif() endif() From 8fb37b8d2156f86208d7758a8ac2441608169604 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 3 Sep 2023 14:22:28 +0200 Subject: [PATCH 06/66] cmake: Fix up missing sub-components due to add_subdirectory add_subdirectory creates a new "stack" of variables, so PARENT_SCOPE points nowhere. Well it points to the outside of the function, which is not outside of the subproject. --- CMakeLists.txt | 111 ++++++++++++++++++++++++++++--------------------- 1 file changed, 63 insertions(+), 48 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1abc3ad8d9..1ceb86778a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1874,29 +1874,40 @@ function(streamfx_add_component COMPONENT_NAME) # Convert the sanitized version to upper case. string(TOUPPER "${COMPONENT_SANITIZED_NAME}" COMPONENT_OPTION_NAME) - set(COMPONENT_OPTION "${PREFIX}COMPONENT_${COMPONENT_OPTION_NAME}" PARENT_SCOPE) + set(COMPONENT_OPTION "${PREFIX}COMPONENT_${COMPONENT_OPTION_NAME}") + set(COMPONENT_OPTION "${COMPONENT_OPTION}" PARENT_SCOPE) # Define the necessary targets. - set(COMPONENT_TARGET "${PROJECT_NAME}_${COMPONENT_SANITIZED_NAME}") - set(COMPONENT_TARGET "${PROJECT_NAME}_${COMPONENT_SANITIZED_NAME}" PARENT_SCOPE) - set(COMPONENT_ALIAS "${PROJECT_NAME}::${COMPONENT_SANITIZED_NAME}") - set(COMPONENT_ALIAS "${PROJECT_NAME}::${COMPONENT_SANITIZED_NAME}" PARENT_SCOPE) + set(COMPONENT_TARGET "StreamFX_${COMPONENT_SANITIZED_NAME}") + set(COMPONENT_TARGET "${COMPONENT_TARGET}" PARENT_SCOPE) + set(COMPONENT_ALIAS "StreamFX::${COMPONENT_SANITIZED_NAME}") + set(COMPONENT_ALIAS "${COMPONENT_ALIAS}" PARENT_SCOPE) - streamfx_add_library(${COMPONENT_TARGET} STATIC) - target_link_libraries(${COMPONENT_TARGET} PUBLIC ${PROJECT_NAME}::Core) + streamfx_add_library(${COMPONENT_TARGET} STATIC EXCLUDE_FROM_ALL) add_library(${COMPONENT_ALIAS} ALIAS ${COMPONENT_TARGET}) set_target_properties(${COMPONENT_TARGET} PROPERTIES - PROJECT_LABNEL "${COMPONENT_ALIAS}" +# PROJECT_LABEL "${COMPONENT_ALIAS}" COMPONENT_LABEL "${COMPONENT_NAME}" COMPONENT_NAME "${COMPONENT_ALIAS}" - COMPONENT_OPTION "${COMPONENT_OPTION_NAME}" + COMPONENT_OPTION "${COMPONENT_OPTION}" ) + # Always depend on StreamFX::Core + target_link_libraries(${COMPONENT_TARGET} PRIVATE $) + # Register the component globally. - list(APPEND ${PREFIX}COMPONENTS "${COMPONENT_TARGET}") + get_target_property(_DEPENDS StreamFX COMPONENT_DEPENDS) + if(_DEPENDS) + list(APPEND _DEPENDS "${COMPONENT_TARGET}") + else() + set(_DEPENDS "${COMPONENT_TARGET}") + endif() + set_target_properties(StreamFX PROPERTIES + COMPONENT_DEPENDS "${_DEPENDS}" + ) # Allow disabling this component. - set(${PREFIX}COMPONENT_${COMPONENT_OPTION_NAME} CACHE BOOL "Enable the ${COMPONENT_NAME} component?") + set(${COMPONENT_OPTION} ON CACHE BOOL "Enable the ${COMPONENT_NAME} component?") # Add files in common places. file(GLOB_RECURSE TEMPLATES FOLLOW_SYMLINKS CONFIGURE_DEPENDS "templates/*") @@ -2114,53 +2125,57 @@ target_compile_definitions(${PROJECT_NAME}_Core PRIVATE ${PROJECT_DEFINITIONS}) file(GLOB COMPONENTS RELATIVE ${PROJECT_SOURCE_DIR} CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/components/*) foreach(COMPONENT ${COMPONENTS}) - add_subdirectory(${COMPONENT} "${PROJECT_BINARY_DIR}/${COMPONENT}" EXCLUDE_FROM_ALL) + add_subdirectory(${COMPONENT} EXCLUDE_FROM_ALL) endforeach() ################################################################################ # Resolve Components ################################################################################ -target_link_libraries(${PROJECT_NAME} PUBLIC $) - -foreach(COMPONENT ${${PREFIX}COMPONENTS}) - # If the component doesn't exist, skip it. - if(NOT TARGET ${COMPONENT}) - message(WARNING "Encountered invalid component '${COMPONENT}' in list of all components.") - continue() - endif() +target_link_libraries(${PROJECT_NAME} PRIVATE $) + +get_target_property(_DEPENDS StreamFX COMPONENT_DEPENDS) +if(_DEPENDS) + foreach(COMPONENT ${_DEPENDS}) + # If the component doesn't exist, skip it. + if(NOT TARGET ${COMPONENT}) + message(WARNING "Encountered invalid component '${COMPONENT}' in list of all components.") + continue() + endif() - get_target_property(_NAME PROPERTY COMPONENT_LABEL) + get_target_property(_NAME ${COMPONENT} COMPONENT_LABEL) - # If the component is disabled, skip it. - get_target_property(_OPTION PROPERTY COMPONENT_OPTION) - if(NOT ${_OPTION}) - message(STATUS "[${_NAME}] Disabled by developer.") - continue() - elseif(${_OPTION}_DISABLED) - message(STATUS "[${_NAME}] Disabled by build script.") - continue() - endif() - - # Test if all dependencies are valid. - set(_HASDEPENDENCY ON) - get_target_property(_DEPENDS PROPERTY COMPONENT_DEPENDS) - foreach(_DEPEND ${_DEPENDS}) - get_target_property(_DNAME PROPERTY COMPONENT_LABEL) - get_target_property(_DOPTION PROPERTY COMPONENT_OPTION) - if((NOT ${_DOPTION}) OR (${_DOPTION}_DISABLED)) - message(STATUS "[${_NAME}] Missing or disabled dependency on '${_DNAME}'.") - set(_HASDEPENDENCY OFF) + # If the component is disabled, skip it. + get_target_property(_OPTION ${COMPONENT} COMPONENT_OPTION) + if(NOT ${_OPTION}) + message(STATUS "[${_NAME}] Disabled by developer.") + continue() + elseif(${_OPTION}_DISABLED) + message(STATUS "[${_NAME}] Disabled by build script.") + continue() + endif() + + # Test if all dependencies are valid. + set(_HASDEPENDENCY ON) + get_target_property(_DEPENDS ${COMPONENT} COMPONENT_DEPENDS) + foreach(_DEPEND ${_DEPENDS}) + get_target_property(_DNAME ${COMPONENT} COMPONENT_LABEL) + get_target_property(_DOPTION ${COMPONENT} COMPONENT_OPTION) + if((NOT ${_DOPTION}) OR (${_DOPTION}_DISABLED)) + message(STATUS "[${_NAME}] Missing or disabled dependency on '${_DNAME}'.") + set(_HASDEPENDENCY OFF) + continue() + endif() + endforeach() + if(NOT _HASDEPENDENCY) + message(STATUS "[${_NAME}] Disabled due to missing dependencies.") continue() endif() - endforeach() - if(NOT _HASDEPENDENCY) - message(STATUS "[${_NAME}] Unable to fulfill some dependencies, disabling...") - continue() - endif() - # Finally if everything is correct, do things. - target_link_libraries(${PROJECT_NAME} PUBLIC $) -endforeach() + # Finally if everything is correct, do things. + message(STATUS "[${_NAME}] Enabled.") + target_link_libraries(${PROJECT_NAME} PRIVATE $) + endforeach() +endif() # ################################################################################ # # Installation From 98403126ad6735315de44e27a42fcc912bd38ddc Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 3 Sep 2023 14:34:26 +0200 Subject: [PATCH 07/66] cmake: Fix missing public info, and remove PROJECT_NAME usage Using PROJECT_NAME makes it incompatible with add_subdirectory, and it's really not necessary anyway. There are no plans to rename the project again. Also needed to expose some information to be public, so that components could actually use it. Seems to be working as intended finally. --- CMakeLists.txt | 99 +++++++++++++++++++++++++++----------------------- 1 file changed, 54 insertions(+), 45 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ceb86778a..b207f95136 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -349,7 +349,7 @@ if(STANDALONE) endif() set(PACKAGE_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Where to place the packages?") - set(PACKAGE_NAME "${PROJECT_NAME}" CACHE STRING "What should the package be called?") + set(PACKAGE_NAME "StreamFX" CACHE STRING "What should the package be called?") set(PACKAGE_SUFFIX "" CACHE STRING "Any suffix for the package name? (Defaults to the current version string)") endif() @@ -380,7 +380,7 @@ project( DESCRIPTION "Additional sources, filters, transitions and encoders for OBS Studio." HOMEPAGE_URL "https://streamfx.xaymar.com/" ) -set(PROJECT_IDENTIFER "com.xaymar.${PROJECT_NAME}.obs") +set(PROJECT_IDENTIFER "com.xaymar.StreamFX.obs") set(PROJECT_TITLE "StreamFX (for OBS Studio)") set(PROJECT_AUTHORS "Michael Fabian 'Xaymar' Dirks ") set(PROJECT_COPYRIGHT "2017 - 2022, Michael Fabian Dirks. All Rights Reserved") @@ -1862,7 +1862,6 @@ function(streamfx_add_library TARGET_NAME TARGET_TYPE) ) endfunction() -set(${PREFIX}COMPONENTS "") function(streamfx_add_component COMPONENT_NAME) # Sanitize the component name by trimming whitespace. string(REGEX REPLACE "^[ \t]+" "" COMPONENT_NAME "${COMPONENT_NAME}") @@ -1886,14 +1885,13 @@ function(streamfx_add_component COMPONENT_NAME) streamfx_add_library(${COMPONENT_TARGET} STATIC EXCLUDE_FROM_ALL) add_library(${COMPONENT_ALIAS} ALIAS ${COMPONENT_TARGET}) set_target_properties(${COMPONENT_TARGET} PROPERTIES -# PROJECT_LABEL "${COMPONENT_ALIAS}" COMPONENT_LABEL "${COMPONENT_NAME}" COMPONENT_NAME "${COMPONENT_ALIAS}" COMPONENT_OPTION "${COMPONENT_OPTION}" ) # Always depend on StreamFX::Core - target_link_libraries(${COMPONENT_TARGET} PRIVATE $) + target_link_libraries(${COMPONENT_TARGET} PRIVATE $) # Register the component globally. get_target_property(_DEPENDS StreamFX COMPONENT_DEPENDS) @@ -1969,9 +1967,9 @@ endfunction() ################################################################################ # Register Library ################################################################################ -streamfx_add_library(${PROJECT_NAME} MODULE) # We are a module for libOBS. +streamfx_add_library(StreamFX MODULE) # We are a module for libOBS. -target_include_directories(${PROJECT_NAME} PRIVATE +target_include_directories(StreamFX PRIVATE "source" "include" "${PROJECT_BINARY_DIR}/generated" @@ -1988,7 +1986,7 @@ if(D_PLATFORM_WINDOWS) # Windows Support "templates/windows/version.rc.in" "generated/version.rc" ) - target_sources(${PROJECT_NAME} + target_sources(StreamFX PRIVATE "templates/windows/version.rc.in" "${PROJECT_BINARY_DIR}/generated/version.rc" @@ -1996,7 +1994,7 @@ if(D_PLATFORM_WINDOWS) # Windows Support endif() # Set file version -set_target_properties(${PROJECT_NAME} PROPERTIES +set_target_properties(StreamFX PROPERTIES MACHO_COMPATIBILITY_VERSION ${_VERSION_MAJOR}.${_VERSION_MINOR} MACHO_CURRENT_VERSION ${PROJECT_VERSION} SOVERSION ${_VERSION_MAJOR}.${_VERSION_MINOR} @@ -2006,18 +2004,18 @@ set_target_properties(${PROJECT_NAME} PROPERTIES # Windows exclusive changes if(D_PLATFORM_WINDOWS) foreach(DELAYLOAD ${PROJECT_LIBRARIES_DELAYED}) - get_target_property(_lf ${PROJECT_NAME} LINK_FLAGS) + get_target_property(_lf StreamFX LINK_FLAGS) if(NOT _lf) set(_lf "") endif() - set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "${_lf} /DELAYLOAD:${DELAYLOAD}") + set_target_properties(StreamFX PROPERTIES LINK_FLAGS "${_lf} /DELAYLOAD:${DELAYLOAD}") add_link_options("/DELAYLOAD:${DELAYLOAD}") endforeach() endif() # MacOS exclusive Changes if(D_PLATFORM_MAC) - set_target_properties(${PROJECT_NAME} PROPERTIES + set_target_properties(StreamFX PROPERTIES # No automatic code signing in XCode XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "" XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO" @@ -2025,7 +2023,7 @@ if(D_PLATFORM_MAC) INSTALL_RPATH "@executable_path/../Frameworks/;@loader_path/../Frameworks/;@loader_path/../Resources/" ) if(STANDALONE) - set_target_properties(${PROJECT_NAME} PROPERTIES + set_target_properties(StreamFX PROPERTIES # @rpath in built binaries BUILD_WITH_INSTALL_RPATH ON ) @@ -2049,7 +2047,7 @@ if(D_PLATFORM_MAC) ) # Bundle Information - set(MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT_NAME}") + set(MACOSX_BUNDLE_BUNDLE_NAME "StreamFX") set(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}") set(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT}") set(MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_IDENTIFER}") @@ -2057,10 +2055,10 @@ if(D_PLATFORM_MAC) set(MACOSX_BUNDLE_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") set(MACOSX_BUNDLE_LONG_VERSION_STRING "${_VERSION}") set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}") - set_target_properties(${PROJECT_NAME} PROPERTIES + set_target_properties(StreamFX PROPERTIES BUNDLE ON BUNDLE_EXTENSION "plugin" - OUTPUT_NAME ${PROJECT_NAME} + OUTPUT_NAME StreamFX MACOSX_BUNDLE_INFO_PLIST "${PROJECT_SOURCE_DIR}/templates/macos/Info.plist.in" XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${MACOSX_BUNDLE_GUI_IDENTIFIER}" ) @@ -2070,8 +2068,19 @@ endif() ################################################################################ # Add Core ################################################################################ -streamfx_add_library(${PROJECT_NAME}_Core STATIC EXCLUDE_FROM_ALL) -add_library(${PROJECT_NAME}::Core ALIAS ${PROJECT_NAME}_Core) +streamfx_add_library(StreamFX_Core STATIC EXCLUDE_FROM_ALL) +add_library(StreamFX::Core ALIAS StreamFX_Core) + +target_link_libraries(StreamFX_Core + PUBLIC + OBS::libobs +) + +target_include_directories(StreamFX_Core + PUBLIC + "${PROJECT_SOURCE_DIR}/source" + "${PROJECT_BINARY_DIR}/generated" +) # Combine all variables that matter. set(PROJECT_FILES @@ -2111,10 +2120,10 @@ if(Qt5_Found OR Qt6_FOUND) endif() # Register the library -target_sources(${PROJECT_NAME}_Core PRIVATE ${PROJECT_FILES}) -target_link_libraries(${PROJECT_NAME}_Core PRIVATE ${PROJECT_LIBRARIES}) -target_include_directories(${PROJECT_NAME}_Core PRIVATE ${PROJECT_INCLUDE_DIRS}) -target_compile_definitions(${PROJECT_NAME}_Core PRIVATE ${PROJECT_DEFINITIONS}) +target_sources(StreamFX_Core PRIVATE ${PROJECT_FILES}) +target_link_libraries(StreamFX_Core PRIVATE ${PROJECT_LIBRARIES}) +target_include_directories(StreamFX_Core PRIVATE ${PROJECT_INCLUDE_DIRS}) +target_compile_definitions(StreamFX_Core PRIVATE ${PROJECT_DEFINITIONS}) ################################################################################ # Components @@ -2131,7 +2140,7 @@ endforeach() ################################################################################ # Resolve Components ################################################################################ -target_link_libraries(${PROJECT_NAME} PRIVATE $) +target_link_libraries(StreamFX PRIVATE $) get_target_property(_DEPENDS StreamFX COMPONENT_DEPENDS) if(_DEPENDS) @@ -2173,7 +2182,7 @@ if(_DEPENDS) # Finally if everything is correct, do things. message(STATUS "[${_NAME}] Enabled.") - target_link_libraries(${PROJECT_NAME} PRIVATE $) + target_link_libraries(StreamFX PRIVATE $) endforeach() endif() @@ -2192,14 +2201,14 @@ if(STANDALONE) # if(D_PLATFORM_WINDOWS) # install( -# TARGETS ${PROJECT_NAME} +# TARGETS StreamFX # RUNTIME DESTINATION "bin/windows-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX # LIBRARY DESTINATION "bin/windows-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX # PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE # ) # if(MSVC) # install( -# FILES $ +# FILES $ # DESTINATION "bin/windows-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" # COMPONENT StreamFX # OPTIONAL @@ -2207,14 +2216,14 @@ if(STANDALONE) # endif() # elseif(D_PLATFORM_LINUX) # install( -# TARGETS ${PROJECT_NAME} +# TARGETS StreamFX # RUNTIME DESTINATION "bin/linux-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX # LIBRARY DESTINATION "bin/linux-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX # PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE # ) # elseif(D_PLATFORM_MAC) # install( -# TARGETS ${PROJECT_NAME} +# TARGETS StreamFX # RUNTIME DESTINATION "bin/mac-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX # LIBRARY DESTINATION "bin/mac-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX # PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE @@ -2233,17 +2242,17 @@ if(STANDALONE) # ) # elseif(D_PLATFORM_WINDOWS) # install( -# TARGETS ${PROJECT_NAME} +# TARGETS StreamFX # RUNTIME DESTINATION "obs-plugins/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX # LIBRARY DESTINATION "obs-plugins/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX # ) # install( # DIRECTORY "data/" -# DESTINATION "data/obs-plugins/${PROJECT_NAME}/" +# DESTINATION "data/obs-plugins/StreamFX/" # ) # if(MSVC) # install( -# FILES $ +# FILES $ # DESTINATION "obs-plugins/${D_PLATFORM_BITS}bit/" # OPTIONAL # ) @@ -2251,28 +2260,28 @@ if(STANDALONE) # elseif(D_PLATFORM_LINUX) # if(STRUCTURE_PACKAGEMANAGER) # install( -# TARGETS ${PROJECT_NAME} +# TARGETS StreamFX # RUNTIME DESTINATION "lib/obs-plugins/" COMPONENT StreamFX # LIBRARY DESTINATION "lib/obs-plugins/" COMPONENT StreamFX # PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE # ) # install( # DIRECTORY "data/" -# DESTINATION "share/obs/obs-plugins/${PROJECT_NAME}" +# DESTINATION "share/obs/obs-plugins/StreamFX" # COMPONENT StreamFX # FILE_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE # DIRECTORY_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE # ) # else() # install( -# TARGETS ${PROJECT_NAME} -# RUNTIME DESTINATION "plugins/${PROJECT_NAME}/bin/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX -# LIBRARY DESTINATION "plugins/${PROJECT_NAME}/bin/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX +# TARGETS StreamFX +# RUNTIME DESTINATION "plugins/StreamFX/bin/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX +# LIBRARY DESTINATION "plugins/StreamFX/bin/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX # PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE # ) # install( # DIRECTORY "data/" -# DESTINATION "plugins/${PROJECT_NAME}/data/" +# DESTINATION "plugins/StreamFX/data/" # COMPONENT StreamFX # FILE_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE # DIRECTORY_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE @@ -2281,7 +2290,7 @@ if(STANDALONE) # elseif(D_PLATFORM_MAC) # if(STRUCTURE_BUNDLE) # install( -# TARGETS ${PROJECT_NAME} +# TARGETS StreamFX # RUNTIME DESTINATION "." COMPONENT StreamFX # LIBRARY DESTINATION "." COMPONENT StreamFX # BUNDLE DESTINATION "." COMPONENT StreamFX @@ -2289,14 +2298,14 @@ if(STANDALONE) # ) # else() # install( -# TARGETS ${PROJECT_NAME} -# RUNTIME DESTINATION "${PROJECT_NAME}/bin/" COMPONENT StreamFX -# LIBRARY DESTINATION "${PROJECT_NAME}/bin/" COMPONENT StreamFX +# TARGETS StreamFX +# RUNTIME DESTINATION "StreamFX/bin/" COMPONENT StreamFX +# LIBRARY DESTINATION "StreamFX/bin/" COMPONENT StreamFX # PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE # ) # install( # DIRECTORY "data/" -# DESTINATION "${PROJECT_NAME}/data/" +# DESTINATION "StreamFX/data/" # COMPONENT StreamFX # FILE_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE # DIRECTORY_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE @@ -2305,10 +2314,10 @@ if(STANDALONE) # endif() else() if(COMMAND setup_plugin_target) - setup_plugin_target(${PROJECT_NAME}) + setup_plugin_target(StreamFX) # Seems like we lost the ability to customize which directoy resources are in, and instead are forced to use '/data'. elseif(COMMAND install_obs_plugin_with_data) - install_obs_plugin_with_data(${PROJECT_NAME} data) + install_obs_plugin_with_data(StreamFX data) endif() endif() @@ -2370,7 +2379,7 @@ endif() # # Apple MacOS # if(D_PLATFORM_MAC) # # .pkg Installer -# set(PACKAGES_PATH_NAME "${PROJECT_NAME}") +# set(PACKAGES_PATH_NAME "StreamFX") # if(STRUCTURE_BUNDLE) # set(PACKAGES_PATH_NAME "${PACKAGES_PATH_NAME}.plugin") # endif() From 0ce977b9ddd638ebee035661cf186f41bdc5cc54 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 3 Sep 2023 14:50:33 +0200 Subject: [PATCH 08/66] cmake: Uncomment still working code --- CMakeLists.txt | 386 ++++++++++++++++++++++++------------------------- 1 file changed, 193 insertions(+), 193 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b207f95136..ee9135f470 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2186,132 +2186,132 @@ if(_DEPENDS) endforeach() endif() -# ################################################################################ -# # Installation -# ################################################################################ +################################################################################ +# Installation +################################################################################ if(STANDALONE) -# if(STRUCTURE_UNIFIED) -# install( -# DIRECTORY "data/" -# DESTINATION "data/" -# FILE_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE -# DIRECTORY_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE -# ) - -# if(D_PLATFORM_WINDOWS) -# install( -# TARGETS StreamFX -# RUNTIME DESTINATION "bin/windows-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX -# LIBRARY DESTINATION "bin/windows-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX -# PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE -# ) -# if(MSVC) -# install( -# FILES $ -# DESTINATION "bin/windows-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" -# COMPONENT StreamFX -# OPTIONAL -# ) -# endif() -# elseif(D_PLATFORM_LINUX) -# install( -# TARGETS StreamFX -# RUNTIME DESTINATION "bin/linux-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX -# LIBRARY DESTINATION "bin/linux-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX -# PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE -# ) -# elseif(D_PLATFORM_MAC) -# install( -# TARGETS StreamFX -# RUNTIME DESTINATION "bin/mac-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX -# LIBRARY DESTINATION "bin/mac-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX -# PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE -# ) -# endif() - -# install( -# FILES LICENSE -# DESTINATION "LICENSE" -# COMPONENT StreamFX -# ) -# install( -# FILES icon.png -# DESTINATION "icon.png" -# COMPONENT StreamFX -# ) -# elseif(D_PLATFORM_WINDOWS) -# install( -# TARGETS StreamFX -# RUNTIME DESTINATION "obs-plugins/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX -# LIBRARY DESTINATION "obs-plugins/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX -# ) -# install( -# DIRECTORY "data/" -# DESTINATION "data/obs-plugins/StreamFX/" -# ) -# if(MSVC) -# install( -# FILES $ -# DESTINATION "obs-plugins/${D_PLATFORM_BITS}bit/" -# OPTIONAL -# ) -# endif() -# elseif(D_PLATFORM_LINUX) -# if(STRUCTURE_PACKAGEMANAGER) -# install( -# TARGETS StreamFX -# RUNTIME DESTINATION "lib/obs-plugins/" COMPONENT StreamFX -# LIBRARY DESTINATION "lib/obs-plugins/" COMPONENT StreamFX -# PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE -# ) -# install( -# DIRECTORY "data/" -# DESTINATION "share/obs/obs-plugins/StreamFX" -# COMPONENT StreamFX -# FILE_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE -# DIRECTORY_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE -# ) -# else() -# install( -# TARGETS StreamFX -# RUNTIME DESTINATION "plugins/StreamFX/bin/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX -# LIBRARY DESTINATION "plugins/StreamFX/bin/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX -# PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE -# ) -# install( -# DIRECTORY "data/" -# DESTINATION "plugins/StreamFX/data/" -# COMPONENT StreamFX -# FILE_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE -# DIRECTORY_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE -# ) -# endif() -# elseif(D_PLATFORM_MAC) -# if(STRUCTURE_BUNDLE) -# install( -# TARGETS StreamFX -# RUNTIME DESTINATION "." COMPONENT StreamFX -# LIBRARY DESTINATION "." COMPONENT StreamFX -# BUNDLE DESTINATION "." COMPONENT StreamFX -# PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE -# ) -# else() -# install( -# TARGETS StreamFX -# RUNTIME DESTINATION "StreamFX/bin/" COMPONENT StreamFX -# LIBRARY DESTINATION "StreamFX/bin/" COMPONENT StreamFX -# PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE -# ) -# install( -# DIRECTORY "data/" -# DESTINATION "StreamFX/data/" -# COMPONENT StreamFX -# FILE_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE -# DIRECTORY_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE -# ) -# endif() -# endif() + if(STRUCTURE_UNIFIED) + install( + DIRECTORY "data/" + DESTINATION "data/" + FILE_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE + DIRECTORY_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE + ) + + if(D_PLATFORM_WINDOWS) + install( + TARGETS StreamFX + RUNTIME DESTINATION "bin/windows-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX + LIBRARY DESTINATION "bin/windows-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX + PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE + ) + if(MSVC) + install( + FILES $ + DESTINATION "bin/windows-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" + COMPONENT StreamFX + OPTIONAL + ) + endif() + elseif(D_PLATFORM_LINUX) + install( + TARGETS StreamFX + RUNTIME DESTINATION "bin/linux-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX + LIBRARY DESTINATION "bin/linux-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX + PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE + ) + elseif(D_PLATFORM_MAC) + install( + TARGETS StreamFX + RUNTIME DESTINATION "bin/mac-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX + LIBRARY DESTINATION "bin/mac-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX + PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE + ) + endif() + + install( + FILES LICENSE + DESTINATION "LICENSE" + COMPONENT StreamFX + ) + install( + FILES icon.png + DESTINATION "icon.png" + COMPONENT StreamFX + ) + elseif(D_PLATFORM_WINDOWS) + install( + TARGETS StreamFX + RUNTIME DESTINATION "obs-plugins/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX + LIBRARY DESTINATION "obs-plugins/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX + ) + install( + DIRECTORY "data/" + DESTINATION "data/obs-plugins/StreamFX/" + ) + if(MSVC) + install( + FILES $ + DESTINATION "obs-plugins/${D_PLATFORM_BITS}bit/" + OPTIONAL + ) + endif() + elseif(D_PLATFORM_LINUX) + if(STRUCTURE_PACKAGEMANAGER) + install( + TARGETS StreamFX + RUNTIME DESTINATION "lib/obs-plugins/" COMPONENT StreamFX + LIBRARY DESTINATION "lib/obs-plugins/" COMPONENT StreamFX + PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE + ) + install( + DIRECTORY "data/" + DESTINATION "share/obs/obs-plugins/StreamFX" + COMPONENT StreamFX + FILE_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE + DIRECTORY_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE + ) + else() + install( + TARGETS StreamFX + RUNTIME DESTINATION "plugins/StreamFX/bin/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX + LIBRARY DESTINATION "plugins/StreamFX/bin/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX + PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE + ) + install( + DIRECTORY "data/" + DESTINATION "plugins/StreamFX/data/" + COMPONENT StreamFX + FILE_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE + DIRECTORY_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE + ) + endif() + elseif(D_PLATFORM_MAC) + if(STRUCTURE_BUNDLE) + install( + TARGETS StreamFX + RUNTIME DESTINATION "." COMPONENT StreamFX + LIBRARY DESTINATION "." COMPONENT StreamFX + BUNDLE DESTINATION "." COMPONENT StreamFX + PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE + ) + else() + install( + TARGETS StreamFX + RUNTIME DESTINATION "StreamFX/bin/" COMPONENT StreamFX + LIBRARY DESTINATION "StreamFX/bin/" COMPONENT StreamFX + PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE + ) + install( + DIRECTORY "data/" + DESTINATION "StreamFX/data/" + COMPONENT StreamFX + FILE_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE + DIRECTORY_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE + ) + endif() + endif() else() if(COMMAND setup_plugin_target) setup_plugin_target(StreamFX) @@ -2321,72 +2321,72 @@ else() endif() endif() -# ################################################################################ -# # Packaging -# ################################################################################ - -# if(STANDALONE) -# # Packaging -# if(NOT PACKAGE_SUFFIX) -# set(_PACKAGE_SUFFIX_OVERRIDE "${_VERSION_THIN}") -# else() -# set(_PACKAGE_SUFFIX_OVERRIDE "${PACKAGE_SUFFIX}") -# endif() -# set(_PACKAGE_FULL_NAME "${PACKAGE_PREFIX}/${PACKAGE_NAME}-${_PACKAGE_SUFFIX_OVERRIDE}") - -# if(STRUCTURE_UNIFIED) -# add_custom_target( -# PACKAGE_ZIP -# ${CMAKE_COMMAND} -E tar cfv "${_PACKAGE_FULL_NAME}.obs" --format=zip -- -# "." -# WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}" -# ) -# else() -# add_custom_target( -# PACKAGE_7Z -# ${CMAKE_COMMAND} -E tar cfv "${_PACKAGE_FULL_NAME}.7z" --format=7zip -- -# "." -# WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}" -# ) -# add_custom_target( -# PACKAGE_ZIP -# ${CMAKE_COMMAND} -E tar cfv "${_PACKAGE_FULL_NAME}.zip" --format=zip -- -# "." -# WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}" -# ) - -# # Windows -# if(D_PLATFORM_WINDOWS) -# ## Installer (InnoSetup) -# get_filename_component(ISS_FILES_DIR "${CMAKE_INSTALL_PREFIX}" ABSOLUTE) -# file(TO_NATIVE_PATH "${ISS_FILES_DIR}" ISS_FILES_DIR) - -# get_filename_component(ISS_PACKAGE_DIR "${PACKAGE_PREFIX}" ABSOLUTE) -# file(TO_NATIVE_PATH "${ISS_PACKAGE_DIR}" ISS_PACKAGE_DIR) - -# get_filename_component(ISS_SOURCE_DIR "${PROJECT_SOURCE_DIR}" ABSOLUTE) -# file(TO_NATIVE_PATH "${ISS_SOURCE_DIR}" ISS_SOURCE_DIR) - -# get_filename_component(ISS_MSVCHELPER_PATH "${msvc-redist-helper_BUILD_DIR}" ABSOLUTE) -# file(TO_NATIVE_PATH "${ISS_MSVCHELPER_PATH}" ISS_MSVCHELPER_PATH) - -# configure_file( -# "templates/windows/installer.iss.in" -# "installer.iss" -# ) -# endif() - -# # Apple MacOS -# if(D_PLATFORM_MAC) -# # .pkg Installer -# set(PACKAGES_PATH_NAME "StreamFX") -# if(STRUCTURE_BUNDLE) -# set(PACKAGES_PATH_NAME "${PACKAGES_PATH_NAME}.plugin") -# endif() -# configure_file( -# "templates/macos/installer.pkgproj.in" -# "installer.pkgproj" -# ) -# endif() -# endif() -# endif() +################################################################################ +# Packaging +################################################################################ + +if(STANDALONE) + # Packaging + if(NOT PACKAGE_SUFFIX) + set(_PACKAGE_SUFFIX_OVERRIDE "${_VERSION_THIN}") + else() + set(_PACKAGE_SUFFIX_OVERRIDE "${PACKAGE_SUFFIX}") + endif() + set(_PACKAGE_FULL_NAME "${PACKAGE_PREFIX}/${PACKAGE_NAME}-${_PACKAGE_SUFFIX_OVERRIDE}") + + if(STRUCTURE_UNIFIED) + add_custom_target( + PACKAGE_ZIP + ${CMAKE_COMMAND} -E tar cfv "${_PACKAGE_FULL_NAME}.obs" --format=zip -- + "." + WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}" + ) + else() + add_custom_target( + PACKAGE_7Z + ${CMAKE_COMMAND} -E tar cfv "${_PACKAGE_FULL_NAME}.7z" --format=7zip -- + "." + WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}" + ) + add_custom_target( + PACKAGE_ZIP + ${CMAKE_COMMAND} -E tar cfv "${_PACKAGE_FULL_NAME}.zip" --format=zip -- + "." + WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}" + ) + + # Windows + if(D_PLATFORM_WINDOWS) + ## Installer (InnoSetup) + get_filename_component(ISS_FILES_DIR "${CMAKE_INSTALL_PREFIX}" ABSOLUTE) + file(TO_NATIVE_PATH "${ISS_FILES_DIR}" ISS_FILES_DIR) + + get_filename_component(ISS_PACKAGE_DIR "${PACKAGE_PREFIX}" ABSOLUTE) + file(TO_NATIVE_PATH "${ISS_PACKAGE_DIR}" ISS_PACKAGE_DIR) + + get_filename_component(ISS_SOURCE_DIR "${PROJECT_SOURCE_DIR}" ABSOLUTE) + file(TO_NATIVE_PATH "${ISS_SOURCE_DIR}" ISS_SOURCE_DIR) + + get_filename_component(ISS_MSVCHELPER_PATH "${msvc-redist-helper_BUILD_DIR}" ABSOLUTE) + file(TO_NATIVE_PATH "${ISS_MSVCHELPER_PATH}" ISS_MSVCHELPER_PATH) + + configure_file( + "templates/windows/installer.iss.in" + "installer.iss" + ) + endif() + + # Apple MacOS + if(D_PLATFORM_MAC) + # .pkg Installer + set(PACKAGES_PATH_NAME "StreamFX") + if(STRUCTURE_BUNDLE) + set(PACKAGES_PATH_NAME "${PACKAGES_PATH_NAME}.plugin") + endif() + configure_file( + "templates/macos/installer.pkgproj.in" + "installer.pkgproj" + ) + endif() + endif() +endif() From efb6e9f0cbe04a92016384431bd2564b7e5a457f Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 3 Sep 2023 14:58:59 +0200 Subject: [PATCH 09/66] cmake: Only enable Qt on components, not on the module The module only holds the resources file, so Qt is not needed here. --- CMakeLists.txt | 50 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ee9135f470..2c72b6e46b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1851,15 +1851,6 @@ function(streamfx_add_library TARGET_NAME TARGET_TYPE) # - Don't export by default, require attributes. # add_compile_options("-fvisibility=hidden") endif() - - # Enable Qt if needed - set_target_properties(${TARGET_NAME} PROPERTIES - AUTOUIC ON - AUTOUIC_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_SOURCE_DIR}/ui" - AUTOMOC ON - AUTORCC ON - AUTOGEN_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated" - ) endfunction() function(streamfx_add_component COMPONENT_NAME) @@ -1943,6 +1934,16 @@ function(streamfx_add_component COMPONENT_NAME) HEADER_FILE_ONLY ON ) + + # Enable Qt if needed + set_target_properties(${TARGET_NAME} PROPERTIES + AUTOUIC ON + AUTOUIC_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_SOURCE_DIR}/ui" + AUTOMOC ON + AUTORCC ON + AUTOGEN_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated" + ) + set_source_files_properties( ${TEMPLATES} ${SOURCE_PRIVATE} @@ -2071,16 +2072,21 @@ endif() streamfx_add_library(StreamFX_Core STATIC EXCLUDE_FROM_ALL) add_library(StreamFX::Core ALIAS StreamFX_Core) -target_link_libraries(StreamFX_Core - PUBLIC - OBS::libobs +# Register the library +target_sources(StreamFX_Core PRIVATE ${PROJECT_FILES}) +target_link_libraries(StreamFX_Core + PRIVATE ${PROJECT_LIBRARIES} + PUBLIC OBS::libobs ) - -target_include_directories(StreamFX_Core +target_include_directories(StreamFX_Core + PRIVATE ${PROJECT_INCLUDE_DIRS} PUBLIC "${PROJECT_SOURCE_DIR}/source" "${PROJECT_BINARY_DIR}/generated" ) +target_compile_definitions(StreamFX_Core + PRIVATE ${PROJECT_DEFINITIONS} +) # Combine all variables that matter. set(PROJECT_FILES @@ -2109,8 +2115,17 @@ set_source_files_properties(${PROJECT_DATA} ${PROJECT_TEMPLATES} ${PROJECT_UI} $ HEADER_FILE_ONLY ON ) -# Prevent non-UI files from being Qt'd + # Enable Qt if needed if(Qt5_Found OR Qt6_FOUND) + set_target_properties(StreamFX_Core PROPERTIES + AUTOUIC ON + AUTOUIC_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_SOURCE_DIR}/ui" + AUTOMOC ON + AUTORCC ON + AUTOGEN_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated" + ) + + # Prevent non-UI files from being Qt'd set_source_files_properties(${PROJECT_DATA} ${PROJECT_TEMPLATES} ${PROJECT_MEDIA} ${PROJECT_PRIVATE_GENERATED} ${PROJECT_PRIVATE_SOURCE} PROPERTIES SKIP_AUTOGEN ON SKIP_AUTOMOC ON @@ -2119,11 +2134,6 @@ if(Qt5_Found OR Qt6_FOUND) ) endif() -# Register the library -target_sources(StreamFX_Core PRIVATE ${PROJECT_FILES}) -target_link_libraries(StreamFX_Core PRIVATE ${PROJECT_LIBRARIES}) -target_include_directories(StreamFX_Core PRIVATE ${PROJECT_INCLUDE_DIRS}) -target_compile_definitions(StreamFX_Core PRIVATE ${PROJECT_DEFINITIONS}) ################################################################################ # Components From d8a673a578e399c572ea9aecbeec9ec119276d08 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 3 Sep 2023 15:17:23 +0200 Subject: [PATCH 10/66] cmake: Always provide at least one file to a target While this would normally work no questions asked in something like 'make', 'nmake' or similar, it is an impossible task in CMake without an empty file. So we'll just provide it with an empty file. --- CMakeLists.txt | 58 +++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c72b6e46b..f059b98798 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -831,7 +831,6 @@ feature_updater(ON) ################################################################################ set(PROJECT_DATA ) set(PROJECT_LIBRARIES ) -set(PROJECT_LIBRARIES_DELAYED ) set(PROJECT_INCLUDE_DIRS ) set(PROJECT_TEMPLATES ) set(PROJECT_PRIVATE_GENERATED ) @@ -1522,12 +1521,6 @@ endif() # Windows if(D_PLATFORM_WINDOWS) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/windll.cpp" - ) - list(APPEND PROJECT_LIBRARIES - Delayimp.lib - ) # Disable/Enable a ton of things. list(APPEND PROJECT_DEFINITIONS # Microsoft Visual C++ @@ -1976,7 +1969,23 @@ target_include_directories(StreamFX PRIVATE "${PROJECT_BINARY_DIR}/generated" ) -if(D_PLATFORM_WINDOWS) # Windows Support +# Ensure there is at least one file. +if(D_PLATFORM_WINDOWS) + target_sources(StreamFX + PRIVATE + "source/windll.cpp" + ) +else() + target_sources(StreamFX + PRIVATE + "/dev/null" + ) +endif() + +if(D_PLATFORM_WINDOWS) + # Windows-exclusive + + # Version Resource set(PROJECT_PRODUCT_NAME "${PROJECT_FULL_NAME}") set(PROJECT_COMPANY_NAME "${PROJECT_AUTHORS}") set(PROJECT_COPYRIGHT "${PROJECT_AUTHORS} © ${PROJECT_COPYRIGHT_YEARS}") @@ -1992,30 +2001,9 @@ if(D_PLATFORM_WINDOWS) # Windows Support "templates/windows/version.rc.in" "${PROJECT_BINARY_DIR}/generated/version.rc" ) -endif() +elseif(D_PLATFORM_MAC) + # MacOS exclusive Changes -# Set file version -set_target_properties(StreamFX PROPERTIES - MACHO_COMPATIBILITY_VERSION ${_VERSION_MAJOR}.${_VERSION_MINOR} - MACHO_CURRENT_VERSION ${PROJECT_VERSION} - SOVERSION ${_VERSION_MAJOR}.${_VERSION_MINOR} - VERSION ${PROJECT_VERSION} -) - -# Windows exclusive changes -if(D_PLATFORM_WINDOWS) - foreach(DELAYLOAD ${PROJECT_LIBRARIES_DELAYED}) - get_target_property(_lf StreamFX LINK_FLAGS) - if(NOT _lf) - set(_lf "") - endif() - set_target_properties(StreamFX PROPERTIES LINK_FLAGS "${_lf} /DELAYLOAD:${DELAYLOAD}") - add_link_options("/DELAYLOAD:${DELAYLOAD}") - endforeach() -endif() - -# MacOS exclusive Changes -if(D_PLATFORM_MAC) set_target_properties(StreamFX PROPERTIES # No automatic code signing in XCode XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "" @@ -2066,6 +2054,14 @@ if(D_PLATFORM_MAC) endif() endif() +# Set file version +set_target_properties(StreamFX PROPERTIES + MACHO_COMPATIBILITY_VERSION ${_VERSION_MAJOR}.${_VERSION_MINOR} + MACHO_CURRENT_VERSION ${PROJECT_VERSION} + SOVERSION ${_VERSION_MAJOR}.${_VERSION_MINOR} + VERSION ${PROJECT_VERSION} +) + ################################################################################ # Add Core ################################################################################ From 54cd3eef5b5e772e8cf2f24dc9f03e76020c37f4 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 3 Sep 2023 15:21:44 +0200 Subject: [PATCH 11/66] cmake: Actually add sources to the Core component --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f059b98798..6c778b8349 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2069,7 +2069,6 @@ streamfx_add_library(StreamFX_Core STATIC EXCLUDE_FROM_ALL) add_library(StreamFX::Core ALIAS StreamFX_Core) # Register the library -target_sources(StreamFX_Core PRIVATE ${PROJECT_FILES}) target_link_libraries(StreamFX_Core PRIVATE ${PROJECT_LIBRARIES} PUBLIC OBS::libobs @@ -2111,7 +2110,7 @@ set_source_files_properties(${PROJECT_DATA} ${PROJECT_TEMPLATES} ${PROJECT_UI} $ HEADER_FILE_ONLY ON ) - # Enable Qt if needed +# Enable Qt if needed if(Qt5_Found OR Qt6_FOUND) set_target_properties(StreamFX_Core PROPERTIES AUTOUIC ON @@ -2130,6 +2129,7 @@ if(Qt5_Found OR Qt6_FOUND) ) endif() +target_sources(StreamFX_Core PRIVATE ${PROJECT_FILES}) ################################################################################ # Components From ac307a49122de1b1bbf574113b85eb61ec64b9b4 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Thu, 7 Sep 2023 03:29:11 +0200 Subject: [PATCH 12/66] cmake: Add common include directories and fix Windows Microsoft has some very annoying #define's which break most if not all of C++ at random spots. Best disable them globally so we don't have to ever deal with them. Also the MSVC CRT warnings are completely pointless, they are just whining that we use the standard instead of their non-portable functionality. --- CMakeLists.txt | 49 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c778b8349..93d355f6b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1626,6 +1626,21 @@ function(streamfx_add_library TARGET_NAME TARGET_TYPE) target_compile_definitions(${TARGET_NAME} PRIVATE __STDC_WANT_LIB_EXT1__=1 ) + if(D_PLATFORM_WINDOWS) + target_compile_definitions(${TARGET_NAME} + PUBLIC + # Microsoft Visual C++ + _CRT_SECURE_NO_WARNINGS + _ENABLE_EXTENDED_ALIGNED_STORAGE + + PUBLIC + # windows.h + # - Disable MIN/MAX macro as this breaks a lot of code. + NOMINMAX + # - Disable IN/OUT macro as this breaks a lot of code. + NOINOUT + ) + endif() # C/C++ Compiler Adjustments if(D_PLATFORM_WINDOWS AND ((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))) @@ -1891,27 +1906,41 @@ function(streamfx_add_component COMPONENT_NAME) # Allow disabling this component. set(${COMPONENT_OPTION} ON CACHE BOOL "Enable the ${COMPONENT_NAME} component?") + # Add common include directories + target_include_directories(${COMPONENT_TARGET} + PRIVATE + "${CMAKE_CURRENT_SOURCE_DIR}/source" + PUBLIC + "${CMAKE_CURRENT_SOURCE_DIR}/include" + ) + # Add files in common places. file(GLOB_RECURSE TEMPLATES FOLLOW_SYMLINKS CONFIGURE_DEPENDS "templates/*") source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/templates" PREFIX "Templates" FILES ${TEMPLATES}) + file(GLOB_RECURSE DATA FOLLOW_SYMLINKS CONFIGURE_DEPENDS "data/*") + source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/data" PREFIX "Data" FILES ${DATA}) + file(GLOB_RECURSE SOURCE_PRIVATE FOLLOW_SYMLINKS CONFIGURE_DEPENDS "ui/*") - source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/ui" PREFIX "User-Interface Files" FILES ${UI_PRIVATE}) + source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/ui" PREFIX "User-Interface Files" FILES ${USERINTERFACE}) file(GLOB_RECURSE SOURCE_PRIVATE FOLLOW_SYMLINKS CONFIGURE_DEPENDS "source/*") source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/source" PREFIX "Private Files" FILES ${SOURCE_PRIVATE}) + file(GLOB_RECURSE UI_PRIVATE FOLLOW_SYMLINKS CONFIGURE_DEPENDS "source/ui/*") file(GLOB_RECURSE GENERATED_PRIVATE FOLLOW_SYMLINKS CONFIGURE_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/source/*") source_group(TREE "${CMAKE_CURRENT_BINARY_DIR}/source" PREFIX "Private Files/Generated" FILES ${GENERATED_PRIVATE}) file(GLOB_RECURSE SOURCE_PUBLIC FOLLOW_SYMLINKS CONFIGURE_DEPENDS "include/*") source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/include" PREFIX "Public Files" FILES ${SOURCE_PUBLIC}) + file(GLOB_RECURSE UI_PUBLIC FOLLOW_SYMLINKS CONFIGURE_DEPENDS "include/ui/*") file(GLOB_RECURSE GENERATED_PUBLIC FOLLOW_SYMLINKS CONFIGURE_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/include/*") source_group(TREE "${CMAKE_CURRENT_BINARY_DIR}/include" PREFIX "Public Files/Generated" FILES ${GENERATED_PUBLIC}) target_sources(${COMPONENT_TARGET} PRIVATE + ${DATA} ${TEMPLATES} - ${UI_PRIVATE} + ${USERINTERFACE} ${SOURCE_PRIVATE} ${GENERATED_PRIVATE} PUBLIC @@ -1921,13 +1950,13 @@ function(streamfx_add_component COMPONENT_NAME) # Ignore data only files. set_source_files_properties( + ${DATA} ${TEMPLATES} - ${UI_PRIVATE} + ${USERINTERFACE} PROPERTIES HEADER_FILE_ONLY ON ) - # Enable Qt if needed set_target_properties(${TARGET_NAME} PROPERTIES AUTOUIC ON @@ -1936,7 +1965,6 @@ function(streamfx_add_component COMPONENT_NAME) AUTORCC ON AUTOGEN_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated" ) - set_source_files_properties( ${TEMPLATES} ${SOURCE_PRIVATE} @@ -1948,7 +1976,16 @@ function(streamfx_add_component COMPONENT_NAME) SKIP_AUTOMOC ON SKIP_AUTORCC ON SKIP_AUTOUIC ON - ) + ) + set_source_files_properties( + ${UI_PRIVATE} + ${UI_PUBLIC} + PROPERTIES + SKIP_AUTOGEN OFF + SKIP_AUTOMOC OFF + SKIP_AUTORCC OFF + SKIP_AUTOUIC OFF + ) endfunction() # Use this to add a dependency on another component, From a3b80daa54694e005dddced589412fb455ee8ce0 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Thu, 7 Sep 2023 06:01:09 +0200 Subject: [PATCH 13/66] Update Contributor guidelines Removes the prefixes from commit titles, as they served no other purpose than to complicate things. While we originally copied this style from obs-studio, it has been increasingly clear that the short description usually already describes what the prefix would also describe. And in case it doesn't, you can just simply filter by file or directory, and get the same result. --- CONTRIBUTING.md | 71 +++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 38 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 45f2ddc699..2bde5906e6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,53 +1,34 @@ # Contributing -This document goes over how you (and/or your organization) are expected to contribute. These guidelines are softly enforced and sometimes not required. +This document intends to teach you the proper way to contribute to the project as a set of guidelines. While they aren't always enforced, your chances of your code being accepted are significantly higher when you follow these. For smaller changes, we might opt to squash your changes to apply the guidelines below to your contribution. -## Localization -We use Crowdin to handle translations into many languages, and you can join the [StreamFX project on Crowdin](https://crowdin.com/project/obs-stream-effects) if you are interested in improving the translations to your native tongue. As Crowdin handles all other languages, Pull Requests therefore should only include changes to `en-US.ini`. +

Repository & Commits

-## Commit Guidelines -Commits should focus on a single change such as formatting, fixing a bug, a warning across the code, and similar things. This means that you should not include a fix to color format handling in a commit that implements a new encoder, or include a fix to a bug with a fix to a warning. +As this is a rather large project, we have certain rules to follow when contributing via git. ### Linear History -This project prefers the linear history of `git rebase` and forbids merge commits. This allows all branches to be a single line back to the root, unless viewed as a whole where it becomes a tree. If you are working on a branch for a feature, bug or other thing, you should know how to rebase back onto the main branch before making a pull request. +We follow the paradigm of linear history which forbids branches from being merged, thus changes made on branches are `git rebase`d back onto the root. This simplifies the code history significantly, but makes reverting changes more difficult. + +❌ `git merge` +✅ `git rebase` -### Commit Message & Title -We require a commit message format like this: +### Commits +A commit should be containing a single change, even if it spans multiple units, and has the following format: ``` -prefix: short description +short description optional long description ``` -The `short description` should be no longer than 80 characters, excluding the `prefix: ` part. The `optional long description` should be present if the change is not immediately obvious - however it does not replace proper documentation. - -#### The correct `prefix` -Depending on where the file is that you ended up modifying, or if you modified multiple files at once, the prefix changes. Take a look at the list to understand which directories cause which prefix: +The short description should be no longer than 120 characters and focus on the important things. The long description is optional, but should be included for larger changes. -- `/CMakeLists.txt`, `/cmake` -> `cmake` -- `/.github/workflows` -> `ci` -- `/data/locale`, `/crowdin.yml` -> `locale` -- `/data/examples` -> `examples` -- `/data` -> `data` (if not part of another prefix) -- `/media` -> `media` -- `/source`, `/include` -> `code` -- `/templates` -> `templates` (or merge with `cmake`) -- `/third-party` -> `third-party` -- `/patches` -> `patches` -- `/tools` -> `tools` -- `/ui` -> `ui` (if not part of a `code` change) -- Most other files -> `project` +
-If multiple locations match, they should be alphabetically sorted and separated by `, `. A change to both `ui` and `code` will as such result in a prefix of `code, ui`. If a `code` change only affects a single file, or multiple files with a common parent file, the prefix should be the path of the file, like shown in the following examples: -- `/source/encoders/encoder-ffmpeg` -> `encoder/ffmpeg` -- `/source/filters/filter-shader` -> `filter/shader` -- `/source/encoders/handlers/handler`, `/source/encoders/encoder-ffmpeg` -> `encoder/ffmpeg` - -## Coding Guidelines +

Coding

### Documentation -Documentation should be present in areas where it would save time to new developers, and in areas where an API is defined. This means that you should not provide documentation for things like `1 + 1`, but for things like the following: +The short form of the this part is **Code != Documentation**. Documentation is what you intend your Code to do, while Code is what it actually does. If your Code mismatches the Documentation, it is time to fix the Code, unless the change is a new addition in terms of behavior or functionality. Note that by this we don't mean to document things like `1 + 1` but instead things like the following: ```c++ int32_t idepth = static_cast(depth); @@ -58,14 +39,18 @@ int32_t container_size = static_cast(pow(2l, (idepth + (idepth / 2)))); ```c++ class magic_class { - void do_magic_thing(float magic_number); + void do_magic_thing(float magic_number) { + // Lots and lots of SIMD code that does a magic thing... + } } ``` -Both of these examples would be much easier to understand if they had proper documentation, and save hours if not even days of delving into code. Documentation is about saving time to new developers, and can't be replaced by code. Code is not Documentation! +Documenting what a block of Code does not only helps you, it also helps other contributors understand what this Code is supposed to do. While you may be able to read your own Code (at least for now), there is no guarantee that either you or someone else will be able to read it in the future. Not only that, but it makes spotting mistakes and fixing them easier, since we have Documentation to tell us what it is supposed to do! ### Naming & Casing -All long-term objects should have a descriptive name, which can be used by other developers to know what it is for. Temporary objects should also have some information, but do not necessarily follow the same rules. +The project isn't too strict about variable naming as well as casing, but we do prefer a universal style across all code. While this may appear as removing your individuality from the code, it ultimately serves the purpose of making it easier to jump from one block of code to the other, without having to guess at what this code now does. + +Additionally we prefer it when things are named by what they either do or what they contain, instead of having the entire alphabet spelled out in different arrangements. While it is fine to have chaos in your own Code for your private or hobby projects, it is not fine to submit such code to other projects. #### Macros - Casing: ELEPHANT_CASE @@ -249,6 +234,16 @@ Special rules for `class` #### Members All class members must be `private` and only accessible through get-/setters. The setter of a member should also validate if the setting is within an allowed range, and throw exceptions if an error occurs. If there is no better option, it is allowed to delay validation until a common function is called. -## Building -Please read [the guide on the wiki](https://github.com/Xaymar/obs-StreamFX/wiki/Building) for building the project. +
+ +

Localization

+ +We use Crowdin to handle translations into many languages, and you can join the [StreamFX project on Crowdin](https://crowdin.com/project/obs-stream-effects) if you are interested in improving the translations to your native tongue. As Crowdin handles all other languages, Pull Requests therefore should only include changes to `en-US.ini`. + +
+## Further Resources +- A guide on how to build the project is in BUILDING.MD. +- A no bullshit guide to `git`: https://rogerdudler.github.io/git-guide/ + - Remember, `git` has help pages for all commands - run `git --help`. + - ... or use visual clients, like TortoiseGit, Github Desktop, SourceTree, and similar. It's what I do. From 0af846ea00656508cd65519a637d007236159c22 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Thu, 7 Sep 2023 06:05:06 +0200 Subject: [PATCH 14/66] Migrate building guide from wiki to code This should always have been part of the code, but hey - we learn at some point and improve ourselves. --- BUILDING.md | 155 ++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 2 + 2 files changed, 157 insertions(+) create mode 100644 BUILDING.md diff --git a/BUILDING.md b/BUILDING.md new file mode 100644 index 0000000000..72bdf0096c --- /dev/null +++ b/BUILDING.md @@ -0,0 +1,155 @@ +# Building +This document intends to guide you through the process of building StreamFX. It requires understanding of the tools used, and may require you to learn tools yourself before you can advance further in the guide. It is intended to be used by developers and contributors. + +## Building Bundled +
The main method to build StreamFX is to first set up an OBS Studio copy and then integrate the StreamFX repository into it. + +1. [Uninstall](Uninstallation) any currently installed versions of StreamFX to prevent conflicts. +2. Follow the [OBS Studio build guide](https://obsproject.com/wiki/install-instructions) for automated building on your platform of choice. + - **MacOS:** You will need to use the XCode generator to build StreamFX as the Ninja generator does not support the flags StreamFX requires. +3. Integrate StreamFX into the OBS Studio build flow: + 1. Navigate to either of these directories: + - **With UI:** `/UI/frontend-plugins` + - **Without UI:** `/plugins` + 2. Open a `git` enabled shell (git-bash on windows). + 3. Run `git submodule add 'https://github.com/Xaymar/obs-StreamFX.git' streamfx`. + 4. Run `git submodule update --init --recursive`. + 5. Append the line `add_subdirectory(streamfx)` to the `CMakeLists.txt` file in the same directory. +4. Run the same script(s) from step 2 again. +5. Done. StreamFX is now part of the build. + +
+ +## Building CI-Style +
This method is designed for continuous integration and releases, and requires significant knowledge of CMake, OBS, and various other tools. Additionally it is not guaranteed to work on every machine, as it is only designed for use in continuous integration and nowhere else. It may even stop being maintained entirely with no warning whatsoever. You are entirely on your own when you choose this method. + +#### Install Prerequisites / Dependencies +- [Git](https://git-scm.com/) + - **Debian / Ubuntu:** `sudo apt install git` +- [CMake](https://cmake.org/) 3.20 (or newer) + - **Debian / Ubuntu:** `sudo apt install cmake` +- A compatible Compiler: + - **Windows** + [Visual Studio](https://visualstudio.microsoft.com/vs/) 2019 (or newer) + - **MacOS** + Xcode 11.x (or newer) for x86_64 + Xcode 12.x (or newer) for arm64 + - **Debian / Ubuntu** + - Essential Build Tools: + `sudo apt install build-essential pkg-config checkinstall make ninja-build` + - One of: + - GCC 11 (or newer) + `sudo apt install gcc-11 g++-11` + - [LLVM](https://releases.llvm.org/) Clang 14 (or newer) + `sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"` + - One of: + - ld or gold + `sudo apt install binutils` + - [LLVM](https://releases.llvm.org/) lld + `sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"` + - [mold](https://github.com/rui314/mold) + `sudo apt install mold` +- [Qt](https://www.qt.io/) 6: + - **Windows** + A Node.JS based tool is provided toread and parse the `/third-party/obs-studio/buildspec.json` file. See `/.github/workflows/main.yml` on usage and output parsing. + - **MacOS** + A Node.JS based tool is provided toread and parse the `/third-party/obs-studio/buildspec.json` file. See `/.github/workflows/main.yml` on usage and output parsing. + - Linux: + - **Debian / Ubuntu:** `sudo apt install qt6-base-dev qt6-base-private-dev libqt6svg6-dev` +- [CURL](https://curl.se/): + - **Windows** + A Node.JS based tool is provided toread and parse the `/third-party/obs-studio/buildspec.json` file. See `/.github/workflows/main.yml` on usage and output parsing. + - **MacOS** + A Node.JS based tool is provided toread and parse the `/third-party/obs-studio/buildspec.json` file. See `/.github/workflows/main.yml` on usage and output parsing. + - **Debian / Ubuntu:** + `sudo apt install libcurl4-openssl-dev` +- [FFmpeg](https://ffmpeg.org/) (Optional, for FFmpeg component only): + - **Windows** + A Node.JS based tool is provided toread and parse the `/third-party/obs-studio/buildspec.json` file. See `/.github/workflows/main.yml` on usage and output parsing. + - **MacOS** + A Node.JS based tool is provided toread and parse the `/third-party/obs-studio/buildspec.json` file. See `/.github/workflows/main.yml` on usage and output parsing. + - **Debian / Ubuntu** + `sudo apt install libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev` +- [LLVM](https://releases.llvm.org/) (Optional, for clang-format and clang-tidy integration only): + - **Debian / Ubuntu** + `sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" all` +- [InnoSetup](https://jrsoftware.org/isinfo.php) (Optional, for **Windows** installer only) + +### Cloning the Project +Using your preferred tool of choice for git, clone the repository including all submodules into a directory. If you use git directly, then you can clone the entire project with `git clone --recursive https://github.com/Xaymar/obs-StreamFX.git streamfx`. + +### Configuring with CMake +There are two ways to handle this step, with the GUI variant of CMake and with the command line version of CMake. This guide will focus on the GUI variant, but all the steps below can be done with the command line version as well. + +1. Launch CMake-GUI and wait for it to open. +2. Click the button named `Browse Build` and point it at an empty folder. For example, create a folder in the project called `build` and select that folder. +3. Click the button named `Browse Source` and point it at the project itself. +4. Click the button named `Configure`, select your preferred Generator (the default is usually fine), and wait for it to complete. This will most likely result in an error which is expected. +5. Adjust the variables in the variable list as necessary. Take a look at [the documentation](#CMake-Options) for what each option does. +6. Click the button named `Generate`, which will also run `Configure`. Both together should succeed if you did everything correctly. +7. If available, you can now click the button named `Open Project` to immediately jump into your IDE of choice. + +
+ +## CMake Options +
The project is intended to be versatile and configurable, so we offer almost everything to be configured on a silver platter directly in CMake (if possible). If StreamFX detects that it is being built together with other projects, it will automatically prefix all options with `StreamFX_` to prevent collisions. + +### Generic +- `GIT` (not prefixed) + Path to the `git` binary on your system, for use with features that require git during configuration and generation. +- `VERSION` + Set or override the version of the project with a custom one. Allowed formats are: SemVer 2.0.0, CMake. + +### Code +- `ENABLE_CLANG` + Enable integration of `clang-format` and `clang-tidy` +- `CLANG_PATH` (not prefixed, only with `ENABLE_CLANG`) + Path to the `clang` installation containing `clang-format` and `clang-tidy`. Only used as a hint. +- `CLANG_FORMAT_PATH` and `CLANG_TIDY_PATH` (not prefixed) + Path to `clang-format` and `clang-tidy` that will be used. + +### Dependencies +- `LibObs_DIR` + Path to the obs-studio libraries. +- `Qt5_DIR`, `Qt6_DIR` or `Qt_DIR` (autodetect) + Path to Qt5 (OBS Studio 27.x and lower) or Qt6 (OBS Studio 28.x and higher). +- `FFmpeg_DIR` + Path to compatible FFmpeg libraries and headers. +- `CURL_DIR` + Path to compatible CURL libraries and headers. +- `AOM_DIR` + Path to compatible AOM libraries and headers. + +### Compiling +- `ENABLE_FASTMATH` + Enable fast math optimizations if the compiler supports them. This trades precision for performance, and is usually good enough anyway. +- `ENABLE_LTO` + Enable link time optimization for faster binaries in exchange for longer build times. +- `ENABLE_PROFILING` + Enable CPU and GPU profiling code, this option reduces performance drastically. +- `TARGET_*` + Specify which architecture target the generated binaries will use. + +### Components +- `COMPONENT_` + Enable the component by the given name. + +### Installing & Packaging +These options are only available in CI-Style mode. + +- `CMAKE_INSTALL_PREFIX` + The path in which installed content should be placed when building the `install` target. +- `STRUCTURE_PACKAGEMANAGER` + If enabled will install files in a layout compatible with package managers. +- `STRUCTURE_UNIFIED` + Enable to install files in a layout compatible with an OBS Studio plugin manager. +- `PACKAGE_NAME` + The name of the packaged archive, excluding the prefix, suffix and extension. +- `PACKAGE_PREFIX` + The path in which the packages should be placed. +- `PACKAGE_SUFFIX` + The suffix to attach to the name, before the file extension. If left blank will attach the current version string to the package. +- `STRUCTURE_UNIFIED` + Enable to replace the PACKAGE_ZIP target with a target that generates a single `.obs` file instead. + +
diff --git a/README.md b/README.md index 5ff22a6e01..98a3d2b712 100644 --- a/README.md +++ b/README.md @@ -10,3 +10,5 @@ Bring your setup to the modern day with StreamFX! With several super fast filter ## Further Links * [Wiki](https://github.com/Xaymar/obs-StreamFX/wiki) * [Installation Guide](https://github.com/xaymar/obs-streamfx/wiki/Installation) +* See BUILDING.md +* See CONTRIBUTING.md From 8f7dd1ba4e69cde607f24c1db3db9226fd8d4621 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Thu, 7 Sep 2023 06:05:21 +0200 Subject: [PATCH 15/66] Remove useless pull request template --- .github/pull_request_template.md | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index d38eb14494..0000000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,15 +0,0 @@ -### Explain the Pull Request - - -#### Completion Checklist - -- [ ] This has been tested on the following platforms: - - [ ] MacOS 10.15 - - [ ] MacOS 11 - - [ ] MacOS 12 - - [ ] Ubuntu 20.04 - - [ ] Ubuntu 22.04 - - [ ] Windows 10 - - [ ] Windows 11 -- [ ] The copyright headers and license files have been updated. -- [ ] I will maintain this for the forseeable future, and have added myself to `CODEOWNERS`. From 3d3aef47afed7563ab4fdef65a448b7cbf6172a3 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Thu, 7 Sep 2023 06:16:11 +0200 Subject: [PATCH 16/66] Reorder the template for issues and bugs --- .github/ISSUE_TEMPLATE/issue.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/issue.yml b/.github/ISSUE_TEMPLATE/issue.yml index 066f44681f..58de8b0a21 100644 --- a/.github/ISSUE_TEMPLATE/issue.yml +++ b/.github/ISSUE_TEMPLATE/issue.yml @@ -7,12 +7,6 @@ title: "REPLACE ME" description: "This form is for bug and crash reports only, primarily used by developers. Abuse of this form will lead to a permanent interaction ban." labels: ["bug"] body: -- type: textarea - attributes: - label: "OBS Studio Logs" - description: "Paste the content or attach the log files from OBS Studio here. In the event of a crash, paste or attach both the crash log and the normal log file." - validations: - required: true - type: textarea attributes: label: "Current and Expected Behavior" @@ -25,6 +19,12 @@ body: description: "What steps are required to consistently reproduce the bug/crash/freeze?" validations: required: true +- type: textarea + attributes: + label: "Log files & Crash Dumps" + description: "Paste the content or attach the log files from OBS Studio here. In the event of a crash, paste or attach both the crash log and the normal log file." + validations: + required: false - type: textarea attributes: label: "Any additional Information we need to know?" From cfcf975794fd83f01792fbcd085563e87ef33fbf Mon Sep 17 00:00:00 2001 From: brighten Date: Fri, 21 Jul 2023 15:18:32 -0700 Subject: [PATCH 17/66] fix: add decimal place to remove ambiguity error: Error compiling shader: 0(142) : error C1101: ambiguous overloaded function reference "log(int)" (0) : lowp float log(lowp float) (0) : mediump float log(mediump float) (0) : float log(float) error: device_pixelshader_create (GL) failed error: Pass (0) <> missing pixel shader! error: [StreamFX] Error loading '/usr/local/share/obs/obs-plugins/StreamFX/effects/color-grade.effect': Unknown error during effect compile. error: [StreamFX] Unexpected exception in function '_create': Unknown error during effect compile.. error: Failed to create source 'Color Grading'! --- data/effects/shared.effect | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/effects/shared.effect b/data/effects/shared.effect index b5d36e0c40..812193ff99 100644 --- a/data/effects/shared.effect +++ b/data/effects/shared.effect @@ -8,7 +8,7 @@ // OBS Studio does not correctly translate all HLSL functionality to GLSL. // log10(x) is HLSL-exclusive and not translated by OBS Shader Parser. -#define m_log10(x) (log(x) / log(10)) +#define m_log10(x) (log(x) / log(10.)) //------------------------------------------------------------------------------ // Uniforms From 6b02b76e6c3c8030ab84d0a59e8cef05ef1ab569 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 05:50:41 +0200 Subject: [PATCH 18/66] Add prefix to commit titles when needed --- CONTRIBUTING.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2bde5906e6..7dabee5e8b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,20 +8,65 @@ As this is a rather large project, we have certain rules to follow when contribu ### Linear History We follow the paradigm of linear history which forbids branches from being merged, thus changes made on branches are `git rebase`d back onto the root. This simplifies the code history significantly, but makes reverting changes more difficult. -❌ `git merge` +❌ `git merge` ✅ `git rebase` ### Commits A commit should be containing a single change, even if it spans multiple units, and has the following format: ``` -short description +prefix: short description optional long description ``` The short description should be no longer than 120 characters and focus on the important things. The long description is optional, but should be included for larger changes. +#### The appropriate `prefix` + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Path(s)PrefixExample
+ data/locale + locale + data/locale/en-US.ini -> locale +
components/namename + components/shader -> shader +
+ source
+ templates
+ data
+ ui +
core + ui/main.ui -> core +
Anything elseOmit the prefix
+ +If multiple match, apply the prefix that changes the most files. If all are equal, alphabetically sort the prefixes and list comma separated. + From d2a543f1181b9c99f4af417893e8b4fa116c3b86 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Wed, 6 Sep 2023 02:39:55 +0200 Subject: [PATCH 19/66] core: Clean up some older C++ code - Remove float_t and double_t usage, as they aren't related to sized types. - Remove unused aligned types, their usage has been replaced quite a while ago. - Update the templates for pow and is_power_of_two. --- source/filters/filter-autoframing.cpp | 2 +- source/filters/filter-autoframing.hpp | 2 +- source/filters/filter-blur.cpp | 18 +- source/filters/filter-blur.hpp | 24 +-- source/filters/filter-color-grade.cpp | 60 +++---- source/filters/filter-color-grade.hpp | 4 +- source/filters/filter-denoising.cpp | 2 +- source/filters/filter-denoising.hpp | 2 +- source/filters/filter-dynamic-mask.cpp | 6 +- source/filters/filter-dynamic-mask.hpp | 6 +- source/filters/filter-sdf-effects.cpp | 98 +++++------ source/filters/filter-sdf-effects.hpp | 40 ++--- source/filters/filter-shader.cpp | 2 +- source/filters/filter-shader.hpp | 2 +- source/filters/filter-upscaling.cpp | 2 +- source/filters/filter-upscaling.hpp | 2 +- source/filters/filter-virtual-greenscreen.cpp | 2 +- source/filters/filter-virtual-greenscreen.hpp | 2 +- source/gfx/blur/gfx-blur-box-linear.cpp | 26 +-- source/gfx/blur/gfx-blur-box.cpp | 56 +++--- source/gfx/blur/gfx-blur-gaussian-linear.cpp | 28 +-- source/gfx/blur/gfx-blur-gaussian-linear.hpp | 4 +- source/gfx/blur/gfx-blur-gaussian.cpp | 50 +++--- source/gfx/blur/gfx-blur-gaussian.hpp | 2 +- source/gfx/gfx-mipmapper.cpp | 4 +- source/gfx/gfx-source-texture.cpp | 2 +- source/gfx/shader/gfx-shader-param-basic.cpp | 12 +- source/gfx/shader/gfx-shader-param-basic.hpp | 2 +- source/gfx/shader/gfx-shader.cpp | 18 +- source/gfx/shader/gfx-shader.hpp | 12 +- source/obs/gs/gs-effect-parameter.cpp | 128 +++++++------- source/obs/gs/gs-effect-parameter.hpp | 34 ++-- source/obs/gs/gs-helper.hpp | 48 +++--- source/obs/gs/gs-texture.cpp | 4 +- source/obs/gs/gs-vertex.cpp | 4 +- source/obs/gs/gs-vertexbuffer.cpp | 24 +-- source/obs/obs-source-factory.hpp | 2 +- source/sources/source-mirror.cpp | 2 +- source/sources/source-mirror.hpp | 2 +- source/sources/source-shader.cpp | 2 +- source/sources/source-shader.hpp | 2 +- source/transitions/transition-shader.cpp | 6 +- source/transitions/transition-shader.hpp | 4 +- source/util/utility.cpp | 64 +------ source/util/utility.hpp | 162 ++++++++++-------- 45 files changed, 473 insertions(+), 507 deletions(-) diff --git a/source/filters/filter-autoframing.cpp b/source/filters/filter-autoframing.cpp index 069211d915..60588b6038 100644 --- a/source/filters/filter-autoframing.cpp +++ b/source/filters/filter-autoframing.cpp @@ -401,7 +401,7 @@ uint32_t autoframing_instance::get_height() return std::max(_out_size.second, 1); } -void autoframing_instance::video_tick(float_t seconds) +void autoframing_instance::video_tick(float seconds) { auto target = obs_filter_get_target(_self); auto width = obs_source_get_base_width(target); diff --git a/source/filters/filter-autoframing.hpp b/source/filters/filter-autoframing.hpp index f5409d0f52..01983f6fc7 100644 --- a/source/filters/filter-autoframing.hpp +++ b/source/filters/filter-autoframing.hpp @@ -126,7 +126,7 @@ namespace streamfx::filter::autoframing { uint32_t get_width() override; uint32_t get_height() override; - virtual void video_tick(float_t seconds) override; + virtual void video_tick(float seconds) override; virtual void video_render(gs_effect_t* effect) override; private: diff --git a/source/filters/filter-blur.cpp b/source/filters/filter-blur.cpp index 61c2905dc7..b399b93089 100644 --- a/source/filters/filter-blur.cpp +++ b/source/filters/filter-blur.cpp @@ -290,12 +290,12 @@ void blur_instance::update(obs_data_t* settings) _mask.type = static_cast(obs_data_get_int(settings, ST_KEY_MASK_TYPE)); switch (_mask.type) { case mask_type::Region: - _mask.region.left = float_t(obs_data_get_double(settings, ST_KEY_MASK_REGION_LEFT) / 100.0); - _mask.region.top = float_t(obs_data_get_double(settings, ST_KEY_MASK_REGION_TOP) / 100.0); - _mask.region.right = 1.0f - float_t(obs_data_get_double(settings, ST_KEY_MASK_REGION_RIGHT) / 100.0); - _mask.region.bottom = 1.0f - float_t(obs_data_get_double(settings, ST_KEY_MASK_REGION_BOTTOM) / 100.0); - _mask.region.feather = float_t(obs_data_get_double(settings, ST_KEY_MASK_REGION_FEATHER) / 100.0); - _mask.region.feather_shift = float_t(obs_data_get_double(settings, ST_KEY_MASK_REGION_FEATHER_SHIFT) / 100.0); + _mask.region.left = float(obs_data_get_double(settings, ST_KEY_MASK_REGION_LEFT) / 100.0); + _mask.region.top = float(obs_data_get_double(settings, ST_KEY_MASK_REGION_TOP) / 100.0); + _mask.region.right = 1.0f - float(obs_data_get_double(settings, ST_KEY_MASK_REGION_RIGHT) / 100.0); + _mask.region.bottom = 1.0f - float(obs_data_get_double(settings, ST_KEY_MASK_REGION_BOTTOM) / 100.0); + _mask.region.feather = float(obs_data_get_double(settings, ST_KEY_MASK_REGION_FEATHER) / 100.0); + _mask.region.feather_shift = float(obs_data_get_double(settings, ST_KEY_MASK_REGION_FEATHER_SHIFT) / 100.0); _mask.region.invert = obs_data_get_bool(settings, ST_KEY_MASK_REGION_INVERT); break; case mask_type::Image: @@ -310,8 +310,8 @@ void blur_instance::update(obs_data_t* settings) _mask.color.r = static_cast((color >> 0) & 0xFF) / 255.0f; _mask.color.g = static_cast((color >> 8) & 0xFF) / 255.0f; _mask.color.b = static_cast((color >> 16) & 0xFF) / 255.0f; - _mask.color.a = static_cast(obs_data_get_double(settings, ST_KEY_MASK_ALPHA)); - _mask.multiplier = float_t(obs_data_get_double(settings, ST_KEY_MASK_MULTIPLIER)); + _mask.color.a = static_cast(obs_data_get_double(settings, ST_KEY_MASK_ALPHA)); + _mask.multiplier = float(obs_data_get_double(settings, ST_KEY_MASK_MULTIPLIER)); } } } @@ -464,7 +464,7 @@ void blur_instance::video_render(gs_effect_t* effect) std::string technique = ""; switch (this->_mask.type) { case mask_type::Region: - if (this->_mask.region.feather > std::numeric_limits::epsilon()) { + if (this->_mask.region.feather > std::numeric_limits::epsilon()) { if (this->_mask.region.invert) { technique = "RegionFeatherInverted"; } else { diff --git a/source/filters/filter-blur.hpp b/source/filters/filter-blur.hpp index 4effdd3485..6d22a54081 100644 --- a/source/filters/filter-blur.hpp +++ b/source/filters/filter-blur.hpp @@ -55,12 +55,12 @@ namespace streamfx::filter::blur { bool enabled; mask_type type; struct { - float_t left; - float_t top; - float_t right; - float_t bottom; - float_t feather; - float_t feather_shift; + float left; + float top; + float right; + float bottom; + float feather; + float feather_shift; bool invert; } region; struct { @@ -76,12 +76,12 @@ namespace streamfx::filter::blur { std::shared_ptr texture; } source; struct { - float_t r; - float_t g; - float_t b; - float_t a; + float r; + float g; + float b; + float a; } color; - float_t multiplier; + float multiplier; } _mask; public: @@ -93,7 +93,7 @@ namespace streamfx::filter::blur { virtual void migrate(obs_data_t* settings, uint64_t version) override; virtual void update(obs_data_t* settings) override; - virtual void video_tick(float_t time) override; + virtual void video_tick(float time) override; virtual void video_render(gs_effect_t* effect) override; private: diff --git a/source/filters/filter-color-grade.cpp b/source/filters/filter-color-grade.cpp index eb9d265bc3..db78fced97 100644 --- a/source/filters/filter-color-grade.cpp +++ b/source/filters/filter-color-grade.cpp @@ -156,12 +156,12 @@ void color_grade_instance::allocate_rendertarget(gs_color_format format) _cache_rt = std::make_unique(format, GS_ZS_NONE); } -float_t fix_gamma_value(double_t v) +float fix_gamma_value(double_t v) { if (v < 0.0) { - return static_cast(-v + 1.0); + return static_cast(-v + 1.0); } else { - return static_cast(1.0 / (v + 1.0)); + return static_cast(1.0 / (v + 1.0)); } } @@ -174,38 +174,38 @@ void color_grade_instance::migrate(obs_data_t* data, uint64_t version) {} void color_grade_instance::update(obs_data_t* data) { - _lift.x = static_cast(obs_data_get_double(data, ST_KEY_LIFT_(ST_RED)) / 100.0); - _lift.y = static_cast(obs_data_get_double(data, ST_KEY_LIFT_(ST_GREEN)) / 100.0); - _lift.z = static_cast(obs_data_get_double(data, ST_KEY_LIFT_(ST_BLUE)) / 100.0); - _lift.w = static_cast(obs_data_get_double(data, ST_KEY_LIFT_(ST_ALL)) / 100.0); + _lift.x = static_cast(obs_data_get_double(data, ST_KEY_LIFT_(ST_RED)) / 100.0); + _lift.y = static_cast(obs_data_get_double(data, ST_KEY_LIFT_(ST_GREEN)) / 100.0); + _lift.z = static_cast(obs_data_get_double(data, ST_KEY_LIFT_(ST_BLUE)) / 100.0); + _lift.w = static_cast(obs_data_get_double(data, ST_KEY_LIFT_(ST_ALL)) / 100.0); _gamma.x = fix_gamma_value(obs_data_get_double(data, ST_KEY_GAMMA_(ST_RED)) / 100.0); _gamma.y = fix_gamma_value(obs_data_get_double(data, ST_KEY_GAMMA_(ST_GREEN)) / 100.0); _gamma.z = fix_gamma_value(obs_data_get_double(data, ST_KEY_GAMMA_(ST_BLUE)) / 100.0); _gamma.w = fix_gamma_value(obs_data_get_double(data, ST_KEY_GAMMA_(ST_ALL)) / 100.0); - _gain.x = static_cast(obs_data_get_double(data, ST_KEY_GAIN_(ST_RED)) / 100.0); - _gain.y = static_cast(obs_data_get_double(data, ST_KEY_GAIN_(ST_GREEN)) / 100.0); - _gain.z = static_cast(obs_data_get_double(data, ST_KEY_GAIN_(ST_BLUE)) / 100.0); - _gain.w = static_cast(obs_data_get_double(data, ST_KEY_GAIN_(ST_ALL)) / 100.0); - _offset.x = static_cast(obs_data_get_double(data, ST_KEY_OFFSET_(ST_RED)) / 100.0); - _offset.y = static_cast(obs_data_get_double(data, ST_KEY_OFFSET_(ST_GREEN)) / 100.0); - _offset.z = static_cast(obs_data_get_double(data, ST_KEY_OFFSET_(ST_BLUE)) / 100.0); - _offset.w = static_cast(obs_data_get_double(data, ST_KEY_OFFSET_(ST_ALL)) / 100.0); + _gain.x = static_cast(obs_data_get_double(data, ST_KEY_GAIN_(ST_RED)) / 100.0); + _gain.y = static_cast(obs_data_get_double(data, ST_KEY_GAIN_(ST_GREEN)) / 100.0); + _gain.z = static_cast(obs_data_get_double(data, ST_KEY_GAIN_(ST_BLUE)) / 100.0); + _gain.w = static_cast(obs_data_get_double(data, ST_KEY_GAIN_(ST_ALL)) / 100.0); + _offset.x = static_cast(obs_data_get_double(data, ST_KEY_OFFSET_(ST_RED)) / 100.0); + _offset.y = static_cast(obs_data_get_double(data, ST_KEY_OFFSET_(ST_GREEN)) / 100.0); + _offset.z = static_cast(obs_data_get_double(data, ST_KEY_OFFSET_(ST_BLUE)) / 100.0); + _offset.w = static_cast(obs_data_get_double(data, ST_KEY_OFFSET_(ST_ALL)) / 100.0); _tint_detection = static_cast(obs_data_get_int(data, ST_KEY_TINT_DETECTION)); _tint_luma = static_cast(obs_data_get_int(data, ST_KEY_TINT_MODE)); - _tint_exponent = static_cast(obs_data_get_double(data, ST_KEY_TINT_EXPONENT)); - _tint_low.x = static_cast(obs_data_get_double(data, ST_KEY_TINT_(ST_TONE_LOW, ST_RED)) / 100.0); - _tint_low.y = static_cast(obs_data_get_double(data, ST_KEY_TINT_(ST_TONE_LOW, ST_GREEN)) / 100.0); - _tint_low.z = static_cast(obs_data_get_double(data, ST_KEY_TINT_(ST_TONE_LOW, ST_BLUE)) / 100.0); - _tint_mid.x = static_cast(obs_data_get_double(data, ST_KEY_TINT_(ST_TONE_MID, ST_RED)) / 100.0); - _tint_mid.y = static_cast(obs_data_get_double(data, ST_KEY_TINT_(ST_TONE_MID, ST_GREEN)) / 100.0); - _tint_mid.z = static_cast(obs_data_get_double(data, ST_KEY_TINT_(ST_TONE_MID, ST_BLUE)) / 100.0); - _tint_hig.x = static_cast(obs_data_get_double(data, ST_KEY_TINT_(ST_TONE_HIGH, ST_RED)) / 100.0); - _tint_hig.y = static_cast(obs_data_get_double(data, ST_KEY_TINT_(ST_TONE_HIGH, ST_GREEN)) / 100.0); - _tint_hig.z = static_cast(obs_data_get_double(data, ST_KEY_TINT_(ST_TONE_HIGH, ST_BLUE)) / 100.0); - _correction.x = static_cast(obs_data_get_double(data, ST_KEY_CORRECTION_(ST_HUE)) / 360.0); - _correction.y = static_cast(obs_data_get_double(data, ST_KEY_CORRECTION_(ST_SATURATION)) / 100.0); - _correction.z = static_cast(obs_data_get_double(data, ST_KEY_CORRECTION_(ST_LIGHTNESS)) / 100.0); - _correction.w = static_cast(obs_data_get_double(data, ST_KEY_CORRECTION_(ST_CONTRAST)) / 100.0); + _tint_exponent = static_cast(obs_data_get_double(data, ST_KEY_TINT_EXPONENT)); + _tint_low.x = static_cast(obs_data_get_double(data, ST_KEY_TINT_(ST_TONE_LOW, ST_RED)) / 100.0); + _tint_low.y = static_cast(obs_data_get_double(data, ST_KEY_TINT_(ST_TONE_LOW, ST_GREEN)) / 100.0); + _tint_low.z = static_cast(obs_data_get_double(data, ST_KEY_TINT_(ST_TONE_LOW, ST_BLUE)) / 100.0); + _tint_mid.x = static_cast(obs_data_get_double(data, ST_KEY_TINT_(ST_TONE_MID, ST_RED)) / 100.0); + _tint_mid.y = static_cast(obs_data_get_double(data, ST_KEY_TINT_(ST_TONE_MID, ST_GREEN)) / 100.0); + _tint_mid.z = static_cast(obs_data_get_double(data, ST_KEY_TINT_(ST_TONE_MID, ST_BLUE)) / 100.0); + _tint_hig.x = static_cast(obs_data_get_double(data, ST_KEY_TINT_(ST_TONE_HIGH, ST_RED)) / 100.0); + _tint_hig.y = static_cast(obs_data_get_double(data, ST_KEY_TINT_(ST_TONE_HIGH, ST_GREEN)) / 100.0); + _tint_hig.z = static_cast(obs_data_get_double(data, ST_KEY_TINT_(ST_TONE_HIGH, ST_BLUE)) / 100.0); + _correction.x = static_cast(obs_data_get_double(data, ST_KEY_CORRECTION_(ST_HUE)) / 360.0); + _correction.y = static_cast(obs_data_get_double(data, ST_KEY_CORRECTION_(ST_SATURATION)) / 100.0); + _correction.z = static_cast(obs_data_get_double(data, ST_KEY_CORRECTION_(ST_LIGHTNESS)) / 100.0); + _correction.w = static_cast(obs_data_get_double(data, ST_KEY_CORRECTION_(ST_CONTRAST)) / 100.0); { int64_t v = obs_data_get_int(data, ST_KEY_RENDERMODE); @@ -370,7 +370,7 @@ void color_grade_instance::video_render(gs_effect_t* shader) { auto op = _ccache_rt->render(width, height); - gs_ortho(0, static_cast(width), 0, static_cast(height), 0, 1); + gs_ortho(0, static_cast(width), 0, static_cast(height), 0, 1); // Blank out the input cache. gs_clear(GS_CLEAR_COLOR | GS_CLEAR_DEPTH, &blank, 0., 0); diff --git a/source/filters/filter-color-grade.hpp b/source/filters/filter-color-grade.hpp index 9e4e7fa776..e9c867d5bc 100644 --- a/source/filters/filter-color-grade.hpp +++ b/source/filters/filter-color-grade.hpp @@ -43,7 +43,7 @@ namespace streamfx::filter::color_grade { vec4 _offset; detection_mode _tint_detection; luma_mode _tint_luma; - float_t _tint_exponent; + float _tint_exponent; vec3 _tint_low; vec3 _tint_mid; vec3 _tint_hig; @@ -83,7 +83,7 @@ namespace streamfx::filter::color_grade { void rebuild_lut(); - virtual void video_tick(float_t time) override; + virtual void video_tick(float time) override; virtual void video_render(gs_effect_t* effect) override; }; diff --git a/source/filters/filter-denoising.cpp b/source/filters/filter-denoising.cpp index 41d1a984ad..42745b3741 100644 --- a/source/filters/filter-denoising.cpp +++ b/source/filters/filter-denoising.cpp @@ -191,7 +191,7 @@ uint32_t streamfx::filter::denoising::denoising_instance::get_height() return std::max(_size.second, 1); } -void denoising_instance::video_tick(float_t time) +void denoising_instance::video_tick(float time) { auto parent = obs_filter_get_parent(_self); auto target = obs_filter_get_target(_self); diff --git a/source/filters/filter-denoising.hpp b/source/filters/filter-denoising.hpp index 99760ff151..50c7eb728d 100644 --- a/source/filters/filter-denoising.hpp +++ b/source/filters/filter-denoising.hpp @@ -64,7 +64,7 @@ namespace streamfx::filter::denoising { uint32_t get_width() override; uint32_t get_height() override; - void video_tick(float_t time) override; + void video_tick(float time) override; void video_render(gs_effect_t* effect) override; private: diff --git a/source/filters/filter-dynamic-mask.cpp b/source/filters/filter-dynamic-mask.cpp index 37950c76c8..b68cf0413f 100644 --- a/source/filters/filter-dynamic-mask.cpp +++ b/source/filters/filter-dynamic-mask.cpp @@ -158,11 +158,11 @@ void dynamic_mask_instance::update(obs_data_t* settings) } std::string chv_key = std::string(ST_KEY_CHANNEL_VALUE) + "." + kv1.second; - found->second.value = static_cast(obs_data_get_double(settings, chv_key.c_str())); + found->second.value = static_cast(obs_data_get_double(settings, chv_key.c_str())); _precalc.base.ptr[static_cast(kv1.first)] = found->second.value; std::string chm_key = std::string(ST_KEY_CHANNEL_MULTIPLIER) + "." + kv1.second; - found->second.scale = static_cast(obs_data_get_double(settings, chm_key.c_str())); + found->second.scale = static_cast(obs_data_get_double(settings, chm_key.c_str())); _precalc.scale.ptr[static_cast(kv1.first)] = found->second.scale; vec4* ch = &_precalc.matrix.x; @@ -185,7 +185,7 @@ void dynamic_mask_instance::update(obs_data_t* settings) for (auto kv2 : channel_translations) { std::string ab_key = std::string(ST_KEY_CHANNEL_INPUT) + "." + kv1.second + "." + kv2.second; - found->second.values.ptr[static_cast(kv2.first)] = static_cast(obs_data_get_double(settings, ab_key.c_str())); + found->second.values.ptr[static_cast(kv2.first)] = static_cast(obs_data_get_double(settings, ab_key.c_str())); ch->ptr[static_cast(kv2.first)] = found->second.values.ptr[static_cast(kv2.first)]; } } diff --git a/source/filters/filter-dynamic-mask.hpp b/source/filters/filter-dynamic-mask.hpp index cbff522a5d..2982116f8e 100644 --- a/source/filters/filter-dynamic-mask.hpp +++ b/source/filters/filter-dynamic-mask.hpp @@ -72,8 +72,8 @@ namespace streamfx::filter::dynamic_mask { int64_t _debug_texture; struct channel_data { - float_t value = 0.0; - float_t scale = 1.0; + float value = 0.0; + float scale = 1.0; vec4 values = {0, 0, 0, 0}; }; std::map _channels; @@ -94,7 +94,7 @@ namespace streamfx::filter::dynamic_mask { virtual void save(obs_data_t* settings) override; virtual gs_color_space video_get_color_space(size_t count, const gs_color_space* preferred_spaces) override; - virtual void video_tick(float_t time) override; + virtual void video_tick(float time) override; virtual void video_render(gs_effect_t* effect) override; void enum_active_sources(obs_source_enum_proc_t enum_callback, void* param) override; diff --git a/source/filters/filter-sdf-effects.cpp b/source/filters/filter-sdf-effects.cpp index 0acf779c2f..172edbe8d8 100644 --- a/source/filters/filter-sdf-effects.cpp +++ b/source/filters/filter-sdf-effects.cpp @@ -160,15 +160,15 @@ void sdf_effects_instance::update(obs_data_t* data) cs c; }; color = uint32_t(obs_data_get_int(data, ST_KEY_SHADOW_OUTER_COLOR)); - _outer_shadow_color.x = float_t(c.r / 255.0); - _outer_shadow_color.y = float_t(c.g / 255.0); - _outer_shadow_color.z = float_t(c.b / 255.0); - _outer_shadow_color.w = float_t(obs_data_get_double(data, ST_KEY_SHADOW_OUTER_ALPHA) / 100.0); + _outer_shadow_color.x = float(c.r / 255.0); + _outer_shadow_color.y = float(c.g / 255.0); + _outer_shadow_color.z = float(c.b / 255.0); + _outer_shadow_color.w = float(obs_data_get_double(data, ST_KEY_SHADOW_OUTER_ALPHA) / 100.0); } - _outer_shadow_range_min = float_t(obs_data_get_double(data, ST_KEY_SHADOW_OUTER_RANGE_MINIMUM)); - _outer_shadow_range_max = float_t(obs_data_get_double(data, ST_KEY_SHADOW_OUTER_RANGE_MAXIMUM)); - _outer_shadow_offset_x = float_t(obs_data_get_double(data, ST_KEY_SHADOW_OUTER_OFFSET_X)); - _outer_shadow_offset_y = float_t(obs_data_get_double(data, ST_KEY_SHADOW_OUTER_OFFSET_Y)); + _outer_shadow_range_min = float(obs_data_get_double(data, ST_KEY_SHADOW_OUTER_RANGE_MINIMUM)); + _outer_shadow_range_max = float(obs_data_get_double(data, ST_KEY_SHADOW_OUTER_RANGE_MAXIMUM)); + _outer_shadow_offset_x = float(obs_data_get_double(data, ST_KEY_SHADOW_OUTER_OFFSET_X)); + _outer_shadow_offset_y = float(obs_data_get_double(data, ST_KEY_SHADOW_OUTER_OFFSET_Y)); } { @@ -183,15 +183,15 @@ void sdf_effects_instance::update(obs_data_t* data) cs c; }; color = uint32_t(obs_data_get_int(data, ST_KEY_SHADOW_INNER_COLOR)); - _inner_shadow_color.x = float_t(c.r / 255.0); - _inner_shadow_color.y = float_t(c.g / 255.0); - _inner_shadow_color.z = float_t(c.b / 255.0); - _inner_shadow_color.w = float_t(obs_data_get_double(data, ST_KEY_SHADOW_INNER_ALPHA) / 100.0); + _inner_shadow_color.x = float(c.r / 255.0); + _inner_shadow_color.y = float(c.g / 255.0); + _inner_shadow_color.z = float(c.b / 255.0); + _inner_shadow_color.w = float(obs_data_get_double(data, ST_KEY_SHADOW_INNER_ALPHA) / 100.0); } - _inner_shadow_range_min = float_t(obs_data_get_double(data, ST_KEY_SHADOW_INNER_RANGE_MINIMUM)); - _inner_shadow_range_max = float_t(obs_data_get_double(data, ST_KEY_SHADOW_INNER_RANGE_MAXIMUM)); - _inner_shadow_offset_x = float_t(obs_data_get_double(data, ST_KEY_SHADOW_INNER_OFFSET_X)); - _inner_shadow_offset_y = float_t(obs_data_get_double(data, ST_KEY_SHADOW_INNER_OFFSET_Y)); + _inner_shadow_range_min = float(obs_data_get_double(data, ST_KEY_SHADOW_INNER_RANGE_MINIMUM)); + _inner_shadow_range_max = float(obs_data_get_double(data, ST_KEY_SHADOW_INNER_RANGE_MAXIMUM)); + _inner_shadow_offset_x = float(obs_data_get_double(data, ST_KEY_SHADOW_INNER_OFFSET_X)); + _inner_shadow_offset_y = float(obs_data_get_double(data, ST_KEY_SHADOW_INNER_OFFSET_Y)); } { @@ -206,16 +206,16 @@ void sdf_effects_instance::update(obs_data_t* data) cs c; }; color = uint32_t(obs_data_get_int(data, ST_KEY_GLOW_OUTER_COLOR)); - _outer_glow_color.x = float_t(c.r / 255.0); - _outer_glow_color.y = float_t(c.g / 255.0); - _outer_glow_color.z = float_t(c.b / 255.0); - _outer_glow_color.w = float_t(obs_data_get_double(data, ST_KEY_GLOW_OUTER_ALPHA) / 100.0); + _outer_glow_color.x = float(c.r / 255.0); + _outer_glow_color.y = float(c.g / 255.0); + _outer_glow_color.z = float(c.b / 255.0); + _outer_glow_color.w = float(obs_data_get_double(data, ST_KEY_GLOW_OUTER_ALPHA) / 100.0); } - _outer_glow_width = float_t(obs_data_get_double(data, ST_KEY_GLOW_OUTER_WIDTH)); - _outer_glow_sharpness = float_t(obs_data_get_double(data, ST_KEY_GLOW_OUTER_SHARPNESS) / 100.0); - _outer_glow_sharpness_inv = float_t(1.0f / (1.0f - _outer_glow_sharpness)); - if (_outer_glow_sharpness >= (1.0f - std::numeric_limits::epsilon())) { - _outer_glow_sharpness = 1.0f - std::numeric_limits::epsilon(); + _outer_glow_width = float(obs_data_get_double(data, ST_KEY_GLOW_OUTER_WIDTH)); + _outer_glow_sharpness = float(obs_data_get_double(data, ST_KEY_GLOW_OUTER_SHARPNESS) / 100.0); + _outer_glow_sharpness_inv = float(1.0f / (1.0f - _outer_glow_sharpness)); + if (_outer_glow_sharpness >= (1.0f - std::numeric_limits::epsilon())) { + _outer_glow_sharpness = 1.0f - std::numeric_limits::epsilon(); } } @@ -231,16 +231,16 @@ void sdf_effects_instance::update(obs_data_t* data) cs c; }; color = uint32_t(obs_data_get_int(data, ST_KEY_GLOW_INNER_COLOR)); - _inner_glow_color.x = float_t(c.r / 255.0); - _inner_glow_color.y = float_t(c.g / 255.0); - _inner_glow_color.z = float_t(c.b / 255.0); - _inner_glow_color.w = float_t(obs_data_get_double(data, ST_KEY_GLOW_INNER_ALPHA) / 100.0); + _inner_glow_color.x = float(c.r / 255.0); + _inner_glow_color.y = float(c.g / 255.0); + _inner_glow_color.z = float(c.b / 255.0); + _inner_glow_color.w = float(obs_data_get_double(data, ST_KEY_GLOW_INNER_ALPHA) / 100.0); } - _inner_glow_width = float_t(obs_data_get_double(data, ST_KEY_GLOW_INNER_WIDTH)); - _inner_glow_sharpness = float_t(obs_data_get_double(data, ST_KEY_GLOW_INNER_SHARPNESS) / 100.0); - _inner_glow_sharpness_inv = float_t(1.0f / (1.0f - _inner_glow_sharpness)); - if (_inner_glow_sharpness >= (1.0f - std::numeric_limits::epsilon())) { - _inner_glow_sharpness = 1.0f - std::numeric_limits::epsilon(); + _inner_glow_width = float(obs_data_get_double(data, ST_KEY_GLOW_INNER_WIDTH)); + _inner_glow_sharpness = float(obs_data_get_double(data, ST_KEY_GLOW_INNER_SHARPNESS) / 100.0); + _inner_glow_sharpness_inv = float(1.0f / (1.0f - _inner_glow_sharpness)); + if (_inner_glow_sharpness >= (1.0f - std::numeric_limits::epsilon())) { + _inner_glow_sharpness = 1.0f - std::numeric_limits::epsilon(); } } @@ -256,25 +256,25 @@ void sdf_effects_instance::update(obs_data_t* data) cs c; }; color = uint32_t(obs_data_get_int(data, ST_KEY_OUTLINE_COLOR)); - _outline_color.x = float_t(c.r / 255.0); - _outline_color.y = float_t(c.g / 255.0); - _outline_color.z = float_t(c.b / 255.0); - _outline_color.w = float_t(obs_data_get_double(data, ST_KEY_OUTLINE_ALPHA) / 100.0); + _outline_color.x = float(c.r / 255.0); + _outline_color.y = float(c.g / 255.0); + _outline_color.z = float(c.b / 255.0); + _outline_color.w = float(obs_data_get_double(data, ST_KEY_OUTLINE_ALPHA) / 100.0); } - _outline_width = float_t(obs_data_get_double(data, ST_KEY_OUTLINE_WIDTH)); - _outline_offset = float_t(obs_data_get_double(data, ST_KEY_OUTLINE_OFFSET)); - _outline_sharpness = float_t(obs_data_get_double(data, ST_KEY_OUTLINE_SHARPNESS) / 100.0); - _outline_sharpness_inv = float_t(1.0f / (1.0f - _outline_sharpness)); - if (_outline_sharpness >= (1.0f - std::numeric_limits::epsilon())) { - _outline_sharpness = 1.0f - std::numeric_limits::epsilon(); + _outline_width = float(obs_data_get_double(data, ST_KEY_OUTLINE_WIDTH)); + _outline_offset = float(obs_data_get_double(data, ST_KEY_OUTLINE_OFFSET)); + _outline_sharpness = float(obs_data_get_double(data, ST_KEY_OUTLINE_SHARPNESS) / 100.0); + _outline_sharpness_inv = float(1.0f / (1.0f - _outline_sharpness)); + if (_outline_sharpness >= (1.0f - std::numeric_limits::epsilon())) { + _outline_sharpness = 1.0f - std::numeric_limits::epsilon(); } } _sdf_scale = double_t(obs_data_get_double(data, ST_KEY_SDF_SCALE) / 100.0); - _sdf_threshold = float_t(obs_data_get_double(data, ST_KEY_SDF_THRESHOLD) / 100.0); + _sdf_threshold = float(obs_data_get_double(data, ST_KEY_SDF_THRESHOLD) / 100.0); } -void sdf_effects_instance::video_tick(float_t) +void sdf_effects_instance::video_tick(float) { if (obs_source_t* target = obs_filter_get_target(_self); target != nullptr) { _source_rendered = false; @@ -372,7 +372,7 @@ void sdf_effects_instance::video_render(gs_effect_t* effect) gs_clear(GS_CLEAR_COLOR | GS_CLEAR_DEPTH, &color_transparent, 0, 0); _sdf_producer_effect.get_parameter("_image").set_texture(_source_texture); - _sdf_producer_effect.get_parameter("_size").set_float2(float_t(sdfW), float_t(sdfH)); + _sdf_producer_effect.get_parameter("_size").set_float2(float(sdfW), float(sdfH)); _sdf_producer_effect.get_parameter("_sdf").set_texture(_sdf_texture); _sdf_producer_effect.get_parameter("_threshold").set_float(_sdf_threshold); @@ -447,7 +447,7 @@ void sdf_effects_instance::video_render(gs_effect_t* effect) _sdf_consumer_effect.get_parameter("pShadowColor").set_float4(_outer_shadow_color); _sdf_consumer_effect.get_parameter("pShadowMin").set_float(_outer_shadow_range_min); _sdf_consumer_effect.get_parameter("pShadowMax").set_float(_outer_shadow_range_max); - _sdf_consumer_effect.get_parameter("pShadowOffset").set_float2(_outer_shadow_offset_x / float_t(baseW), _outer_shadow_offset_y / float_t(baseH)); + _sdf_consumer_effect.get_parameter("pShadowOffset").set_float2(_outer_shadow_offset_x / float(baseW), _outer_shadow_offset_y / float(baseH)); while (gs_effect_loop(_sdf_consumer_effect.get_object(), "ShadowOuter")) { _gfx_util->draw_fullscreen_triangle(); } @@ -459,7 +459,7 @@ void sdf_effects_instance::video_render(gs_effect_t* effect) _sdf_consumer_effect.get_parameter("pShadowColor").set_float4(_inner_shadow_color); _sdf_consumer_effect.get_parameter("pShadowMin").set_float(_inner_shadow_range_min); _sdf_consumer_effect.get_parameter("pShadowMax").set_float(_inner_shadow_range_max); - _sdf_consumer_effect.get_parameter("pShadowOffset").set_float2(_inner_shadow_offset_x / float_t(baseW), _inner_shadow_offset_y / float_t(baseH)); + _sdf_consumer_effect.get_parameter("pShadowOffset").set_float2(_inner_shadow_offset_x / float(baseW), _inner_shadow_offset_y / float(baseH)); while (gs_effect_loop(_sdf_consumer_effect.get_object(), "ShadowInner")) { _gfx_util->draw_fullscreen_triangle(); } diff --git a/source/filters/filter-sdf-effects.hpp b/source/filters/filter-sdf-effects.hpp index ff14077650..51a0c03bf3 100644 --- a/source/filters/filter-sdf-effects.hpp +++ b/source/filters/filter-sdf-effects.hpp @@ -28,7 +28,7 @@ namespace streamfx::filter::sdf_effects { std::shared_ptr _sdf_read; std::shared_ptr _sdf_texture; double_t _sdf_scale; - float_t _sdf_threshold; + float _sdf_threshold; // Effects bool _output_rendered; @@ -37,36 +37,36 @@ namespace streamfx::filter::sdf_effects { /// Inner Shadow bool _inner_shadow; vec4 _inner_shadow_color; - float_t _inner_shadow_range_min; - float_t _inner_shadow_range_max; - float_t _inner_shadow_offset_x; - float_t _inner_shadow_offset_y; + float _inner_shadow_range_min; + float _inner_shadow_range_max; + float _inner_shadow_offset_x; + float _inner_shadow_offset_y; /// Outer Shadow bool _outer_shadow; vec4 _outer_shadow_color; - float_t _outer_shadow_range_min; - float_t _outer_shadow_range_max; - float_t _outer_shadow_offset_x; - float_t _outer_shadow_offset_y; + float _outer_shadow_range_min; + float _outer_shadow_range_max; + float _outer_shadow_offset_x; + float _outer_shadow_offset_y; /// Inner Glow bool _inner_glow; vec4 _inner_glow_color; - float_t _inner_glow_width; - float_t _inner_glow_sharpness; - float_t _inner_glow_sharpness_inv; + float _inner_glow_width; + float _inner_glow_sharpness; + float _inner_glow_sharpness_inv; /// Outer Glow bool _outer_glow; vec4 _outer_glow_color; - float_t _outer_glow_width; - float_t _outer_glow_sharpness; - float_t _outer_glow_sharpness_inv; + float _outer_glow_width; + float _outer_glow_sharpness; + float _outer_glow_sharpness_inv; /// Outline bool _outline; vec4 _outline_color; - float_t _outline_width; - float_t _outline_offset; - float_t _outline_sharpness; - float_t _outline_sharpness_inv; + float _outline_width; + float _outline_offset; + float _outline_sharpness; + float _outline_sharpness_inv; public: sdf_effects_instance(obs_data_t* settings, obs_source_t* self); @@ -76,7 +76,7 @@ namespace streamfx::filter::sdf_effects { virtual void migrate(obs_data_t* data, uint64_t version) override; virtual void update(obs_data_t* settings) override; - virtual void video_tick(float_t) override; + virtual void video_tick(float) override; virtual void video_render(gs_effect_t*) override; }; diff --git a/source/filters/filter-shader.cpp b/source/filters/filter-shader.cpp index 3398d55e8e..e164d2f60b 100644 --- a/source/filters/filter-shader.cpp +++ b/source/filters/filter-shader.cpp @@ -69,7 +69,7 @@ void shader_instance::update(obs_data_t* data) _fx->update(data); } -void shader_instance::video_tick(float_t sec_since_last) +void shader_instance::video_tick(float sec_since_last) { if (_fx->tick(sec_since_last)) { obs_data_t* data = obs_source_get_settings(_self); diff --git a/source/filters/filter-shader.hpp b/source/filters/filter-shader.hpp index 3b174e8c9a..4b0b3a52c5 100644 --- a/source/filters/filter-shader.hpp +++ b/source/filters/filter-shader.hpp @@ -27,7 +27,7 @@ namespace streamfx::filter::shader { virtual void migrate(obs_data_t* data, uint64_t version) override; virtual void update(obs_data_t* data) override; - virtual void video_tick(float_t sec_since_last) override; + virtual void video_tick(float sec_since_last) override; virtual void video_render(gs_effect_t* effect) override; void show() override; diff --git a/source/filters/filter-upscaling.cpp b/source/filters/filter-upscaling.cpp index 824eaffe0e..c4dfe90e34 100644 --- a/source/filters/filter-upscaling.cpp +++ b/source/filters/filter-upscaling.cpp @@ -193,7 +193,7 @@ uint32_t streamfx::filter::upscaling::upscaling_instance::get_height() return std::max(_out_size.second, 1); } -void upscaling_instance::video_tick(float_t time) +void upscaling_instance::video_tick(float time) { auto target = obs_filter_get_target(_self); auto width = obs_source_get_base_width(target); diff --git a/source/filters/filter-upscaling.hpp b/source/filters/filter-upscaling.hpp index 77f3a59d8c..19cf3817a9 100644 --- a/source/filters/filter-upscaling.hpp +++ b/source/filters/filter-upscaling.hpp @@ -65,7 +65,7 @@ namespace streamfx::filter::upscaling { uint32_t get_width() override; uint32_t get_height() override; - void video_tick(float_t time) override; + void video_tick(float time) override; void video_render(gs_effect_t* effect) override; private: diff --git a/source/filters/filter-virtual-greenscreen.cpp b/source/filters/filter-virtual-greenscreen.cpp index 4045016860..392ea758ef 100644 --- a/source/filters/filter-virtual-greenscreen.cpp +++ b/source/filters/filter-virtual-greenscreen.cpp @@ -202,7 +202,7 @@ uint32_t streamfx::filter::virtual_greenscreen::virtual_greenscreen_instance::ge return std::max(_size.second, 1); } -void virtual_greenscreen_instance::video_tick(float_t time) +void virtual_greenscreen_instance::video_tick(float time) { auto target = obs_filter_get_target(_self); auto width = obs_source_get_base_width(target); diff --git a/source/filters/filter-virtual-greenscreen.hpp b/source/filters/filter-virtual-greenscreen.hpp index fe0d369abc..4d0c5ac164 100644 --- a/source/filters/filter-virtual-greenscreen.hpp +++ b/source/filters/filter-virtual-greenscreen.hpp @@ -65,7 +65,7 @@ namespace streamfx::filter::virtual_greenscreen { uint32_t get_width() override; uint32_t get_height() override; - void video_tick(float_t time) override; + void video_tick(float time) override; void video_render(gs_effect_t* effect) override; private: diff --git a/source/gfx/blur/gfx-blur-box-linear.cpp b/source/gfx/blur/gfx-blur-box-linear.cpp index f094997e13..e134a9da8a 100644 --- a/source/gfx/blur/gfx-blur-box-linear.cpp +++ b/source/gfx/blur/gfx-blur-box-linear.cpp @@ -236,8 +236,8 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::box_linear::r auto gdmp = streamfx::obs::gs::debug_marker(streamfx::obs::gs::debug_color_azure_radiance, "Box Linear Blur"); #endif - float_t width = float_t(_input_texture->get_width()); - float_t height = float_t(_input_texture->get_height()); + float width = float(_input_texture->get_width()); + float height = float(_input_texture->get_height()); gs_set_cull_mode(GS_NEITHER); gs_enable_color(true, true, true, true); @@ -257,10 +257,10 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::box_linear::r if (effect) { // Pass 1 effect.get_parameter("pImage").set_texture(_input_texture); - effect.get_parameter("pImageTexel").set_float2(float_t(1.f / width), 0.f); - effect.get_parameter("pStepScale").set_float2(float_t(_step_scale.first), float_t(_step_scale.second)); - effect.get_parameter("pSize").set_float(float_t(_size)); - effect.get_parameter("pSizeInverseMul").set_float(float_t(1.0f / (float_t(_size) * 2.0f + 1.0f))); + effect.get_parameter("pImageTexel").set_float2(float(1.f / width), 0.f); + effect.get_parameter("pStepScale").set_float2(float(_step_scale.first), float(_step_scale.second)); + effect.get_parameter("pSize").set_float(float(_size)); + effect.get_parameter("pSizeInverseMul").set_float(float(1.0f / (float(_size) * 2.0f + 1.0f))); { #if defined(ENABLE_PROFILING) && !defined(D_PLATFORM_MAC) && _DEBUG @@ -276,7 +276,7 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::box_linear::r // Pass 2 effect.get_parameter("pImage").set_texture(_rendertarget2->get_texture()); - effect.get_parameter("pImageTexel").set_float2(0., float_t(1.f / height)); + effect.get_parameter("pImageTexel").set_float2(0., float(1.f / height)); { #if defined(ENABLE_PROFILING) && !defined(D_PLATFORM_MAC) && _DEBUG @@ -326,8 +326,8 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::box_linear_di auto gdmp = streamfx::obs::gs::debug_marker(streamfx::obs::gs::debug_color_azure_radiance, "Box Linear Directional Blur"); #endif - float_t width = float_t(_input_texture->get_width()); - float_t height = float_t(_input_texture->get_height()); + float width = float(_input_texture->get_width()); + float height = float(_input_texture->get_height()); gs_blend_state_push(); gs_reset_blend_state(); @@ -346,10 +346,10 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::box_linear_di streamfx::obs::gs::effect effect = _data->get_effect(); if (effect) { effect.get_parameter("pImage").set_texture(_input_texture); - effect.get_parameter("pImageTexel").set_float2(float_t(1. / width * cos(_angle)), float_t(1.f / height * sin(_angle))); - effect.get_parameter("pStepScale").set_float2(float_t(_step_scale.first), float_t(_step_scale.second)); - effect.get_parameter("pSize").set_float(float_t(_size)); - effect.get_parameter("pSizeInverseMul").set_float(float_t(1.0f / (float_t(_size) * 2.0f + 1.0f))); + effect.get_parameter("pImageTexel").set_float2(float(1. / width * cos(_angle)), float(1.f / height * sin(_angle))); + effect.get_parameter("pStepScale").set_float2(float(_step_scale.first), float(_step_scale.second)); + effect.get_parameter("pSize").set_float(float(_size)); + effect.get_parameter("pSizeInverseMul").set_float(float(1.0f / (float(_size) * 2.0f + 1.0f))); { auto op = _rendertarget->render(uint32_t(width), uint32_t(height)); diff --git a/source/gfx/blur/gfx-blur-box.cpp b/source/gfx/blur/gfx-blur-box.cpp index 9c243f7830..beda17d124 100644 --- a/source/gfx/blur/gfx-blur-box.cpp +++ b/source/gfx/blur/gfx-blur-box.cpp @@ -246,8 +246,8 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::box::render() auto gdmp = streamfx::obs::gs::debug_marker(streamfx::obs::gs::debug_color_azure_radiance, "Box Blur"); #endif - float_t width = float_t(_input_texture->get_width()); - float_t height = float_t(_input_texture->get_height()); + float width = float(_input_texture->get_width()); + float height = float(_input_texture->get_height()); gs_set_cull_mode(GS_NEITHER); gs_enable_color(true, true, true, true); @@ -267,10 +267,10 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::box::render() if (effect) { // Pass 1 effect.get_parameter("pImage").set_texture(_input_texture); - effect.get_parameter("pImageTexel").set_float2(float_t(1.f / width), 0.f); - effect.get_parameter("pStepScale").set_float2(float_t(_step_scale.first), float_t(_step_scale.second)); - effect.get_parameter("pSize").set_float(float_t(_size)); - effect.get_parameter("pSizeInverseMul").set_float(float_t(1.0f / (float_t(_size) * 2.0f + 1.0f))); + effect.get_parameter("pImageTexel").set_float2(float(1.f / width), 0.f); + effect.get_parameter("pStepScale").set_float2(float(_step_scale.first), float(_step_scale.second)); + effect.get_parameter("pSize").set_float(float(_size)); + effect.get_parameter("pSizeInverseMul").set_float(float(1.0f / (float(_size) * 2.0f + 1.0f))); { #if defined(ENABLE_PROFILING) && !defined(D_PLATFORM_MAC) && _DEBUG @@ -286,7 +286,7 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::box::render() // Pass 2 effect.get_parameter("pImage").set_texture(_rendertarget2->get_texture()); - effect.get_parameter("pImageTexel").set_float2(0.f, float_t(1.f / height)); + effect.get_parameter("pImageTexel").set_float2(0.f, float(1.f / height)); { #if defined(ENABLE_PROFILING) && !defined(D_PLATFORM_MAC) && _DEBUG @@ -336,8 +336,8 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::box_direction auto gdmp = streamfx::obs::gs::debug_marker(streamfx::obs::gs::debug_color_azure_radiance, "Box Directional Blur"); #endif - float_t width = float_t(_input_texture->get_width()); - float_t height = float_t(_input_texture->get_height()); + float width = float(_input_texture->get_width()); + float height = float(_input_texture->get_height()); gs_blend_state_push(); gs_reset_blend_state(); @@ -356,10 +356,10 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::box_direction streamfx::obs::gs::effect effect = _data->get_effect(); if (effect) { effect.get_parameter("pImage").set_texture(_input_texture); - effect.get_parameter("pImageTexel").set_float2(float_t(1. / width * cos(_angle)), float_t(1.f / height * sin(_angle))); - effect.get_parameter("pStepScale").set_float2(float_t(_step_scale.first), float_t(_step_scale.second)); - effect.get_parameter("pSize").set_float(float_t(_size)); - effect.get_parameter("pSizeInverseMul").set_float(float_t(1.0f / (float_t(_size) * 2.0f + 1.0f))); + effect.get_parameter("pImageTexel").set_float2(float(1. / width * cos(_angle)), float(1.f / height * sin(_angle))); + effect.get_parameter("pStepScale").set_float2(float(_step_scale.first), float(_step_scale.second)); + effect.get_parameter("pSize").set_float(float(_size)); + effect.get_parameter("pSizeInverseMul").set_float(float(1.0f / (float(_size) * 2.0f + 1.0f))); { auto op = _rendertarget->render(uint32_t(width), uint32_t(height)); @@ -410,8 +410,8 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::box_rotationa auto gdmp = streamfx::obs::gs::debug_marker(streamfx::obs::gs::debug_color_azure_radiance, "Box Rotational Blur"); #endif - float_t width = float_t(_input_texture->get_width()); - float_t height = float_t(_input_texture->get_height()); + float width = float(_input_texture->get_width()); + float height = float(_input_texture->get_height()); gs_blend_state_push(); gs_reset_blend_state(); @@ -430,12 +430,12 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::box_rotationa streamfx::obs::gs::effect effect = _data->get_effect(); if (effect) { effect.get_parameter("pImage").set_texture(_input_texture); - effect.get_parameter("pImageTexel").set_float2(float_t(1.f / width), float_t(1.f / height)); - effect.get_parameter("pStepScale").set_float2(float_t(_step_scale.first), float_t(_step_scale.second)); - effect.get_parameter("pSize").set_float(float_t(_size)); - effect.get_parameter("pSizeInverseMul").set_float(float_t(1.0f / (float_t(_size) * 2.0f + 1.0f))); - effect.get_parameter("pAngle").set_float(float_t(_angle / _size)); - effect.get_parameter("pCenter").set_float2(float_t(_center.first), float_t(_center.second)); + effect.get_parameter("pImageTexel").set_float2(float(1.f / width), float(1.f / height)); + effect.get_parameter("pStepScale").set_float2(float(_step_scale.first), float(_step_scale.second)); + effect.get_parameter("pSize").set_float(float(_size)); + effect.get_parameter("pSizeInverseMul").set_float(float(1.0f / (float(_size) * 2.0f + 1.0f))); + effect.get_parameter("pAngle").set_float(float(_angle / _size)); + effect.get_parameter("pCenter").set_float2(float(_center.first), float(_center.second)); { auto op = _rendertarget->render(uint32_t(width), uint32_t(height)); @@ -476,8 +476,8 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::box_zoom::ren auto gdmp = streamfx::obs::gs::debug_marker(streamfx::obs::gs::debug_color_azure_radiance, "Box Zoom Blur"); #endif - float_t width = float_t(_input_texture->get_width()); - float_t height = float_t(_input_texture->get_height()); + float width = float(_input_texture->get_width()); + float height = float(_input_texture->get_height()); gs_blend_state_push(); gs_reset_blend_state(); @@ -496,11 +496,11 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::box_zoom::ren streamfx::obs::gs::effect effect = _data->get_effect(); if (effect) { effect.get_parameter("pImage").set_texture(_input_texture); - effect.get_parameter("pImageTexel").set_float2(float_t(1.f / width), float_t(1.f / height)); - effect.get_parameter("pStepScale").set_float2(float_t(_step_scale.first), float_t(_step_scale.second)); - effect.get_parameter("pSize").set_float(float_t(_size)); - effect.get_parameter("pSizeInverseMul").set_float(float_t(1.0f / (float_t(_size) * 2.0f + 1.0f))); - effect.get_parameter("pCenter").set_float2(float_t(_center.first), float_t(_center.second)); + effect.get_parameter("pImageTexel").set_float2(float(1.f / width), float(1.f / height)); + effect.get_parameter("pStepScale").set_float2(float(_step_scale.first), float(_step_scale.second)); + effect.get_parameter("pSize").set_float(float(_size)); + effect.get_parameter("pSizeInverseMul").set_float(float(1.0f / (float(_size) * 2.0f + 1.0f))); + effect.get_parameter("pCenter").set_float2(float(_center.first), float(_center.second)); { auto op = _rendertarget->render(uint32_t(width), uint32_t(height)); diff --git a/source/gfx/blur/gfx-blur-gaussian-linear.cpp b/source/gfx/blur/gfx-blur-gaussian-linear.cpp index b744734906..96fb5e883a 100644 --- a/source/gfx/blur/gfx-blur-gaussian-linear.cpp +++ b/source/gfx/blur/gfx-blur-gaussian-linear.cpp @@ -40,7 +40,7 @@ streamfx::gfx::blur::gaussian_linear_data::gaussian_linear_data() : _gfx_util(:: // Precalculate Kernels for (std::size_t kernel_size = 1; kernel_size <= ST_MAX_BLUR_SIZE; kernel_size++) { std::vector kernel_math(ST_MAX_KERNEL_SIZE); - std::vector kernel_data(ST_MAX_KERNEL_SIZE); + std::vector kernel_data(ST_MAX_KERNEL_SIZE); double_t actual_width = 1.; // Find actual kernel width. @@ -61,7 +61,7 @@ streamfx::gfx::blur::gaussian_linear_data::gaussian_linear_data() : _gfx_util(:: // Normalize to fill the entire 0..1 range over the width. double_t inverse_sum = 1.0 / sum; for (std::size_t p = 0; p <= kernel_size; p++) { - kernel_data.at(p) = float_t(kernel_math[p] * inverse_sum); + kernel_data.at(p) = float(kernel_math[p] * inverse_sum); } _kernels.push_back(std::move(kernel_data)); @@ -78,7 +78,7 @@ streamfx::obs::gs::effect streamfx::gfx::blur::gaussian_linear_data::get_effect( return _effect; } -std::vector const& streamfx::gfx::blur::gaussian_linear_data::get_kernel(std::size_t width) +std::vector const& streamfx::gfx::blur::gaussian_linear_data::get_kernel(std::size_t width) { if (width < 1) width = 1; @@ -292,8 +292,8 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::gaussian_line return _input_texture; } - float_t width = float_t(_input_texture->get_width()); - float_t height = float_t(_input_texture->get_height()); + float width = float(_input_texture->get_width()); + float height = float(_input_texture->get_height()); // Setup gs_set_cull_mode(GS_NEITHER); @@ -310,13 +310,13 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::gaussian_line gs_stencil_op(GS_STENCIL_BOTH, GS_ZERO, GS_ZERO, GS_ZERO); effect.get_parameter("pImage").set_texture(_input_texture); - effect.get_parameter("pStepScale").set_float2(float_t(_step_scale.first), float_t(_step_scale.second)); - effect.get_parameter("pSize").set_float(float_t(_size)); + effect.get_parameter("pStepScale").set_float2(float(_step_scale.first), float(_step_scale.second)); + effect.get_parameter("pSize").set_float(float(_size)); effect.get_parameter("pKernel").set_value(kernel.data(), ST_MAX_KERNEL_SIZE); // First Pass if (_step_scale.first > std::numeric_limits::epsilon()) { - effect.get_parameter("pImageTexel").set_float2(float_t(1.f / width), 0.f); + effect.get_parameter("pImageTexel").set_float2(float(1.f / width), 0.f); { #if defined(ENABLE_PROFILING) && !defined(D_PLATFORM_MAC) && _DEBUG @@ -336,7 +336,7 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::gaussian_line // Second Pass if (_step_scale.second > std::numeric_limits::epsilon()) { - effect.get_parameter("pImageTexel").set_float2(0.f, float_t(1.f / height)); + effect.get_parameter("pImageTexel").set_float2(0.f, float(1.f / height)); { #if defined(ENABLE_PROFILING) && !defined(D_PLATFORM_MAC) && _DEBUG @@ -397,8 +397,8 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::gaussian_line return _input_texture; } - float_t width = float_t(_input_texture->get_width()); - float_t height = float_t(_input_texture->get_height()); + float width = float(_input_texture->get_width()); + float height = float(_input_texture->get_height()); // Setup gs_set_cull_mode(GS_NEITHER); @@ -415,9 +415,9 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::gaussian_line gs_stencil_op(GS_STENCIL_BOTH, GS_ZERO, GS_ZERO, GS_ZERO); effect.get_parameter("pImage").set_texture(_input_texture); - effect.get_parameter("pImageTexel").set_float2(float_t(1.f / width * cos(_angle)), float_t(1.f / height * sin(_angle))); - effect.get_parameter("pStepScale").set_float2(float_t(_step_scale.first), float_t(_step_scale.second)); - effect.get_parameter("pSize").set_float(float_t(_size)); + effect.get_parameter("pImageTexel").set_float2(float(1.f / width * cos(_angle)), float(1.f / height * sin(_angle))); + effect.get_parameter("pStepScale").set_float2(float(_step_scale.first), float(_step_scale.second)); + effect.get_parameter("pSize").set_float(float(_size)); effect.get_parameter("pKernel").set_value(kernel.data(), ST_MAX_KERNEL_SIZE); // First Pass diff --git a/source/gfx/blur/gfx-blur-gaussian-linear.hpp b/source/gfx/blur/gfx-blur-gaussian-linear.hpp index 50a8db2946..9c35003a22 100644 --- a/source/gfx/blur/gfx-blur-gaussian-linear.hpp +++ b/source/gfx/blur/gfx-blur-gaussian-linear.hpp @@ -20,7 +20,7 @@ namespace streamfx::gfx { class gaussian_linear_data { streamfx::obs::gs::effect _effect; std::shared_ptr _gfx_util; - std::vector> _kernels; + std::vector> _kernels; public: gaussian_linear_data(); @@ -30,7 +30,7 @@ namespace streamfx::gfx { streamfx::obs::gs::effect get_effect(); - std::vector const& get_kernel(std::size_t width); + std::vector const& get_kernel(std::size_t width); }; class gaussian_linear_factory : public ::streamfx::gfx::blur::ifactory { diff --git a/source/gfx/blur/gfx-blur-gaussian.cpp b/source/gfx/blur/gfx-blur-gaussian.cpp index 16c5f34740..b60a2c879f 100644 --- a/source/gfx/blur/gfx-blur-gaussian.cpp +++ b/source/gfx/blur/gfx-blur-gaussian.cpp @@ -108,7 +108,7 @@ std::shared_ptr streamfx::gfx::blur::gaussian_data::get_gfx return _gfx_util; } -std::vector const& streamfx::gfx::blur::gaussian_data::get_kernel(std::size_t width) +std::vector const& streamfx::gfx::blur::gaussian_data::get_kernel(std::size_t width) { width = std::clamp(width, 1, ST_MAX_BLUR_SIZE); return _kernels.at(width); @@ -321,8 +321,8 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::gaussian::ren } auto kernel = _data->get_kernel(size_t(_size)); - float_t width = float_t(_input_texture->get_width()); - float_t height = float_t(_input_texture->get_height()); + float width = float(_input_texture->get_width()); + float height = float(_input_texture->get_height()); // Setup gs_set_cull_mode(GS_NEITHER); @@ -338,14 +338,14 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::gaussian::ren gs_stencil_function(GS_STENCIL_BOTH, GS_ALWAYS); gs_stencil_op(GS_STENCIL_BOTH, GS_ZERO, GS_ZERO, GS_ZERO); - effect.get_parameter("pStepScale").set_float2(float_t(_step_scale.first), float_t(_step_scale.second)); - effect.get_parameter("pSize").set_float(float_t(_size * ST_OVERSAMPLE_MULTIPLIER)); + effect.get_parameter("pStepScale").set_float2(float(_step_scale.first), float(_step_scale.second)); + effect.get_parameter("pSize").set_float(float(_size * ST_OVERSAMPLE_MULTIPLIER)); effect.get_parameter("pKernel").set_value(kernel.data(), ST_KERNEL_SIZE); // First Pass if (_step_scale.first > std::numeric_limits::epsilon()) { effect.get_parameter("pImage").set_texture(_input_texture); - effect.get_parameter("pImageTexel").set_float2(float_t(1.f / width), 0.f); + effect.get_parameter("pImageTexel").set_float2(float(1.f / width), 0.f); { #if defined(ENABLE_PROFILING) && !defined(D_PLATFORM_MAC) && _DEBUG @@ -365,7 +365,7 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::gaussian::ren // Second Pass if (_step_scale.second > std::numeric_limits::epsilon()) { effect.get_parameter("pImage").set_texture(_rendertarget->get_texture()); - effect.get_parameter("pImageTexel").set_float2(0.f, float_t(1.f / height)); + effect.get_parameter("pImageTexel").set_float2(0.f, float(1.f / height)); { #if defined(ENABLE_PROFILING) && !defined(D_PLATFORM_MAC) && _DEBUG @@ -426,8 +426,8 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::gaussian_dire } auto kernel = _data->get_kernel(size_t(_size)); - float_t width = float_t(_input_texture->get_width()); - float_t height = float_t(_input_texture->get_height()); + float width = float(_input_texture->get_width()); + float height = float(_input_texture->get_height()); // Setup gs_set_cull_mode(GS_NEITHER); @@ -444,9 +444,9 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::gaussian_dire gs_stencil_op(GS_STENCIL_BOTH, GS_ZERO, GS_ZERO, GS_ZERO); effect.get_parameter("pImage").set_texture(_input_texture); - effect.get_parameter("pImageTexel").set_float2(float_t(1.f / width * cos(m_angle)), float_t(1.f / height * sin(m_angle))); - effect.get_parameter("pStepScale").set_float2(float_t(_step_scale.first), float_t(_step_scale.second)); - effect.get_parameter("pSize").set_float(float_t(_size * ST_OVERSAMPLE_MULTIPLIER)); + effect.get_parameter("pImageTexel").set_float2(float(1.f / width * cos(m_angle)), float(1.f / height * sin(m_angle))); + effect.get_parameter("pStepScale").set_float2(float(_step_scale.first), float(_step_scale.second)); + effect.get_parameter("pSize").set_float(float(_size * ST_OVERSAMPLE_MULTIPLIER)); effect.get_parameter("pKernel").set_value(kernel.data(), ST_KERNEL_SIZE); { @@ -482,8 +482,8 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::gaussian_rota } auto kernel = _data->get_kernel(size_t(_size)); - float_t width = float_t(_input_texture->get_width()); - float_t height = float_t(_input_texture->get_height()); + float width = float(_input_texture->get_width()); + float height = float(_input_texture->get_height()); // Setup gs_set_cull_mode(GS_NEITHER); @@ -500,11 +500,11 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::gaussian_rota gs_stencil_op(GS_STENCIL_BOTH, GS_ZERO, GS_ZERO, GS_ZERO); effect.get_parameter("pImage").set_texture(_input_texture); - effect.get_parameter("pImageTexel").set_float2(float_t(1.f / width), float_t(1.f / height)); - effect.get_parameter("pStepScale").set_float2(float_t(_step_scale.first), float_t(_step_scale.second)); - effect.get_parameter("pSize").set_float(float_t(_size * ST_OVERSAMPLE_MULTIPLIER)); - effect.get_parameter("pAngle").set_float(float_t(m_angle / _size)); - effect.get_parameter("pCenter").set_float2(float_t(m_center.first), float_t(m_center.second)); + effect.get_parameter("pImageTexel").set_float2(float(1.f / width), float(1.f / height)); + effect.get_parameter("pStepScale").set_float2(float(_step_scale.first), float(_step_scale.second)); + effect.get_parameter("pSize").set_float(float(_size * ST_OVERSAMPLE_MULTIPLIER)); + effect.get_parameter("pAngle").set_float(float(m_angle / _size)); + effect.get_parameter("pCenter").set_float2(float(m_center.first), float(m_center.second)); effect.get_parameter("pKernel").set_value(kernel.data(), ST_KERNEL_SIZE); // First Pass @@ -563,8 +563,8 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::gaussian_zoom return _input_texture; } - float_t width = float_t(_input_texture->get_width()); - float_t height = float_t(_input_texture->get_height()); + float width = float(_input_texture->get_width()); + float height = float(_input_texture->get_height()); // Setup gs_set_cull_mode(GS_NEITHER); @@ -581,10 +581,10 @@ std::shared_ptr<::streamfx::obs::gs::texture> streamfx::gfx::blur::gaussian_zoom gs_stencil_op(GS_STENCIL_BOTH, GS_ZERO, GS_ZERO, GS_ZERO); effect.get_parameter("pImage").set_texture(_input_texture); - effect.get_parameter("pImageTexel").set_float2(float_t(1.f / width), float_t(1.f / height)); - effect.get_parameter("pStepScale").set_float2(float_t(_step_scale.first), float_t(_step_scale.second)); - effect.get_parameter("pSize").set_float(float_t(_size)); - effect.get_parameter("pCenter").set_float2(float_t(m_center.first), float_t(m_center.second)); + effect.get_parameter("pImageTexel").set_float2(float(1.f / width), float(1.f / height)); + effect.get_parameter("pStepScale").set_float2(float(_step_scale.first), float(_step_scale.second)); + effect.get_parameter("pSize").set_float(float(_size)); + effect.get_parameter("pCenter").set_float2(float(m_center.first), float(m_center.second)); effect.get_parameter("pKernel").set_value(kernel.data(), ST_KERNEL_SIZE); // First Pass diff --git a/source/gfx/blur/gfx-blur-gaussian.hpp b/source/gfx/blur/gfx-blur-gaussian.hpp index 654dc91c97..5fbad993fe 100644 --- a/source/gfx/blur/gfx-blur-gaussian.hpp +++ b/source/gfx/blur/gfx-blur-gaussian.hpp @@ -30,7 +30,7 @@ namespace streamfx::gfx { std::shared_ptr get_gfx_util(); - std::vector const& get_kernel(std::size_t width); + std::vector const& get_kernel(std::size_t width); }; class gaussian_factory : public ::streamfx::gfx::blur::ifactory { diff --git a/source/gfx/gfx-mipmapper.cpp b/source/gfx/gfx-mipmapper.cpp index 6974f98a7a..823a8fd1a6 100644 --- a/source/gfx/gfx-mipmapper.cpp +++ b/source/gfx/gfx-mipmapper.cpp @@ -277,8 +277,8 @@ void streamfx::gfx::mipmapper::rebuild(std::shared_ptr(width >> mip, 1); uint32_t cheight = std::max(height >> mip, 1); - float_t iwidth = 1.f / static_cast(cwidth); - float_t iheight = 1.f / static_cast(cheight); + float iwidth = 1.f / static_cast(cwidth); + float iheight = 1.f / static_cast(cheight); try { auto op = _rt->render(cwidth, cheight); diff --git a/source/gfx/gfx-source-texture.cpp b/source/gfx/gfx-source-texture.cpp index 1b961962aa..c4257b055f 100644 --- a/source/gfx/gfx-source-texture.cpp +++ b/source/gfx/gfx-source-texture.cpp @@ -74,7 +74,7 @@ std::shared_ptr streamfx::gfx::source_texture::rende auto op = _rt->render(static_cast(width), static_cast(height)); vec4 black; vec4_zero(&black); - gs_ortho(0, static_cast(width), 0, static_cast(height), 0, 1); + gs_ortho(0, static_cast(width), 0, static_cast(height), 0, 1); gs_clear(GS_CLEAR_COLOR, &black, 0, 0); obs_source_video_render(_child.get()); } diff --git a/source/gfx/shader/gfx-shader-param-basic.cpp b/source/gfx/shader/gfx-shader-param-basic.cpp index 7ee30b2abf..154490fc62 100644 --- a/source/gfx/shader/gfx-shader-param-basic.cpp +++ b/source/gfx/shader/gfx-shader-param-basic.cpp @@ -37,7 +37,7 @@ inline bool get_annotation_string(streamfx::obs::gs::effect_parameter param, std return false; } -inline bool get_annotation_float(streamfx::obs::gs::effect_parameter param, std::string_view anno_name, float_t& out) +inline bool get_annotation_float(streamfx::obs::gs::effect_parameter param, std::string_view anno_name, float& out) { if (!param) { return false; @@ -203,8 +203,8 @@ streamfx::gfx::shader::float_parameter::float_parameter(streamfx::gfx::shader::s // Reset minimum, maximum, step and scale. for (std::size_t idx = 0; idx < get_size(); idx++) { - _min[idx].f32 = std::numeric_limits::lowest(); - _max[idx].f32 = std::numeric_limits::max(); + _min[idx].f32 = std::numeric_limits::lowest(); + _max[idx].f32 = std::numeric_limits::max(); _step[idx].f32 = 0.01f; _scale[idx].f32 = 1.00f; } @@ -236,7 +236,7 @@ streamfx::gfx::shader::float_parameter::~float_parameter() {} void streamfx::gfx::shader::float_parameter::defaults(obs_data_t* settings) { - std::vector defaults; + std::vector defaults; defaults.resize(get_size()); get_parameter().get_default_value(defaults.data(), get_size()); @@ -245,7 +245,7 @@ void streamfx::gfx::shader::float_parameter::defaults(obs_data_t* settings) } } -static inline obs_property_t* build_float_property(streamfx::gfx::shader::basic_field_type ft, obs_properties_t* props, const char* key, const char* name, float_t min, float_t max, float_t step, std::list edata) +static inline obs_property_t* build_float_property(streamfx::gfx::shader::basic_field_type ft, obs_properties_t* props, const char* key, const char* name, float min, float max, float step, std::list edata) { switch (ft) { case streamfx::gfx::shader::basic_field_type::Enum: { @@ -287,7 +287,7 @@ void streamfx::gfx::shader::float_parameter::properties(obs_properties_t* props, void streamfx::gfx::shader::float_parameter::update(obs_data_t* settings) { for (std::size_t idx = 0; idx < get_size(); idx++) { - _data[idx].f32 = static_cast(obs_data_get_double(settings, key_at(idx).data())) * _scale[idx].f32; + _data[idx].f32 = static_cast(obs_data_get_double(settings, key_at(idx).data())) * _scale[idx].f32; } } diff --git a/source/gfx/shader/gfx-shader-param-basic.hpp b/source/gfx/shader/gfx-shader-param-basic.hpp index 3d22805815..ce8bbd925b 100644 --- a/source/gfx/shader/gfx-shader-param-basic.hpp +++ b/source/gfx/shader/gfx-shader-param-basic.hpp @@ -26,7 +26,7 @@ namespace streamfx::gfx { union { int32_t i32; uint32_t ui32; - float_t f32; + float f32; }; }; diff --git a/source/gfx/shader/gfx-shader.cpp b/source/gfx/shader/gfx-shader.cpp index 2fa1c19183..ef8b6144df 100644 --- a/source/gfx/shader/gfx-shader.cpp +++ b/source/gfx/shader/gfx-shader.cpp @@ -49,7 +49,7 @@ streamfx::gfx::shader::shader::shader(obs_source_t* self, shader_mode mode) // Initialize random values. _random.seed(static_cast(_random_seed)); for (size_t idx = 0; idx < 16; idx++) { - _random_values[idx] = static_cast(static_cast(_random()) / static_cast(_random.max())); + _random_values[idx] = static_cast(static_cast(_random()) / static_cast(_random.max())); } } @@ -343,7 +343,7 @@ void streamfx::gfx::shader::shader::update(obs_data_t* data) _random_seed = seed; _random.seed(static_cast(_random_seed)); for (size_t idx = 0; idx < 16; idx++) { - _random_values[idx] = static_cast(static_cast(_random()) / static_cast(_random.max())); + _random_values[idx] = static_cast(static_cast(_random()) / static_cast(_random.max())); } } @@ -399,9 +399,9 @@ uint32_t streamfx::gfx::shader::shader::base_height() return _base_height; } -bool streamfx::gfx::shader::shader::tick(float_t time) +bool streamfx::gfx::shader::shader::tick(float time) { - _shader_file_tick = static_cast(static_cast(_shader_file_tick) + static_cast(time)); + _shader_file_tick = static_cast(static_cast(_shader_file_tick) + static_cast(time)); if (_shader_file_tick >= 1.0f / 3.0f) { _shader_file_tick -= 1.0f / 3.0f; bool v1, v2; @@ -422,7 +422,7 @@ bool streamfx::gfx::shader::shader::tick(float_t time) // Recreate Per-Activation-Random values. for (size_t idx = 0; idx < 8; idx++) { - _random_values[8 + idx] = static_cast(static_cast(_random()) / static_cast(_random.max())); + _random_values[8 + idx] = static_cast(static_cast(_random()) / static_cast(_random.max())); } // Flag Render Target as outdated. @@ -444,14 +444,14 @@ void streamfx::gfx::shader::shader::prepare_render() // float4 Time: (Time in Seconds), (Time in Current Second), (Time in Seconds only), (Random Value) if (streamfx::obs::gs::effect_parameter el = _shader.get_parameter("Time"); el != nullptr) { if (el.get_type() == streamfx::obs::gs::effect_parameter::type::Float4) { - el.set_float4(_time, _time_loop, static_cast(_loops), static_cast(static_cast(_random()) / static_cast(_random.max()))); + el.set_float4(_time, _time_loop, static_cast(_loops), static_cast(static_cast(_random()) / static_cast(_random.max()))); } } // float4 ViewSize: (Width), (Height), (1.0 / Width), (1.0 / Height) if (auto el = _shader.get_parameter("ViewSize"); el != nullptr) { if (el.get_type() == streamfx::obs::gs::effect_parameter::type::Float4) { - el.set_float4(static_cast(width()), static_cast(height()), 1.0f / static_cast(width()), 1.0f / static_cast(height())); + el.set_float4(static_cast(width()), static_cast(height()), 1.0f / static_cast(width()), 1.0f / static_cast(height())); } } @@ -574,7 +574,7 @@ void streamfx::gfx::shader::shader::set_input_b(std::shared_ptr(static_cast(_random()) / static_cast(_random.max())); + _random_values[4 + idx] = static_cast(static_cast(_random()) / static_cast(_random.max())); } } diff --git a/source/gfx/shader/gfx-shader.hpp b/source/gfx/shader/gfx-shader.hpp index da63fc5ed7..15a56cce76 100644 --- a/source/gfx/shader/gfx-shader.hpp +++ b/source/gfx/shader/gfx-shader.hpp @@ -51,7 +51,7 @@ namespace streamfx::gfx { std::string _shader_tech; std::filesystem::file_time_type _shader_file_mt; uintmax_t _shader_file_sz; - float_t _shader_file_tick; + float _shader_file_tick; shader_param_map_t _shader_params; // Options @@ -62,12 +62,12 @@ namespace streamfx::gfx { // Cache bool _have_current_params; - float_t _time; - float_t _time_loop; + float _time; + float _time_loop; int32_t _loops; std::mt19937_64 _random; int32_t _random_seed; - float_t _random_values[16]; // 0..4 Per-Instance-Random, 4..8 Per-Activation-Random 9..15 Per-Frame-Random + float _random_values[16]; // 0..4 Per-Instance-Random, 4..8 Per-Activation-Random 9..15 Per-Frame-Random // Rendering bool _rt_up_to_date; @@ -103,7 +103,7 @@ namespace streamfx::gfx { uint32_t base_height(); - bool tick(float_t time); + bool tick(float time); void prepare_render(); @@ -120,7 +120,7 @@ namespace streamfx::gfx { void set_input_b(std::shared_ptr tex, bool srgb = false); - void set_transition_time(float_t t); + void set_transition_time(float t); void set_transition_size(uint32_t w, uint32_t h); diff --git a/source/obs/gs/gs-effect-parameter.cpp b/source/obs/gs/gs-effect-parameter.cpp index 9131250cb2..bf71e98757 100644 --- a/source/obs/gs/gs-effect-parameter.cpp +++ b/source/obs/gs/gs-effect-parameter.cpp @@ -216,33 +216,33 @@ void streamfx::obs::gs::effect_parameter::set_bool_array(bool v[], std::size_t s gs_effect_set_val(get(), v, sz); } -void streamfx::obs::gs::effect_parameter::set_float(float_t x) +void streamfx::obs::gs::effect_parameter::set_float(float x) { if (get_type() != type::Float) throw std::bad_cast(); gs_effect_set_float(get(), x); } -void streamfx::obs::gs::effect_parameter::get_float(float_t& x) +void streamfx::obs::gs::effect_parameter::get_float(float& x) { if (get_type() != type::Float) throw std::bad_cast(); void* ptr = gs_effect_get_val(get()); if (ptr) { - x = *reinterpret_cast(ptr); + x = *reinterpret_cast(ptr); bfree(ptr); } else { x = 0; } } -void streamfx::obs::gs::effect_parameter::get_default_float(float_t& x) +void streamfx::obs::gs::effect_parameter::get_default_float(float& x) { if (get_type() != type::Float) throw std::bad_cast(); void* ptr = gs_effect_get_default_val(get()); if (ptr) { - x = *reinterpret_cast(ptr); + x = *reinterpret_cast(ptr); bfree(ptr); } else { x = 0; @@ -266,7 +266,7 @@ void streamfx::obs::gs::effect_parameter::get_default_float2(vec2& v) get_default_float2(v.x, v.y); } -void streamfx::obs::gs::effect_parameter::set_float2(float_t x, float_t y) +void streamfx::obs::gs::effect_parameter::set_float2(float x, float y) { vec2 data; data.x = x; @@ -274,28 +274,28 @@ void streamfx::obs::gs::effect_parameter::set_float2(float_t x, float_t y) set_float2(data); } -void streamfx::obs::gs::effect_parameter::get_float2(float_t& x, float_t& y) +void streamfx::obs::gs::effect_parameter::get_float2(float& x, float& y) { if (get_type() != type::Float2) throw std::bad_cast(); uint8_t* ptr = static_cast(gs_effect_get_val(get())); if (ptr) { - x = *reinterpret_cast(ptr); - y = *reinterpret_cast(ptr + sizeof(float_t)); + x = *reinterpret_cast(ptr); + y = *reinterpret_cast(ptr + sizeof(float)); bfree(ptr); } else { x = y = 0; } } -void streamfx::obs::gs::effect_parameter::get_default_float2(float_t& x, float_t& y) +void streamfx::obs::gs::effect_parameter::get_default_float2(float& x, float& y) { if (get_type() != type::Float2) throw std::bad_cast(); uint8_t* ptr = static_cast(gs_effect_get_default_val(get())); if (ptr) { - x = *reinterpret_cast(ptr); - y = *reinterpret_cast(ptr + sizeof(float_t)); + x = *reinterpret_cast(ptr); + y = *reinterpret_cast(ptr + sizeof(float)); bfree(ptr); } else { x = y = 0; @@ -319,7 +319,7 @@ void streamfx::obs::gs::effect_parameter::get_default_float3(vec3& v) get_default_float3(v.x, v.y, v.z); } -void streamfx::obs::gs::effect_parameter::set_float3(float_t x, float_t y, float_t z) +void streamfx::obs::gs::effect_parameter::set_float3(float x, float y, float z) { if (get_type() != type::Float3) throw std::bad_cast(); @@ -327,30 +327,30 @@ void streamfx::obs::gs::effect_parameter::set_float3(float_t x, float_t y, float gs_effect_set_vec3(get(), &v); } -void streamfx::obs::gs::effect_parameter::get_float3(float_t& x, float_t& y, float_t& z) +void streamfx::obs::gs::effect_parameter::get_float3(float& x, float& y, float& z) { if (get_type() != type::Float3) throw std::bad_cast(); uint8_t* ptr = static_cast(gs_effect_get_val(get())); if (ptr) { - x = *reinterpret_cast(ptr); - y = *reinterpret_cast(ptr + sizeof(float_t)); - z = *reinterpret_cast(ptr + sizeof(float_t) * 2); + x = *reinterpret_cast(ptr); + y = *reinterpret_cast(ptr + sizeof(float)); + z = *reinterpret_cast(ptr + sizeof(float) * 2); bfree(ptr); } else { x = y = z = 0; } } -void streamfx::obs::gs::effect_parameter::get_default_float3(float_t& x, float_t& y, float_t& z) +void streamfx::obs::gs::effect_parameter::get_default_float3(float& x, float& y, float& z) { if (get_type() != type::Float3) throw std::bad_cast(); uint8_t* ptr = static_cast(gs_effect_get_default_val(get())); if (ptr) { - x = *reinterpret_cast(ptr); - y = *reinterpret_cast(ptr + sizeof(float_t)); - z = *reinterpret_cast(ptr + sizeof(float_t) * 2); + x = *reinterpret_cast(ptr); + y = *reinterpret_cast(ptr + sizeof(float)); + z = *reinterpret_cast(ptr + sizeof(float) * 2); bfree(ptr); } else { x = y = z = 0; @@ -374,7 +374,7 @@ void streamfx::obs::gs::effect_parameter::get_default_float4(vec4& v) get_default_float4(v.x, v.y, v.z, v.w); } -void streamfx::obs::gs::effect_parameter::set_float4(float_t x, float_t y, float_t z, float_t w) +void streamfx::obs::gs::effect_parameter::set_float4(float x, float y, float z, float w) { if (get_type() != type::Float4) throw std::bad_cast(); @@ -382,32 +382,32 @@ void streamfx::obs::gs::effect_parameter::set_float4(float_t x, float_t y, float gs_effect_set_vec4(get(), &v); } -void streamfx::obs::gs::effect_parameter::get_float4(float_t& x, float_t& y, float_t& z, float_t& w) +void streamfx::obs::gs::effect_parameter::get_float4(float& x, float& y, float& z, float& w) { if (get_type() != type::Float4) throw std::bad_cast(); uint8_t* ptr = static_cast(gs_effect_get_val(get())); if (ptr) { - x = *reinterpret_cast(ptr); - y = *reinterpret_cast(ptr + sizeof(float_t)); - z = *reinterpret_cast(ptr + sizeof(float_t) * 2); - w = *reinterpret_cast(ptr + sizeof(float_t) * 3); + x = *reinterpret_cast(ptr); + y = *reinterpret_cast(ptr + sizeof(float)); + z = *reinterpret_cast(ptr + sizeof(float) * 2); + w = *reinterpret_cast(ptr + sizeof(float) * 3); bfree(ptr); } else { x = y = z = w = 0; } } -void streamfx::obs::gs::effect_parameter::get_default_float4(float_t& x, float_t& y, float_t& z, float_t& w) +void streamfx::obs::gs::effect_parameter::get_default_float4(float& x, float& y, float& z, float& w) { if (get_type() != type::Float4) throw std::bad_cast(); uint8_t* ptr = static_cast(gs_effect_get_default_val(get())); if (ptr) { - x = *reinterpret_cast(ptr); - y = *reinterpret_cast(ptr + sizeof(float_t)); - z = *reinterpret_cast(ptr + sizeof(float_t) * 2); - w = *reinterpret_cast(ptr + sizeof(float_t) * 3); + x = *reinterpret_cast(ptr); + y = *reinterpret_cast(ptr + sizeof(float)); + z = *reinterpret_cast(ptr + sizeof(float) * 2); + w = *reinterpret_cast(ptr + sizeof(float) * 3); bfree(ptr); } else { x = y = z = w = 0; @@ -574,22 +574,22 @@ void streamfx::obs::gs::effect_parameter::get_matrix(matrix4& v) throw std::bad_cast(); uint8_t* ptr = static_cast(gs_effect_get_val(get())); if (ptr) { - v.x.x = *reinterpret_cast(ptr + sizeof(float_t) * 0); - v.x.y = *reinterpret_cast(ptr + sizeof(float_t) * 1); - v.x.z = *reinterpret_cast(ptr + sizeof(float_t) * 2); - v.x.w = *reinterpret_cast(ptr + sizeof(float_t) * 3); - v.y.x = *reinterpret_cast(ptr + sizeof(float_t) * 4); - v.y.y = *reinterpret_cast(ptr + sizeof(float_t) * 5); - v.y.z = *reinterpret_cast(ptr + sizeof(float_t) * 6); - v.y.w = *reinterpret_cast(ptr + sizeof(float_t) * 7); - v.z.x = *reinterpret_cast(ptr + sizeof(float_t) * 8); - v.z.y = *reinterpret_cast(ptr + sizeof(float_t) * 9); - v.z.z = *reinterpret_cast(ptr + sizeof(float_t) * 10); - v.z.w = *reinterpret_cast(ptr + sizeof(float_t) * 11); - v.t.x = *reinterpret_cast(ptr + sizeof(float_t) * 12); - v.t.y = *reinterpret_cast(ptr + sizeof(float_t) * 13); - v.t.z = *reinterpret_cast(ptr + sizeof(float_t) * 14); - v.t.w = *reinterpret_cast(ptr + sizeof(float_t) * 15); + v.x.x = *reinterpret_cast(ptr + sizeof(float) * 0); + v.x.y = *reinterpret_cast(ptr + sizeof(float) * 1); + v.x.z = *reinterpret_cast(ptr + sizeof(float) * 2); + v.x.w = *reinterpret_cast(ptr + sizeof(float) * 3); + v.y.x = *reinterpret_cast(ptr + sizeof(float) * 4); + v.y.y = *reinterpret_cast(ptr + sizeof(float) * 5); + v.y.z = *reinterpret_cast(ptr + sizeof(float) * 6); + v.y.w = *reinterpret_cast(ptr + sizeof(float) * 7); + v.z.x = *reinterpret_cast(ptr + sizeof(float) * 8); + v.z.y = *reinterpret_cast(ptr + sizeof(float) * 9); + v.z.z = *reinterpret_cast(ptr + sizeof(float) * 10); + v.z.w = *reinterpret_cast(ptr + sizeof(float) * 11); + v.t.x = *reinterpret_cast(ptr + sizeof(float) * 12); + v.t.y = *reinterpret_cast(ptr + sizeof(float) * 13); + v.t.z = *reinterpret_cast(ptr + sizeof(float) * 14); + v.t.w = *reinterpret_cast(ptr + sizeof(float) * 15); bfree(ptr); } else { v.x = vec4{}; @@ -605,22 +605,22 @@ void streamfx::obs::gs::effect_parameter::get_default_matrix(matrix4& v) throw std::bad_cast(); uint8_t* ptr = static_cast(gs_effect_get_default_val(get())); if (ptr) { - v.x.x = *reinterpret_cast(ptr + sizeof(float_t) * 0); - v.x.y = *reinterpret_cast(ptr + sizeof(float_t) * 1); - v.x.z = *reinterpret_cast(ptr + sizeof(float_t) * 2); - v.x.w = *reinterpret_cast(ptr + sizeof(float_t) * 3); - v.y.x = *reinterpret_cast(ptr + sizeof(float_t) * 4); - v.y.y = *reinterpret_cast(ptr + sizeof(float_t) * 5); - v.y.z = *reinterpret_cast(ptr + sizeof(float_t) * 6); - v.y.w = *reinterpret_cast(ptr + sizeof(float_t) * 7); - v.z.x = *reinterpret_cast(ptr + sizeof(float_t) * 8); - v.z.y = *reinterpret_cast(ptr + sizeof(float_t) * 9); - v.z.z = *reinterpret_cast(ptr + sizeof(float_t) * 10); - v.z.w = *reinterpret_cast(ptr + sizeof(float_t) * 11); - v.t.x = *reinterpret_cast(ptr + sizeof(float_t) * 12); - v.t.y = *reinterpret_cast(ptr + sizeof(float_t) * 13); - v.t.z = *reinterpret_cast(ptr + sizeof(float_t) * 14); - v.t.w = *reinterpret_cast(ptr + sizeof(float_t) * 15); + v.x.x = *reinterpret_cast(ptr + sizeof(float) * 0); + v.x.y = *reinterpret_cast(ptr + sizeof(float) * 1); + v.x.z = *reinterpret_cast(ptr + sizeof(float) * 2); + v.x.w = *reinterpret_cast(ptr + sizeof(float) * 3); + v.y.x = *reinterpret_cast(ptr + sizeof(float) * 4); + v.y.y = *reinterpret_cast(ptr + sizeof(float) * 5); + v.y.z = *reinterpret_cast(ptr + sizeof(float) * 6); + v.y.w = *reinterpret_cast(ptr + sizeof(float) * 7); + v.z.x = *reinterpret_cast(ptr + sizeof(float) * 8); + v.z.y = *reinterpret_cast(ptr + sizeof(float) * 9); + v.z.z = *reinterpret_cast(ptr + sizeof(float) * 10); + v.z.w = *reinterpret_cast(ptr + sizeof(float) * 11); + v.t.x = *reinterpret_cast(ptr + sizeof(float) * 12); + v.t.y = *reinterpret_cast(ptr + sizeof(float) * 13); + v.t.z = *reinterpret_cast(ptr + sizeof(float) * 14); + v.t.w = *reinterpret_cast(ptr + sizeof(float) * 15); bfree(ptr); } else { v.x = vec4{}; diff --git a/source/obs/gs/gs-effect-parameter.hpp b/source/obs/gs/gs-effect-parameter.hpp index 454058e964..b28ba97dad 100644 --- a/source/obs/gs/gs-effect-parameter.hpp +++ b/source/obs/gs/gs-effect-parameter.hpp @@ -129,30 +129,30 @@ namespace streamfx::obs::gs { void set_bool_array(bool v[], std::size_t sz); - void set_float(float_t x); - void get_float(float_t& x); - void get_default_float(float_t& x); + void set_float(float x); + void get_float(float& x); + void get_default_float(float& x); void set_float2(vec2 const& v); void get_float2(vec2& v); void get_default_float2(vec2& v); - void set_float2(float_t x, float_t y); - void get_float2(float_t& x, float_t& y); - void get_default_float2(float_t& x, float_t& y); + void set_float2(float x, float y); + void get_float2(float& x, float& y); + void get_default_float2(float& x, float& y); void set_float3(vec3 const& v); void get_float3(vec3& v); void get_default_float3(vec3& v); - void set_float3(float_t x, float_t y, float_t z); - void get_float3(float_t& x, float_t& y, float_t& z); - void get_default_float3(float_t& x, float_t& y, float_t& z); + void set_float3(float x, float y, float z); + void get_float3(float& x, float& y, float& z); + void get_default_float3(float& x, float& y, float& z); void set_float4(vec4 const& v); void get_float4(vec4& v); void get_default_float4(vec4& v); - void set_float4(float_t x, float_t y, float_t z, float_t w); - void get_float4(float_t& x, float_t& y, float_t& z, float_t& w); - void get_default_float4(float_t& x, float_t& y, float_t& z, float_t& w); + void set_float4(float x, float y, float z, float w); + void get_float4(float& x, float& y, float& z, float& w); + void get_default_float4(float& x, float& y, float& z, float& w); void set_int(int32_t x); void get_int(int32_t& x); @@ -185,7 +185,7 @@ namespace streamfx::obs::gs { void get_default_string(std::string& v); public /* Helpers */: - inline float_t get_bool() + inline float get_bool() { bool v; get_bool(v); @@ -198,15 +198,15 @@ namespace streamfx::obs::gs { return v; }; - inline float_t get_float() + inline float get_float() { - float_t v; + float v; get_float(v); return v; }; - inline float_t get_default_float() + inline float get_default_float() { - float_t v; + float v; get_default_float(v); return v; }; diff --git a/source/obs/gs/gs-helper.hpp b/source/obs/gs/gs-helper.hpp index d802af41e7..9e7c748a5d 100644 --- a/source/obs/gs/gs-helper.hpp +++ b/source/obs/gs/gs-helper.hpp @@ -26,36 +26,36 @@ namespace streamfx::obs::gs { }; #if defined(ENABLE_PROFILING) && !defined(D_PLATFORM_MAC) && _DEBUG - static constexpr float_t debug_color_white[4] = {1.f, 1.f, 1.f, 1.f}; - static constexpr float_t debug_color_gray[4] = {.5f, .5f, .5f, 1.f}; - static constexpr float_t debug_color_black[4] = {0.f, 0.f, 0.f, 1.f}; - static constexpr float_t debug_color_red[4] = {1.f, 0.f, 0.f, 1.f}; - static constexpr float_t debug_color_flush_orange[4] = {1.f, .5f, 0.f, 1.f}; - static constexpr float_t debug_color_yellow[4] = {1.f, 1.f, 0.f, 1.f}; - static constexpr float_t debug_color_chartreuse[4] = {.5f, 1.f, 0.f, 1.f}; - static constexpr float_t debug_color_green[4] = {0.f, 1.f, 0.f, 1.f}; - static constexpr float_t debug_color_spring_green[4] = {0.f, 1.f, .5f, 1.f}; - static constexpr float_t debug_color_teal[4] = {0.f, 1.f, 1.f, 1.f}; - static constexpr float_t debug_color_azure_radiance[4] = {0.f, .5f, 1.f, 1.f}; - static constexpr float_t debug_color_blue[4] = {0.f, 0.f, 1.f, 1.f}; - static constexpr float_t debug_color_electric_violet[4] = {.5f, 0.f, 1.f, 1.f}; - static constexpr float_t debug_color_magenta[4] = {1.f, 0.f, 1.f, 1.f}; - static constexpr float_t debug_color_rose[4] = {1.f, 0.f, .5f, 1.f}; + static constexpr float debug_color_white[4] = {1.f, 1.f, 1.f, 1.f}; + static constexpr float debug_color_gray[4] = {.5f, .5f, .5f, 1.f}; + static constexpr float debug_color_black[4] = {0.f, 0.f, 0.f, 1.f}; + static constexpr float debug_color_red[4] = {1.f, 0.f, 0.f, 1.f}; + static constexpr float debug_color_flush_orange[4] = {1.f, .5f, 0.f, 1.f}; + static constexpr float debug_color_yellow[4] = {1.f, 1.f, 0.f, 1.f}; + static constexpr float debug_color_chartreuse[4] = {.5f, 1.f, 0.f, 1.f}; + static constexpr float debug_color_green[4] = {0.f, 1.f, 0.f, 1.f}; + static constexpr float debug_color_spring_green[4] = {0.f, 1.f, .5f, 1.f}; + static constexpr float debug_color_teal[4] = {0.f, 1.f, 1.f, 1.f}; + static constexpr float debug_color_azure_radiance[4] = {0.f, .5f, 1.f, 1.f}; + static constexpr float debug_color_blue[4] = {0.f, 0.f, 1.f, 1.f}; + static constexpr float debug_color_electric_violet[4] = {.5f, 0.f, 1.f, 1.f}; + static constexpr float debug_color_magenta[4] = {1.f, 0.f, 1.f, 1.f}; + static constexpr float debug_color_rose[4] = {1.f, 0.f, .5f, 1.f}; - static const float_t* debug_color_source = debug_color_white; - static const float_t* debug_color_capture = debug_color_flush_orange; - static const float_t* debug_color_cache = debug_color_capture; - static const float_t* debug_color_convert = debug_color_electric_violet; - static const float_t* debug_color_cache_render = debug_color_convert; - static const float_t* debug_color_copy = debug_color_azure_radiance; - static const float_t* debug_color_allocate = debug_color_red; - static const float_t* debug_color_render = debug_color_teal; + static const float* debug_color_source = debug_color_white; + static const float* debug_color_capture = debug_color_flush_orange; + static const float* debug_color_cache = debug_color_capture; + static const float* debug_color_convert = debug_color_electric_violet; + static const float* debug_color_cache_render = debug_color_convert; + static const float* debug_color_copy = debug_color_azure_radiance; + static const float* debug_color_allocate = debug_color_red; + static const float* debug_color_render = debug_color_teal; class debug_marker { std::string _name; public: - inline debug_marker(const float_t color[4], const char* format, ...) + inline debug_marker(const float color[4], const char* format, ...) { std::size_t size; std::vector buffer(64); diff --git a/source/obs/gs/gs-texture.cpp b/source/obs/gs/gs-texture.cpp index 332e00f980..d6f4b38d36 100644 --- a/source/obs/gs/gs-texture.cpp +++ b/source/obs/gs/gs-texture.cpp @@ -63,7 +63,7 @@ streamfx::obs::gs::texture::texture(uint32_t width, uint32_t height, uint32_t de throw std::logic_error("mip_levels must be at least 1"); if (mip_levels > 1 || ((texture_flags & flags::BuildMipMaps) == flags::BuildMipMaps)) { - bool isPOT = (streamfx::util::math::is_equal(pow(2, static_cast(floor(log(width) / log(2)))), width) && streamfx::util::math::is_equal(pow(2, static_cast(floor(log(height) / log(2)))), height) && streamfx::util::math::is_equal(pow(2, static_cast(floor(log(depth) / log(2)))), depth)); + bool isPOT = (streamfx::util::math::is_close_epsilon(pow(2, static_cast(floor(log(width) / log(2)))), width) && streamfx::util::math::is_close_epsilon(pow(2, static_cast(floor(log(height) / log(2)))), height) && streamfx::util::math::is_close_epsilon(pow(2, static_cast(floor(log(depth) / log(2)))), depth)); if (!isPOT) throw std::logic_error("mip mapping requires power of two dimensions"); } @@ -87,7 +87,7 @@ streamfx::obs::gs::texture::texture(uint32_t size, gs_color_format format, uint3 throw std::logic_error("mip_levels must be at least 1"); if (mip_levels > 1 || ((texture_flags & flags::BuildMipMaps) == flags::BuildMipMaps)) { - bool isPOT = streamfx::util::math::is_equal(pow(2, static_cast(floor(log(size) / log(2)))), size); + bool isPOT = streamfx::util::math::is_close_epsilon(pow(2, static_cast(floor(log(size) / log(2)))), size); if (!isPOT) throw std::logic_error("mip mapping requires power of two dimensions"); } diff --git a/source/obs/gs/gs-vertex.cpp b/source/obs/gs/gs-vertex.cpp index 851e0e30bb..edbdb6463d 100644 --- a/source/obs/gs/gs-vertex.cpp +++ b/source/obs/gs/gs-vertex.cpp @@ -10,7 +10,7 @@ streamfx::obs::gs::vertex::vertex() : position(nullptr), normal(nullptr), tangent(nullptr), color(nullptr), _has_store(true), _store(nullptr) { - _store = streamfx::util::malloc_aligned(16, sizeof(vec3) * 3 + sizeof(uint32_t) + sizeof(vec4) * MAXIMUM_UVW_LAYERS); + _store = streamfx::util::memory::malloc_aligned(16, sizeof(vec3) * 3 + sizeof(uint32_t) + sizeof(vec4) * MAXIMUM_UVW_LAYERS); std::size_t offset = 0; @@ -35,7 +35,7 @@ streamfx::obs::gs::vertex::vertex() : position(nullptr), normal(nullptr), tangen streamfx::obs::gs::vertex::~vertex() { if (_has_store) { - streamfx::util::free_aligned(_store); + streamfx::util::memory::free_aligned(_store); } } diff --git a/source/obs/gs/gs-vertexbuffer.cpp b/source/obs/gs/gs-vertexbuffer.cpp index 0fb5e5ab15..9f13691f9a 100644 --- a/source/obs/gs/gs-vertexbuffer.cpp +++ b/source/obs/gs/gs-vertexbuffer.cpp @@ -25,10 +25,10 @@ void streamfx::obs::gs::vertex_buffer::initialize(uint32_t capacity, uint8_t lay _data = std::make_shared(); _data->num = _capacity; _data->num_tex = _layers; - _data->points = _positions = static_cast(streamfx::util::malloc_aligned(16, sizeof(vec3) * _capacity)); - _data->normals = _normals = static_cast(streamfx::util::malloc_aligned(16, sizeof(vec3) * _capacity)); - _data->tangents = _tangents = static_cast(streamfx::util::malloc_aligned(16, sizeof(vec3) * _capacity)); - _data->colors = _colors = static_cast(streamfx::util::malloc_aligned(16, sizeof(uint32_t) * _capacity)); + _data->points = _positions = static_cast(streamfx::util::memory::malloc_aligned(16, sizeof(vec3) * _capacity)); + _data->normals = _normals = static_cast(streamfx::util::memory::malloc_aligned(16, sizeof(vec3) * _capacity)); + _data->tangents = _tangents = static_cast(streamfx::util::memory::malloc_aligned(16, sizeof(vec3) * _capacity)); + _data->colors = _colors = static_cast(streamfx::util::memory::malloc_aligned(16, sizeof(uint32_t) * _capacity)); // Clear the allocated memory of any data. memset(_positions, 0, sizeof(vec3) * _capacity); @@ -39,9 +39,9 @@ void streamfx::obs::gs::vertex_buffer::initialize(uint32_t capacity, uint8_t lay if (_layers == 0) { _data->tvarray = nullptr; } else { - _data->tvarray = _uv_layers = static_cast(streamfx::util::malloc_aligned(16, sizeof(gs_tvertarray) * _layers)); + _data->tvarray = _uv_layers = static_cast(streamfx::util::memory::malloc_aligned(16, sizeof(gs_tvertarray) * _layers)); for (uint8_t n = 0; n < _layers; n++) { - _uv_layers[n].array = _uvs[n] = static_cast(streamfx::util::malloc_aligned(16, sizeof(vec4) * _capacity)); + _uv_layers[n].array = _uvs[n] = static_cast(streamfx::util::memory::malloc_aligned(16, sizeof(vec4) * _capacity)); _uv_layers[n].width = 4; memset(_uvs[n], 0, sizeof(vec4) * _capacity); } @@ -72,13 +72,13 @@ void streamfx::obs::gs::vertex_buffer::initialize(uint32_t capacity, uint8_t lay void streamfx::obs::gs::vertex_buffer::finalize() { // Free data - streamfx::util::free_aligned(_positions); - streamfx::util::free_aligned(_normals); - streamfx::util::free_aligned(_tangents); - streamfx::util::free_aligned(_colors); - streamfx::util::free_aligned(_uv_layers); + streamfx::util::memory::free_aligned(_positions); + streamfx::util::memory::free_aligned(_normals); + streamfx::util::memory::free_aligned(_tangents); + streamfx::util::memory::free_aligned(_colors); + streamfx::util::memory::free_aligned(_uv_layers); for (std::size_t n = 0; n < _layers; n++) { - streamfx::util::free_aligned(_uvs[n]); + streamfx::util::memory::free_aligned(_uvs[n]); } _buffer.reset(); diff --git a/source/obs/obs-source-factory.hpp b/source/obs/obs-source-factory.hpp index 91f83a85be..f25e3c30e1 100644 --- a/source/obs/obs-source-factory.hpp +++ b/source/obs/obs-source-factory.hpp @@ -850,7 +850,7 @@ namespace streamfx::obs { return GS_CS_SRGB; } - virtual void video_tick(float_t seconds) {} + virtual void video_tick(float seconds) {} virtual void video_render(gs_effect_t* effect) {} diff --git a/source/sources/source-mirror.cpp b/source/sources/source-mirror.cpp index d166abb89b..1bdccc4bf5 100644 --- a/source/sources/source-mirror.cpp +++ b/source/sources/source-mirror.cpp @@ -140,7 +140,7 @@ void mirror_instance::save(obs_data_t* data) } } -void mirror_instance::video_tick(float_t time) {} +void mirror_instance::video_tick(float time) {} void mirror_instance::video_render(gs_effect_t* effect) { diff --git a/source/sources/source-mirror.hpp b/source/sources/source-mirror.hpp index daaa31cbfd..59e609915e 100644 --- a/source/sources/source-mirror.hpp +++ b/source/sources/source-mirror.hpp @@ -55,7 +55,7 @@ namespace streamfx::source::mirror { virtual void update(obs_data_t*) override; virtual void save(obs_data_t*) override; - virtual void video_tick(float_t) override; + virtual void video_tick(float) override; virtual void video_render(gs_effect_t*) override; virtual void enum_active_sources(obs_source_enum_proc_t, void*) override; diff --git a/source/sources/source-shader.cpp b/source/sources/source-shader.cpp index 2b8419888e..021c659244 100644 --- a/source/sources/source-shader.cpp +++ b/source/sources/source-shader.cpp @@ -66,7 +66,7 @@ void shader_instance::update(obs_data_t* data) _fx->update(data); } -void shader_instance::video_tick(float_t sec_since_last) +void shader_instance::video_tick(float sec_since_last) { if (_fx->tick(sec_since_last)) { obs_data_t* data = obs_source_get_settings(_self); diff --git a/source/sources/source-shader.hpp b/source/sources/source-shader.hpp index a5407dc194..f40085c157 100644 --- a/source/sources/source-shader.hpp +++ b/source/sources/source-shader.hpp @@ -26,7 +26,7 @@ namespace streamfx::source::shader { virtual void load(obs_data_t* data) override; virtual void update(obs_data_t* data) override; - virtual void video_tick(float_t sec_since_last) override; + virtual void video_tick(float sec_since_last) override; virtual void video_render(gs_effect_t* effect) override; void show() override; diff --git a/source/transitions/transition-shader.cpp b/source/transitions/transition-shader.cpp index f68cb5a854..0a38b96e44 100644 --- a/source/transitions/transition-shader.cpp +++ b/source/transitions/transition-shader.cpp @@ -66,7 +66,7 @@ void shader_instance::update(obs_data_t* data) _fx->update(data); } -void shader_instance::video_tick(float_t sec_since_last) +void shader_instance::video_tick(float sec_since_last) { if (_fx->tick(sec_since_last)) { obs_data_t* data = obs_source_get_settings(_self); @@ -93,7 +93,7 @@ void shader_instance::video_render(gs_effect_t* effect) obs_transition_video_render(_self, [](void* data, gs_texture_t* a, gs_texture_t* b, float t, uint32_t cx, uint32_t cy) { reinterpret_cast(data)->transition_render(a, b, t, cx, cy); }); } -void shader_instance::transition_render(gs_texture_t* a, gs_texture_t* b, float_t t, uint32_t cx, uint32_t cy) +void shader_instance::transition_render(gs_texture_t* a, gs_texture_t* b, float t, uint32_t cx, uint32_t cy) { _fx->set_input_a(std::make_shared<::streamfx::obs::gs::texture>(a, false)); _fx->set_input_b(std::make_shared<::streamfx::obs::gs::texture>(b, false)); @@ -106,7 +106,7 @@ void shader_instance::transition_render(gs_texture_t* a, gs_texture_t* b, float_ bool shader_instance::audio_render(uint64_t* ts_out, obs_source_audio_mix* audio_output, uint32_t mixers, std::size_t channels, std::size_t sample_rate) { return obs_transition_audio_render( - _self, ts_out, audio_output, mixers, channels, sample_rate, [](void*, float_t t) { return 1.0f - t; }, [](void*, float_t t) { return t; }); + _self, ts_out, audio_output, mixers, channels, sample_rate, [](void*, float t) { return 1.0f - t; }, [](void*, float t) { return t; }); } void shader_instance::transition_start() diff --git a/source/transitions/transition-shader.hpp b/source/transitions/transition-shader.hpp index a5049637bb..b115f84272 100644 --- a/source/transitions/transition-shader.hpp +++ b/source/transitions/transition-shader.hpp @@ -25,10 +25,10 @@ namespace streamfx::transition::shader { virtual void load(obs_data_t* data) override; virtual void update(obs_data_t* data) override; - virtual void video_tick(float_t sec_since_last) override; + virtual void video_tick(float sec_since_last) override; virtual void video_render(gs_effect_t* effect) override; - void transition_render(gs_texture_t* a, gs_texture_t* b, float_t t, uint32_t cx, uint32_t cy); + void transition_render(gs_texture_t* a, gs_texture_t* b, float t, uint32_t cx, uint32_t cy); virtual bool audio_render(uint64_t* ts_out, struct obs_source_audio_mix* audio_output, uint32_t mixers, std::size_t channels, std::size_t sample_rate) override; diff --git a/source/util/utility.cpp b/source/util/utility.cpp index e59b7c1dbe..1e840fd923 100644 --- a/source/util/utility.cpp +++ b/source/util/utility.cpp @@ -22,66 +22,6 @@ obs_property_t* streamfx::util::obs_properties_add_tristate(obs_properties_t* pr return p; } -void* streamfx::util::vec2a::operator new(std::size_t count) -{ - return streamfx::util::malloc_aligned(16, count); -} - -void* streamfx::util::vec2a::operator new[](std::size_t count) -{ - return streamfx::util::malloc_aligned(16, count); -} - -void streamfx::util::vec2a::operator delete(void* p) -{ - streamfx::util::free_aligned(p); -} - -void streamfx::util::vec2a::operator delete[](void* p) -{ - streamfx::util::free_aligned(p); -} - -void* streamfx::util::vec3a::operator new(std::size_t count) -{ - return streamfx::util::malloc_aligned(16, count); -} - -void* streamfx::util::vec3a::operator new[](std::size_t count) -{ - return streamfx::util::malloc_aligned(16, count); -} - -void streamfx::util::vec3a::operator delete(void* p) -{ - streamfx::util::free_aligned(p); -} - -void streamfx::util::vec3a::operator delete[](void* p) -{ - streamfx::util::free_aligned(p); -} - -void* streamfx::util::vec4a::operator new(std::size_t count) -{ - return streamfx::util::malloc_aligned(16, count); -} - -void* streamfx::util::vec4a::operator new[](std::size_t count) -{ - return streamfx::util::malloc_aligned(16, count); -} - -void streamfx::util::vec4a::operator delete(void* p) -{ - streamfx::util::free_aligned(p); -} - -void streamfx::util::vec4a::operator delete[](void* p) -{ - streamfx::util::free_aligned(p); -} - std::pair streamfx::util::size_from_string(std::string_view text, bool allowSquare) { int64_t width, height; @@ -122,7 +62,7 @@ std::pair streamfx::util::size_from_string(std::string_view te return {width, height}; } -void* streamfx::util::malloc_aligned(std::size_t align, std::size_t size) +void* streamfx::util::memory::malloc_aligned(std::size_t align, std::size_t size) { #ifdef USE_MSC_ALLOC return _aligned_malloc(size, align); @@ -146,7 +86,7 @@ void* streamfx::util::malloc_aligned(std::size_t align, std::size_t size) #endif } -void streamfx::util::free_aligned(void* mem) +void streamfx::util::memory::free_aligned(void* mem) { #ifdef USE_MSC_ALLOC _aligned_free(mem); diff --git a/source/util/utility.hpp b/source/util/utility.hpp index 0b63c26077..c39f724642 100644 --- a/source/util/utility.hpp +++ b/source/util/utility.hpp @@ -5,6 +5,7 @@ #pragma once #include "warning-disable.hpp" +#include #include #include #include @@ -56,39 +57,13 @@ namespace streamfx::util { return tristate == -1; } - struct vec2a : public vec2 { - // 16-byte Aligned version of vec2 - static void* operator new(std::size_t count); - static void* operator new[](std::size_t count); - static void operator delete(void* p); - static void operator delete[](void* p); - }; - -#ifdef _MSC_VER - __declspec(align(16)) -#endif - struct vec3a : public vec3 { - // 16-byte Aligned version of vec3 - static void* operator new(std::size_t count); - static void* operator new[](std::size_t count); - static void operator delete(void* p); - static void operator delete[](void* p); - }; - -#ifdef _MSC_VER - __declspec(align(16)) -#endif - struct vec4a : public vec4 { - // 16-byte Aligned version of vec4 - static void* operator new(std::size_t count); - static void* operator new[](std::size_t count); - static void operator delete(void* p); - static void operator delete[](void* p); - }; - std::pair size_from_string(std::string_view text, bool allowSquare = true); namespace math { + /** Integer exponentiation by squaring. + * Complexity: O(log(exp) + * Has fall-backs to the normal methods for non-integer types. + */ template inline T pow(T base, T exp) { @@ -102,19 +77,55 @@ namespace streamfx::util { return res; } - // Proven by tests to be the fastest implementation on Intel and AMD CPUs. - // Ranking: log10, loop < bitscan < pow - // loop and log10 trade blows, usually almost identical. - // loop is used for integers, log10 for anything else. - template - inline bool is_power_of_two(T v) + template<> + inline float pow(float base, float exp) { - return T(1ull << uint64_t(floor(log10(T(v)) / log10(2.0)))) == v; + return ::powf(base, exp); } + template<> + inline double pow(double base, double exp) + { + return ::pow(base, exp); + } + + template<> + inline long double pow(long double base, long double exp) + { + return ::powl(base, exp); + } + + /** Fast PoT testing + * + * This was tested and verified to be the fastest implementation on + * Intel and AMD x86 CPUs, in both 32bit and 64bit modes. It is + * possible to make it even faster with a bit of SIMD magic (see + * json-simd), but it would no longer be generic - and not worth it. + * + * Ranking: popcnt < log10, loop < bitscan < pow + * - log10 version is useful for floating point. + * - popcnt and loop are fixed point and integers. + * - Pretty clear solution here. + * + */ template - inline bool is_power_of_two_loop(T v) + inline bool is_power_of_two(T v) { + static_assert(std::is_integral::value, "Input must be an integral type."); + +#if 1 // Optimizes to popcount if available. + return std::bitset(v).count() == 0; + +#elif 0 // Loop Variant 1, uses bit shifts. + bool bit = false; + for (std::size_t index = 0; index < (sizeof(T) * 8) || (v == 0); index++) { + if (bit && (v & 1)) + return false; + bit = (v & 1); + v >>= 1; + } + return true; +#elif 0 // Loop Variant 2, optimized by compiler to the above. bool have_bit = false; for (std::size_t index = 0; index < (sizeof(T) * 8); index++) { bool cur = (v & (static_cast(1ull) << index)) != 0; @@ -125,48 +136,61 @@ namespace streamfx::util { } } return true; +#endif } -#pragma push_macro("P_IS_POWER_OF_TWO_AS_LOOP") -#define P_IS_POWER_OF_TWO_AS_LOOP(x) \ - template<> \ - inline bool is_power_of_two(x v) \ - { \ - return is_power_of_two_loop(v); \ - } - P_IS_POWER_OF_TWO_AS_LOOP(int8_t) - P_IS_POWER_OF_TWO_AS_LOOP(uint8_t) - P_IS_POWER_OF_TWO_AS_LOOP(int16_t) - P_IS_POWER_OF_TWO_AS_LOOP(uint16_t) - P_IS_POWER_OF_TWO_AS_LOOP(int32_t) - P_IS_POWER_OF_TWO_AS_LOOP(uint32_t) - P_IS_POWER_OF_TWO_AS_LOOP(int64_t) - P_IS_POWER_OF_TWO_AS_LOOP(uint64_t) -#undef P_IS_POWER_OF_TWO_AS_LOOP -#pragma pop_macro("P_IS_POWER_OF_TWO_AS_LOOP") + template + inline bool is_power_of_two(float v) + { + return T(1ull << uint64_t(floor(log10(v) / log10(2.0f)))) == v; + } + + template + inline bool is_power_of_two(double v) + { + return T(1ull << uint64_t(floor(log10(v) / log10(2.0)))) == v; + } + + template + inline bool is_power_of_two(long double v) + { + return T(1ull << uint64_t(floor(log10(v) / log10(2.0l)))) == v; + } + template + inline bool is_power_of_two_loop(T v) + { + return is_power_of_two(v); + } + + /** Retrieves the lower bound on the exponent for a texture that would fit the given size. + * + */ template inline uint64_t get_power_of_two_exponent_floor(T v) { - return uint64_t(floor(log10(T(v)) / log10(2.0))); + return uint64_t(floor(log10(T(v)) / log10(2.0l))); } + /** Retrieves the upper bound on the exponent for a texture that would fit the given size. + * + */ template inline uint64_t get_power_of_two_exponent_ceil(T v) { - return uint64_t(ceil(log10(T(v)) / log10(2.0))); + return uint64_t(ceil(log10(T(v)) / log10(2.0l))); } template - inline bool is_equal(T target, C value) + inline bool is_close_epsilon(T target, C value) { return (target > (value - std::numeric_limits::epsilon())) && (target < (value + std::numeric_limits::epsilon())); } template - inline bool is_close(T target, T value, T delta) + inline bool is_close(T target, T value, T epsilon) { - return (target > (value - delta)) && (target < (value + delta)); + return (target > (value - epsilon)) && (target < (value + epsilon)); } template @@ -189,7 +213,7 @@ namespace streamfx::util { //static const double_t two_pi = pi * 2.; static const double_t two_pi_sqroot = 2.506628274631000502415765284811; //sqrt(two_pi); - if (is_equal(0, o)) { + if (is_close_epsilon(0, o)) { return T(std::numeric_limits::infinity()); } @@ -197,7 +221,7 @@ namespace streamfx::util { double_t left_e = 1. / (o * two_pi_sqroot); double_t mid_right_e = ((x /* - u*/) / o); double_t right_e = -0.5 * mid_right_e * mid_right_e; - double_t final = left_e * exp(right_e); + double final = left_e * exp(right_e); return T(final); } @@ -237,10 +261,12 @@ namespace streamfx::util { }; } // namespace math - inline std::size_t aligned_offset(std::size_t align, std::size_t pos) - { - return ((pos / align) + 1) * align; - } - void* malloc_aligned(std::size_t align, std::size_t size); - void free_aligned(void* mem); + namespace memory { + inline std::size_t aligned_offset(std::size_t align, std::size_t pos) + { + return ((pos / align) + 1) * align; + } + void* malloc_aligned(std::size_t align, std::size_t size); + void free_aligned(void* mem); + } // namespace memory } // namespace streamfx::util From d5cf2d2ccf0cc8a792f6e33f98e09104b4cf6970 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Wed, 6 Sep 2023 02:48:42 +0200 Subject: [PATCH 20/66] ffmpeg: Move into its own component While we're at it, let's also fix the invalid destructor, as well as the NVENC HEVC encoder incorrectly using H264.Level to store H265.Level. --- CMakeLists.txt | 205 ++---------------- components/ffmpeg/CMakeLists.txt | 26 +++ .../ffmpeg/source}/encoders/codecs/av1.cpp | 0 .../ffmpeg/source}/encoders/codecs/av1.hpp | 0 .../ffmpeg/source}/encoders/codecs/dnxhr.cpp | 0 .../ffmpeg/source}/encoders/codecs/dnxhr.hpp | 0 .../ffmpeg/source}/encoders/codecs/h264.cpp | 0 .../ffmpeg/source}/encoders/codecs/h264.hpp | 0 .../ffmpeg/source}/encoders/codecs/hevc.cpp | 0 .../ffmpeg/source}/encoders/codecs/hevc.hpp | 0 .../ffmpeg/source}/encoders/codecs/prores.cpp | 0 .../ffmpeg/source}/encoders/codecs/prores.hpp | 0 .../source}/encoders/encoder-ffmpeg.cpp | 0 .../source}/encoders/encoder-ffmpeg.hpp | 0 .../ffmpeg/source}/encoders/ffmpeg/amf.cpp | 0 .../ffmpeg/source}/encoders/ffmpeg/amf.hpp | 0 .../ffmpeg/source}/encoders/ffmpeg/cfhd.cpp | 0 .../ffmpeg/source}/encoders/ffmpeg/cfhd.hpp | 0 .../ffmpeg/source}/encoders/ffmpeg/debug.cpp | 0 .../ffmpeg/source}/encoders/ffmpeg/debug.hpp | 0 .../ffmpeg/source}/encoders/ffmpeg/dnxhd.cpp | 0 .../ffmpeg/source}/encoders/ffmpeg/dnxhd.hpp | 0 .../source}/encoders/ffmpeg/handler.cpp | 0 .../source}/encoders/ffmpeg/handler.hpp | 1 + .../ffmpeg/source}/encoders/ffmpeg/nvenc.cpp | 21 +- .../ffmpeg/source}/encoders/ffmpeg/nvenc.hpp | 0 .../source}/encoders/ffmpeg/prores_aw.cpp | 0 .../source}/encoders/ffmpeg/prores_aw.hpp | 0 .../ffmpeg/source}/ffmpeg/avframe-queue.cpp | 0 .../ffmpeg/source}/ffmpeg/avframe-queue.hpp | 0 .../ffmpeg/source}/ffmpeg/hwapi/base.cpp | 0 .../ffmpeg/source}/ffmpeg/hwapi/base.hpp | 0 .../ffmpeg/source}/ffmpeg/hwapi/d3d11.cpp | 0 .../ffmpeg/source}/ffmpeg/hwapi/d3d11.hpp | 0 .../ffmpeg/source}/ffmpeg/swscale.cpp | 0 .../ffmpeg/source}/ffmpeg/swscale.hpp | 0 .../ffmpeg/source}/ffmpeg/tools.cpp | 0 .../ffmpeg/source}/ffmpeg/tools.hpp | 0 38 files changed, 60 insertions(+), 193 deletions(-) create mode 100644 components/ffmpeg/CMakeLists.txt rename {source => components/ffmpeg/source}/encoders/codecs/av1.cpp (100%) rename {source => components/ffmpeg/source}/encoders/codecs/av1.hpp (100%) rename {source => components/ffmpeg/source}/encoders/codecs/dnxhr.cpp (100%) rename {source => components/ffmpeg/source}/encoders/codecs/dnxhr.hpp (100%) rename {source => components/ffmpeg/source}/encoders/codecs/h264.cpp (100%) rename {source => components/ffmpeg/source}/encoders/codecs/h264.hpp (100%) rename {source => components/ffmpeg/source}/encoders/codecs/hevc.cpp (100%) rename {source => components/ffmpeg/source}/encoders/codecs/hevc.hpp (100%) rename {source => components/ffmpeg/source}/encoders/codecs/prores.cpp (100%) rename {source => components/ffmpeg/source}/encoders/codecs/prores.hpp (100%) rename {source => components/ffmpeg/source}/encoders/encoder-ffmpeg.cpp (100%) rename {source => components/ffmpeg/source}/encoders/encoder-ffmpeg.hpp (100%) rename {source => components/ffmpeg/source}/encoders/ffmpeg/amf.cpp (100%) rename {source => components/ffmpeg/source}/encoders/ffmpeg/amf.hpp (100%) rename {source => components/ffmpeg/source}/encoders/ffmpeg/cfhd.cpp (100%) rename {source => components/ffmpeg/source}/encoders/ffmpeg/cfhd.hpp (100%) rename {source => components/ffmpeg/source}/encoders/ffmpeg/debug.cpp (100%) rename {source => components/ffmpeg/source}/encoders/ffmpeg/debug.hpp (100%) rename {source => components/ffmpeg/source}/encoders/ffmpeg/dnxhd.cpp (100%) rename {source => components/ffmpeg/source}/encoders/ffmpeg/dnxhd.hpp (100%) rename {source => components/ffmpeg/source}/encoders/ffmpeg/handler.cpp (100%) rename {source => components/ffmpeg/source}/encoders/ffmpeg/handler.hpp (98%) rename {source => components/ffmpeg/source}/encoders/ffmpeg/nvenc.cpp (98%) rename {source => components/ffmpeg/source}/encoders/ffmpeg/nvenc.hpp (100%) rename {source => components/ffmpeg/source}/encoders/ffmpeg/prores_aw.cpp (100%) rename {source => components/ffmpeg/source}/encoders/ffmpeg/prores_aw.hpp (100%) rename {source => components/ffmpeg/source}/ffmpeg/avframe-queue.cpp (100%) rename {source => components/ffmpeg/source}/ffmpeg/avframe-queue.hpp (100%) rename {source => components/ffmpeg/source}/ffmpeg/hwapi/base.cpp (100%) rename {source => components/ffmpeg/source}/ffmpeg/hwapi/base.hpp (100%) rename {source => components/ffmpeg/source}/ffmpeg/hwapi/d3d11.cpp (100%) rename {source => components/ffmpeg/source}/ffmpeg/hwapi/d3d11.hpp (100%) rename {source => components/ffmpeg/source}/ffmpeg/swscale.cpp (100%) rename {source => components/ffmpeg/source}/ffmpeg/swscale.hpp (100%) rename {source => components/ffmpeg/source}/ffmpeg/tools.cpp (100%) rename {source => components/ffmpeg/source}/ffmpeg/tools.hpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 93d355f6b2..39105a8737 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -287,14 +287,6 @@ endif() set(${PREFIX}VERSION "" CACHE STRING "Specify an override for the automatically detected version. Accepts a mixture of SemVer 2.0 and CMake Version.") # Features -## Encoders -set(${PREFIX}ENABLE_ENCODER_FFMPEG ${FEATURE_STABLE} CACHE BOOL "Enable FFmpeg Encoder integration.") -set(${PREFIX}ENABLE_ENCODER_FFMPEG_AMF ${FEATURE_DEPRECATED} CACHE BOOL "Enable AMF Encoder in FFmpeg.") -set(${PREFIX}ENABLE_ENCODER_FFMPEG_NVENC ${FEATURE_STABLE} CACHE BOOL "Enable NVENC Encoder in FFmpeg.") -set(${PREFIX}ENABLE_ENCODER_FFMPEG_PRORES ${FEATURE_STABLE} CACHE BOOL "Enable ProRes Encoder in FFmpeg.") -set(${PREFIX}ENABLE_ENCODER_FFMPEG_DNXHR ${FEATURE_STABLE} CACHE BOOL "Enable DNXHR Encoder in FFmpeg.") -set(${PREFIX}ENABLE_ENCODER_FFMPEG_CFHD ${FEATURE_STABLE} CACHE BOOL "Enable CineForm Encoder in FFmpeg.") - ## Filters set(${PREFIX}ENABLE_FILTER_AUTOFRAMING ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Auto-Framing Filter") set(${PREFIX}ENABLE_FILTER_AUTOFRAMING_NVIDIA ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable NVIDIA provider(s) Auto-Framing Filter") @@ -449,54 +441,6 @@ macro(set_feature_disabled FEATURE DISABLED) set(${PREFIX}DISABLE_${FEATURE} ${DISABLED} CACHE INTERNAL "" FORCE) endmacro() -# Features -function(feature_encoder_ffmpeg RESOLVE) - is_feature_enabled(ENCODER_FFMPEG T_CHECK) - if(RESOLVE AND T_CHECK) - if(NOT HAVE_FFMPEG) - message(WARNING "FFmpeg Encoder requires FFmpeg. Disabling...") - set_feature_disabled(ENCODER_FFMPEG ON) - else() - # AMF - is_feature_enabled(ENCODER_FFMPEG_AMF T_CHECK) - if(T_CHECK AND D_PLATFORM_MAC) - message(WARNING "FFmpeg Encoder 'AMF' requires Windows or Linux. Disabling...") - set_feature_disabled(ENCODER_FFMPEG_AMF ON) - endif() - - # NVENC - is_feature_enabled(ENCODER_FFMPEG_NVENC T_CHECK) - if(T_CHECK AND D_PLATFORM_MAC) - message(WARNING "FFmpeg Encoder 'NVENC' requires Windows or Linux. Disabling...") - set_feature_disabled(ENCODER_FFMPEG_NVENC ON) - endif() - - # ProRes - is_feature_enabled(ENCODER_FFMPEG_PRORES T_CHECK) - - # DNxHR - is_feature_enabled(ENCODER_FFMPEG_DNXHR T_CHECK) - - # CineForm - is_feature_enabled(ENCODER_FFMPEG_CFHD T_CHECK) - endif() - elseif(T_CHECK) - set(REQUIRE_FFMPEG ON PARENT_SCOPE) - endif() -endfunction() - -function(feature_encoder_aom_av1 RESOLVE) - is_feature_enabled(ENCODER_AOM_AV1 T_CHECK) - if(RESOLVE AND T_CHECK) - if(NOT HAVE_AOM) - message(WARNING "AOM AV1 encoder missing AOM library. Disabling...") - set_feature_disabled(ENCODER_AOM_AV1 ON) - endif() - elseif(T_CHECK) - set(REQUIRE_AOM ON PARENT_SCOPE) - endif() -endfunction() - function(feature_filter_autoframing RESOLVE) is_feature_enabled(FILTER_AUTOFRAMING T_CHECK) if(RESOLVE AND T_CHECK) @@ -651,8 +595,6 @@ function(feature_updater RESOLVE) endfunction() # Set Requirements -feature_encoder_ffmpeg(OFF) -feature_encoder_aom_av1(OFF) feature_filter_autoframing(OFF) feature_filter_blur(OFF) feature_filter_color_grade(OFF) @@ -713,24 +655,6 @@ if(REQUIRE_CURL) find_package("CURL") endif() -#- FFmpeg -set(HAVE_FFMPEG OFF) -if(REQUIRE_FFMPEG) - find_package("FFmpeg" - COMPONENTS "avutil" "avcodec" "swscale" - ) - set(HAVE_FFMPEG ${FFmpeg_FOUND}) -endif() - -#- AOM -set(HAVE_AOM OFF) -if(REQUIRE_AOM) - if(NOT D_PLATFORM_MAC) - find_package("AOM") - set(HAVE_AOM ${AOM_FOUND}) - endif() -endif() - #- JSON set(HAVE_JSON OFF) if(REQUIRE_JSON) @@ -808,8 +732,6 @@ if(REQUIRE_QT) endif() # Verify Requirements -feature_encoder_ffmpeg(ON) -feature_encoder_aom_av1(ON) feature_filter_autoframing(ON) feature_filter_blur(ON) feature_filter_color_grade(ON) @@ -882,15 +804,6 @@ if(CURL_FOUND) list(APPEND PROJECT_LIBRARIES CURL::libcurl) endif() -if(HAVE_FFMPEG) - list(APPEND PROJECT_LIBRARIES - ${FFMPEG_LIBRARIES} - ) - list(APPEND PROJECT_INCLUDE_DIRS - ${FFMPEG_INCLUDE_DIRS} - ) -endif() - if(HAVE_JSON) list(APPEND PROJECT_INCLUDE_DIRS ${JSON_INCLUDE_DIR}) endif() @@ -1102,107 +1015,6 @@ list(APPEND PROJECT_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/source" ) -# Encoder/FFmpeg -is_feature_enabled(ENCODER_FFMPEG T_CHECK) -if(T_CHECK) - list(APPEND PROJECT_PRIVATE_SOURCE - # FFmpeg - "source/ffmpeg/avframe-queue.cpp" - "source/ffmpeg/avframe-queue.hpp" - "source/ffmpeg/swscale.hpp" - "source/ffmpeg/swscale.cpp" - "source/ffmpeg/tools.hpp" - "source/ffmpeg/tools.cpp" - "source/ffmpeg/hwapi/base.hpp" - "source/ffmpeg/hwapi/base.cpp" - "source/ffmpeg/hwapi/d3d11.hpp" - "source/ffmpeg/hwapi/d3d11.cpp" - - # Encoders - "source/encoders/encoder-ffmpeg.hpp" - "source/encoders/encoder-ffmpeg.cpp" - - # Encoders/Codecs - "source/encoders/codecs/hevc.hpp" - "source/encoders/codecs/hevc.cpp" - "source/encoders/codecs/h264.hpp" - "source/encoders/codecs/h264.cpp" - "source/encoders/codecs/prores.hpp" - "source/encoders/codecs/prores.cpp" - "source/encoders/codecs/dnxhr.hpp" - "source/encoders/codecs/dnxhr.cpp" - - # Encoders/Handlers - "source/encoders/ffmpeg/handler.hpp" - "source/encoders/ffmpeg/handler.cpp" - "source/encoders/ffmpeg/debug.hpp" - "source/encoders/ffmpeg/debug.cpp" - ) - list(APPEND PROJECT_DEFINITIONS - ENABLE_ENCODER_FFMPEG - ) - - # AMF - is_feature_enabled(ENCODER_FFMPEG_AMF T_CHECK) - if(T_CHECK) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/encoders/ffmpeg/amf.hpp" - "source/encoders/ffmpeg/amf.cpp" - ) - list(APPEND PROJECT_DEFINITIONS - ENABLE_ENCODER_FFMPEG_AMF - ) - endif() - - # NVENC - is_feature_enabled(ENCODER_FFMPEG_NVENC T_CHECK) - if(T_CHECK) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/encoders/ffmpeg/nvenc.hpp" - "source/encoders/ffmpeg/nvenc.cpp" - ) - list(APPEND PROJECT_DEFINITIONS - ENABLE_ENCODER_FFMPEG_NVENC - ) - endif() - - # ProRES - is_feature_enabled(ENCODER_FFMPEG_PRORES T_CHECK) - if(T_CHECK) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/encoders/ffmpeg/prores_aw.hpp" - "source/encoders/ffmpeg/prores_aw.cpp" - ) - list(APPEND PROJECT_DEFINITIONS - ENABLE_ENCODER_FFMPEG_PRORES - ) - endif() - - # DNxHR - is_feature_enabled(ENCODER_FFMPEG_DNXHR T_CHECK) - if(T_CHECK) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/encoders/ffmpeg/dnxhd.hpp" - "source/encoders/ffmpeg/dnxhd.cpp" - ) - list(APPEND PROJECT_DEFINITIONS - ENABLE_ENCODER_FFMPEG_DNXHR - ) - endif() - - # CineForm HD - is_feature_enabled(ENCODER_FFMPEG_CFHD T_CHECK) - if(T_CHECK) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/encoders/ffmpeg/cfhd.hpp" - "source/encoders/ffmpeg/cfhd.cpp" - ) - list(APPEND PROJECT_DEFINITIONS - ENABLE_ENCODER_FFMPEG_CFHD - ) - endif() -endif() - # Filter/Auto-Framing is_feature_enabled(FILTER_AUTOFRAMING T_CHECK) if(T_CHECK) @@ -1905,6 +1717,7 @@ function(streamfx_add_component COMPONENT_NAME) # Allow disabling this component. set(${COMPONENT_OPTION} ON CACHE BOOL "Enable the ${COMPONENT_NAME} component?") + set(${COMPONENT_OPTION}_DISABLED OFF CACHE INTERNAL "Disable the ${_NAME} component?" FORCE) # Add common include directories target_include_directories(${COMPONENT_TARGET} @@ -1995,6 +1808,22 @@ function(streamfx_add_component_dependency _NAME) set_target_properties(${COMPONENT_TARGET} PROPERTIES COMPONENT_DEPENDS "${DEPENDS}") endfunction() +function(streamfx_disable_component _NAME _REASON) + # If the component doesn't exist, skip it. + if(NOT TARGET ${_NAME}) + message(WARNING "Not disabling invalid component '${COMPONENT}'.") + return() + endif() + + get_target_property(_NAME ${COMPONENT} COMPONENT_LABEL) + get_target_property(_OPTION ${COMPONENT} COMPONENT_OPTION) + + CacheSet(${_OPTION}_DISABLED ON) + if(_REASON) + message(STATUS "[${_NAME}] Disabled due to: ${_REASON}") + endif() +endfunction() + ################################################################################ # Register Library ################################################################################ diff --git a/components/ffmpeg/CMakeLists.txt b/components/ffmpeg/CMakeLists.txt new file mode 100644 index 0000000000..668b3182ec --- /dev/null +++ b/components/ffmpeg/CMakeLists.txt @@ -0,0 +1,26 @@ +## AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER END +cmake_minimum_required(VERSION 3.26) +project("FFmpeg") +list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") + +streamfx_add_component(${PROJECT_NAME}) + +find_package("FFmpeg" + COMPONENTS "avutil" "avcodec" "swscale" +) +if(NOT FFmpeg_FOUND) + streamfx_disable_component(${COMPONENT_TARGET} "FFmpeg is not available.") + return() +else() + target_link_libraries(${COMPONENT_TARGET} + PUBLIC + ${FFMPEG_LIBRARIES} + ) + + target_include_directories(${COMPONENT_TARGET} + PUBLIC + ${FFMPEG_INCLUDE_DIRS} + ) +endif() diff --git a/source/encoders/codecs/av1.cpp b/components/ffmpeg/source/encoders/codecs/av1.cpp similarity index 100% rename from source/encoders/codecs/av1.cpp rename to components/ffmpeg/source/encoders/codecs/av1.cpp diff --git a/source/encoders/codecs/av1.hpp b/components/ffmpeg/source/encoders/codecs/av1.hpp similarity index 100% rename from source/encoders/codecs/av1.hpp rename to components/ffmpeg/source/encoders/codecs/av1.hpp diff --git a/source/encoders/codecs/dnxhr.cpp b/components/ffmpeg/source/encoders/codecs/dnxhr.cpp similarity index 100% rename from source/encoders/codecs/dnxhr.cpp rename to components/ffmpeg/source/encoders/codecs/dnxhr.cpp diff --git a/source/encoders/codecs/dnxhr.hpp b/components/ffmpeg/source/encoders/codecs/dnxhr.hpp similarity index 100% rename from source/encoders/codecs/dnxhr.hpp rename to components/ffmpeg/source/encoders/codecs/dnxhr.hpp diff --git a/source/encoders/codecs/h264.cpp b/components/ffmpeg/source/encoders/codecs/h264.cpp similarity index 100% rename from source/encoders/codecs/h264.cpp rename to components/ffmpeg/source/encoders/codecs/h264.cpp diff --git a/source/encoders/codecs/h264.hpp b/components/ffmpeg/source/encoders/codecs/h264.hpp similarity index 100% rename from source/encoders/codecs/h264.hpp rename to components/ffmpeg/source/encoders/codecs/h264.hpp diff --git a/source/encoders/codecs/hevc.cpp b/components/ffmpeg/source/encoders/codecs/hevc.cpp similarity index 100% rename from source/encoders/codecs/hevc.cpp rename to components/ffmpeg/source/encoders/codecs/hevc.cpp diff --git a/source/encoders/codecs/hevc.hpp b/components/ffmpeg/source/encoders/codecs/hevc.hpp similarity index 100% rename from source/encoders/codecs/hevc.hpp rename to components/ffmpeg/source/encoders/codecs/hevc.hpp diff --git a/source/encoders/codecs/prores.cpp b/components/ffmpeg/source/encoders/codecs/prores.cpp similarity index 100% rename from source/encoders/codecs/prores.cpp rename to components/ffmpeg/source/encoders/codecs/prores.cpp diff --git a/source/encoders/codecs/prores.hpp b/components/ffmpeg/source/encoders/codecs/prores.hpp similarity index 100% rename from source/encoders/codecs/prores.hpp rename to components/ffmpeg/source/encoders/codecs/prores.hpp diff --git a/source/encoders/encoder-ffmpeg.cpp b/components/ffmpeg/source/encoders/encoder-ffmpeg.cpp similarity index 100% rename from source/encoders/encoder-ffmpeg.cpp rename to components/ffmpeg/source/encoders/encoder-ffmpeg.cpp diff --git a/source/encoders/encoder-ffmpeg.hpp b/components/ffmpeg/source/encoders/encoder-ffmpeg.hpp similarity index 100% rename from source/encoders/encoder-ffmpeg.hpp rename to components/ffmpeg/source/encoders/encoder-ffmpeg.hpp diff --git a/source/encoders/ffmpeg/amf.cpp b/components/ffmpeg/source/encoders/ffmpeg/amf.cpp similarity index 100% rename from source/encoders/ffmpeg/amf.cpp rename to components/ffmpeg/source/encoders/ffmpeg/amf.cpp diff --git a/source/encoders/ffmpeg/amf.hpp b/components/ffmpeg/source/encoders/ffmpeg/amf.hpp similarity index 100% rename from source/encoders/ffmpeg/amf.hpp rename to components/ffmpeg/source/encoders/ffmpeg/amf.hpp diff --git a/source/encoders/ffmpeg/cfhd.cpp b/components/ffmpeg/source/encoders/ffmpeg/cfhd.cpp similarity index 100% rename from source/encoders/ffmpeg/cfhd.cpp rename to components/ffmpeg/source/encoders/ffmpeg/cfhd.cpp diff --git a/source/encoders/ffmpeg/cfhd.hpp b/components/ffmpeg/source/encoders/ffmpeg/cfhd.hpp similarity index 100% rename from source/encoders/ffmpeg/cfhd.hpp rename to components/ffmpeg/source/encoders/ffmpeg/cfhd.hpp diff --git a/source/encoders/ffmpeg/debug.cpp b/components/ffmpeg/source/encoders/ffmpeg/debug.cpp similarity index 100% rename from source/encoders/ffmpeg/debug.cpp rename to components/ffmpeg/source/encoders/ffmpeg/debug.cpp diff --git a/source/encoders/ffmpeg/debug.hpp b/components/ffmpeg/source/encoders/ffmpeg/debug.hpp similarity index 100% rename from source/encoders/ffmpeg/debug.hpp rename to components/ffmpeg/source/encoders/ffmpeg/debug.hpp diff --git a/source/encoders/ffmpeg/dnxhd.cpp b/components/ffmpeg/source/encoders/ffmpeg/dnxhd.cpp similarity index 100% rename from source/encoders/ffmpeg/dnxhd.cpp rename to components/ffmpeg/source/encoders/ffmpeg/dnxhd.cpp diff --git a/source/encoders/ffmpeg/dnxhd.hpp b/components/ffmpeg/source/encoders/ffmpeg/dnxhd.hpp similarity index 100% rename from source/encoders/ffmpeg/dnxhd.hpp rename to components/ffmpeg/source/encoders/ffmpeg/dnxhd.hpp diff --git a/source/encoders/ffmpeg/handler.cpp b/components/ffmpeg/source/encoders/ffmpeg/handler.cpp similarity index 100% rename from source/encoders/ffmpeg/handler.cpp rename to components/ffmpeg/source/encoders/ffmpeg/handler.cpp diff --git a/source/encoders/ffmpeg/handler.hpp b/components/ffmpeg/source/encoders/ffmpeg/handler.hpp similarity index 98% rename from source/encoders/ffmpeg/handler.hpp rename to components/ffmpeg/source/encoders/ffmpeg/handler.hpp index 02ecb92b97..69c49f0e26 100644 --- a/source/encoders/ffmpeg/handler.hpp +++ b/components/ffmpeg/source/encoders/ffmpeg/handler.hpp @@ -19,6 +19,7 @@ namespace streamfx::encoder::ffmpeg { struct handler { handler(std::string codec); + virtual ~handler(){}; virtual bool has_keyframes(ffmpeg_factory* factory); virtual bool has_threading(ffmpeg_factory* factory); diff --git a/source/encoders/ffmpeg/nvenc.cpp b/components/ffmpeg/source/encoders/ffmpeg/nvenc.cpp similarity index 98% rename from source/encoders/ffmpeg/nvenc.cpp rename to components/ffmpeg/source/encoders/ffmpeg/nvenc.cpp index a68361d54f..2b96b39deb 100644 --- a/source/encoders/ffmpeg/nvenc.cpp +++ b/components/ffmpeg/source/encoders/ffmpeg/nvenc.cpp @@ -88,7 +88,7 @@ extern "C" { #define ST_KEY_H265_PROFILE "H265.Profile" #define ST_KEY_H265_TIER "H265.Tier" -#define ST_KEY_H264_LEVEL "H265.Level" +#define ST_KEY_H265_LEVEL "H265.Level" using namespace streamfx::encoder::ffmpeg; using namespace streamfx::encoder::codec; @@ -1045,7 +1045,7 @@ void nvenc_hevc::defaults(ffmpeg_factory* factory, obs_data_t* settings) obs_data_set_default_string(settings, ST_KEY_H265_PROFILE, ""); obs_data_set_default_string(settings, ST_KEY_H265_TIER, ""); - obs_data_set_default_string(settings, ST_KEY_H264_LEVEL, "auto"); + obs_data_set_default_string(settings, ST_KEY_H265_LEVEL, "auto"); } void nvenc_hevc::properties(ffmpeg_factory* factory, ffmpeg_instance* instance, obs_properties_t* props) @@ -1061,6 +1061,17 @@ void nvenc_hevc::migrate(ffmpeg_factory* factory, ffmpeg_instance* instance, obs { nvenc::migrate(factory, instance, settings, version); + // Migrate: + // - all versions below 0.12. + // - all versions that are larger than 0.12, but smaller than 0.12.0.315. + // - no other version. + if ((version < STREAMFX_MAKE_VERSION(0, 12, 0, 0)) + || ((version > STREAMFX_MAKE_VERSION(0, 12, 0, 0)) && (version < STREAMFX_MAKE_VERSION(0, 12, 0, 315)))) { + // Accidentally had this stored int he wrong place. Oops. + obs_data_set_string(settings, ST_KEY_H265_LEVEL, obs_data_get_string(settings, ST_KEY_H264_LEVEL)); + obs_data_unset_user_value(settings, ST_KEY_H264_LEVEL); + } + if (version < STREAMFX_MAKE_VERSION(0, 11, 1, 0)) { // Profile if (auto v = obs_data_get_int(settings, ST_KEY_H265_PROFILE); v != -1) { @@ -1092,7 +1103,7 @@ void nvenc_hevc::migrate(ffmpeg_factory* factory, ffmpeg_instance* instance, obs } // Level - obs_data_set_string(settings, ST_KEY_H264_LEVEL, "auto"); + obs_data_set_string(settings, ST_KEY_H265_LEVEL, "auto"); } } @@ -1110,7 +1121,7 @@ void nvenc_hevc::update(ffmpeg_factory* factory, ffmpeg_instance* instance, obs_ if (const char* v = obs_data_get_string(settings, ST_KEY_H265_TIER); v && (v[0] != '\0')) { av_opt_set(context->priv_data, "tier", v, AV_OPT_SEARCH_CHILDREN); } - if (const char* v = obs_data_get_string(settings, ST_KEY_H264_LEVEL); v && (v[0] != '\0')) { + if (const char* v = obs_data_get_string(settings, ST_KEY_H265_LEVEL); v && (v[0] != '\0')) { av_opt_set(context->priv_data, "level", v, AV_OPT_SEARCH_CHILDREN); } } @@ -1172,7 +1183,7 @@ void nvenc_hevc::properties_encoder(ffmpeg_factory* factory, ffmpeg_instance* in }); } { - auto p = obs_properties_add_list(grp, ST_KEY_H264_LEVEL, D_TRANSLATE(S_CODEC_HEVC_LEVEL), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING); + auto p = obs_properties_add_list(grp, ST_KEY_H265_LEVEL, D_TRANSLATE(S_CODEC_HEVC_LEVEL), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING); streamfx::ffmpeg::tools::avoption_list_add_entries(context->priv_data, "level", [&p](const AVOption* opt) { if (opt->default_val.i64 == 0) { diff --git a/source/encoders/ffmpeg/nvenc.hpp b/components/ffmpeg/source/encoders/ffmpeg/nvenc.hpp similarity index 100% rename from source/encoders/ffmpeg/nvenc.hpp rename to components/ffmpeg/source/encoders/ffmpeg/nvenc.hpp diff --git a/source/encoders/ffmpeg/prores_aw.cpp b/components/ffmpeg/source/encoders/ffmpeg/prores_aw.cpp similarity index 100% rename from source/encoders/ffmpeg/prores_aw.cpp rename to components/ffmpeg/source/encoders/ffmpeg/prores_aw.cpp diff --git a/source/encoders/ffmpeg/prores_aw.hpp b/components/ffmpeg/source/encoders/ffmpeg/prores_aw.hpp similarity index 100% rename from source/encoders/ffmpeg/prores_aw.hpp rename to components/ffmpeg/source/encoders/ffmpeg/prores_aw.hpp diff --git a/source/ffmpeg/avframe-queue.cpp b/components/ffmpeg/source/ffmpeg/avframe-queue.cpp similarity index 100% rename from source/ffmpeg/avframe-queue.cpp rename to components/ffmpeg/source/ffmpeg/avframe-queue.cpp diff --git a/source/ffmpeg/avframe-queue.hpp b/components/ffmpeg/source/ffmpeg/avframe-queue.hpp similarity index 100% rename from source/ffmpeg/avframe-queue.hpp rename to components/ffmpeg/source/ffmpeg/avframe-queue.hpp diff --git a/source/ffmpeg/hwapi/base.cpp b/components/ffmpeg/source/ffmpeg/hwapi/base.cpp similarity index 100% rename from source/ffmpeg/hwapi/base.cpp rename to components/ffmpeg/source/ffmpeg/hwapi/base.cpp diff --git a/source/ffmpeg/hwapi/base.hpp b/components/ffmpeg/source/ffmpeg/hwapi/base.hpp similarity index 100% rename from source/ffmpeg/hwapi/base.hpp rename to components/ffmpeg/source/ffmpeg/hwapi/base.hpp diff --git a/source/ffmpeg/hwapi/d3d11.cpp b/components/ffmpeg/source/ffmpeg/hwapi/d3d11.cpp similarity index 100% rename from source/ffmpeg/hwapi/d3d11.cpp rename to components/ffmpeg/source/ffmpeg/hwapi/d3d11.cpp diff --git a/source/ffmpeg/hwapi/d3d11.hpp b/components/ffmpeg/source/ffmpeg/hwapi/d3d11.hpp similarity index 100% rename from source/ffmpeg/hwapi/d3d11.hpp rename to components/ffmpeg/source/ffmpeg/hwapi/d3d11.hpp diff --git a/source/ffmpeg/swscale.cpp b/components/ffmpeg/source/ffmpeg/swscale.cpp similarity index 100% rename from source/ffmpeg/swscale.cpp rename to components/ffmpeg/source/ffmpeg/swscale.cpp diff --git a/source/ffmpeg/swscale.hpp b/components/ffmpeg/source/ffmpeg/swscale.hpp similarity index 100% rename from source/ffmpeg/swscale.hpp rename to components/ffmpeg/source/ffmpeg/swscale.hpp diff --git a/source/ffmpeg/tools.cpp b/components/ffmpeg/source/ffmpeg/tools.cpp similarity index 100% rename from source/ffmpeg/tools.cpp rename to components/ffmpeg/source/ffmpeg/tools.cpp diff --git a/source/ffmpeg/tools.hpp b/components/ffmpeg/source/ffmpeg/tools.hpp similarity index 100% rename from source/ffmpeg/tools.hpp rename to components/ffmpeg/source/ffmpeg/tools.hpp From ecaf39bee1d7543592fb4e7ae8c99903a8061318 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Thu, 7 Sep 2023 03:29:11 +0200 Subject: [PATCH 21/66] shader: Move into its own component --- CMakeLists.txt | 80 ------------------- components/shader/CMakeLists.txt | 8 ++ .../shader/source}/filters/filter-shader.cpp | 0 .../shader/source}/filters/filter-shader.hpp | 0 .../gfx/shader/gfx-shader-param-audio.cpp | 0 .../gfx/shader/gfx-shader-param-audio.hpp | 0 .../gfx/shader/gfx-shader-param-basic.cpp | 0 .../gfx/shader/gfx-shader-param-basic.hpp | 0 .../gfx/shader/gfx-shader-param-matrix.cpp | 0 .../gfx/shader/gfx-shader-param-matrix.hpp | 0 .../gfx/shader/gfx-shader-param-texture.cpp | 0 .../gfx/shader/gfx-shader-param-texture.hpp | 0 .../source}/gfx/shader/gfx-shader-param.cpp | 0 .../source}/gfx/shader/gfx-shader-param.hpp | 0 .../shader/source}/gfx/shader/gfx-shader.cpp | 0 .../shader/source}/gfx/shader/gfx-shader.hpp | 0 .../shader/source}/sources/source-shader.cpp | 0 .../shader/source}/sources/source-shader.hpp | 0 .../source}/transitions/transition-shader.cpp | 0 .../source}/transitions/transition-shader.hpp | 0 20 files changed, 8 insertions(+), 80 deletions(-) create mode 100644 components/shader/CMakeLists.txt rename {source => components/shader/source}/filters/filter-shader.cpp (100%) rename {source => components/shader/source}/filters/filter-shader.hpp (100%) rename {source => components/shader/source}/gfx/shader/gfx-shader-param-audio.cpp (100%) rename {source => components/shader/source}/gfx/shader/gfx-shader-param-audio.hpp (100%) rename {source => components/shader/source}/gfx/shader/gfx-shader-param-basic.cpp (100%) rename {source => components/shader/source}/gfx/shader/gfx-shader-param-basic.hpp (100%) rename {source => components/shader/source}/gfx/shader/gfx-shader-param-matrix.cpp (100%) rename {source => components/shader/source}/gfx/shader/gfx-shader-param-matrix.hpp (100%) rename {source => components/shader/source}/gfx/shader/gfx-shader-param-texture.cpp (100%) rename {source => components/shader/source}/gfx/shader/gfx-shader-param-texture.hpp (100%) rename {source => components/shader/source}/gfx/shader/gfx-shader-param.cpp (100%) rename {source => components/shader/source}/gfx/shader/gfx-shader-param.hpp (100%) rename {source => components/shader/source}/gfx/shader/gfx-shader.cpp (100%) rename {source => components/shader/source}/gfx/shader/gfx-shader.hpp (100%) rename {source => components/shader/source}/sources/source-shader.cpp (100%) rename {source => components/shader/source}/sources/source-shader.hpp (100%) rename {source => components/shader/source}/transitions/transition-shader.cpp (100%) rename {source => components/shader/source}/transitions/transition-shader.hpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 39105a8737..6e11b9eae6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -296,7 +296,6 @@ set(${PREFIX}ENABLE_FILTER_DENOISING ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable set(${PREFIX}ENABLE_FILTER_DENOISING_NVIDIA ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable NVIDIA provider(s) for Denoising Filter") set(${PREFIX}ENABLE_FILTER_DYNAMIC_MASK ${FEATURE_STABLE} CACHE BOOL "Enable Dynamic Mask Filter") set(${PREFIX}ENABLE_FILTER_SDF_EFFECTS ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable SDF Effects Filter") -set(${PREFIX}ENABLE_FILTER_SHADER ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Shader Filter") set(${PREFIX}ENABLE_FILTER_TRANSFORM ${FEATURE_STABLE} CACHE BOOL "Enable Transform Filter") set(${PREFIX}ENABLE_FILTER_UPSCALING ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Upscaling Filter") set(${PREFIX}ENABLE_FILTER_UPSCALING_NVIDIA ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable NVIDIA provider(s) for Upscaling Filter") @@ -305,10 +304,6 @@ set(${PREFIX}ENABLE_FILTER_VIRTUAL_GREENSCREEN_NVIDIA ${FEATURE_EXPERIMENTAL} CA ## Sources set(${PREFIX}ENABLE_SOURCE_MIRROR ${FEATURE_DEPRECATED} CACHE BOOL "Enable Mirror Source") -set(${PREFIX}ENABLE_SOURCE_SHADER ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Shader Source") - -## Transitions -set(${PREFIX}ENABLE_TRANSITION_SHADER ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Shader Transition") ## FrontEnd & UI set(${PREFIX}ENABLE_FRONTEND ON CACHE BOOL "Enable Frontend code.") @@ -498,10 +493,6 @@ function(feature_filter_sdf_effects RESOLVE) is_feature_enabled(FILTER_SDF_EFFECTS T_CHECK) endfunction() -function(feature_filter_shader RESOLVE) - is_feature_enabled(FILTER_SHADER T_CHECK) -endfunction() - function(feature_filter_transform RESOLVE) is_feature_enabled(FILTER_TRANSFORM T_CHECK) endfunction() @@ -550,14 +541,6 @@ function(feature_source_mirror RESOLVE) is_feature_enabled(SOURCE_MIRROR T_CHECK) endfunction() -function(feature_source_shader RESOLVE) - is_feature_enabled(SOURCE_SHADER T_CHECK) -endfunction() - -function(feature_transition_shader RESOLVE) - is_feature_enabled(TRANSITION_SHADER T_CHECK) -endfunction() - function(feature_frontend RESOLVE) is_feature_enabled(FRONTEND T_CHECK) if(RESOLVE AND T_CHECK) @@ -601,13 +584,10 @@ feature_filter_color_grade(OFF) feature_filter_denoising(OFF) feature_filter_dynamic_mask(OFF) feature_filter_sdf_effects(OFF) -feature_filter_shader(OFF) feature_filter_transform(OFF) feature_filter_upscaling(OFF) feature_filter_virtual_greenscreen(OFF) feature_source_mirror(OFF) -feature_source_shader(OFF) -feature_transition_shader(OFF) feature_frontend(OFF) feature_updater(OFF) @@ -738,13 +718,10 @@ feature_filter_color_grade(ON) feature_filter_denoising(ON) feature_filter_dynamic_mask(ON) feature_filter_sdf_effects(ON) -feature_filter_shader(ON) feature_filter_transform(ON) feature_filter_upscaling(ON) feature_filter_virtual_greenscreen(ON) feature_source_mirror(ON) -feature_source_shader(ON) -feature_transition_shader(ON) feature_frontend(ON) feature_updater(ON) @@ -1113,19 +1090,6 @@ if(T_CHECK) ) endif() -# Filter/Shader -is_feature_enabled(FILTER_SHADER T_CHECK) -if(T_CHECK) - set(REQUIRE_PART_SHADER ON) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/filters/filter-shader.hpp" - "source/filters/filter-shader.cpp" - ) - list(APPEND PROJECT_DEFINITIONS - ENABLE_FILTER_SHADER - ) -endif() - # Filter/Transform is_feature_enabled(FILTER_TRANSFORM T_CHECK) if(T_CHECK) @@ -1204,32 +1168,6 @@ if(T_CHECK) ) endif() -# Source/Shader -is_feature_enabled(SOURCE_SHADER T_CHECK) -if(T_CHECK) - set(REQUIRE_PART_SHADER ON) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/sources/source-shader.hpp" - "source/sources/source-shader.cpp" - ) - list(APPEND PROJECT_DEFINITIONS - ENABLE_SOURCE_SHADER - ) -endif() - -# Transition/Shader -is_feature_enabled(TRANSITION_SHADER T_CHECK) -if(T_CHECK) - set(REQUIRE_PART_SHADER ON) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/transitions/transition-shader.hpp" - "source/transitions/transition-shader.cpp" - ) - list(APPEND PROJECT_DEFINITIONS - ENABLE_TRANSITION_SHADER - ) -endif() - # Profiling is_feature_enabled(PROFILING T_CHECK) if(T_CHECK) @@ -1296,24 +1234,6 @@ endif() # Parts ################################################################################ -# Shaders -if(REQUIRE_PART_SHADER) - 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() - # LUT if(REQUIRE_LUT) list(APPEND PROJECT_PRIVATE_SOURCE diff --git a/components/shader/CMakeLists.txt b/components/shader/CMakeLists.txt new file mode 100644 index 0000000000..37da762bf2 --- /dev/null +++ b/components/shader/CMakeLists.txt @@ -0,0 +1,8 @@ +## AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER END +cmake_minimum_required(VERSION 3.26) +project("Shader") +list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") + +streamfx_add_component(${PROJECT_NAME}) diff --git a/source/filters/filter-shader.cpp b/components/shader/source/filters/filter-shader.cpp similarity index 100% rename from source/filters/filter-shader.cpp rename to components/shader/source/filters/filter-shader.cpp diff --git a/source/filters/filter-shader.hpp b/components/shader/source/filters/filter-shader.hpp similarity index 100% rename from source/filters/filter-shader.hpp rename to components/shader/source/filters/filter-shader.hpp diff --git a/source/gfx/shader/gfx-shader-param-audio.cpp b/components/shader/source/gfx/shader/gfx-shader-param-audio.cpp similarity index 100% rename from source/gfx/shader/gfx-shader-param-audio.cpp rename to components/shader/source/gfx/shader/gfx-shader-param-audio.cpp diff --git a/source/gfx/shader/gfx-shader-param-audio.hpp b/components/shader/source/gfx/shader/gfx-shader-param-audio.hpp similarity index 100% rename from source/gfx/shader/gfx-shader-param-audio.hpp rename to components/shader/source/gfx/shader/gfx-shader-param-audio.hpp diff --git a/source/gfx/shader/gfx-shader-param-basic.cpp b/components/shader/source/gfx/shader/gfx-shader-param-basic.cpp similarity index 100% rename from source/gfx/shader/gfx-shader-param-basic.cpp rename to components/shader/source/gfx/shader/gfx-shader-param-basic.cpp diff --git a/source/gfx/shader/gfx-shader-param-basic.hpp b/components/shader/source/gfx/shader/gfx-shader-param-basic.hpp similarity index 100% rename from source/gfx/shader/gfx-shader-param-basic.hpp rename to components/shader/source/gfx/shader/gfx-shader-param-basic.hpp diff --git a/source/gfx/shader/gfx-shader-param-matrix.cpp b/components/shader/source/gfx/shader/gfx-shader-param-matrix.cpp similarity index 100% rename from source/gfx/shader/gfx-shader-param-matrix.cpp rename to components/shader/source/gfx/shader/gfx-shader-param-matrix.cpp diff --git a/source/gfx/shader/gfx-shader-param-matrix.hpp b/components/shader/source/gfx/shader/gfx-shader-param-matrix.hpp similarity index 100% rename from source/gfx/shader/gfx-shader-param-matrix.hpp rename to components/shader/source/gfx/shader/gfx-shader-param-matrix.hpp diff --git a/source/gfx/shader/gfx-shader-param-texture.cpp b/components/shader/source/gfx/shader/gfx-shader-param-texture.cpp similarity index 100% rename from source/gfx/shader/gfx-shader-param-texture.cpp rename to components/shader/source/gfx/shader/gfx-shader-param-texture.cpp diff --git a/source/gfx/shader/gfx-shader-param-texture.hpp b/components/shader/source/gfx/shader/gfx-shader-param-texture.hpp similarity index 100% rename from source/gfx/shader/gfx-shader-param-texture.hpp rename to components/shader/source/gfx/shader/gfx-shader-param-texture.hpp diff --git a/source/gfx/shader/gfx-shader-param.cpp b/components/shader/source/gfx/shader/gfx-shader-param.cpp similarity index 100% rename from source/gfx/shader/gfx-shader-param.cpp rename to components/shader/source/gfx/shader/gfx-shader-param.cpp diff --git a/source/gfx/shader/gfx-shader-param.hpp b/components/shader/source/gfx/shader/gfx-shader-param.hpp similarity index 100% rename from source/gfx/shader/gfx-shader-param.hpp rename to components/shader/source/gfx/shader/gfx-shader-param.hpp diff --git a/source/gfx/shader/gfx-shader.cpp b/components/shader/source/gfx/shader/gfx-shader.cpp similarity index 100% rename from source/gfx/shader/gfx-shader.cpp rename to components/shader/source/gfx/shader/gfx-shader.cpp diff --git a/source/gfx/shader/gfx-shader.hpp b/components/shader/source/gfx/shader/gfx-shader.hpp similarity index 100% rename from source/gfx/shader/gfx-shader.hpp rename to components/shader/source/gfx/shader/gfx-shader.hpp diff --git a/source/sources/source-shader.cpp b/components/shader/source/sources/source-shader.cpp similarity index 100% rename from source/sources/source-shader.cpp rename to components/shader/source/sources/source-shader.cpp diff --git a/source/sources/source-shader.hpp b/components/shader/source/sources/source-shader.hpp similarity index 100% rename from source/sources/source-shader.hpp rename to components/shader/source/sources/source-shader.hpp diff --git a/source/transitions/transition-shader.cpp b/components/shader/source/transitions/transition-shader.cpp similarity index 100% rename from source/transitions/transition-shader.cpp rename to components/shader/source/transitions/transition-shader.cpp diff --git a/source/transitions/transition-shader.hpp b/components/shader/source/transitions/transition-shader.hpp similarity index 100% rename from source/transitions/transition-shader.hpp rename to components/shader/source/transitions/transition-shader.hpp From 792bf163b477a7fac0ba41595d57106dfed2f018 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 00:55:48 +0200 Subject: [PATCH 22/66] dynamic-mask: Move into its own component --- CMakeLists.txt | 22 ------------------- components/dynamic-mask/CMakeLists.txt | 8 +++++++ .../source}/filters/filter-dynamic-mask.cpp | 0 .../source}/filters/filter-dynamic-mask.hpp | 0 4 files changed, 8 insertions(+), 22 deletions(-) create mode 100644 components/dynamic-mask/CMakeLists.txt rename {source => components/dynamic-mask/source}/filters/filter-dynamic-mask.cpp (100%) rename {source => components/dynamic-mask/source}/filters/filter-dynamic-mask.hpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e11b9eae6..fe7186b433 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -294,7 +294,6 @@ set(${PREFIX}ENABLE_FILTER_BLUR ${FEATURE_UNSTABLE} CACHE BOOL "Enable Blur Filt set(${PREFIX}ENABLE_FILTER_COLOR_GRADE ${FEATURE_STABLE} CACHE BOOL "Enable Color Grade Filter") set(${PREFIX}ENABLE_FILTER_DENOISING ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Denoising filter") set(${PREFIX}ENABLE_FILTER_DENOISING_NVIDIA ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable NVIDIA provider(s) for Denoising Filter") -set(${PREFIX}ENABLE_FILTER_DYNAMIC_MASK ${FEATURE_STABLE} CACHE BOOL "Enable Dynamic Mask Filter") set(${PREFIX}ENABLE_FILTER_SDF_EFFECTS ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable SDF Effects Filter") set(${PREFIX}ENABLE_FILTER_TRANSFORM ${FEATURE_STABLE} CACHE BOOL "Enable Transform Filter") set(${PREFIX}ENABLE_FILTER_UPSCALING ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Upscaling Filter") @@ -485,10 +484,6 @@ function(feature_filter_denoising RESOLVE) endif() endfunction() -function(feature_filter_dynamic_mask RESOLVE) - is_feature_enabled(FILTER_DYNAMIC_MASK T_CHECK) -endfunction() - function(feature_filter_sdf_effects RESOLVE) is_feature_enabled(FILTER_SDF_EFFECTS T_CHECK) endfunction() @@ -582,7 +577,6 @@ feature_filter_autoframing(OFF) feature_filter_blur(OFF) feature_filter_color_grade(OFF) feature_filter_denoising(OFF) -feature_filter_dynamic_mask(OFF) feature_filter_sdf_effects(OFF) feature_filter_transform(OFF) feature_filter_upscaling(OFF) @@ -716,7 +710,6 @@ feature_filter_autoframing(ON) feature_filter_blur(ON) feature_filter_color_grade(ON) feature_filter_denoising(ON) -feature_filter_dynamic_mask(ON) feature_filter_sdf_effects(ON) feature_filter_transform(ON) feature_filter_upscaling(ON) @@ -1059,21 +1052,6 @@ if(T_CHECK) set(REQUIRE_LUT ON) endif() -# Filter/Dynamic Mask -is_feature_enabled(FILTER_DYNAMIC_MASK T_CHECK) -if(T_CHECK) - list(APPEND PROJECT_DATA - "data/effects/channel-mask.effect" - ) - 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() - # Filter/SDF Effects is_feature_enabled(FILTER_SDF_EFFECTS T_CHECK) if(T_CHECK) diff --git a/components/dynamic-mask/CMakeLists.txt b/components/dynamic-mask/CMakeLists.txt new file mode 100644 index 0000000000..9d4568f155 --- /dev/null +++ b/components/dynamic-mask/CMakeLists.txt @@ -0,0 +1,8 @@ +## AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER END +cmake_minimum_required(VERSION 3.26) +project("DynamicMask") +list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") + +streamfx_add_component("Dynamic Mask") diff --git a/source/filters/filter-dynamic-mask.cpp b/components/dynamic-mask/source/filters/filter-dynamic-mask.cpp similarity index 100% rename from source/filters/filter-dynamic-mask.cpp rename to components/dynamic-mask/source/filters/filter-dynamic-mask.cpp diff --git a/source/filters/filter-dynamic-mask.hpp b/components/dynamic-mask/source/filters/filter-dynamic-mask.hpp similarity index 100% rename from source/filters/filter-dynamic-mask.hpp rename to components/dynamic-mask/source/filters/filter-dynamic-mask.hpp From 02f8ca8d8309b8a2fbed163de59a205056ec0227 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 00:59:01 +0200 Subject: [PATCH 23/66] transform: Move into its own component --- CMakeLists.txt | 19 ------------------- components/transform/CMakeLists.txt | 8 ++++++++ .../source/filter}/filter-transform.cpp | 0 .../source/filter}/filter-transform.hpp | 0 4 files changed, 8 insertions(+), 19 deletions(-) create mode 100644 components/transform/CMakeLists.txt rename {source/filters => components/transform/source/filter}/filter-transform.cpp (100%) rename {source/filters => components/transform/source/filter}/filter-transform.hpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index fe7186b433..3b1aca1c9d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -295,7 +295,6 @@ set(${PREFIX}ENABLE_FILTER_COLOR_GRADE ${FEATURE_STABLE} CACHE BOOL "Enable Colo set(${PREFIX}ENABLE_FILTER_DENOISING ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Denoising filter") set(${PREFIX}ENABLE_FILTER_DENOISING_NVIDIA ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable NVIDIA provider(s) for Denoising Filter") set(${PREFIX}ENABLE_FILTER_SDF_EFFECTS ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable SDF Effects Filter") -set(${PREFIX}ENABLE_FILTER_TRANSFORM ${FEATURE_STABLE} CACHE BOOL "Enable Transform Filter") set(${PREFIX}ENABLE_FILTER_UPSCALING ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Upscaling Filter") set(${PREFIX}ENABLE_FILTER_UPSCALING_NVIDIA ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable NVIDIA provider(s) for Upscaling Filter") set(${PREFIX}ENABLE_FILTER_VIRTUAL_GREENSCREEN ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Virtual Greenscreen Filter") @@ -488,10 +487,6 @@ function(feature_filter_sdf_effects RESOLVE) is_feature_enabled(FILTER_SDF_EFFECTS T_CHECK) endfunction() -function(feature_filter_transform RESOLVE) - is_feature_enabled(FILTER_TRANSFORM T_CHECK) -endfunction() - function(feature_filter_upscaling RESOLVE) is_feature_enabled(FILTER_UPSCALING T_CHECK) if(RESOLVE AND T_CHECK) @@ -578,7 +573,6 @@ feature_filter_blur(OFF) feature_filter_color_grade(OFF) feature_filter_denoising(OFF) feature_filter_sdf_effects(OFF) -feature_filter_transform(OFF) feature_filter_upscaling(OFF) feature_filter_virtual_greenscreen(OFF) feature_source_mirror(OFF) @@ -711,7 +705,6 @@ feature_filter_blur(ON) feature_filter_color_grade(ON) feature_filter_denoising(ON) feature_filter_sdf_effects(ON) -feature_filter_transform(ON) feature_filter_upscaling(ON) feature_filter_virtual_greenscreen(ON) feature_source_mirror(ON) @@ -1068,18 +1061,6 @@ if(T_CHECK) ) endif() -# Filter/Transform -is_feature_enabled(FILTER_TRANSFORM T_CHECK) -if(T_CHECK) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/filters/filter-transform.hpp" - "source/filters/filter-transform.cpp" - ) - list(APPEND PROJECT_DEFINITIONS - ENABLE_FILTER_TRANSFORM - ) -endif() - # Filter/Denoising is_feature_enabled(FILTER_DENOISING T_CHECK) if(T_CHECK) diff --git a/components/transform/CMakeLists.txt b/components/transform/CMakeLists.txt new file mode 100644 index 0000000000..e8ecae8243 --- /dev/null +++ b/components/transform/CMakeLists.txt @@ -0,0 +1,8 @@ +## AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER END +cmake_minimum_required(VERSION 3.26) +project("Transform") +list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") + +streamfx_add_component("Transform") diff --git a/source/filters/filter-transform.cpp b/components/transform/source/filter/filter-transform.cpp similarity index 100% rename from source/filters/filter-transform.cpp rename to components/transform/source/filter/filter-transform.cpp diff --git a/source/filters/filter-transform.hpp b/components/transform/source/filter/filter-transform.hpp similarity index 100% rename from source/filters/filter-transform.hpp rename to components/transform/source/filter/filter-transform.hpp From 4f845ac9963a21ad28bb106f4a8225fa06a4a860 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 01:02:18 +0200 Subject: [PATCH 24/66] blur: Move into its own component This still contains some of the old reusable code, which was never used in the first place. I'm unsure what the end goal for it was, as nothing really ended up using it anywhere else. --- CMakeLists.txt | 40 ------------------- components/blur/CMakeLists.txt | 8 ++++ .../blur/source/filter}/filter-blur.cpp | 0 .../blur/source/filter}/filter-blur.hpp | 0 .../blur/source}/gfx/blur/gfx-blur-base.cpp | 0 .../blur/source}/gfx/blur/gfx-blur-base.hpp | 0 .../source}/gfx/blur/gfx-blur-box-linear.cpp | 0 .../source}/gfx/blur/gfx-blur-box-linear.hpp | 0 .../blur/source}/gfx/blur/gfx-blur-box.cpp | 0 .../blur/source}/gfx/blur/gfx-blur-box.hpp | 0 .../gfx/blur/gfx-blur-dual-filtering.cpp | 0 .../gfx/blur/gfx-blur-dual-filtering.hpp | 0 .../gfx/blur/gfx-blur-gaussian-linear.cpp | 0 .../gfx/blur/gfx-blur-gaussian-linear.hpp | 0 .../source}/gfx/blur/gfx-blur-gaussian.cpp | 0 .../source}/gfx/blur/gfx-blur-gaussian.hpp | 0 16 files changed, 8 insertions(+), 40 deletions(-) create mode 100644 components/blur/CMakeLists.txt rename {source/filters => components/blur/source/filter}/filter-blur.cpp (100%) rename {source/filters => components/blur/source/filter}/filter-blur.hpp (100%) rename {source => components/blur/source}/gfx/blur/gfx-blur-base.cpp (100%) rename {source => components/blur/source}/gfx/blur/gfx-blur-base.hpp (100%) rename {source => components/blur/source}/gfx/blur/gfx-blur-box-linear.cpp (100%) rename {source => components/blur/source}/gfx/blur/gfx-blur-box-linear.hpp (100%) rename {source => components/blur/source}/gfx/blur/gfx-blur-box.cpp (100%) rename {source => components/blur/source}/gfx/blur/gfx-blur-box.hpp (100%) rename {source => components/blur/source}/gfx/blur/gfx-blur-dual-filtering.cpp (100%) rename {source => components/blur/source}/gfx/blur/gfx-blur-dual-filtering.hpp (100%) rename {source => components/blur/source}/gfx/blur/gfx-blur-gaussian-linear.cpp (100%) rename {source => components/blur/source}/gfx/blur/gfx-blur-gaussian-linear.hpp (100%) rename {source => components/blur/source}/gfx/blur/gfx-blur-gaussian.cpp (100%) rename {source => components/blur/source}/gfx/blur/gfx-blur-gaussian.hpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b1aca1c9d..780b8329b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -290,7 +290,6 @@ set(${PREFIX}VERSION "" CACHE STRING "Specify an override for the automatically ## Filters set(${PREFIX}ENABLE_FILTER_AUTOFRAMING ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Auto-Framing Filter") set(${PREFIX}ENABLE_FILTER_AUTOFRAMING_NVIDIA ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable NVIDIA provider(s) Auto-Framing Filter") -set(${PREFIX}ENABLE_FILTER_BLUR ${FEATURE_UNSTABLE} CACHE BOOL "Enable Blur Filter") set(${PREFIX}ENABLE_FILTER_COLOR_GRADE ${FEATURE_STABLE} CACHE BOOL "Enable Color Grade Filter") set(${PREFIX}ENABLE_FILTER_DENOISING ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Denoising filter") set(${PREFIX}ENABLE_FILTER_DENOISING_NVIDIA ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable NVIDIA provider(s) for Denoising Filter") @@ -455,10 +454,6 @@ function(feature_filter_autoframing RESOLVE) endif() endfunction() -function(feature_filter_blur RESOLVE) - is_feature_enabled(FILTER_BLUR T_CHECK) -endfunction() - function(feature_filter_color_grade RESOLVE) is_feature_enabled(FILTER_COLOR_GRADE T_CHECK) endfunction() @@ -569,7 +564,6 @@ endfunction() # Set Requirements feature_filter_autoframing(OFF) -feature_filter_blur(OFF) feature_filter_color_grade(OFF) feature_filter_denoising(OFF) feature_filter_sdf_effects(OFF) @@ -701,7 +695,6 @@ endif() # Verify Requirements feature_filter_autoframing(ON) -feature_filter_blur(ON) feature_filter_color_grade(ON) feature_filter_denoising(ON) feature_filter_sdf_effects(ON) @@ -996,39 +989,6 @@ if(T_CHECK) endif() endif() -# Filter/Blur -is_feature_enabled(FILTER_BLUR T_CHECK) -if(T_CHECK) - list(APPEND PROJECT_DATA - "data/effects/mask.effect" - "data/effects/blur/common.effect" - "data/effects/blur/box.effect" - "data/effects/blur/box-linear.effect" - "data/effects/blur/dual-filtering.effect" - "data/effects/blur/gaussian.effect" - "data/effects/blur/gaussian-linear.effect" - ) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/gfx/blur/gfx-blur-base.hpp" - "source/gfx/blur/gfx-blur-base.cpp" - "source/gfx/blur/gfx-blur-box.hpp" - "source/gfx/blur/gfx-blur-box.cpp" - "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() - # Filter/Color Grade is_feature_enabled(FILTER_COLOR_GRADE T_CHECK) if(T_CHECK) diff --git a/components/blur/CMakeLists.txt b/components/blur/CMakeLists.txt new file mode 100644 index 0000000000..46020e19b0 --- /dev/null +++ b/components/blur/CMakeLists.txt @@ -0,0 +1,8 @@ +## AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER END +cmake_minimum_required(VERSION 3.26) +project("Blur") +list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") + +streamfx_add_component("Blur") diff --git a/source/filters/filter-blur.cpp b/components/blur/source/filter/filter-blur.cpp similarity index 100% rename from source/filters/filter-blur.cpp rename to components/blur/source/filter/filter-blur.cpp diff --git a/source/filters/filter-blur.hpp b/components/blur/source/filter/filter-blur.hpp similarity index 100% rename from source/filters/filter-blur.hpp rename to components/blur/source/filter/filter-blur.hpp diff --git a/source/gfx/blur/gfx-blur-base.cpp b/components/blur/source/gfx/blur/gfx-blur-base.cpp similarity index 100% rename from source/gfx/blur/gfx-blur-base.cpp rename to components/blur/source/gfx/blur/gfx-blur-base.cpp diff --git a/source/gfx/blur/gfx-blur-base.hpp b/components/blur/source/gfx/blur/gfx-blur-base.hpp similarity index 100% rename from source/gfx/blur/gfx-blur-base.hpp rename to components/blur/source/gfx/blur/gfx-blur-base.hpp diff --git a/source/gfx/blur/gfx-blur-box-linear.cpp b/components/blur/source/gfx/blur/gfx-blur-box-linear.cpp similarity index 100% rename from source/gfx/blur/gfx-blur-box-linear.cpp rename to components/blur/source/gfx/blur/gfx-blur-box-linear.cpp diff --git a/source/gfx/blur/gfx-blur-box-linear.hpp b/components/blur/source/gfx/blur/gfx-blur-box-linear.hpp similarity index 100% rename from source/gfx/blur/gfx-blur-box-linear.hpp rename to components/blur/source/gfx/blur/gfx-blur-box-linear.hpp diff --git a/source/gfx/blur/gfx-blur-box.cpp b/components/blur/source/gfx/blur/gfx-blur-box.cpp similarity index 100% rename from source/gfx/blur/gfx-blur-box.cpp rename to components/blur/source/gfx/blur/gfx-blur-box.cpp diff --git a/source/gfx/blur/gfx-blur-box.hpp b/components/blur/source/gfx/blur/gfx-blur-box.hpp similarity index 100% rename from source/gfx/blur/gfx-blur-box.hpp rename to components/blur/source/gfx/blur/gfx-blur-box.hpp diff --git a/source/gfx/blur/gfx-blur-dual-filtering.cpp b/components/blur/source/gfx/blur/gfx-blur-dual-filtering.cpp similarity index 100% rename from source/gfx/blur/gfx-blur-dual-filtering.cpp rename to components/blur/source/gfx/blur/gfx-blur-dual-filtering.cpp diff --git a/source/gfx/blur/gfx-blur-dual-filtering.hpp b/components/blur/source/gfx/blur/gfx-blur-dual-filtering.hpp similarity index 100% rename from source/gfx/blur/gfx-blur-dual-filtering.hpp rename to components/blur/source/gfx/blur/gfx-blur-dual-filtering.hpp diff --git a/source/gfx/blur/gfx-blur-gaussian-linear.cpp b/components/blur/source/gfx/blur/gfx-blur-gaussian-linear.cpp similarity index 100% rename from source/gfx/blur/gfx-blur-gaussian-linear.cpp rename to components/blur/source/gfx/blur/gfx-blur-gaussian-linear.cpp diff --git a/source/gfx/blur/gfx-blur-gaussian-linear.hpp b/components/blur/source/gfx/blur/gfx-blur-gaussian-linear.hpp similarity index 100% rename from source/gfx/blur/gfx-blur-gaussian-linear.hpp rename to components/blur/source/gfx/blur/gfx-blur-gaussian-linear.hpp diff --git a/source/gfx/blur/gfx-blur-gaussian.cpp b/components/blur/source/gfx/blur/gfx-blur-gaussian.cpp similarity index 100% rename from source/gfx/blur/gfx-blur-gaussian.cpp rename to components/blur/source/gfx/blur/gfx-blur-gaussian.cpp diff --git a/source/gfx/blur/gfx-blur-gaussian.hpp b/components/blur/source/gfx/blur/gfx-blur-gaussian.hpp similarity index 100% rename from source/gfx/blur/gfx-blur-gaussian.hpp rename to components/blur/source/gfx/blur/gfx-blur-gaussian.hpp From 5d5852c8f7a9da0d5b0f3c933d91e94c5bfea9b7 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 01:06:32 +0200 Subject: [PATCH 25/66] color-grade: Move into its own component Another re-usable code section that never got reused. This one is actually more useful, so I might split it into its own component eventually. --- CMakeLists.txt | 40 ------------------- components/color-grade/CMakeLists.txt | 8 ++++ .../source}/filters/filter-color-grade.cpp | 0 .../source}/filters/filter-color-grade.hpp | 0 .../source}/gfx/lut/gfx-lut-consumer.cpp | 0 .../source}/gfx/lut/gfx-lut-consumer.hpp | 0 .../source}/gfx/lut/gfx-lut-producer.cpp | 0 .../source}/gfx/lut/gfx-lut-producer.hpp | 0 .../color-grade/source}/gfx/lut/gfx-lut.cpp | 0 .../color-grade/source}/gfx/lut/gfx-lut.hpp | 0 10 files changed, 8 insertions(+), 40 deletions(-) create mode 100644 components/color-grade/CMakeLists.txt rename {source => components/color-grade/source}/filters/filter-color-grade.cpp (100%) rename {source => components/color-grade/source}/filters/filter-color-grade.hpp (100%) rename {source => components/color-grade/source}/gfx/lut/gfx-lut-consumer.cpp (100%) rename {source => components/color-grade/source}/gfx/lut/gfx-lut-consumer.hpp (100%) rename {source => components/color-grade/source}/gfx/lut/gfx-lut-producer.cpp (100%) rename {source => components/color-grade/source}/gfx/lut/gfx-lut-producer.hpp (100%) rename {source => components/color-grade/source}/gfx/lut/gfx-lut.cpp (100%) rename {source => components/color-grade/source}/gfx/lut/gfx-lut.hpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 780b8329b2..5eebe3880c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -290,7 +290,6 @@ set(${PREFIX}VERSION "" CACHE STRING "Specify an override for the automatically ## Filters set(${PREFIX}ENABLE_FILTER_AUTOFRAMING ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Auto-Framing Filter") set(${PREFIX}ENABLE_FILTER_AUTOFRAMING_NVIDIA ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable NVIDIA provider(s) Auto-Framing Filter") -set(${PREFIX}ENABLE_FILTER_COLOR_GRADE ${FEATURE_STABLE} CACHE BOOL "Enable Color Grade Filter") set(${PREFIX}ENABLE_FILTER_DENOISING ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Denoising filter") set(${PREFIX}ENABLE_FILTER_DENOISING_NVIDIA ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable NVIDIA provider(s) for Denoising Filter") set(${PREFIX}ENABLE_FILTER_SDF_EFFECTS ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable SDF Effects Filter") @@ -454,10 +453,6 @@ function(feature_filter_autoframing RESOLVE) endif() endfunction() -function(feature_filter_color_grade RESOLVE) - is_feature_enabled(FILTER_COLOR_GRADE T_CHECK) -endfunction() - function(feature_filter_denoising RESOLVE) is_feature_enabled(FILTER_DENOISING T_CHECK) if(RESOLVE AND T_CHECK) @@ -564,7 +559,6 @@ endfunction() # Set Requirements feature_filter_autoframing(OFF) -feature_filter_color_grade(OFF) feature_filter_denoising(OFF) feature_filter_sdf_effects(OFF) feature_filter_upscaling(OFF) @@ -695,7 +689,6 @@ endif() # Verify Requirements feature_filter_autoframing(ON) -feature_filter_color_grade(ON) feature_filter_denoising(ON) feature_filter_sdf_effects(ON) feature_filter_upscaling(ON) @@ -989,22 +982,6 @@ if(T_CHECK) endif() endif() -# Filter/Color Grade -is_feature_enabled(FILTER_COLOR_GRADE T_CHECK) -if(T_CHECK) - list(APPEND PROJECT_DATA - "data/effects/color-grade.effect" - ) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/filters/filter-color-grade.hpp" - "source/filters/filter-color-grade.cpp" - ) - list(APPEND PROJECT_DEFINITIONS - ENABLE_FILTER_COLOR_GRADE - ) - set(REQUIRE_LUT ON) -endif() - # Filter/SDF Effects is_feature_enabled(FILTER_SDF_EFFECTS T_CHECK) if(T_CHECK) @@ -1153,23 +1130,6 @@ endif() # Parts ################################################################################ -# LUT -if(REQUIRE_LUT) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/gfx/lut/gfx-lut.hpp" - "source/gfx/lut/gfx-lut.cpp" - "source/gfx/lut/gfx-lut-consumer.hpp" - "source/gfx/lut/gfx-lut-consumer.cpp" - "source/gfx/lut/gfx-lut-producer.hpp" - "source/gfx/lut/gfx-lut-producer.cpp" - ) - list(APPEND PROJECT_DATA - "data/effects/lut.effect" - "data/effects/lut-consumer.effect" - "data/effects/lut-producer.effect" - ) -endif() - # Windows if(D_PLATFORM_WINDOWS) # Disable/Enable a ton of things. diff --git a/components/color-grade/CMakeLists.txt b/components/color-grade/CMakeLists.txt new file mode 100644 index 0000000000..e6136a1c22 --- /dev/null +++ b/components/color-grade/CMakeLists.txt @@ -0,0 +1,8 @@ +## AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER END +cmake_minimum_required(VERSION 3.26) +project("ColorGrade") +list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") + +streamfx_add_component("Color Grade") diff --git a/source/filters/filter-color-grade.cpp b/components/color-grade/source/filters/filter-color-grade.cpp similarity index 100% rename from source/filters/filter-color-grade.cpp rename to components/color-grade/source/filters/filter-color-grade.cpp diff --git a/source/filters/filter-color-grade.hpp b/components/color-grade/source/filters/filter-color-grade.hpp similarity index 100% rename from source/filters/filter-color-grade.hpp rename to components/color-grade/source/filters/filter-color-grade.hpp diff --git a/source/gfx/lut/gfx-lut-consumer.cpp b/components/color-grade/source/gfx/lut/gfx-lut-consumer.cpp similarity index 100% rename from source/gfx/lut/gfx-lut-consumer.cpp rename to components/color-grade/source/gfx/lut/gfx-lut-consumer.cpp diff --git a/source/gfx/lut/gfx-lut-consumer.hpp b/components/color-grade/source/gfx/lut/gfx-lut-consumer.hpp similarity index 100% rename from source/gfx/lut/gfx-lut-consumer.hpp rename to components/color-grade/source/gfx/lut/gfx-lut-consumer.hpp diff --git a/source/gfx/lut/gfx-lut-producer.cpp b/components/color-grade/source/gfx/lut/gfx-lut-producer.cpp similarity index 100% rename from source/gfx/lut/gfx-lut-producer.cpp rename to components/color-grade/source/gfx/lut/gfx-lut-producer.cpp diff --git a/source/gfx/lut/gfx-lut-producer.hpp b/components/color-grade/source/gfx/lut/gfx-lut-producer.hpp similarity index 100% rename from source/gfx/lut/gfx-lut-producer.hpp rename to components/color-grade/source/gfx/lut/gfx-lut-producer.hpp diff --git a/source/gfx/lut/gfx-lut.cpp b/components/color-grade/source/gfx/lut/gfx-lut.cpp similarity index 100% rename from source/gfx/lut/gfx-lut.cpp rename to components/color-grade/source/gfx/lut/gfx-lut.cpp diff --git a/source/gfx/lut/gfx-lut.hpp b/components/color-grade/source/gfx/lut/gfx-lut.hpp similarity index 100% rename from source/gfx/lut/gfx-lut.hpp rename to components/color-grade/source/gfx/lut/gfx-lut.hpp From 65e91fbbc440d4fdac8abd9559eaa85a9860ec4b Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 01:10:08 +0200 Subject: [PATCH 26/66] mirror: Move into its own component Soon to be replaced by Spout/Sink --- CMakeLists.txt | 21 ------------------- components/mirror/CMakeLists.txt | 8 +++++++ .../mirror/source}/sources/source-mirror.cpp | 0 .../mirror/source}/sources/source-mirror.hpp | 0 4 files changed, 8 insertions(+), 21 deletions(-) create mode 100644 components/mirror/CMakeLists.txt rename {source => components/mirror/source}/sources/source-mirror.cpp (100%) rename {source => components/mirror/source}/sources/source-mirror.hpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5eebe3880c..dc44e7c90d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -298,9 +298,6 @@ set(${PREFIX}ENABLE_FILTER_UPSCALING_NVIDIA ${FEATURE_EXPERIMENTAL} CACHE BOOL " set(${PREFIX}ENABLE_FILTER_VIRTUAL_GREENSCREEN ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Virtual Greenscreen Filter") set(${PREFIX}ENABLE_FILTER_VIRTUAL_GREENSCREEN_NVIDIA ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable NVIDIA provider(s) for Virtual Greenscreen Filter") -## Sources -set(${PREFIX}ENABLE_SOURCE_MIRROR ${FEATURE_DEPRECATED} CACHE BOOL "Enable Mirror Source") - ## FrontEnd & UI set(${PREFIX}ENABLE_FRONTEND ON CACHE BOOL "Enable Frontend code.") set(${PREFIX}ENABLE_UPDATER ON CACHE BOOL "Enable automatic update checks.") @@ -517,10 +514,6 @@ function(feature_filter_virtual_greenscreen RESOLVE) endif() endfunction() -function(feature_source_mirror RESOLVE) - is_feature_enabled(SOURCE_MIRROR T_CHECK) -endfunction() - function(feature_frontend RESOLVE) is_feature_enabled(FRONTEND T_CHECK) if(RESOLVE AND T_CHECK) @@ -563,7 +556,6 @@ feature_filter_denoising(OFF) feature_filter_sdf_effects(OFF) feature_filter_upscaling(OFF) feature_filter_virtual_greenscreen(OFF) -feature_source_mirror(OFF) feature_frontend(OFF) feature_updater(OFF) @@ -693,7 +685,6 @@ feature_filter_denoising(ON) feature_filter_sdf_effects(ON) feature_filter_upscaling(ON) feature_filter_virtual_greenscreen(ON) -feature_source_mirror(ON) feature_frontend(ON) feature_updater(ON) @@ -1052,18 +1043,6 @@ if(T_CHECK) endif() endif() -# Source/Mirror -is_feature_enabled(SOURCE_MIRROR T_CHECK) -if(T_CHECK) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/sources/source-mirror.hpp" - "source/sources/source-mirror.cpp" - ) - list(APPEND PROJECT_DEFINITIONS - ENABLE_SOURCE_MIRROR - ) -endif() - # Profiling is_feature_enabled(PROFILING T_CHECK) if(T_CHECK) diff --git a/components/mirror/CMakeLists.txt b/components/mirror/CMakeLists.txt new file mode 100644 index 0000000000..159d811272 --- /dev/null +++ b/components/mirror/CMakeLists.txt @@ -0,0 +1,8 @@ +## AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER END +cmake_minimum_required(VERSION 3.26) +project("Mirror") +list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") + +streamfx_add_component("Mirror") diff --git a/source/sources/source-mirror.cpp b/components/mirror/source/sources/source-mirror.cpp similarity index 100% rename from source/sources/source-mirror.cpp rename to components/mirror/source/sources/source-mirror.cpp diff --git a/source/sources/source-mirror.hpp b/components/mirror/source/sources/source-mirror.hpp similarity index 100% rename from source/sources/source-mirror.hpp rename to components/mirror/source/sources/source-mirror.hpp From 7ebe4f5631cb61c8bfc9974a38df2d9cbc90fc6a Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 01:12:43 +0200 Subject: [PATCH 27/66] sdf-effects: Move into its own component --- CMakeLists.txt | 23 ------------------- components/sdf-effects/CMakeLists.txt | 8 +++++++ .../source}/filters/filter-sdf-effects.cpp | 0 .../source}/filters/filter-sdf-effects.hpp | 0 4 files changed, 8 insertions(+), 23 deletions(-) create mode 100644 components/sdf-effects/CMakeLists.txt rename {source => components/sdf-effects/source}/filters/filter-sdf-effects.cpp (100%) rename {source => components/sdf-effects/source}/filters/filter-sdf-effects.hpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index dc44e7c90d..2bd559f3cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -292,7 +292,6 @@ set(${PREFIX}ENABLE_FILTER_AUTOFRAMING ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enabl set(${PREFIX}ENABLE_FILTER_AUTOFRAMING_NVIDIA ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable NVIDIA provider(s) Auto-Framing Filter") set(${PREFIX}ENABLE_FILTER_DENOISING ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Denoising filter") set(${PREFIX}ENABLE_FILTER_DENOISING_NVIDIA ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable NVIDIA provider(s) for Denoising Filter") -set(${PREFIX}ENABLE_FILTER_SDF_EFFECTS ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable SDF Effects Filter") set(${PREFIX}ENABLE_FILTER_UPSCALING ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Upscaling Filter") set(${PREFIX}ENABLE_FILTER_UPSCALING_NVIDIA ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable NVIDIA provider(s) for Upscaling Filter") set(${PREFIX}ENABLE_FILTER_VIRTUAL_GREENSCREEN ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Virtual Greenscreen Filter") @@ -470,10 +469,6 @@ function(feature_filter_denoising RESOLVE) endif() endfunction() -function(feature_filter_sdf_effects RESOLVE) - is_feature_enabled(FILTER_SDF_EFFECTS T_CHECK) -endfunction() - function(feature_filter_upscaling RESOLVE) is_feature_enabled(FILTER_UPSCALING T_CHECK) if(RESOLVE AND T_CHECK) @@ -553,7 +548,6 @@ endfunction() # Set Requirements feature_filter_autoframing(OFF) feature_filter_denoising(OFF) -feature_filter_sdf_effects(OFF) feature_filter_upscaling(OFF) feature_filter_virtual_greenscreen(OFF) feature_frontend(OFF) @@ -682,7 +676,6 @@ endif() # Verify Requirements feature_filter_autoframing(ON) feature_filter_denoising(ON) -feature_filter_sdf_effects(ON) feature_filter_upscaling(ON) feature_filter_virtual_greenscreen(ON) feature_frontend(ON) @@ -973,22 +966,6 @@ if(T_CHECK) endif() endif() -# Filter/SDF Effects -is_feature_enabled(FILTER_SDF_EFFECTS T_CHECK) -if(T_CHECK) - list(APPEND PROJECT_DATA - "data/effects/sdf/sdf-producer.effect" - "data/effects/sdf/sdf-consumer.effect" - ) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/filters/filter-sdf-effects.hpp" - "source/filters/filter-sdf-effects.cpp" - ) - list(APPEND PROJECT_DEFINITIONS - ENABLE_FILTER_SDF_EFFECTS - ) -endif() - # Filter/Denoising is_feature_enabled(FILTER_DENOISING T_CHECK) if(T_CHECK) diff --git a/components/sdf-effects/CMakeLists.txt b/components/sdf-effects/CMakeLists.txt new file mode 100644 index 0000000000..fa270a7714 --- /dev/null +++ b/components/sdf-effects/CMakeLists.txt @@ -0,0 +1,8 @@ +## AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER END +cmake_minimum_required(VERSION 3.26) +project("SDFFx") +list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") + +streamfx_add_component("SDF Effects") diff --git a/source/filters/filter-sdf-effects.cpp b/components/sdf-effects/source/filters/filter-sdf-effects.cpp similarity index 100% rename from source/filters/filter-sdf-effects.cpp rename to components/sdf-effects/source/filters/filter-sdf-effects.cpp diff --git a/source/filters/filter-sdf-effects.hpp b/components/sdf-effects/source/filters/filter-sdf-effects.hpp similarity index 100% rename from source/filters/filter-sdf-effects.hpp rename to components/sdf-effects/source/filters/filter-sdf-effects.hpp From d7d8253518b1515a810e73881f9ccb8cc37443d6 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 01:17:37 +0200 Subject: [PATCH 28/66] autoframing: Move into its own component --- CMakeLists.txt | 43 ------------------- components/autoframing/CMakeLists.txt | 8 ++++ .../source}/filters/filter-autoframing.cpp | 0 .../source}/filters/filter-autoframing.hpp | 0 4 files changed, 8 insertions(+), 43 deletions(-) create mode 100644 components/autoframing/CMakeLists.txt rename {source => components/autoframing/source}/filters/filter-autoframing.cpp (100%) rename {source => components/autoframing/source}/filters/filter-autoframing.hpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2bd559f3cc..f3aeda9e73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -288,8 +288,6 @@ set(${PREFIX}VERSION "" CACHE STRING "Specify an override for the automatically # Features ## Filters -set(${PREFIX}ENABLE_FILTER_AUTOFRAMING ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Auto-Framing Filter") -set(${PREFIX}ENABLE_FILTER_AUTOFRAMING_NVIDIA ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable NVIDIA provider(s) Auto-Framing Filter") set(${PREFIX}ENABLE_FILTER_DENOISING ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Denoising filter") set(${PREFIX}ENABLE_FILTER_DENOISING_NVIDIA ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable NVIDIA provider(s) for Denoising Filter") set(${PREFIX}ENABLE_FILTER_UPSCALING ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Upscaling Filter") @@ -428,27 +426,6 @@ macro(set_feature_disabled FEATURE DISABLED) set(${PREFIX}DISABLE_${FEATURE} ${DISABLED} CACHE INTERNAL "" FORCE) endmacro() -function(feature_filter_autoframing RESOLVE) - is_feature_enabled(FILTER_AUTOFRAMING T_CHECK) - if(RESOLVE AND T_CHECK) - # Verify that the requirements for the providers are available - if(NOT HAVE_NVIDIA_AR_SDK) - message(WARNING "'NVIDIA Augmented Reality SDK' is missing. Disabling NVIDIA provider...") - set_feature_disabled(FILTER_AUTOFRAMING_NVIDIA ON) - endif() - - # Verify that we have at least one provider for Auto-Framing. - is_feature_enabled(FILTER_AUTOFRAMING_NVIDIA T_CHECK_NVIDIA) - if(NOT T_CHECK_NVIDIA) - message(WARNING "Auto-Framing has no available providers. Disabling...") - set_feature_disabled(FILTER_AUTOFRAMING ON) - endif() - elseif(T_CHECK) - set(REQUIRE_NVIDIA_AR_SDK ON PARENT_SCOPE) - set(REQUIRE_NVIDIA_CUDA ON PARENT_SCOPE) - endif() -endfunction() - function(feature_filter_denoising RESOLVE) is_feature_enabled(FILTER_DENOISING T_CHECK) if(RESOLVE AND T_CHECK) @@ -546,7 +523,6 @@ function(feature_updater RESOLVE) endfunction() # Set Requirements -feature_filter_autoframing(OFF) feature_filter_denoising(OFF) feature_filter_upscaling(OFF) feature_filter_virtual_greenscreen(OFF) @@ -674,7 +650,6 @@ if(REQUIRE_QT) endif() # Verify Requirements -feature_filter_autoframing(ON) feature_filter_denoising(ON) feature_filter_upscaling(ON) feature_filter_virtual_greenscreen(ON) @@ -948,24 +923,6 @@ list(APPEND PROJECT_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/source" ) -# Filter/Auto-Framing -is_feature_enabled(FILTER_AUTOFRAMING T_CHECK) -if(T_CHECK) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/filters/filter-autoframing.hpp" - "source/filters/filter-autoframing.cpp" - ) - list(APPEND PROJECT_DEFINITIONS - ENABLE_FILTER_AUTOFRAMING - ) - is_feature_enabled(FILTER_AUTOFRAMING_NVIDIA T_CHECK) - if(T_CHECK) - list(APPEND PROJECT_DEFINITIONS - ENABLE_FILTER_AUTOFRAMING_NVIDIA - ) - endif() -endif() - # Filter/Denoising is_feature_enabled(FILTER_DENOISING T_CHECK) if(T_CHECK) diff --git a/components/autoframing/CMakeLists.txt b/components/autoframing/CMakeLists.txt new file mode 100644 index 0000000000..01b39bd856 --- /dev/null +++ b/components/autoframing/CMakeLists.txt @@ -0,0 +1,8 @@ +## AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER END +cmake_minimum_required(VERSION 3.26) +project("AutoFraming") +list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") + +streamfx_add_component("Auto-Framing") diff --git a/source/filters/filter-autoframing.cpp b/components/autoframing/source/filters/filter-autoframing.cpp similarity index 100% rename from source/filters/filter-autoframing.cpp rename to components/autoframing/source/filters/filter-autoframing.cpp diff --git a/source/filters/filter-autoframing.hpp b/components/autoframing/source/filters/filter-autoframing.hpp similarity index 100% rename from source/filters/filter-autoframing.hpp rename to components/autoframing/source/filters/filter-autoframing.hpp From e3ddbe43361dfb31d08992aab140b630cdb83d0e Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 01:22:06 +0200 Subject: [PATCH 29/66] denoising: Move into its own component --- CMakeLists.txt | 42 ------------------- components/denoising/CMakeLists.txt | 8 ++++ .../source}/filters/filter-denoising.cpp | 0 .../source}/filters/filter-denoising.hpp | 0 4 files changed, 8 insertions(+), 42 deletions(-) create mode 100644 components/denoising/CMakeLists.txt rename {source => components/denoising/source}/filters/filter-denoising.cpp (100%) rename {source => components/denoising/source}/filters/filter-denoising.hpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index f3aeda9e73..d08c08275a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -288,8 +288,6 @@ set(${PREFIX}VERSION "" CACHE STRING "Specify an override for the automatically # Features ## Filters -set(${PREFIX}ENABLE_FILTER_DENOISING ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Denoising filter") -set(${PREFIX}ENABLE_FILTER_DENOISING_NVIDIA ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable NVIDIA provider(s) for Denoising Filter") set(${PREFIX}ENABLE_FILTER_UPSCALING ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Upscaling Filter") set(${PREFIX}ENABLE_FILTER_UPSCALING_NVIDIA ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable NVIDIA provider(s) for Upscaling Filter") set(${PREFIX}ENABLE_FILTER_VIRTUAL_GREENSCREEN ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Virtual Greenscreen Filter") @@ -426,26 +424,6 @@ macro(set_feature_disabled FEATURE DISABLED) set(${PREFIX}DISABLE_${FEATURE} ${DISABLED} CACHE INTERNAL "" FORCE) endmacro() -function(feature_filter_denoising RESOLVE) - is_feature_enabled(FILTER_DENOISING T_CHECK) - if(RESOLVE AND T_CHECK) - # Verify that the requirements for the providers are available - if(NOT HAVE_NVIDIA_VFX_SDK) - message(WARNING "'NVIDIA Video Effects SDK' is missing. Disabling NVIDIA provider...") - set_feature_disabled(FILTER_DENOISING_NVIDIA ON) - endif() - - # Verify that we have at least one provider for Video Denoising. - is_feature_enabled(FILTER_DENOISING_NVIDIA T_CHECK_NVIDIA) - if(NOT T_CHECK_NVIDIA) - message(WARNING "Denoising has no available providers. Disabling...") - set_feature_disabled(FILTER_DENOISING ON) - endif() - elseif(T_CHECK) - set(REQUIRE_NVIDIA_VFX_SDK ON PARENT_SCOPE) - endif() -endfunction() - function(feature_filter_upscaling RESOLVE) is_feature_enabled(FILTER_UPSCALING T_CHECK) if(RESOLVE AND T_CHECK) @@ -523,7 +501,6 @@ function(feature_updater RESOLVE) endfunction() # Set Requirements -feature_filter_denoising(OFF) feature_filter_upscaling(OFF) feature_filter_virtual_greenscreen(OFF) feature_frontend(OFF) @@ -650,7 +627,6 @@ if(REQUIRE_QT) endif() # Verify Requirements -feature_filter_denoising(ON) feature_filter_upscaling(ON) feature_filter_virtual_greenscreen(ON) feature_frontend(ON) @@ -923,24 +899,6 @@ list(APPEND PROJECT_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/source" ) -# Filter/Denoising -is_feature_enabled(FILTER_DENOISING T_CHECK) -if(T_CHECK) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/filters/filter-denoising.hpp" - "source/filters/filter-denoising.cpp" - ) - list(APPEND PROJECT_DEFINITIONS - ENABLE_FILTER_DENOISING - ) - is_feature_enabled(FILTER_DENOISING_NVIDIA T_CHECK) - if(T_CHECK) - list(APPEND PROJECT_DEFINITIONS - ENABLE_FILTER_DENOISING_NVIDIA - ) - endif() -endif() - # Filter/Upscaling is_feature_enabled(FILTER_UPSCALING T_CHECK) if(T_CHECK) diff --git a/components/denoising/CMakeLists.txt b/components/denoising/CMakeLists.txt new file mode 100644 index 0000000000..8311476b9f --- /dev/null +++ b/components/denoising/CMakeLists.txt @@ -0,0 +1,8 @@ +## AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER END +cmake_minimum_required(VERSION 3.26) +project("Denoising") +list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") + +streamfx_add_component("Denoising") diff --git a/source/filters/filter-denoising.cpp b/components/denoising/source/filters/filter-denoising.cpp similarity index 100% rename from source/filters/filter-denoising.cpp rename to components/denoising/source/filters/filter-denoising.cpp diff --git a/source/filters/filter-denoising.hpp b/components/denoising/source/filters/filter-denoising.hpp similarity index 100% rename from source/filters/filter-denoising.hpp rename to components/denoising/source/filters/filter-denoising.hpp From 484c790c2a38bb1917ca2bea69bfcd2280bcb47a Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 01:23:50 +0200 Subject: [PATCH 30/66] virtual-greenscreen: Move into its own component --- CMakeLists.txt | 42 ------------------- components/virtual-greenscreen/CMakeLists.txt | 8 ++++ .../filters/filter-virtual-greenscreen.cpp | 0 .../filters/filter-virtual-greenscreen.hpp | 0 4 files changed, 8 insertions(+), 42 deletions(-) create mode 100644 components/virtual-greenscreen/CMakeLists.txt rename {source => components/virtual-greenscreen/source}/filters/filter-virtual-greenscreen.cpp (100%) rename {source => components/virtual-greenscreen/source}/filters/filter-virtual-greenscreen.hpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index d08c08275a..f6de386b03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -290,8 +290,6 @@ set(${PREFIX}VERSION "" CACHE STRING "Specify an override for the automatically ## Filters set(${PREFIX}ENABLE_FILTER_UPSCALING ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Upscaling Filter") set(${PREFIX}ENABLE_FILTER_UPSCALING_NVIDIA ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable NVIDIA provider(s) for Upscaling Filter") -set(${PREFIX}ENABLE_FILTER_VIRTUAL_GREENSCREEN ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Virtual Greenscreen Filter") -set(${PREFIX}ENABLE_FILTER_VIRTUAL_GREENSCREEN_NVIDIA ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable NVIDIA provider(s) for Virtual Greenscreen Filter") ## FrontEnd & UI set(${PREFIX}ENABLE_FRONTEND ON CACHE BOOL "Enable Frontend code.") @@ -444,26 +442,6 @@ function(feature_filter_upscaling RESOLVE) endif() endfunction() -function(feature_filter_virtual_greenscreen RESOLVE) - is_feature_enabled(FILTER_VIRTUAL_GREENSCREEN T_CHECK) - if(RESOLVE AND T_CHECK) - # Verify that the requirements for the providers are available - if(NOT HAVE_NVIDIA_VFX_SDK) - message(WARNING "'NVIDIA Video Effects SDK' is missing. Disabling NVIDIA provider(s)...") - set_feature_disabled(FILTER_VIRTUAL_GREENSCREEN_NVIDIA ON) - endif() - - # Verify that we have at least one provider for Video Super-Resolution. - is_feature_enabled(FILTER_VIRTUAL_GREENSCREEN_NVIDIA T_CHECK_NVIDIA) - if(NOT T_CHECK_NVIDIA) - message(WARNING "Virtual Greenscreen has no available providers. Disabling...") - set_feature_disabled(FILTER_VIRTUAL_GREENSCREEN ON) - endif() - elseif(T_CHECK) - set(REQUIRE_NVIDIA_VFX_SDK ON PARENT_SCOPE) - endif() -endfunction() - function(feature_frontend RESOLVE) is_feature_enabled(FRONTEND T_CHECK) if(RESOLVE AND T_CHECK) @@ -502,7 +480,6 @@ endfunction() # Set Requirements feature_filter_upscaling(OFF) -feature_filter_virtual_greenscreen(OFF) feature_frontend(OFF) feature_updater(OFF) @@ -628,7 +605,6 @@ endif() # Verify Requirements feature_filter_upscaling(ON) -feature_filter_virtual_greenscreen(ON) feature_frontend(ON) feature_updater(ON) @@ -917,24 +893,6 @@ if(T_CHECK) endif() endif() -# Filter/Virtual Greenscreen -is_feature_enabled(FILTER_VIRTUAL_GREENSCREEN T_CHECK) -if(T_CHECK) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/filters/filter-virtual-greenscreen.hpp" - "source/filters/filter-virtual-greenscreen.cpp" - ) - list(APPEND PROJECT_DEFINITIONS - ENABLE_FILTER_VIRTUAL_GREENSCREEN - ) - is_feature_enabled(FILTER_VIRTUAL_GREENSCREEN_NVIDIA T_CHECK) - if(T_CHECK) - list(APPEND PROJECT_DEFINITIONS - ENABLE_FILTER_VIRTUAL_GREENSCREEN_NVIDIA - ) - endif() -endif() - # Profiling is_feature_enabled(PROFILING T_CHECK) if(T_CHECK) diff --git a/components/virtual-greenscreen/CMakeLists.txt b/components/virtual-greenscreen/CMakeLists.txt new file mode 100644 index 0000000000..90aa24e7de --- /dev/null +++ b/components/virtual-greenscreen/CMakeLists.txt @@ -0,0 +1,8 @@ +## AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER END +cmake_minimum_required(VERSION 3.26) +project("VirtualGreenscreen") +list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") + +streamfx_add_component("Virtual Greenscreen") diff --git a/source/filters/filter-virtual-greenscreen.cpp b/components/virtual-greenscreen/source/filters/filter-virtual-greenscreen.cpp similarity index 100% rename from source/filters/filter-virtual-greenscreen.cpp rename to components/virtual-greenscreen/source/filters/filter-virtual-greenscreen.cpp diff --git a/source/filters/filter-virtual-greenscreen.hpp b/components/virtual-greenscreen/source/filters/filter-virtual-greenscreen.hpp similarity index 100% rename from source/filters/filter-virtual-greenscreen.hpp rename to components/virtual-greenscreen/source/filters/filter-virtual-greenscreen.hpp From 72b0daca0507a0ba30dce76da426af9f0dbaa500 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 01:25:31 +0200 Subject: [PATCH 31/66] upscaling: Move into its own component --- CMakeLists.txt | 44 ------------------- components/upscaling/CMakeLists.txt | 8 ++++ .../source}/filters/filter-upscaling.cpp | 0 .../source}/filters/filter-upscaling.hpp | 0 4 files changed, 8 insertions(+), 44 deletions(-) create mode 100644 components/upscaling/CMakeLists.txt rename {source => components/upscaling/source}/filters/filter-upscaling.cpp (100%) rename {source => components/upscaling/source}/filters/filter-upscaling.hpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index f6de386b03..ec6ff5aeab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -287,10 +287,6 @@ endif() set(${PREFIX}VERSION "" CACHE STRING "Specify an override for the automatically detected version. Accepts a mixture of SemVer 2.0 and CMake Version.") # Features -## Filters -set(${PREFIX}ENABLE_FILTER_UPSCALING ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable Upscaling Filter") -set(${PREFIX}ENABLE_FILTER_UPSCALING_NVIDIA ${FEATURE_EXPERIMENTAL} CACHE BOOL "Enable NVIDIA provider(s) for Upscaling Filter") - ## FrontEnd & UI set(${PREFIX}ENABLE_FRONTEND ON CACHE BOOL "Enable Frontend code.") set(${PREFIX}ENABLE_UPDATER ON CACHE BOOL "Enable automatic update checks.") @@ -422,26 +418,6 @@ macro(set_feature_disabled FEATURE DISABLED) set(${PREFIX}DISABLE_${FEATURE} ${DISABLED} CACHE INTERNAL "" FORCE) endmacro() -function(feature_filter_upscaling RESOLVE) - is_feature_enabled(FILTER_UPSCALING T_CHECK) - if(RESOLVE AND T_CHECK) - # Verify that the requirements for the providers are available - if(NOT HAVE_NVIDIA_VFX_SDK) - message(WARNING "'NVIDIA Video Effects SDK' is missing. Disabling NVIDIA provider(s)...") - set_feature_disabled(FILTER_UPSCALING_NVIDIA ON) - endif() - - # Verify that we have at least one provider for Video Super-Resolution. - is_feature_enabled(FILTER_UPSCALING_NVIDIA T_CHECK_NVIDIA) - if(NOT T_CHECK_NVIDIA) - message(WARNING "Upscaling has no available providers. Disabling...") - set_feature_disabled(FILTER_UPSCALING ON) - endif() - elseif(T_CHECK) - set(REQUIRE_NVIDIA_VFX_SDK ON PARENT_SCOPE) - endif() -endfunction() - function(feature_frontend RESOLVE) is_feature_enabled(FRONTEND T_CHECK) if(RESOLVE AND T_CHECK) @@ -479,7 +455,6 @@ function(feature_updater RESOLVE) endfunction() # Set Requirements -feature_filter_upscaling(OFF) feature_frontend(OFF) feature_updater(OFF) @@ -604,7 +579,6 @@ if(REQUIRE_QT) endif() # Verify Requirements -feature_filter_upscaling(ON) feature_frontend(ON) feature_updater(ON) @@ -875,24 +849,6 @@ list(APPEND PROJECT_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/source" ) -# Filter/Upscaling -is_feature_enabled(FILTER_UPSCALING T_CHECK) -if(T_CHECK) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/filters/filter-upscaling.hpp" - "source/filters/filter-upscaling.cpp" - ) - list(APPEND PROJECT_DEFINITIONS - ENABLE_FILTER_UPSCALING - ) - is_feature_enabled(FILTER_UPSCALING_NVIDIA T_CHECK) - if(T_CHECK) - list(APPEND PROJECT_DEFINITIONS - ENABLE_FILTER_UPSCALING_NVIDIA - ) - endif() -endif() - # Profiling is_feature_enabled(PROFILING T_CHECK) if(T_CHECK) diff --git a/components/upscaling/CMakeLists.txt b/components/upscaling/CMakeLists.txt new file mode 100644 index 0000000000..1d458d4d02 --- /dev/null +++ b/components/upscaling/CMakeLists.txt @@ -0,0 +1,8 @@ +## AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER END +cmake_minimum_required(VERSION 3.26) +project("Upscaling") +list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") + +streamfx_add_component("Upscaling") diff --git a/source/filters/filter-upscaling.cpp b/components/upscaling/source/filters/filter-upscaling.cpp similarity index 100% rename from source/filters/filter-upscaling.cpp rename to components/upscaling/source/filters/filter-upscaling.cpp diff --git a/source/filters/filter-upscaling.hpp b/components/upscaling/source/filters/filter-upscaling.hpp similarity index 100% rename from source/filters/filter-upscaling.hpp rename to components/upscaling/source/filters/filter-upscaling.hpp From e6c81ca71eaa4a1071a98e782e399090c08d90d9 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 01:34:27 +0200 Subject: [PATCH 32/66] Always build Frontend and Updater We now require these features all the time, as they are becoming more of a core part of the StreamFX UI. Additionally several components rely on these already being present, so omitting them is not a great idea. --- CMakeLists.txt | 303 ++++++++++++++----------------------------------- 1 file changed, 87 insertions(+), 216 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ec6ff5aeab..55b0a94d63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -286,15 +286,7 @@ endif() # Version override set(${PREFIX}VERSION "" CACHE STRING "Specify an override for the automatically detected version. Accepts a mixture of SemVer 2.0 and CMake Version.") -# Features -## FrontEnd & UI -set(${PREFIX}ENABLE_FRONTEND ON CACHE BOOL "Enable Frontend code.") -set(${PREFIX}ENABLE_UPDATER ON CACHE BOOL "Enable automatic update checks.") - -## Code Related -set(${PREFIX}ENABLE_PROFILING OFF CACHE BOOL "Enable CPU and GPU performance tracking, which has a non-zero overhead at all times. Do not enable this for release builds.") - -## Compile/Link Related +# Compile/Link Related set(${PREFIX}ENABLE_LTO ${D_HAS_IPO} CACHE BOOL "Enable Link Time Optimization for faster and smaller binaries.") set(${PREFIX}ENABLE_FASTMATH ON CACHE BOOL "Enable fast math optimizations, which sacrifice precision and stability.") if(D_PLATFORM_ARCH_X86) @@ -394,71 +386,9 @@ endif() set_property(GLOBAL PROPERTY AUTOGEN_SOURCE_GROUP "User-Interface Files/Generated") ################################################################################ -# Components (Old System) +# Dependencies ################################################################################ -# Component resolving: -# 1. Check which features are enabled. For each feature, set what they require to ON. -# 2. Try and find required items. -# 3. Again check which features are enabled, if their requirements are missing, warn about it and disable them. -# TODO: Consider making this an error instead. - -macro(is_feature_enabled FEATURE OUTPUT) - set(T_ENABLED ${${PREFIX}ENABLE_${FEATURE}}) - set(T_DISABLED ${${PREFIX}DISABLE_${FEATURE}}) - if(T_ENABLED AND NOT T_DISABLED) - set(${OUTPUT} ON) - else() - # set(${PREFIX}DISABLE_${FEATURE} ON CACHE INTERNAL "" FORCE) - set(${OUTPUT} OFF) - endif() -endmacro() - -macro(set_feature_disabled FEATURE DISABLED) - set(${PREFIX}DISABLE_${FEATURE} ${DISABLED} CACHE INTERNAL "" FORCE) -endmacro() - -function(feature_frontend RESOLVE) - is_feature_enabled(FRONTEND T_CHECK) - if(RESOLVE AND T_CHECK) - if(NOT (Qt6_FOUND OR Qt5_FOUND)) - message(WARNING "Front-End requires Qt. Disabling...") - set_feature_disabled(FRONTEND ON) - elseif(NOT obs-frontend-api_FOUND) - message(WARNING "Front-End requires OBS FrontEnd API. Disabling...") - set_feature_disabled(FRONTEND ON) - elseif(NOT HAVE_JSON) - message(WARNING "Front-End requires nlohmann::json. Disabling...") - set_feature_disabled(FRONTEND ON) - endif() - elseif(T_CHECK) - set(REQUIRE_QT ON PARENT_SCOPE) - set(REQUIRE_OBS_FRONTEND_API ON PARENT_SCOPE) - set(REQUIRE_JSON ON PARENT_SCOPE) - endif() -endfunction() - -function(feature_updater RESOLVE) - is_feature_enabled(UPDATER T_CHECK) - if(RESOLVE AND T_CHECK) - if(NOT CURL_FOUND) - message(WARNING "Updater requires CURL. Disabling...") - set_feature_disabled(UPDATER ON) - elseif(NOT HAVE_JSON) - message(WARNING "Updater requires nlohmann::json. Disabling...") - set_feature_disabled(UPDATER ON) - endif() - elseif(T_CHECK) - set(REQUIRE_CURL ON PARENT_SCOPE) - set(REQUIRE_JSON ON PARENT_SCOPE) - endif() -endfunction() - -# Set Requirements -feature_frontend(OFF) -feature_updater(OFF) - -# Fulfill Requirements #- OBS: Library if(STANDALONE) find_package("libobs" REQUIRED CONFIG) @@ -483,35 +413,25 @@ if(D_PLATFORM_MAC) endif() #- OBS: Front-End API -set(obs-frontend-api_FOUND OFF) -if(REQUIRE_OBS_FRONTEND_API) - if(STANDALONE) - find_package("obs-frontend-api" CONFIG) - set(obs-frontend-api_FOUND "${obs-frontend-api_FOUND}") - elseif(TARGET obs-frontend-api) - set(obs-frontend-api_FOUND ON) - endif() - if(NOT TARGET OBS::obs-frontend-api) - add_library(OBS::obs-frontend-api ALIAS obs-frontend-api) - endif() +if(STANDALONE) + find_package("obs-frontend-api" CONFIG) + set(obs-frontend-api_FOUND "${obs-frontend-api_FOUND}") +elseif(TARGET obs-frontend-api) + set(obs-frontend-api_FOUND ON) +endif() +if(NOT TARGET OBS::obs-frontend-api) + add_library(OBS::obs-frontend-api ALIAS obs-frontend-api) endif() #- CURL -set(CURL_FOUND OFF) -if(REQUIRE_CURL) - find_package("CURL") -endif() +find_package("CURL") #- JSON -set(HAVE_JSON OFF) -if(REQUIRE_JSON) - if(NOT EXISTS "${PROJECT_SOURCE_DIR}/third-party/nlohmann-json/single_include") - message(FATAL_ERROR "Please make sure to update git submodules to their latest supported version.") - return() - else() - set(JSON_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/third-party/nlohmann-json/single_include") - set(HAVE_JSON ON) - endif() +if(NOT EXISTS "${PROJECT_SOURCE_DIR}/third-party/nlohmann-json/single_include") + message(FATAL_ERROR "Please make sure to update git submodules to their latest supported version.") + return() +else() + set(JSON_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/third-party/nlohmann-json/single_include") endif() #- NVIDIA Augmented Reality SDK @@ -556,31 +476,11 @@ if(REQUIRE_NVIDIA_CUDA AND D_PLATFORM_WINDOWS) set(HAVE_NVIDIA_CUDA ON) endif() -#- Qt -if(REQUIRE_QT) - # Try Qt6 first... - find_package("Qt6" - COMPONENTS Core Gui Widgets - CONFIG - ) - - # If Qt6 isn't present, try Qt5 - if(NOT Qt6_FOUND) - find_package("Qt5" - COMPONENTS Core Gui Widgets - CONFIG - ) - endif() - if(Qt6_FOUND) - message(STATUS "Using Qt6.") - elseif(Qt5_FOUND) - message(STATUS "Using Qt5.") - endif() -endif() - -# Verify Requirements -feature_frontend(ON) -feature_updater(ON) +#- Qt 6 +find_package("Qt6" + COMPONENTS Core Gui Widgets + CONFIG +) ################################################################################ # Code @@ -629,18 +529,14 @@ LIST(APPEND PROJECT_PRIVATE_GENERATED "${PROJECT_BINARY_DIR}/generated/module.cp # Minimum Dependencies list(APPEND PROJECT_LIBRARIES OBS::libobs) -# Components -if(CURL_FOUND) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/util/util-curl.hpp" - "source/util/util-curl.cpp" - ) - list(APPEND PROJECT_LIBRARIES CURL::libcurl) -endif() +# Dependencies +list(APPEND PROJECT_PRIVATE_SOURCE + "source/util/util-curl.hpp" + "source/util/util-curl.cpp" +) +list(APPEND PROJECT_LIBRARIES CURL::libcurl) -if(HAVE_JSON) - list(APPEND PROJECT_INCLUDE_DIRS ${JSON_INCLUDE_DIR}) -endif() +list(APPEND PROJECT_INCLUDE_DIRS ${JSON_INCLUDE_DIR}) if(TRUE) # OpenGL if(NOT TARGET khronos_glad) @@ -737,20 +633,12 @@ if(HAVE_NVIDIA_CUDA) ) endif() -if(REQUIRE_OBS_FRONTEND_API AND obs-frontend-api_FOUND) - list(APPEND PROJECT_LIBRARIES OBS::obs-frontend-api) - list(APPEND PROJECT_UI_SOURCE - "source/obs/browser/obs-browser-panel.hpp" - ) -endif() +list(APPEND PROJECT_LIBRARIES OBS::obs-frontend-api) +list(APPEND PROJECT_UI_SOURCE + "source/obs/browser/obs-browser-panel.hpp" +) -if(REQUIRE_QT) - if(Qt5_FOUND) - list(APPEND PROJECT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets) - elseif(Qt6_FOUND) - list(APPEND PROJECT_LIBRARIES Qt6::Core Qt6::Gui Qt6::Widgets) - endif() -endif() +list(APPEND PROJECT_LIBRARIES Qt6::Core Qt6::Gui Qt6::Widgets) ################################################################################ # Features @@ -850,66 +738,51 @@ list(APPEND PROJECT_INCLUDE_DIRS ) # Profiling -is_feature_enabled(PROFILING T_CHECK) -if(T_CHECK) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/util/util-profiler.cpp" - "source/util/util-profiler.hpp" - ) - list(APPEND PROJECT_DEFINITIONS - ENABLE_PROFILING - ) -endif() +list(APPEND PROJECT_PRIVATE_SOURCE + "source/util/util-profiler.cpp" + "source/util/util-profiler.hpp" +) # Updater -is_feature_enabled(UPDATER T_CHECK) -if(T_CHECK) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/updater.hpp" - "source/updater.cpp" - ) - list(APPEND PROJECT_DEFINITIONS - ENABLE_UPDATER - ) -endif() +list(APPEND PROJECT_PRIVATE_SOURCE + "source/updater.hpp" + "source/updater.cpp" +) +list(APPEND PROJECT_DEFINITIONS + ENABLE_UPDATER +) # Frontend -is_feature_enabled(FRONTEND T_CHECK) -if(T_CHECK) - list(APPEND PROJECT_UI - "ui/streamfx.qrc" - "ui/about.ui" - "ui/about-entry.ui" - ) - list(APPEND PROJECT_UI_SOURCE - "source/ui/ui-common.hpp" - "source/ui/ui.hpp" - "source/ui/ui.cpp" - "source/ui/ui-about.hpp" - "source/ui/ui-about.cpp" - "source/ui/ui-about-entry.hpp" - "source/ui/ui-about-entry.cpp" - "source/ui/ui-obs-browser-widget.hpp" - "source/ui/ui-obs-browser-widget.cpp" - ) - list(APPEND PROJECT_INCLUDE_DIRS - "source/ui" - ) - list(APPEND PROJECT_DEFINITIONS - ENABLE_FRONTEND - ) +list(APPEND PROJECT_UI + "ui/streamfx.qrc" + "ui/about.ui" + "ui/about-entry.ui" +) +list(APPEND PROJECT_UI_SOURCE + "source/ui/ui-common.hpp" + "source/ui/ui.hpp" + "source/ui/ui.cpp" + "source/ui/ui-about.hpp" + "source/ui/ui-about.cpp" + "source/ui/ui-about-entry.hpp" + "source/ui/ui-about-entry.cpp" + "source/ui/ui-obs-browser-widget.hpp" + "source/ui/ui-obs-browser-widget.cpp" +) +list(APPEND PROJECT_INCLUDE_DIRS + "source/ui" +) +list(APPEND PROJECT_DEFINITIONS + ENABLE_FRONTEND +) - is_feature_enabled(UPDATER T_CHECK) - if(T_CHECK) - list(APPEND PROJECT_UI_SOURCE - "source/ui/ui-updater.hpp" - "source/ui/ui-updater.cpp" - ) - list(APPEND PROJECT_UI - "ui/updater.ui" - ) - endif() -endif() +list(APPEND PROJECT_UI_SOURCE + "source/ui/ui-updater.hpp" + "source/ui/ui-updater.cpp" +) +list(APPEND PROJECT_UI + "ui/updater.ui" +) ################################################################################ # Parts @@ -1561,23 +1434,21 @@ set_source_files_properties(${PROJECT_DATA} ${PROJECT_TEMPLATES} ${PROJECT_UI} $ ) # Enable Qt if needed -if(Qt5_Found OR Qt6_FOUND) - set_target_properties(StreamFX_Core PROPERTIES - AUTOUIC ON - AUTOUIC_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_SOURCE_DIR}/ui" - AUTOMOC ON - AUTORCC ON - AUTOGEN_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated" - ) +set_target_properties(StreamFX_Core PROPERTIES + AUTOUIC ON + AUTOUIC_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_SOURCE_DIR}/ui" + AUTOMOC ON + AUTORCC ON + AUTOGEN_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated" +) - # Prevent non-UI files from being Qt'd - set_source_files_properties(${PROJECT_DATA} ${PROJECT_TEMPLATES} ${PROJECT_MEDIA} ${PROJECT_PRIVATE_GENERATED} ${PROJECT_PRIVATE_SOURCE} PROPERTIES - SKIP_AUTOGEN ON - SKIP_AUTOMOC ON - SKIP_AUTORCC ON - SKIP_AUTOUIC ON - ) -endif() +# Prevent non-UI files from being Qt'd +set_source_files_properties(${PROJECT_DATA} ${PROJECT_TEMPLATES} ${PROJECT_MEDIA} ${PROJECT_PRIVATE_GENERATED} ${PROJECT_PRIVATE_SOURCE} PROPERTIES + SKIP_AUTOGEN ON + SKIP_AUTOMOC ON + SKIP_AUTORCC ON + SKIP_AUTOUIC ON +) target_sources(StreamFX_Core PRIVATE ${PROJECT_FILES}) From 090f49d3c886b584539763cea358f5cbb93e384a Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 01:40:32 +0200 Subject: [PATCH 33/66] Add NVIDIA Maxine Audio Effects SDK as a third party dependency --- .gitmodules | 3 +++ third-party/nvidia-maxine-afx-sdk | 1 + 2 files changed, 4 insertions(+) create mode 160000 third-party/nvidia-maxine-afx-sdk diff --git a/.gitmodules b/.gitmodules index ece048a67f..d8a13cae99 100644 --- a/.gitmodules +++ b/.gitmodules @@ -23,3 +23,6 @@ [submodule "third-party/obs-studio"] path = third-party/obs-studio url = https://github.com/obsproject/obs-studio.git +[submodule "third-party/nvidia-maxine-afx-sdk"] + path = third-party/nvidia-maxine-afx-sdk + url = https://github.com/NVIDIA/MAXINE-AFX-SDK.git diff --git a/third-party/nvidia-maxine-afx-sdk b/third-party/nvidia-maxine-afx-sdk new file mode 160000 index 0000000000..4d4ed8d8ac --- /dev/null +++ b/third-party/nvidia-maxine-afx-sdk @@ -0,0 +1 @@ +Subproject commit 4d4ed8d8aca914f4dbf8570f1626cf4108e19bb4 From 7c887c06e82a738b0a4893fc31782a3d50e844b6 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 01:42:47 +0200 Subject: [PATCH 34/66] nvidia: Move into its own component This component enables interactivity with NVIDIA libraries. Currently this is limited to NVIDIA Maxine only. --- CMakeLists.txt | 105 ------------------ components/nvidia/CMakeLists.txt | 44 ++++++++ .../nvidia/ar/nvidia-ar-facedetection.cpp | 0 .../nvidia/ar/nvidia-ar-facedetection.hpp | 0 .../source}/nvidia/ar/nvidia-ar-feature.cpp | 0 .../source}/nvidia/ar/nvidia-ar-feature.hpp | 0 .../nvidia/source}/nvidia/ar/nvidia-ar.cpp | 0 .../nvidia/source}/nvidia/ar/nvidia-ar.hpp | 0 .../nvidia/cuda/nvidia-cuda-context.cpp | 0 .../nvidia/cuda/nvidia-cuda-context.hpp | 0 .../nvidia/cuda/nvidia-cuda-gs-texture.cpp | 0 .../nvidia/cuda/nvidia-cuda-gs-texture.hpp | 0 .../nvidia/cuda/nvidia-cuda-memory.cpp | 0 .../nvidia/cuda/nvidia-cuda-memory.hpp | 0 .../source}/nvidia/cuda/nvidia-cuda-obs.cpp | 0 .../source}/nvidia/cuda/nvidia-cuda-obs.hpp | 0 .../nvidia/cuda/nvidia-cuda-stream.cpp | 0 .../nvidia/cuda/nvidia-cuda-stream.hpp | 0 .../source}/nvidia/cuda/nvidia-cuda.cpp | 0 .../source}/nvidia/cuda/nvidia-cuda.hpp | 0 .../source}/nvidia/cv/nvidia-cv-image.cpp | 0 .../source}/nvidia/cv/nvidia-cv-image.hpp | 0 .../source}/nvidia/cv/nvidia-cv-texture.cpp | 0 .../source}/nvidia/cv/nvidia-cv-texture.hpp | 0 .../nvidia/source}/nvidia/cv/nvidia-cv.cpp | 0 .../nvidia/source}/nvidia/cv/nvidia-cv.hpp | 0 .../nvidia/vfx/nvidia-vfx-denoising.cpp | 0 .../nvidia/vfx/nvidia-vfx-denoising.hpp | 0 .../source}/nvidia/vfx/nvidia-vfx-effect.cpp | 0 .../source}/nvidia/vfx/nvidia-vfx-effect.hpp | 0 .../nvidia/vfx/nvidia-vfx-greenscreen.cpp | 0 .../nvidia/vfx/nvidia-vfx-greenscreen.hpp | 0 .../nvidia/vfx/nvidia-vfx-superresolution.cpp | 0 .../nvidia/vfx/nvidia-vfx-superresolution.hpp | 0 .../nvidia/source}/nvidia/vfx/nvidia-vfx.cpp | 0 .../nvidia/source}/nvidia/vfx/nvidia-vfx.hpp | 0 36 files changed, 44 insertions(+), 105 deletions(-) create mode 100644 components/nvidia/CMakeLists.txt rename {source => components/nvidia/source}/nvidia/ar/nvidia-ar-facedetection.cpp (100%) rename {source => components/nvidia/source}/nvidia/ar/nvidia-ar-facedetection.hpp (100%) rename {source => components/nvidia/source}/nvidia/ar/nvidia-ar-feature.cpp (100%) rename {source => components/nvidia/source}/nvidia/ar/nvidia-ar-feature.hpp (100%) rename {source => components/nvidia/source}/nvidia/ar/nvidia-ar.cpp (100%) rename {source => components/nvidia/source}/nvidia/ar/nvidia-ar.hpp (100%) rename {source => components/nvidia/source}/nvidia/cuda/nvidia-cuda-context.cpp (100%) rename {source => components/nvidia/source}/nvidia/cuda/nvidia-cuda-context.hpp (100%) rename {source => components/nvidia/source}/nvidia/cuda/nvidia-cuda-gs-texture.cpp (100%) rename {source => components/nvidia/source}/nvidia/cuda/nvidia-cuda-gs-texture.hpp (100%) rename {source => components/nvidia/source}/nvidia/cuda/nvidia-cuda-memory.cpp (100%) rename {source => components/nvidia/source}/nvidia/cuda/nvidia-cuda-memory.hpp (100%) rename {source => components/nvidia/source}/nvidia/cuda/nvidia-cuda-obs.cpp (100%) rename {source => components/nvidia/source}/nvidia/cuda/nvidia-cuda-obs.hpp (100%) rename {source => components/nvidia/source}/nvidia/cuda/nvidia-cuda-stream.cpp (100%) rename {source => components/nvidia/source}/nvidia/cuda/nvidia-cuda-stream.hpp (100%) rename {source => components/nvidia/source}/nvidia/cuda/nvidia-cuda.cpp (100%) rename {source => components/nvidia/source}/nvidia/cuda/nvidia-cuda.hpp (100%) rename {source => components/nvidia/source}/nvidia/cv/nvidia-cv-image.cpp (100%) rename {source => components/nvidia/source}/nvidia/cv/nvidia-cv-image.hpp (100%) rename {source => components/nvidia/source}/nvidia/cv/nvidia-cv-texture.cpp (100%) rename {source => components/nvidia/source}/nvidia/cv/nvidia-cv-texture.hpp (100%) rename {source => components/nvidia/source}/nvidia/cv/nvidia-cv.cpp (100%) rename {source => components/nvidia/source}/nvidia/cv/nvidia-cv.hpp (100%) rename {source => components/nvidia/source}/nvidia/vfx/nvidia-vfx-denoising.cpp (100%) rename {source => components/nvidia/source}/nvidia/vfx/nvidia-vfx-denoising.hpp (100%) rename {source => components/nvidia/source}/nvidia/vfx/nvidia-vfx-effect.cpp (100%) rename {source => components/nvidia/source}/nvidia/vfx/nvidia-vfx-effect.hpp (100%) rename {source => components/nvidia/source}/nvidia/vfx/nvidia-vfx-greenscreen.cpp (100%) rename {source => components/nvidia/source}/nvidia/vfx/nvidia-vfx-greenscreen.hpp (100%) rename {source => components/nvidia/source}/nvidia/vfx/nvidia-vfx-superresolution.cpp (100%) rename {source => components/nvidia/source}/nvidia/vfx/nvidia-vfx-superresolution.hpp (100%) rename {source => components/nvidia/source}/nvidia/vfx/nvidia-vfx.cpp (100%) rename {source => components/nvidia/source}/nvidia/vfx/nvidia-vfx.hpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 55b0a94d63..1b8446dca5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -434,48 +434,6 @@ else() set(JSON_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/third-party/nlohmann-json/single_include") endif() -#- NVIDIA Augmented Reality SDK -set(HAVE_NVIDIA_AR_SDK OFF) -if(REQUIRE_NVIDIA_AR_SDK AND D_PLATFORM_WINDOWS) - if(EXISTS "${PROJECT_SOURCE_DIR}/third-party/nvidia-maxine-ar-sdk/version.h") - set(HAVE_NVIDIA_AR_SDK ON) - endif() - - if(NOT TARGET NVIDIA::AR) - add_library(NVIDIA::AR IMPORTED INTERFACE) - target_include_directories(NVIDIA::AR - INTERFACE - "${PROJECT_SOURCE_DIR}/third-party/nvidia-maxine-ar-sdk/nvar/include/" - "${PROJECT_SOURCE_DIR}/third-party/nvidia-maxine-ar-sdk/nvar/src/" - ) - endif() -endif() - -#- NVIDIA Video Effects SDK -set(HAVE_NVIDIA_VFX_SDK OFF) -if(REQUIRE_NVIDIA_VFX_SDK AND D_PLATFORM_WINDOWS) - if(EXISTS "${PROJECT_SOURCE_DIR}/third-party/nvidia-maxine-vfx-sdk/version.h") - set(HAVE_NVIDIA_VFX_SDK ON) - endif() - - if(NOT TARGET NVIDIA::VFX) - add_library(NVIDIA::VFX IMPORTED INTERFACE) - target_include_directories(NVIDIA::VFX - INTERFACE - "${PROJECT_SOURCE_DIR}/third-party/nvidia-maxine-vfx-sdk/nvvfx/include/" - "${PROJECT_SOURCE_DIR}/third-party/nvidia-maxine-vfx-sdk/nvvfx/src/" - ) - endif() - - set(REQUIRE_NVIDIA_CUDA ON) -endif() - -#- NVIDIA CUDA (Windows) -set(HAVE_NVIDIA_CUDA OFF) -if(REQUIRE_NVIDIA_CUDA AND D_PLATFORM_WINDOWS) - set(HAVE_NVIDIA_CUDA ON) -endif() - #- Qt 6 find_package("Qt6" COMPONENTS Core Gui Widgets @@ -570,69 +528,6 @@ if(TRUE) # OpenGL list(APPEND PROJECT_LIBRARIES khronos_glad) endif() -if(HAVE_NVIDIA_VFX_SDK OR HAVE_NVIDIA_AR_SDK) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/nvidia/cv/nvidia-cv.hpp" - "source/nvidia/cv/nvidia-cv.cpp" - "source/nvidia/cv/nvidia-cv-image.hpp" - "source/nvidia/cv/nvidia-cv-image.cpp" - "source/nvidia/cv/nvidia-cv-texture.hpp" - "source/nvidia/cv/nvidia-cv-texture.cpp" - ) -endif() - -if(HAVE_NVIDIA_AR_SDK) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/nvidia/ar/nvidia-ar.hpp" - "source/nvidia/ar/nvidia-ar.cpp" - "source/nvidia/ar/nvidia-ar-feature.hpp" - "source/nvidia/ar/nvidia-ar-feature.cpp" - "source/nvidia/ar/nvidia-ar-facedetection.hpp" - "source/nvidia/ar/nvidia-ar-facedetection.cpp" - ) - list(APPEND PROJECT_LIBRARIES - NVIDIA::AR - ) -endif() - -if(HAVE_NVIDIA_VFX_SDK) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/nvidia/vfx/nvidia-vfx.hpp" - "source/nvidia/vfx/nvidia-vfx.cpp" - "source/nvidia/vfx/nvidia-vfx-denoising.hpp" - "source/nvidia/vfx/nvidia-vfx-denoising.cpp" - "source/nvidia/vfx/nvidia-vfx-effect.hpp" - "source/nvidia/vfx/nvidia-vfx-effect.cpp" - "source/nvidia/vfx/nvidia-vfx-greenscreen.hpp" - "source/nvidia/vfx/nvidia-vfx-greenscreen.cpp" - "source/nvidia/vfx/nvidia-vfx-superresolution.hpp" - "source/nvidia/vfx/nvidia-vfx-superresolution.cpp" - ) - list(APPEND PROJECT_LIBRARIES - NVIDIA::VFX - ) -endif() - -if(HAVE_NVIDIA_CUDA) - list(APPEND PROJECT_PRIVATE_SOURCE - "source/nvidia/cuda/nvidia-cuda.hpp" - "source/nvidia/cuda/nvidia-cuda.cpp" - "source/nvidia/cuda/nvidia-cuda-obs.hpp" - "source/nvidia/cuda/nvidia-cuda-obs.cpp" - "source/nvidia/cuda/nvidia-cuda-context.hpp" - "source/nvidia/cuda/nvidia-cuda-context.cpp" - "source/nvidia/cuda/nvidia-cuda-gs-texture.hpp" - "source/nvidia/cuda/nvidia-cuda-gs-texture.cpp" - "source/nvidia/cuda/nvidia-cuda-memory.hpp" - "source/nvidia/cuda/nvidia-cuda-memory.cpp" - "source/nvidia/cuda/nvidia-cuda-stream.hpp" - "source/nvidia/cuda/nvidia-cuda-stream.cpp" - ) - list(APPEND PROJECT_DEFINITIONS - ENABLE_NVIDIA_CUDA - ) -endif() - list(APPEND PROJECT_LIBRARIES OBS::obs-frontend-api) list(APPEND PROJECT_UI_SOURCE "source/obs/browser/obs-browser-panel.hpp" diff --git a/components/nvidia/CMakeLists.txt b/components/nvidia/CMakeLists.txt new file mode 100644 index 0000000000..2dfeb5f0d7 --- /dev/null +++ b/components/nvidia/CMakeLists.txt @@ -0,0 +1,44 @@ +## AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER END +cmake_minimum_required(VERSION 3.26) +project("NVIDIA") +list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") + +streamfx_add_component("NVIDIA") + +#- NVIDIA Audio Effects SDK +if(NOT TARGET NVIDIA::AFX) + add_library(NVIDIA::AFX IMPORTED INTERFACE) + target_include_directories(NVIDIA::AFX + INTERFACE + "${StreamFX_SOURCE_DIR}/third-party/nvidia-maxine-afx-sdk/nvafx/include/" + ) +endif() + +#- NVIDIA Augmented Reality SDK +if(NOT TARGET NVIDIA::AR) + add_library(NVIDIA::AR IMPORTED INTERFACE) + target_include_directories(NVIDIA::AR + INTERFACE + "${StreamFX_SOURCE_DIR}/third-party/nvidia-maxine-ar-sdk/nvar/include/" + "${StreamFX_SOURCE_DIR}/third-party/nvidia-maxine-ar-sdk/nvar/src/" + ) +endif() + +#- NVIDIA Video Effects SDK +if(NOT TARGET NVIDIA::VFX) + add_library(NVIDIA::VFX IMPORTED INTERFACE) + target_include_directories(NVIDIA::VFX + INTERFACE + "${StreamFX_SOURCE_DIR}/third-party/nvidia-maxine-vfx-sdk/nvvfx/include/" + "${StreamFX_SOURCE_DIR}/third-party/nvidia-maxine-vfx-sdk/nvvfx/src/" + ) +endif() + +target_link_libraries(${COMPONENT_TARGET} + PRIVATE + NVIDIA::AFX + NVIDIA::AR + NVIDIA::VFX +) diff --git a/source/nvidia/ar/nvidia-ar-facedetection.cpp b/components/nvidia/source/nvidia/ar/nvidia-ar-facedetection.cpp similarity index 100% rename from source/nvidia/ar/nvidia-ar-facedetection.cpp rename to components/nvidia/source/nvidia/ar/nvidia-ar-facedetection.cpp diff --git a/source/nvidia/ar/nvidia-ar-facedetection.hpp b/components/nvidia/source/nvidia/ar/nvidia-ar-facedetection.hpp similarity index 100% rename from source/nvidia/ar/nvidia-ar-facedetection.hpp rename to components/nvidia/source/nvidia/ar/nvidia-ar-facedetection.hpp diff --git a/source/nvidia/ar/nvidia-ar-feature.cpp b/components/nvidia/source/nvidia/ar/nvidia-ar-feature.cpp similarity index 100% rename from source/nvidia/ar/nvidia-ar-feature.cpp rename to components/nvidia/source/nvidia/ar/nvidia-ar-feature.cpp diff --git a/source/nvidia/ar/nvidia-ar-feature.hpp b/components/nvidia/source/nvidia/ar/nvidia-ar-feature.hpp similarity index 100% rename from source/nvidia/ar/nvidia-ar-feature.hpp rename to components/nvidia/source/nvidia/ar/nvidia-ar-feature.hpp diff --git a/source/nvidia/ar/nvidia-ar.cpp b/components/nvidia/source/nvidia/ar/nvidia-ar.cpp similarity index 100% rename from source/nvidia/ar/nvidia-ar.cpp rename to components/nvidia/source/nvidia/ar/nvidia-ar.cpp diff --git a/source/nvidia/ar/nvidia-ar.hpp b/components/nvidia/source/nvidia/ar/nvidia-ar.hpp similarity index 100% rename from source/nvidia/ar/nvidia-ar.hpp rename to components/nvidia/source/nvidia/ar/nvidia-ar.hpp diff --git a/source/nvidia/cuda/nvidia-cuda-context.cpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-context.cpp similarity index 100% rename from source/nvidia/cuda/nvidia-cuda-context.cpp rename to components/nvidia/source/nvidia/cuda/nvidia-cuda-context.cpp diff --git a/source/nvidia/cuda/nvidia-cuda-context.hpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-context.hpp similarity index 100% rename from source/nvidia/cuda/nvidia-cuda-context.hpp rename to components/nvidia/source/nvidia/cuda/nvidia-cuda-context.hpp diff --git a/source/nvidia/cuda/nvidia-cuda-gs-texture.cpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-gs-texture.cpp similarity index 100% rename from source/nvidia/cuda/nvidia-cuda-gs-texture.cpp rename to components/nvidia/source/nvidia/cuda/nvidia-cuda-gs-texture.cpp diff --git a/source/nvidia/cuda/nvidia-cuda-gs-texture.hpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-gs-texture.hpp similarity index 100% rename from source/nvidia/cuda/nvidia-cuda-gs-texture.hpp rename to components/nvidia/source/nvidia/cuda/nvidia-cuda-gs-texture.hpp diff --git a/source/nvidia/cuda/nvidia-cuda-memory.cpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-memory.cpp similarity index 100% rename from source/nvidia/cuda/nvidia-cuda-memory.cpp rename to components/nvidia/source/nvidia/cuda/nvidia-cuda-memory.cpp diff --git a/source/nvidia/cuda/nvidia-cuda-memory.hpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-memory.hpp similarity index 100% rename from source/nvidia/cuda/nvidia-cuda-memory.hpp rename to components/nvidia/source/nvidia/cuda/nvidia-cuda-memory.hpp diff --git a/source/nvidia/cuda/nvidia-cuda-obs.cpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-obs.cpp similarity index 100% rename from source/nvidia/cuda/nvidia-cuda-obs.cpp rename to components/nvidia/source/nvidia/cuda/nvidia-cuda-obs.cpp diff --git a/source/nvidia/cuda/nvidia-cuda-obs.hpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-obs.hpp similarity index 100% rename from source/nvidia/cuda/nvidia-cuda-obs.hpp rename to components/nvidia/source/nvidia/cuda/nvidia-cuda-obs.hpp diff --git a/source/nvidia/cuda/nvidia-cuda-stream.cpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-stream.cpp similarity index 100% rename from source/nvidia/cuda/nvidia-cuda-stream.cpp rename to components/nvidia/source/nvidia/cuda/nvidia-cuda-stream.cpp diff --git a/source/nvidia/cuda/nvidia-cuda-stream.hpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-stream.hpp similarity index 100% rename from source/nvidia/cuda/nvidia-cuda-stream.hpp rename to components/nvidia/source/nvidia/cuda/nvidia-cuda-stream.hpp diff --git a/source/nvidia/cuda/nvidia-cuda.cpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda.cpp similarity index 100% rename from source/nvidia/cuda/nvidia-cuda.cpp rename to components/nvidia/source/nvidia/cuda/nvidia-cuda.cpp diff --git a/source/nvidia/cuda/nvidia-cuda.hpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda.hpp similarity index 100% rename from source/nvidia/cuda/nvidia-cuda.hpp rename to components/nvidia/source/nvidia/cuda/nvidia-cuda.hpp diff --git a/source/nvidia/cv/nvidia-cv-image.cpp b/components/nvidia/source/nvidia/cv/nvidia-cv-image.cpp similarity index 100% rename from source/nvidia/cv/nvidia-cv-image.cpp rename to components/nvidia/source/nvidia/cv/nvidia-cv-image.cpp diff --git a/source/nvidia/cv/nvidia-cv-image.hpp b/components/nvidia/source/nvidia/cv/nvidia-cv-image.hpp similarity index 100% rename from source/nvidia/cv/nvidia-cv-image.hpp rename to components/nvidia/source/nvidia/cv/nvidia-cv-image.hpp diff --git a/source/nvidia/cv/nvidia-cv-texture.cpp b/components/nvidia/source/nvidia/cv/nvidia-cv-texture.cpp similarity index 100% rename from source/nvidia/cv/nvidia-cv-texture.cpp rename to components/nvidia/source/nvidia/cv/nvidia-cv-texture.cpp diff --git a/source/nvidia/cv/nvidia-cv-texture.hpp b/components/nvidia/source/nvidia/cv/nvidia-cv-texture.hpp similarity index 100% rename from source/nvidia/cv/nvidia-cv-texture.hpp rename to components/nvidia/source/nvidia/cv/nvidia-cv-texture.hpp diff --git a/source/nvidia/cv/nvidia-cv.cpp b/components/nvidia/source/nvidia/cv/nvidia-cv.cpp similarity index 100% rename from source/nvidia/cv/nvidia-cv.cpp rename to components/nvidia/source/nvidia/cv/nvidia-cv.cpp diff --git a/source/nvidia/cv/nvidia-cv.hpp b/components/nvidia/source/nvidia/cv/nvidia-cv.hpp similarity index 100% rename from source/nvidia/cv/nvidia-cv.hpp rename to components/nvidia/source/nvidia/cv/nvidia-cv.hpp diff --git a/source/nvidia/vfx/nvidia-vfx-denoising.cpp b/components/nvidia/source/nvidia/vfx/nvidia-vfx-denoising.cpp similarity index 100% rename from source/nvidia/vfx/nvidia-vfx-denoising.cpp rename to components/nvidia/source/nvidia/vfx/nvidia-vfx-denoising.cpp diff --git a/source/nvidia/vfx/nvidia-vfx-denoising.hpp b/components/nvidia/source/nvidia/vfx/nvidia-vfx-denoising.hpp similarity index 100% rename from source/nvidia/vfx/nvidia-vfx-denoising.hpp rename to components/nvidia/source/nvidia/vfx/nvidia-vfx-denoising.hpp diff --git a/source/nvidia/vfx/nvidia-vfx-effect.cpp b/components/nvidia/source/nvidia/vfx/nvidia-vfx-effect.cpp similarity index 100% rename from source/nvidia/vfx/nvidia-vfx-effect.cpp rename to components/nvidia/source/nvidia/vfx/nvidia-vfx-effect.cpp diff --git a/source/nvidia/vfx/nvidia-vfx-effect.hpp b/components/nvidia/source/nvidia/vfx/nvidia-vfx-effect.hpp similarity index 100% rename from source/nvidia/vfx/nvidia-vfx-effect.hpp rename to components/nvidia/source/nvidia/vfx/nvidia-vfx-effect.hpp diff --git a/source/nvidia/vfx/nvidia-vfx-greenscreen.cpp b/components/nvidia/source/nvidia/vfx/nvidia-vfx-greenscreen.cpp similarity index 100% rename from source/nvidia/vfx/nvidia-vfx-greenscreen.cpp rename to components/nvidia/source/nvidia/vfx/nvidia-vfx-greenscreen.cpp diff --git a/source/nvidia/vfx/nvidia-vfx-greenscreen.hpp b/components/nvidia/source/nvidia/vfx/nvidia-vfx-greenscreen.hpp similarity index 100% rename from source/nvidia/vfx/nvidia-vfx-greenscreen.hpp rename to components/nvidia/source/nvidia/vfx/nvidia-vfx-greenscreen.hpp diff --git a/source/nvidia/vfx/nvidia-vfx-superresolution.cpp b/components/nvidia/source/nvidia/vfx/nvidia-vfx-superresolution.cpp similarity index 100% rename from source/nvidia/vfx/nvidia-vfx-superresolution.cpp rename to components/nvidia/source/nvidia/vfx/nvidia-vfx-superresolution.cpp diff --git a/source/nvidia/vfx/nvidia-vfx-superresolution.hpp b/components/nvidia/source/nvidia/vfx/nvidia-vfx-superresolution.hpp similarity index 100% rename from source/nvidia/vfx/nvidia-vfx-superresolution.hpp rename to components/nvidia/source/nvidia/vfx/nvidia-vfx-superresolution.hpp diff --git a/source/nvidia/vfx/nvidia-vfx.cpp b/components/nvidia/source/nvidia/vfx/nvidia-vfx.cpp similarity index 100% rename from source/nvidia/vfx/nvidia-vfx.cpp rename to components/nvidia/source/nvidia/vfx/nvidia-vfx.cpp diff --git a/source/nvidia/vfx/nvidia-vfx.hpp b/components/nvidia/source/nvidia/vfx/nvidia-vfx.hpp similarity index 100% rename from source/nvidia/vfx/nvidia-vfx.hpp rename to components/nvidia/source/nvidia/vfx/nvidia-vfx.hpp From 434936baf61a4c730c10a410a22630ba8bcd09ba Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 01:43:44 +0200 Subject: [PATCH 35/66] Split Find/Resolve/Link component discovery stages --- CMakeLists.txt | 45 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b8446dca5..8f3d61c415 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1354,17 +1354,18 @@ target_sources(StreamFX_Core PRIVATE ${PROJECT_FILES}) # for an improved system which suffers under less issues. This new component # system should address the main necessary parts, +#- Registration file(GLOB COMPONENTS RELATIVE ${PROJECT_SOURCE_DIR} CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/components/*) foreach(COMPONENT ${COMPONENTS}) - add_subdirectory(${COMPONENT} EXCLUDE_FROM_ALL) + # Ignore directories with no CMakeLists.txt + if(EXISTS "${PROJECT_SOURCE_DIR}/${COMPONENT}/CMakeLists.txt") + add_subdirectory(${COMPONENT} EXCLUDE_FROM_ALL) + endif() endforeach() -################################################################################ -# Resolve Components -################################################################################ -target_link_libraries(StreamFX PRIVATE $) - get_target_property(_DEPENDS StreamFX COMPONENT_DEPENDS) + +#- Resolving if(_DEPENDS) foreach(COMPONENT ${_DEPENDS}) # If the component doesn't exist, skip it. @@ -1378,17 +1379,15 @@ if(_DEPENDS) # If the component is disabled, skip it. get_target_property(_OPTION ${COMPONENT} COMPONENT_OPTION) if(NOT ${_OPTION}) - message(STATUS "[${_NAME}] Disabled by developer.") continue() elseif(${_OPTION}_DISABLED) - message(STATUS "[${_NAME}] Disabled by build script.") continue() endif() # Test if all dependencies are valid. set(_HASDEPENDENCY ON) - get_target_property(_DEPENDS ${COMPONENT} COMPONENT_DEPENDS) - foreach(_DEPEND ${_DEPENDS}) + get_target_property(_CDEPENDS ${COMPONENT} COMPONENT_DEPENDS) + foreach(_DEPEND ${_CDEPENDS}) get_target_property(_DNAME ${COMPONENT} COMPONENT_LABEL) get_target_property(_DOPTION ${COMPONENT} COMPONENT_OPTION) if((NOT ${_DOPTION}) OR (${_DOPTION}_DISABLED)) @@ -1398,7 +1397,30 @@ if(_DEPENDS) endif() endforeach() if(NOT _HASDEPENDENCY) - message(STATUS "[${_NAME}] Disabled due to missing dependencies.") + message(STATUS "[${_NAME}] Missing dependencies, disabling...") + set(${_OPTION}_DISABLED TRUE) + continue() + endif() + endforeach() +endif() + +#- Linking +target_link_libraries(StreamFX PRIVATE $) +if(_DEPENDS) + foreach(COMPONENT ${_DEPENDS}) + if(NOT TARGET ${COMPONENT}) + continue() + endif() + + get_target_property(_NAME ${COMPONENT} COMPONENT_LABEL) + + # If the component is disabled, skip it. + get_target_property(_OPTION ${COMPONENT} COMPONENT_OPTION) + if(NOT ${_OPTION}) + message(STATUS "[${_NAME}] Disabled by developer.") + continue() + elseif(${_OPTION}_DISABLED) + message(STATUS "[${_NAME}] Disabled by build script.") continue() endif() @@ -1408,6 +1430,7 @@ if(_DEPENDS) endforeach() endif() + ################################################################################ # Installation ################################################################################ From a48a32931ab9c27663ee13508cb94e5ab67b4646 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 01:54:48 +0200 Subject: [PATCH 36/66] Update build guide with latest instructiosn --- BUILDING.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 72bdf0096c..a0c4730177 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -8,14 +8,12 @@ This document intends to guide you through the process of building StreamFX. It 2. Follow the [OBS Studio build guide](https://obsproject.com/wiki/install-instructions) for automated building on your platform of choice. - **MacOS:** You will need to use the XCode generator to build StreamFX as the Ninja generator does not support the flags StreamFX requires. 3. Integrate StreamFX into the OBS Studio build flow: - 1. Navigate to either of these directories: - - **With UI:** `/UI/frontend-plugins` - - **Without UI:** `/plugins` + 1. Navigate to `/UI/frontend-plugins` 2. Open a `git` enabled shell (git-bash on windows). 3. Run `git submodule add 'https://github.com/Xaymar/obs-StreamFX.git' streamfx`. 4. Run `git submodule update --init --recursive`. 5. Append the line `add_subdirectory(streamfx)` to the `CMakeLists.txt` file in the same directory. -4. Run the same script(s) from step 2 again. +4. Run the same steps from the build guide in step 2 again. 5. Done. StreamFX is now part of the build. @@ -54,8 +52,8 @@ This document intends to guide you through the process of building StreamFX. It A Node.JS based tool is provided toread and parse the `/third-party/obs-studio/buildspec.json` file. See `/.github/workflows/main.yml` on usage and output parsing. - **MacOS** A Node.JS based tool is provided toread and parse the `/third-party/obs-studio/buildspec.json` file. See `/.github/workflows/main.yml` on usage and output parsing. - - Linux: - - **Debian / Ubuntu:** `sudo apt install qt6-base-dev qt6-base-private-dev libqt6svg6-dev` + - **Debian / Ubuntu:** + `sudo apt install qt6-base-dev qt6-base-private-dev libqt6svg6-dev` - [CURL](https://curl.se/): - **Windows** A Node.JS based tool is provided toread and parse the `/third-party/obs-studio/buildspec.json` file. See `/.github/workflows/main.yml` on usage and output parsing. From 92b93a2479a90579322da11dc5f4387fbefd11d9 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 04:43:09 +0200 Subject: [PATCH 37/66] nvidia: Add optional dependencies to the NVIDIA component --- components/nvidia/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/nvidia/CMakeLists.txt b/components/nvidia/CMakeLists.txt index 2dfeb5f0d7..77848bc441 100644 --- a/components/nvidia/CMakeLists.txt +++ b/components/nvidia/CMakeLists.txt @@ -5,8 +5,6 @@ cmake_minimum_required(VERSION 3.26) project("NVIDIA") list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") -streamfx_add_component("NVIDIA") - #- NVIDIA Audio Effects SDK if(NOT TARGET NVIDIA::AFX) add_library(NVIDIA::AFX IMPORTED INTERFACE) @@ -36,9 +34,15 @@ if(NOT TARGET NVIDIA::VFX) ) endif() +streamfx_add_component("NVIDIA") target_link_libraries(${COMPONENT_TARGET} PRIVATE NVIDIA::AFX NVIDIA::AR NVIDIA::VFX ) + +streamfx_add_component_dependency(Auto-Framing OPTIONAL) +streamfx_add_component_dependency(Denoising OPTIONAL) +streamfx_add_component_dependency(Upscaling OPTIONAL) +streamfx_add_component_dependency("Virtual Greenscreen" OPTIONAL) From 0e913edccfa24c4d8e97b7994dd443e5c9ae14cc Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 04:45:20 +0200 Subject: [PATCH 38/66] Update component logic to support required and optional resolving This allows resolving a dependency tree up to 10 elements deep, but a different solution may be necessary in the future. A better alternative in the future might be to keep a copy of the unresolved entries and then compare every loop, instead of limiting to a fixed number of cycles. This currently doesn't address cyclic dependencies, since I'm not quite sure how those would work with the current model anyway. --- CMakeLists.txt | 264 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 190 insertions(+), 74 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f3d61c415..b5da48166c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -754,6 +754,7 @@ endif() define_property(TARGET PROPERTY COMPONENT_LABEL) define_property(TARGET PROPERTY COMPONENT_NAME) define_property(TARGET PROPERTY COMPONENT_OPTION) +define_property(TARGET PROPERTY COMPONENT_RESOLVER) define_property(TARGET PROPERTY COMPONENT_DEPENDS) function(streamfx_add_library TARGET_NAME TARGET_TYPE) @@ -1025,17 +1026,27 @@ function(streamfx_add_library TARGET_NAME TARGET_TYPE) endif() endfunction() -function(streamfx_add_component COMPONENT_NAME) - # Sanitize the component name by trimming whitespace. - string(REGEX REPLACE "^[ \t]+" "" COMPONENT_NAME "${COMPONENT_NAME}") - string(REGEX REPLACE "[ \t]+$" "" COMPONENT_NAME "${COMPONENT_NAME}") +function(streamfx_sanitize_name TEXT _OUTPUT_NAME _OUTPUT_TARGET _OUTPUT_OPTION) + string(REGEX REPLACE "^[ \t]+" "" TEXT "${TEXT}") + string(REGEX REPLACE "[ \t]+$" "" TEXT "${TEXT}") + string(REGEX REPLACE "[^a-zA-Z0-9_-]+" "_" TEXT2 "${TEXT}") + string(REGEX REPLACE "_[_]+" "_" TEXT2 "${TEXT2}") + string(TOUPPER "${TEXT2}" TEXT3) + + set(${_OUTPUT_NAME} "${TEXT}" PARENT_SCOPE) + set(${_OUTPUT_TARGET} "${TEXT2}" PARENT_SCOPE) + set(${_OUTPUT_OPTION} "${TEXT3}" PARENT_SCOPE) +endfunction() - # Generate a sanitized version of the component name for use in targets and options. - string(REGEX REPLACE "[^a-zA-Z0-9_-]+" "_" COMPONENT_SANITIZED_NAME "${COMPONENT_NAME}") - string(REGEX REPLACE "_[_]+" "_" COMPONENT_SANITIZED_NAME "${COMPONENT_SANITIZED_NAME}") +function(streamfx_add_component COMPONENT_NAME) + cmake_parse_arguments(PARSE_ARGV 1 _ARG + "" + "RESOLVER" + "" + ) - # Convert the sanitized version to upper case. - string(TOUPPER "${COMPONENT_SANITIZED_NAME}" COMPONENT_OPTION_NAME) + # Sanitize name for further use. + streamfx_sanitize_name("${COMPONENT_NAME}" COMPONENT_NAME COMPONENT_SANITIZED_NAME COMPONENT_OPTION_NAME) set(COMPONENT_OPTION "${PREFIX}COMPONENT_${COMPONENT_OPTION_NAME}") set(COMPONENT_OPTION "${COMPONENT_OPTION}" PARENT_SCOPE) @@ -1059,13 +1070,20 @@ function(streamfx_add_component COMPONENT_NAME) # Register the component globally. get_target_property(_DEPENDS StreamFX COMPONENT_DEPENDS) if(_DEPENDS) - list(APPEND _DEPENDS "${COMPONENT_TARGET}") + list(APPEND _DEPENDS "${COMPONENT_SANITIZED_NAME}") else() - set(_DEPENDS "${COMPONENT_TARGET}") + set(_DEPENDS "${COMPONENT_SANITIZED_NAME}") endif() set_target_properties(StreamFX PROPERTIES COMPONENT_DEPENDS "${_DEPENDS}" ) + + # If there is a resolver function, register it. + if(_ARG_RESOLVER) + set_target_properties(${COMPONENT_TARGET} + COMPONENT_RESOLVER "${_ARG_RESOLVER}" + ) + endif() # Allow disabling this component. set(${COMPONENT_OPTION} ON CACHE BOOL "Enable the ${COMPONENT_NAME} component?") @@ -1153,26 +1171,76 @@ function(streamfx_add_component COMPONENT_NAME) ) endfunction() -# Use this to add a dependency on another component, +function(streamfx_has_component _NAME _OUTPUT) + streamfx_sanitize_name("${_NAME}" _NAME _TARGET _OPTION) + + set(${_OUTPUT} OFF PARENT_SCOPE) + if(TARGET "StreamFX_${_TARGET}") + set(${_OUTPUT} ON PARENT_SCOPE) + endif() +endfunction() + +function(streamfx_enabled_component _NAME _OUTPUT) + streamfx_sanitize_name("${_NAME}" _NAME _TARGET _OPTION) + if(NOT TARGET "StreamFX_${_TARGET}") + message(FATAL_ERROR "Unknown component '${_NAME}'.") + endif() + + get_target_property(_OPTION "StreamFX_${_TARGET}" COMPONENT_OPTION) + set(${_OUTPUT} OFF PARENT_SCOPE) + if(${_OPTION} AND NOT (${_OPTION}_DISABLED)) + set(${_OUTPUT} ON PARENT_SCOPE) + endif() +endfunction() + +# Use this to add a dependency on another component. function(streamfx_add_component_dependency _NAME) - get_target_property(DEPENDS ${COMPONENT_TARGET} COMPONENT_DEPENDS) - list(APPEND DEPENDS "${_NAME}") - set_target_properties(${COMPONENT_TARGET} PROPERTIES COMPONENT_DEPENDS "${DEPENDS}") + cmake_parse_arguments(PARSE_ARGV 1 _ARG + "OPTIONAL" + "" + "" + ) + + streamfx_sanitize_name("${_NAME}" _NAME _TARGET _OPTION) + + set(DEPENDENCY "${_TARGET}") + if(_ARG_OPTIONAL) + list(APPEND DEPENDENCY "OPTIONAL") + endif() + string(REPLACE ";" "\\;" DEPENDENCY "${DEPENDENCY}") + + get_target_property(DEPENDS "${COMPONENT_TARGET}" COMPONENT_DEPENDS) + if(DEPENDS) + list(APPEND DEPENDS "${DEPENDENCY}") + else() + set(DEPENDS "${DEPENDENCY}") + endif() + set_target_properties("${COMPONENT_TARGET}" PROPERTIES COMPONENT_DEPENDS "${DEPENDS}") endfunction() -function(streamfx_disable_component _NAME _REASON) +# Use this to disable a component via script. +function(streamfx_disable_component _NAME) + cmake_parse_arguments(PARSE_ARGV 1 _ARG + "" + "REASON" + "" + ) + + streamfx_sanitize_name("${_NAME}" _NAME _TARGET _OPTION) + set(_TARGET "StreamFX_${_TARGET}") + # If the component doesn't exist, skip it. - if(NOT TARGET ${_NAME}) - message(WARNING "Not disabling invalid component '${COMPONENT}'.") + if(NOT TARGET ${_TARGET}) + message(WARNING "Not disabling invalid component '${_NAME}'.") return() endif() - get_target_property(_NAME ${COMPONENT} COMPONENT_LABEL) - get_target_property(_OPTION ${COMPONENT} COMPONENT_OPTION) + get_target_property(_LABEL ${_TARGET} COMPONENT_LABEL) + get_target_property(_OPTION ${_TARGET} COMPONENT_OPTION) CacheSet(${_OPTION}_DISABLED ON) - if(_REASON) - message(STATUS "[${_NAME}] Disabled due to: ${_REASON}") + if(_ARG_REASON) + message(STATUS "[${_LABEL}] Disabled due to: ${_ARG_REASON}") endif() endfunction() @@ -1363,73 +1431,121 @@ foreach(COMPONENT ${COMPONENTS}) endif() endforeach() -get_target_property(_DEPENDS StreamFX COMPONENT_DEPENDS) - -#- Resolving -if(_DEPENDS) - foreach(COMPONENT ${_DEPENDS}) - # If the component doesn't exist, skip it. - if(NOT TARGET ${COMPONENT}) - message(WARNING "Encountered invalid component '${COMPONENT}' in list of all components.") - continue() - endif() +get_target_property(_UNRESOLVED StreamFX COMPONENT_DEPENDS) +set(_RESOLVED "") +set(_DISABLED "") + +#- Cleanup +list(REMOVE_DUPLICATES _UNRESOLVED) +foreach(_ENTITY ${_UNRESOLVED}) + # Remove any invalid entries. + if(NOT TARGET "StreamFX_${_ENTITY}") + message(WARNING "Encountered invalid component '${_ENTITY}', removing...") + list(REMOVE_ITEM _UNRESOLVED "${_ENTITY}") + continue() + endif() +endforeach() - get_target_property(_NAME ${COMPONENT} COMPONENT_LABEL) +#- Resolve Dependencies in a loop +set(_UNRESOLVED_LOOP 0) +while(_UNRESOLVED) + MATH(EXPR _UNRESOLVED_LOOP "${_UNRESOLVED_LOOP}+1") + if(_UNRESOLVED_LOOP GREATER_EQUAL 10) + message(FATAL_ERROR "Infinite loop while resolving components: ${_UNRESOLVED}") + endif() - # If the component is disabled, skip it. - get_target_property(_OPTION ${COMPONENT} COMPONENT_OPTION) + # Attempt to resolve while there are still unresolved entries. + foreach(_ENTITY ${_UNRESOLVED}) + set(RENTITY "StreamFX_${_ENTITY}") + + get_target_property(_LABEL "${RENTITY}" COMPONENT_LABEL) + get_target_property(_OPTION "${RENTITY}" COMPONENT_OPTION) + get_target_property(_DEPENDS "${RENTITY}" COMPONENT_DEPENDS) + get_target_property(_RESOLVER "${RENTITY}" COMPONENT_RESOLVER) + + # Remove any that have been disabled. if(NOT ${_OPTION}) + message(STATUS "[${_LABEL}] Disabled by user.") + list(REMOVE_ITEM _UNRESOLVED "${_ENTITY}") + list(APPEND _DISABLED "${_ENTITY}") continue() - elseif(${_OPTION}_DISABLED) + elseif(${_OPTION}_DISABLED) # Test for pre-resolve disabling. + message(STATUS "[${_LABEL}] Disabled by build script.") + list(REMOVE_ITEM _UNRESOLVED "${_ENTITY}") + list(APPEND _DISABLED "${_ENTITY}") continue() endif() - - # Test if all dependencies are valid. - set(_HASDEPENDENCY ON) - get_target_property(_CDEPENDS ${COMPONENT} COMPONENT_DEPENDS) - foreach(_DEPEND ${_CDEPENDS}) - get_target_property(_DNAME ${COMPONENT} COMPONENT_LABEL) - get_target_property(_DOPTION ${COMPONENT} COMPONENT_OPTION) - if((NOT ${_DOPTION}) OR (${_DOPTION}_DISABLED)) - message(STATUS "[${_NAME}] Missing or disabled dependency on '${_DNAME}'.") - set(_HASDEPENDENCY OFF) - continue() - endif() - endforeach() - if(NOT _HASDEPENDENCY) - message(STATUS "[${_NAME}] Missing dependencies, disabling...") - set(${_OPTION}_DISABLED TRUE) - continue() - endif() - endforeach() -endif() -#- Linking -target_link_libraries(StreamFX PRIVATE $) -if(_DEPENDS) - foreach(COMPONENT ${_DEPENDS}) - if(NOT TARGET ${COMPONENT}) + # Check if all dependencies are resolved. + set(_HAS_UNRESOLVED_DEPENDS OFF) + set(_HAS_DISABLED_DEPENDS OFF) + set(_HAS_UNRESOLVED_OPTIONAL_DEPENDS OFF) + if(_DEPENDS) + foreach(_DEPEND ${_DEPENDS}) + list(GET _DEPEND 0 _ENTITY2) + set(RENTITY2 "StreamFX_${_ENTITY2}") + + get_target_property(_ENTITY2_LABEL "${RENTITY2}" COMPONENT_LABEL) + + if(NOT ("OPTIONAL" IN_LIST _DEPEND)) + if("${_ENTITY2}" IN_LIST _DISABLED) + message("[${_LABEL}] Required dependency '${_ENTITY2_LABEL}' is disabled.") + set(_HAS_DISABLED_DEPENDS ON) + endif() + if("${_ENTITY2}" IN_LIST _UNRESOLVED) + set(_HAS_UNRESOLVED_DEPENDS ON) + endif() + else() + if("${_ENTITY2}" IN_LIST _UNRESOLVED) + set(_HAS_UNRESOLVED_OPTIONAL_DEPENDS ON) + endif() + endif() + endforeach() + list(JOIN _DEPENDS ", " _DEPENDS) + else() + set(_DEPENDS "") + endif() + if(_HAS_DISABLED_DEPENDS) # A required dependency is disabled, so disable this entry. + message(STATUS "[${_LABEL}] Disabled by dependency.") + list(REMOVE_ITEM _UNRESOLVED "${_ENTITY}") + list(APPEND _DISABLED "${_ENTITY}") + streamfx_disable_component(${_ENTITY}) + continue() + elseif(_HAS_UNRESOLVED_DEPENDS) + continue() + elseif(_HAS_UNRESOLVED_OPTIONAL_DEPENDS AND (_UNRESOLVED_LOOP LESS 8)) + # Temporarily skip this element while there are still remaining loops. continue() endif() - get_target_property(_NAME ${COMPONENT} COMPONENT_LABEL) - - # If the component is disabled, skip it. - get_target_property(_OPTION ${COMPONENT} COMPONENT_OPTION) - if(NOT ${_OPTION}) - message(STATUS "[${_NAME}] Disabled by developer.") - continue() - elseif(${_OPTION}_DISABLED) - message(STATUS "[${_NAME}] Disabled by build script.") + # Call Resolver function + if(_RESOLVER) + cmake_language(CALL ${_RESOLVER}) + endif() + if(${_OPTION}_DISABLED) # Test for resolve disabling. + message(STATUS "[${_LABEL}] Disabled by resolver.") + list(REMOVE_ITEM _UNRESOLVED "${_ENTITY}") + list(APPEND _DISABLED "${_ENTITY}") continue() endif() - # Finally if everything is correct, do things. - message(STATUS "[${_NAME}] Enabled.") - target_link_libraries(StreamFX PRIVATE $) + # Finally, if everything went well, we now have a resolved entity. + list(REMOVE_ITEM _UNRESOLVED "${_ENTITY}") + list(APPEND _RESOLVED "${_ENTITY}") + message(STATUS "[${_LABEL}] Enabled. Depends: ${_DEPENDS}") endforeach() -endif() +endwhile() +#- Linking +target_link_libraries(StreamFX PRIVATE $) +foreach(_ENTITY ${_RESOLVED}) + if(NOT TARGET StreamFX_${_ENTITY}) + continue() + endif() + + # Finally if everything is correct, do things. + target_link_libraries(StreamFX PRIVATE $) +endforeach() ################################################################################ # Installation From 4339a5f85370d7634c46d9ae1b933de2c3c864c1 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 04:48:47 +0200 Subject: [PATCH 39/66] Update copyright.js tool It will now properly sort authors by date, and follow renames, which should give a much better coverage of copyright information. --- tools/copyright.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tools/copyright.js b/tools/copyright.js index 66e2dc18c5..2beab25d83 100644 --- a/tools/copyright.js +++ b/tools/copyright.js @@ -133,8 +133,7 @@ async function git_retrieveAuthors(file) { let proc = CHILD_PROCESS.spawn("git", [ "--no-pager", "log", - "--date-order", - "--reverse", + "--follow", "--format=format:%aI|%aN <%aE>", "--", file @@ -190,7 +189,11 @@ async function git_retrieveAuthors(file) { let author = authors.get(name); if (author) { - author.to = new Date(date) + let dt = new Date(date) + if (author.from > dt) + author.from = dt; + if (author.to < dt) + author.to = dt; } else { authors.set(name, { from: new Date(date), @@ -203,6 +206,14 @@ async function git_retrieveAuthors(file) { async function generateCopyright(file) { let authors = await git_retrieveAuthors(file) + authors = new Map([...authors].sort((a, b) => { + if (a[1].from < b[1].from) { + return -1; + } else if (a[1].from > b[1].from) { + return 1; + } + return 0; + })); let lines = []; for (let entry of authors) { let from = entry[1].from.getUTCFullYear(); From 4cf2a399f446ecc478fe9df9291dd48e4a9ef3a1 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 05:16:02 +0200 Subject: [PATCH 40/66] Update Copyright headers These now include all history, which has fixed some headers that used to be wrong. --- .mailmap | 1 + components/autoframing/CMakeLists.txt | 5 +++-- components/blur/CMakeLists.txt | 5 +++-- components/blur/source/filter/filter-blur.cpp | 3 ++- components/blur/source/filter/filter-blur.hpp | 2 +- components/color-grade/CMakeLists.txt | 5 +++-- .../source/gfx/lut/gfx-lut-consumer.hpp | 2 +- .../source/gfx/lut/gfx-lut-producer.hpp | 2 +- .../color-grade/source/gfx/lut/gfx-lut.hpp | 2 +- components/denoising/CMakeLists.txt | 5 +++-- components/dynamic-mask/CMakeLists.txt | 5 +++-- components/ffmpeg/CMakeLists.txt | 5 +++-- .../ffmpeg/source/encoders/codecs/av1.cpp | 2 +- .../ffmpeg/source/encoders/codecs/av1.hpp | 2 +- .../ffmpeg/source/encoders/codecs/dnxhr.hpp | 2 +- .../ffmpeg/source/encoders/ffmpeg/amf.cpp | 3 +-- .../ffmpeg/source/encoders/ffmpeg/debug.cpp | 3 +-- .../ffmpeg/source/encoders/ffmpeg/dnxhd.cpp | 3 +-- .../ffmpeg/source/encoders/ffmpeg/dnxhd.hpp | 3 +-- .../ffmpeg/source/encoders/ffmpeg/handler.cpp | 2 +- .../ffmpeg/source/encoders/ffmpeg/handler.hpp | 2 +- .../ffmpeg/source/encoders/ffmpeg/nvenc.cpp | 3 +-- .../source/encoders/ffmpeg/prores_aw.cpp | 3 +-- .../source/encoders/ffmpeg/prores_aw.hpp | 3 +-- components/mirror/CMakeLists.txt | 5 +++-- .../mirror/source/sources/source-mirror.cpp | 2 +- .../mirror/source/sources/source-mirror.hpp | 2 +- components/nvidia/CMakeLists.txt | 5 +++-- .../source/nvidia/ar/nvidia-ar-feature.cpp | 2 +- .../nvidia/source/nvidia/ar/nvidia-ar.cpp | 2 +- .../nvidia/cuda/nvidia-cuda-context.hpp | 2 +- .../nvidia/cuda/nvidia-cuda-gs-texture.hpp | 2 +- .../source/nvidia/cuda/nvidia-cuda-memory.cpp | 2 +- .../source/nvidia/cuda/nvidia-cuda-memory.hpp | 2 +- .../source/nvidia/cuda/nvidia-cuda-obs.cpp | 2 +- .../source/nvidia/cuda/nvidia-cuda-obs.hpp | 2 +- .../source/nvidia/cuda/nvidia-cuda-stream.cpp | 2 +- .../source/nvidia/cuda/nvidia-cuda-stream.hpp | 2 +- .../source/nvidia/cv/nvidia-cv-image.hpp | 2 +- .../source/nvidia/cv/nvidia-cv-texture.hpp | 2 +- components/sdf-effects/CMakeLists.txt | 5 +++-- .../source/filters/filter-sdf-effects.cpp | 2 +- .../source/filters/filter-sdf-effects.hpp | 2 +- components/shader/CMakeLists.txt | 5 +++-- .../shader/source/filters/filter-shader.cpp | 2 +- .../shader/source/filters/filter-shader.hpp | 2 +- .../shader/source/gfx/shader/gfx-shader.cpp | 2 +- .../shader/source/gfx/shader/gfx-shader.hpp | 2 +- .../shader/source/sources/source-shader.hpp | 2 +- .../source/transitions/transition-shader.hpp | 2 +- components/transform/CMakeLists.txt | 5 +++-- .../source/filter/filter-transform.cpp | 2 +- .../source/filter/filter-transform.hpp | 2 +- components/upscaling/CMakeLists.txt | 5 +++-- components/virtual-greenscreen/CMakeLists.txt | 5 +++-- data/effects/sdf/sdf-producer.effect | 2 +- .../shaders/filter/bulge_pinch.effect | 2 +- .../examples/shaders/filter/pixelation.effect | 3 ++- data/examples/shaders/filter/wave.effect | 2 +- data/examples/shaders/filter/zigzag.effect | 2 +- source/common.hpp | 2 +- source/configuration.hpp | 2 +- source/gfx/gfx-mipmapper.cpp | 3 ++- source/gfx/gfx-mipmapper.hpp | 2 +- source/gfx/gfx-opengl.hpp | 2 +- source/gfx/gfx-source-texture.cpp | 2 +- source/gfx/gfx-source-texture.hpp | 2 +- source/gfx/gfx-util.cpp | 3 ++- source/gfx/gfx-util.hpp | 2 +- source/obs/gs/gs-effect-pass.cpp | 2 +- source/obs/gs/gs-effect-pass.hpp | 2 +- source/obs/gs/gs-effect-technique.hpp | 2 +- source/obs/gs/gs-effect.cpp | 2 +- source/obs/gs/gs-effect.hpp | 2 +- source/obs/gs/gs-helper.cpp | 2 +- source/obs/gs/gs-helper.hpp | 2 +- source/obs/gs/gs-indexbuffer.cpp | 2 +- source/obs/gs/gs-indexbuffer.hpp | 2 +- source/obs/gs/gs-limits.hpp | 2 +- source/obs/gs/gs-mipmapper.cpp | 2 +- source/obs/gs/gs-mipmapper.hpp | 2 +- source/obs/gs/gs-rendertarget.cpp | 2 +- source/obs/gs/gs-rendertarget.hpp | 2 +- source/obs/gs/gs-sampler.cpp | 2 +- source/obs/gs/gs-sampler.hpp | 2 +- source/obs/gs/gs-texture.cpp | 2 +- source/obs/gs/gs-texture.hpp | 2 +- source/obs/gs/gs-vertex.cpp | 2 +- source/obs/gs/gs-vertex.hpp | 2 +- source/obs/gs/gs-vertexbuffer.cpp | 2 +- source/obs/gs/gs-vertexbuffer.hpp | 2 +- source/obs/obs-encoder-factory.cpp | 2 +- source/obs/obs-signal-handler.cpp | 2 +- source/obs/obs-source-active-child.cpp | 2 +- source/obs/obs-source-active-reference.cpp | 2 +- source/obs/obs-source-active-reference.hpp | 2 +- source/obs/obs-source-factory.cpp | 2 +- source/obs/obs-source-showing-reference.cpp | 2 +- source/obs/obs-source-showing-reference.hpp | 2 +- source/obs/obs-source.cpp | 2 +- source/obs/obs-source.hpp | 2 +- source/obs/obs-tools.cpp | 2 +- source/obs/obs-tools.hpp | 2 +- source/obs/obs-weak-source.cpp | 2 +- source/plugin.hpp | 2 +- source/strings.hpp | 2 +- source/ui/ui-about-entry.hpp | 2 +- source/ui/ui-common.hpp | 2 +- source/util/util-event.hpp | 2 +- source/util/util-logging.cpp | 2 +- source/util/util-threadpool.hpp | 2 +- source/util/utility.cpp | 2 +- source/util/utility.hpp | 2 +- source/windll.cpp | 2 +- templates/config.hpp.in | 3 +-- templates/macos/installer.pkgproj.in | 1 + templates/module.cpp.in | 2 +- templates/version.hpp.in | 21 +------------------ templates/windows/installer.iss.in | 2 +- templates/windows/version.rc.in | 2 +- 120 files changed, 150 insertions(+), 158 deletions(-) diff --git a/.mailmap b/.mailmap index 76c68b297f..007409ecf4 100644 --- a/.mailmap +++ b/.mailmap @@ -3,5 +3,6 @@ Michael Fabian 'Xaymar' Dirks Vainock <39059951+Vainock@users.noreply.github.com> Charles Fettinger Charles Fettinger +Radegast Stravinsky Radegast Stravinsky <58457062+Radegast-FFXIV@users.noreply.github.com> Carsten Braun diff --git a/components/autoframing/CMakeLists.txt b/components/autoframing/CMakeLists.txt index 01b39bd856..a99c2619ef 100644 --- a/components/autoframing/CMakeLists.txt +++ b/components/autoframing/CMakeLists.txt @@ -1,6 +1,7 @@ -## AUTOGENERATED COPYRIGHT HEADER START -# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks # AUTOGENERATED COPYRIGHT HEADER END + cmake_minimum_required(VERSION 3.26) project("AutoFraming") list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") diff --git a/components/blur/CMakeLists.txt b/components/blur/CMakeLists.txt index 46020e19b0..849a281f49 100644 --- a/components/blur/CMakeLists.txt +++ b/components/blur/CMakeLists.txt @@ -1,6 +1,7 @@ -## AUTOGENERATED COPYRIGHT HEADER START -# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks # AUTOGENERATED COPYRIGHT HEADER END + cmake_minimum_required(VERSION 3.26) project("Blur") list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") diff --git a/components/blur/source/filter/filter-blur.cpp b/components/blur/source/filter/filter-blur.cpp index b399b93089..9067973bf2 100644 --- a/components/blur/source/filter/filter-blur.cpp +++ b/components/blur/source/filter/filter-blur.cpp @@ -1,5 +1,6 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2019 Cat Stevens // AUTOGENERATED COPYRIGHT HEADER END #include "filter-blur.hpp" diff --git a/components/blur/source/filter/filter-blur.hpp b/components/blur/source/filter/filter-blur.hpp index 6d22a54081..3066ec87da 100644 --- a/components/blur/source/filter/filter-blur.hpp +++ b/components/blur/source/filter/filter-blur.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/components/color-grade/CMakeLists.txt b/components/color-grade/CMakeLists.txt index e6136a1c22..2af29289e6 100644 --- a/components/color-grade/CMakeLists.txt +++ b/components/color-grade/CMakeLists.txt @@ -1,6 +1,7 @@ -## AUTOGENERATED COPYRIGHT HEADER START -# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks # AUTOGENERATED COPYRIGHT HEADER END + cmake_minimum_required(VERSION 3.26) project("ColorGrade") list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") diff --git a/components/color-grade/source/gfx/lut/gfx-lut-consumer.hpp b/components/color-grade/source/gfx/lut/gfx-lut-consumer.hpp index 76fb7c1054..d970c8543d 100644 --- a/components/color-grade/source/gfx/lut/gfx-lut-consumer.hpp +++ b/components/color-grade/source/gfx/lut/gfx-lut-consumer.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/components/color-grade/source/gfx/lut/gfx-lut-producer.hpp b/components/color-grade/source/gfx/lut/gfx-lut-producer.hpp index 733d282b93..f15bcce986 100644 --- a/components/color-grade/source/gfx/lut/gfx-lut-producer.hpp +++ b/components/color-grade/source/gfx/lut/gfx-lut-producer.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/components/color-grade/source/gfx/lut/gfx-lut.hpp b/components/color-grade/source/gfx/lut/gfx-lut.hpp index 82c88f999b..d9e412cb74 100644 --- a/components/color-grade/source/gfx/lut/gfx-lut.hpp +++ b/components/color-grade/source/gfx/lut/gfx-lut.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/components/denoising/CMakeLists.txt b/components/denoising/CMakeLists.txt index 8311476b9f..372c4435c1 100644 --- a/components/denoising/CMakeLists.txt +++ b/components/denoising/CMakeLists.txt @@ -1,6 +1,7 @@ -## AUTOGENERATED COPYRIGHT HEADER START -# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks # AUTOGENERATED COPYRIGHT HEADER END + cmake_minimum_required(VERSION 3.26) project("Denoising") list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") diff --git a/components/dynamic-mask/CMakeLists.txt b/components/dynamic-mask/CMakeLists.txt index 9d4568f155..9e7c7a1044 100644 --- a/components/dynamic-mask/CMakeLists.txt +++ b/components/dynamic-mask/CMakeLists.txt @@ -1,6 +1,7 @@ -## AUTOGENERATED COPYRIGHT HEADER START -# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks # AUTOGENERATED COPYRIGHT HEADER END + cmake_minimum_required(VERSION 3.26) project("DynamicMask") list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") diff --git a/components/ffmpeg/CMakeLists.txt b/components/ffmpeg/CMakeLists.txt index 668b3182ec..13346ad428 100644 --- a/components/ffmpeg/CMakeLists.txt +++ b/components/ffmpeg/CMakeLists.txt @@ -1,6 +1,7 @@ -## AUTOGENERATED COPYRIGHT HEADER START -# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks # AUTOGENERATED COPYRIGHT HEADER END + cmake_minimum_required(VERSION 3.26) project("FFmpeg") list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") diff --git a/components/ffmpeg/source/encoders/codecs/av1.cpp b/components/ffmpeg/source/encoders/codecs/av1.cpp index 241a75bd5e..e95cb9e7c7 100644 --- a/components/ffmpeg/source/encoders/codecs/av1.cpp +++ b/components/ffmpeg/source/encoders/codecs/av1.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "av1.hpp" diff --git a/components/ffmpeg/source/encoders/codecs/av1.hpp b/components/ffmpeg/source/encoders/codecs/av1.hpp index b0207b0ac7..71b4cc6b6c 100644 --- a/components/ffmpeg/source/encoders/codecs/av1.hpp +++ b/components/ffmpeg/source/encoders/codecs/av1.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/components/ffmpeg/source/encoders/codecs/dnxhr.hpp b/components/ffmpeg/source/encoders/codecs/dnxhr.hpp index dbe91ed269..457c68214b 100644 --- a/components/ffmpeg/source/encoders/codecs/dnxhr.hpp +++ b/components/ffmpeg/source/encoders/codecs/dnxhr.hpp @@ -1,6 +1,6 @@ // AUTOGENERATED COPYRIGHT HEADER START +// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2022 Carsten Braun -// Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/components/ffmpeg/source/encoders/ffmpeg/amf.cpp b/components/ffmpeg/source/encoders/ffmpeg/amf.cpp index ed6a0d76c8..8968d906b6 100644 --- a/components/ffmpeg/source/encoders/ffmpeg/amf.cpp +++ b/components/ffmpeg/source/encoders/ffmpeg/amf.cpp @@ -1,7 +1,6 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks -// AUTOGENERATED COPYRIGHT HEADER END // Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// AUTOGENERATED COPYRIGHT HEADER END //--------------------------------------------------------------------------------// // THIS FEATURE IS DEPRECATED. SUBMITTED PATCHES WILL BE REJECTED. diff --git a/components/ffmpeg/source/encoders/ffmpeg/debug.cpp b/components/ffmpeg/source/encoders/ffmpeg/debug.cpp index 6d73ce2958..d32c1c2090 100644 --- a/components/ffmpeg/source/encoders/ffmpeg/debug.cpp +++ b/components/ffmpeg/source/encoders/ffmpeg/debug.cpp @@ -1,8 +1,7 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks -// AUTOGENERATED COPYRIGHT HEADER END // Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2020 Daniel Molkentin +// AUTOGENERATED COPYRIGHT HEADER END #include "debug.hpp" #include "common.hpp" diff --git a/components/ffmpeg/source/encoders/ffmpeg/dnxhd.cpp b/components/ffmpeg/source/encoders/ffmpeg/dnxhd.cpp index 9a660b31c4..594c6bae76 100644 --- a/components/ffmpeg/source/encoders/ffmpeg/dnxhd.cpp +++ b/components/ffmpeg/source/encoders/ffmpeg/dnxhd.cpp @@ -1,9 +1,8 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks -// AUTOGENERATED COPYRIGHT HEADER END // Copyright (C) 2022 Carsten Braun // Copyright (C) 2022 lainon // Copyright (C) 2022-2023 Michael Fabian 'Xaymar' Dirks +// AUTOGENERATED COPYRIGHT HEADER END #include "dnxhd.hpp" #include "common.hpp" diff --git a/components/ffmpeg/source/encoders/ffmpeg/dnxhd.hpp b/components/ffmpeg/source/encoders/ffmpeg/dnxhd.hpp index 18cad6ef1b..c54f87bf0f 100644 --- a/components/ffmpeg/source/encoders/ffmpeg/dnxhd.hpp +++ b/components/ffmpeg/source/encoders/ffmpeg/dnxhd.hpp @@ -1,8 +1,7 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END // Copyright (C) 2022 Carsten Braun -// Copyright (C) 2022-2023 Michael Fabian 'Xaymar' Dirks #pragma once #include "encoders/encoder-ffmpeg.hpp" diff --git a/components/ffmpeg/source/encoders/ffmpeg/handler.cpp b/components/ffmpeg/source/encoders/ffmpeg/handler.cpp index ab55b9a2f8..362c318a9e 100644 --- a/components/ffmpeg/source/encoders/ffmpeg/handler.cpp +++ b/components/ffmpeg/source/encoders/ffmpeg/handler.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "handler.hpp" diff --git a/components/ffmpeg/source/encoders/ffmpeg/handler.hpp b/components/ffmpeg/source/encoders/ffmpeg/handler.hpp index 69c49f0e26..fcc452d446 100644 --- a/components/ffmpeg/source/encoders/ffmpeg/handler.hpp +++ b/components/ffmpeg/source/encoders/ffmpeg/handler.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/components/ffmpeg/source/encoders/ffmpeg/nvenc.cpp b/components/ffmpeg/source/encoders/ffmpeg/nvenc.cpp index 2b96b39deb..6e5d648643 100644 --- a/components/ffmpeg/source/encoders/ffmpeg/nvenc.cpp +++ b/components/ffmpeg/source/encoders/ffmpeg/nvenc.cpp @@ -1,8 +1,7 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks -// AUTOGENERATED COPYRIGHT HEADER END // Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2022 lainon +// AUTOGENERATED COPYRIGHT HEADER END #include "nvenc.hpp" #include "common.hpp" diff --git a/components/ffmpeg/source/encoders/ffmpeg/prores_aw.cpp b/components/ffmpeg/source/encoders/ffmpeg/prores_aw.cpp index d39293b4ec..1df3d5fe76 100644 --- a/components/ffmpeg/source/encoders/ffmpeg/prores_aw.cpp +++ b/components/ffmpeg/source/encoders/ffmpeg/prores_aw.cpp @@ -1,7 +1,6 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks -// AUTOGENERATED COPYRIGHT HEADER END // Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// AUTOGENERATED COPYRIGHT HEADER END #include "prores_aw.hpp" #include "common.hpp" diff --git a/components/ffmpeg/source/encoders/ffmpeg/prores_aw.hpp b/components/ffmpeg/source/encoders/ffmpeg/prores_aw.hpp index 86f579882f..b73eb2f1c2 100644 --- a/components/ffmpeg/source/encoders/ffmpeg/prores_aw.hpp +++ b/components/ffmpeg/source/encoders/ffmpeg/prores_aw.hpp @@ -1,7 +1,6 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks -// AUTOGENERATED COPYRIGHT HEADER END // Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// AUTOGENERATED COPYRIGHT HEADER END #pragma once #include "encoders/encoder-ffmpeg.hpp" diff --git a/components/mirror/CMakeLists.txt b/components/mirror/CMakeLists.txt index 159d811272..4897d3e010 100644 --- a/components/mirror/CMakeLists.txt +++ b/components/mirror/CMakeLists.txt @@ -1,6 +1,7 @@ -## AUTOGENERATED COPYRIGHT HEADER START -# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks # AUTOGENERATED COPYRIGHT HEADER END + cmake_minimum_required(VERSION 3.26) project("Mirror") list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") diff --git a/components/mirror/source/sources/source-mirror.cpp b/components/mirror/source/sources/source-mirror.cpp index 1bdccc4bf5..5bc6a7b2be 100644 --- a/components/mirror/source/sources/source-mirror.cpp +++ b/components/mirror/source/sources/source-mirror.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END diff --git a/components/mirror/source/sources/source-mirror.hpp b/components/mirror/source/sources/source-mirror.hpp index 59e609915e..88a06e1fcf 100644 --- a/components/mirror/source/sources/source-mirror.hpp +++ b/components/mirror/source/sources/source-mirror.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/components/nvidia/CMakeLists.txt b/components/nvidia/CMakeLists.txt index 77848bc441..84e3caa667 100644 --- a/components/nvidia/CMakeLists.txt +++ b/components/nvidia/CMakeLists.txt @@ -1,6 +1,7 @@ -## AUTOGENERATED COPYRIGHT HEADER START -# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks # AUTOGENERATED COPYRIGHT HEADER END + cmake_minimum_required(VERSION 3.26) project("NVIDIA") list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") diff --git a/components/nvidia/source/nvidia/ar/nvidia-ar-feature.cpp b/components/nvidia/source/nvidia/ar/nvidia-ar-feature.cpp index fece13c9a9..45d3014956 100644 --- a/components/nvidia/source/nvidia/ar/nvidia-ar-feature.cpp +++ b/components/nvidia/source/nvidia/ar/nvidia-ar-feature.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "nvidia-ar-feature.hpp" diff --git a/components/nvidia/source/nvidia/ar/nvidia-ar.cpp b/components/nvidia/source/nvidia/ar/nvidia-ar.cpp index b1da7dd0d0..ebe95b3fd6 100644 --- a/components/nvidia/source/nvidia/ar/nvidia-ar.cpp +++ b/components/nvidia/source/nvidia/ar/nvidia-ar.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "nvidia-ar.hpp" diff --git a/components/nvidia/source/nvidia/cuda/nvidia-cuda-context.hpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-context.hpp index 1b487c5061..0a85942e23 100644 --- a/components/nvidia/source/nvidia/cuda/nvidia-cuda-context.hpp +++ b/components/nvidia/source/nvidia/cuda/nvidia-cuda-context.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END diff --git a/components/nvidia/source/nvidia/cuda/nvidia-cuda-gs-texture.hpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-gs-texture.hpp index 8512d7d523..d091337114 100644 --- a/components/nvidia/source/nvidia/cuda/nvidia-cuda-gs-texture.hpp +++ b/components/nvidia/source/nvidia/cuda/nvidia-cuda-gs-texture.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/components/nvidia/source/nvidia/cuda/nvidia-cuda-memory.cpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-memory.cpp index bb530824c0..33a7d09ed1 100644 --- a/components/nvidia/source/nvidia/cuda/nvidia-cuda-memory.cpp +++ b/components/nvidia/source/nvidia/cuda/nvidia-cuda-memory.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "nvidia-cuda-memory.hpp" diff --git a/components/nvidia/source/nvidia/cuda/nvidia-cuda-memory.hpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-memory.hpp index 1530a7adee..44157e986d 100644 --- a/components/nvidia/source/nvidia/cuda/nvidia-cuda-memory.hpp +++ b/components/nvidia/source/nvidia/cuda/nvidia-cuda-memory.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/components/nvidia/source/nvidia/cuda/nvidia-cuda-obs.cpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-obs.cpp index 47ebc0c5b8..fef5d2e8ee 100644 --- a/components/nvidia/source/nvidia/cuda/nvidia-cuda-obs.cpp +++ b/components/nvidia/source/nvidia/cuda/nvidia-cuda-obs.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "nvidia-cuda-obs.hpp" diff --git a/components/nvidia/source/nvidia/cuda/nvidia-cuda-obs.hpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-obs.hpp index c5266dca3d..23f3bd88fd 100644 --- a/components/nvidia/source/nvidia/cuda/nvidia-cuda-obs.hpp +++ b/components/nvidia/source/nvidia/cuda/nvidia-cuda-obs.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/components/nvidia/source/nvidia/cuda/nvidia-cuda-stream.cpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-stream.cpp index a80b782f75..8665c3108b 100644 --- a/components/nvidia/source/nvidia/cuda/nvidia-cuda-stream.cpp +++ b/components/nvidia/source/nvidia/cuda/nvidia-cuda-stream.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "nvidia-cuda-stream.hpp" diff --git a/components/nvidia/source/nvidia/cuda/nvidia-cuda-stream.hpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-stream.hpp index 28541455aa..941fb7f38d 100644 --- a/components/nvidia/source/nvidia/cuda/nvidia-cuda-stream.hpp +++ b/components/nvidia/source/nvidia/cuda/nvidia-cuda-stream.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/components/nvidia/source/nvidia/cv/nvidia-cv-image.hpp b/components/nvidia/source/nvidia/cv/nvidia-cv-image.hpp index 799cc884de..349203c268 100644 --- a/components/nvidia/source/nvidia/cv/nvidia-cv-image.hpp +++ b/components/nvidia/source/nvidia/cv/nvidia-cv-image.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/components/nvidia/source/nvidia/cv/nvidia-cv-texture.hpp b/components/nvidia/source/nvidia/cv/nvidia-cv-texture.hpp index 873c3527e7..611a46c943 100644 --- a/components/nvidia/source/nvidia/cv/nvidia-cv-texture.hpp +++ b/components/nvidia/source/nvidia/cv/nvidia-cv-texture.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/components/sdf-effects/CMakeLists.txt b/components/sdf-effects/CMakeLists.txt index fa270a7714..69439f60df 100644 --- a/components/sdf-effects/CMakeLists.txt +++ b/components/sdf-effects/CMakeLists.txt @@ -1,6 +1,7 @@ -## AUTOGENERATED COPYRIGHT HEADER START -# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks # AUTOGENERATED COPYRIGHT HEADER END + cmake_minimum_required(VERSION 3.26) project("SDFFx") list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") diff --git a/components/sdf-effects/source/filters/filter-sdf-effects.cpp b/components/sdf-effects/source/filters/filter-sdf-effects.cpp index 172edbe8d8..d0fd68d1f4 100644 --- a/components/sdf-effects/source/filters/filter-sdf-effects.cpp +++ b/components/sdf-effects/source/filters/filter-sdf-effects.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2018-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "filter-sdf-effects.hpp" diff --git a/components/sdf-effects/source/filters/filter-sdf-effects.hpp b/components/sdf-effects/source/filters/filter-sdf-effects.hpp index 51a0c03bf3..497873c667 100644 --- a/components/sdf-effects/source/filters/filter-sdf-effects.hpp +++ b/components/sdf-effects/source/filters/filter-sdf-effects.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2018-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/components/shader/CMakeLists.txt b/components/shader/CMakeLists.txt index 37da762bf2..b7e028183b 100644 --- a/components/shader/CMakeLists.txt +++ b/components/shader/CMakeLists.txt @@ -1,6 +1,7 @@ -## AUTOGENERATED COPYRIGHT HEADER START -# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks # AUTOGENERATED COPYRIGHT HEADER END + cmake_minimum_required(VERSION 3.26) project("Shader") list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") diff --git a/components/shader/source/filters/filter-shader.cpp b/components/shader/source/filters/filter-shader.cpp index e164d2f60b..031628969a 100644 --- a/components/shader/source/filters/filter-shader.cpp +++ b/components/shader/source/filters/filter-shader.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2021 coolsoft.rf // AUTOGENERATED COPYRIGHT HEADER END diff --git a/components/shader/source/filters/filter-shader.hpp b/components/shader/source/filters/filter-shader.hpp index 4b0b3a52c5..5de3026c35 100644 --- a/components/shader/source/filters/filter-shader.hpp +++ b/components/shader/source/filters/filter-shader.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2021 coolsoft.rf // AUTOGENERATED COPYRIGHT HEADER END diff --git a/components/shader/source/gfx/shader/gfx-shader.cpp b/components/shader/source/gfx/shader/gfx-shader.cpp index ef8b6144df..3f9f127451 100644 --- a/components/shader/source/gfx/shader/gfx-shader.cpp +++ b/components/shader/source/gfx/shader/gfx-shader.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2018-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2021 coolsoft.rf // Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END diff --git a/components/shader/source/gfx/shader/gfx-shader.hpp b/components/shader/source/gfx/shader/gfx-shader.hpp index 15a56cce76..e58214e694 100644 --- a/components/shader/source/gfx/shader/gfx-shader.hpp +++ b/components/shader/source/gfx/shader/gfx-shader.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2018-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2021 coolsoft.rf // Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END diff --git a/components/shader/source/sources/source-shader.hpp b/components/shader/source/sources/source-shader.hpp index f40085c157..5cf5284ce0 100644 --- a/components/shader/source/sources/source-shader.hpp +++ b/components/shader/source/sources/source-shader.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2021 coolsoft.rf // AUTOGENERATED COPYRIGHT HEADER END diff --git a/components/shader/source/transitions/transition-shader.hpp b/components/shader/source/transitions/transition-shader.hpp index b115f84272..a3efd2ce36 100644 --- a/components/shader/source/transitions/transition-shader.hpp +++ b/components/shader/source/transitions/transition-shader.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/components/transform/CMakeLists.txt b/components/transform/CMakeLists.txt index e8ecae8243..ac1f619616 100644 --- a/components/transform/CMakeLists.txt +++ b/components/transform/CMakeLists.txt @@ -1,6 +1,7 @@ -## AUTOGENERATED COPYRIGHT HEADER START -# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks # AUTOGENERATED COPYRIGHT HEADER END + cmake_minimum_required(VERSION 3.26) project("Transform") list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") diff --git a/components/transform/source/filter/filter-transform.cpp b/components/transform/source/filter/filter-transform.cpp index d326d7c628..52135aa677 100644 --- a/components/transform/source/filter/filter-transform.cpp +++ b/components/transform/source/filter/filter-transform.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END diff --git a/components/transform/source/filter/filter-transform.hpp b/components/transform/source/filter/filter-transform.hpp index 2497ec1378..afea575c30 100644 --- a/components/transform/source/filter/filter-transform.hpp +++ b/components/transform/source/filter/filter-transform.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/components/upscaling/CMakeLists.txt b/components/upscaling/CMakeLists.txt index 1d458d4d02..d498041c85 100644 --- a/components/upscaling/CMakeLists.txt +++ b/components/upscaling/CMakeLists.txt @@ -1,6 +1,7 @@ -## AUTOGENERATED COPYRIGHT HEADER START -# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks # AUTOGENERATED COPYRIGHT HEADER END + cmake_minimum_required(VERSION 3.26) project("Upscaling") list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") diff --git a/components/virtual-greenscreen/CMakeLists.txt b/components/virtual-greenscreen/CMakeLists.txt index 90aa24e7de..440f0bf83d 100644 --- a/components/virtual-greenscreen/CMakeLists.txt +++ b/components/virtual-greenscreen/CMakeLists.txt @@ -1,6 +1,7 @@ -## AUTOGENERATED COPYRIGHT HEADER START -# Copyright (C) NaN-NaN undefined +# AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks # AUTOGENERATED COPYRIGHT HEADER END + cmake_minimum_required(VERSION 3.26) project("VirtualGreenscreen") list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") diff --git a/data/effects/sdf/sdf-producer.effect b/data/effects/sdf/sdf-producer.effect index 226dc87a12..9fe8c4dbea 100644 --- a/data/effects/sdf/sdf-producer.effect +++ b/data/effects/sdf/sdf-producer.effect @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2018-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END // 2D Signed Distance Field Generator diff --git a/data/examples/shaders/filter/bulge_pinch.effect b/data/examples/shaders/filter/bulge_pinch.effect index 8ed255f1a2..b1497c6ce1 100644 --- a/data/examples/shaders/filter/bulge_pinch.effect +++ b/data/examples/shaders/filter/bulge_pinch.effect @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2021 Radegast-FFXIV +// Copyright (C) 2021 Radegast Stravinsky // Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END // Copyright 2021 Radegast Stravinsky diff --git a/data/examples/shaders/filter/pixelation.effect b/data/examples/shaders/filter/pixelation.effect index 0aead4af4d..ba9941b03b 100644 --- a/data/examples/shaders/filter/pixelation.effect +++ b/data/examples/shaders/filter/pixelation.effect @@ -1,6 +1,7 @@ // AUTOGENERATED COPYRIGHT HEADER START +// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2020 Daniel Hodgson // Copyright (C) 2021 kilin -// Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END // Always provided by OBS diff --git a/data/examples/shaders/filter/wave.effect b/data/examples/shaders/filter/wave.effect index a999854736..0d2bfac198 100644 --- a/data/examples/shaders/filter/wave.effect +++ b/data/examples/shaders/filter/wave.effect @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2021 Radegast-FFXIV +// Copyright (C) 2021 Radegast Stravinsky // Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END // diff --git a/data/examples/shaders/filter/zigzag.effect b/data/examples/shaders/filter/zigzag.effect index 9204287f0e..178bd605d7 100644 --- a/data/examples/shaders/filter/zigzag.effect +++ b/data/examples/shaders/filter/zigzag.effect @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2021 Radegast-FFXIV +// Copyright (C) 2021 Radegast Stravinsky // Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END // diff --git a/source/common.hpp b/source/common.hpp index 0e75ababb4..2626d4b180 100644 --- a/source/common.hpp +++ b/source/common.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/source/configuration.hpp b/source/configuration.hpp index 2574301997..453f6b617f 100644 --- a/source/configuration.hpp +++ b/source/configuration.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/source/gfx/gfx-mipmapper.cpp b/source/gfx/gfx-mipmapper.cpp index 823a8fd1a6..9da7c9bc66 100644 --- a/source/gfx/gfx-mipmapper.cpp +++ b/source/gfx/gfx-mipmapper.cpp @@ -1,5 +1,6 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2022-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END #include "gfx-mipmapper.hpp" diff --git a/source/gfx/gfx-mipmapper.hpp b/source/gfx/gfx-mipmapper.hpp index ec37c013b9..e159c67fa6 100644 --- a/source/gfx/gfx-mipmapper.hpp +++ b/source/gfx/gfx-mipmapper.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2022-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/source/gfx/gfx-opengl.hpp b/source/gfx/gfx-opengl.hpp index e90af37720..c52dfb0c19 100644 --- a/source/gfx/gfx-opengl.hpp +++ b/source/gfx/gfx-opengl.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "warning-disable.hpp" diff --git a/source/gfx/gfx-source-texture.cpp b/source/gfx/gfx-source-texture.cpp index c4257b055f..dd89a2fde0 100644 --- a/source/gfx/gfx-source-texture.cpp +++ b/source/gfx/gfx-source-texture.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2018-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "gfx-source-texture.hpp" diff --git a/source/gfx/gfx-source-texture.hpp b/source/gfx/gfx-source-texture.hpp index 3d64d9cc63..e2169fdda1 100644 --- a/source/gfx/gfx-source-texture.hpp +++ b/source/gfx/gfx-source-texture.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2018-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/source/gfx/gfx-util.cpp b/source/gfx/gfx-util.cpp index ea78f353fc..77a9f5793b 100644 --- a/source/gfx/gfx-util.cpp +++ b/source/gfx/gfx-util.cpp @@ -1,5 +1,6 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2022-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END #include "gfx-util.hpp" diff --git a/source/gfx/gfx-util.hpp b/source/gfx/gfx-util.hpp index 0b19aaab67..5f7be4584c 100644 --- a/source/gfx/gfx-util.hpp +++ b/source/gfx/gfx-util.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2022-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/source/obs/gs/gs-effect-pass.cpp b/source/obs/gs/gs-effect-pass.cpp index 8bf6c478b7..83581c427c 100644 --- a/source/obs/gs/gs-effect-pass.cpp +++ b/source/obs/gs/gs-effect-pass.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END diff --git a/source/obs/gs/gs-effect-pass.hpp b/source/obs/gs/gs-effect-pass.hpp index 6c79e74252..31130daa86 100644 --- a/source/obs/gs/gs-effect-pass.hpp +++ b/source/obs/gs/gs-effect-pass.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END diff --git a/source/obs/gs/gs-effect-technique.hpp b/source/obs/gs/gs-effect-technique.hpp index d93d1d21e4..350f9c626d 100644 --- a/source/obs/gs/gs-effect-technique.hpp +++ b/source/obs/gs/gs-effect-technique.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END diff --git a/source/obs/gs/gs-effect.cpp b/source/obs/gs/gs-effect.cpp index 4894ff4e56..6558e78c5b 100644 --- a/source/obs/gs/gs-effect.cpp +++ b/source/obs/gs/gs-effect.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END diff --git a/source/obs/gs/gs-effect.hpp b/source/obs/gs/gs-effect.hpp index 50e0c46a60..789f601f68 100644 --- a/source/obs/gs/gs-effect.hpp +++ b/source/obs/gs/gs-effect.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END diff --git a/source/obs/gs/gs-helper.cpp b/source/obs/gs/gs-helper.cpp index e01cba30eb..1038c709b3 100644 --- a/source/obs/gs/gs-helper.cpp +++ b/source/obs/gs/gs-helper.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "gs-helper.hpp" diff --git a/source/obs/gs/gs-helper.hpp b/source/obs/gs/gs-helper.hpp index 9e7c748a5d..d8efcb3144 100644 --- a/source/obs/gs/gs-helper.hpp +++ b/source/obs/gs/gs-helper.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/source/obs/gs/gs-indexbuffer.cpp b/source/obs/gs/gs-indexbuffer.cpp index c1b2c96849..906259544c 100644 --- a/source/obs/gs/gs-indexbuffer.cpp +++ b/source/obs/gs/gs-indexbuffer.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "gs-indexbuffer.hpp" diff --git a/source/obs/gs/gs-indexbuffer.hpp b/source/obs/gs/gs-indexbuffer.hpp index 046896c181..2d3c7ea9bc 100644 --- a/source/obs/gs/gs-indexbuffer.hpp +++ b/source/obs/gs/gs-indexbuffer.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/source/obs/gs/gs-limits.hpp b/source/obs/gs/gs-limits.hpp index 0fdccfda1c..d44c5583fb 100644 --- a/source/obs/gs/gs-limits.hpp +++ b/source/obs/gs/gs-limits.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/source/obs/gs/gs-mipmapper.cpp b/source/obs/gs/gs-mipmapper.cpp index 1285a08a28..6d0cc5d8cd 100644 --- a/source/obs/gs/gs-mipmapper.cpp +++ b/source/obs/gs/gs-mipmapper.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END diff --git a/source/obs/gs/gs-mipmapper.hpp b/source/obs/gs/gs-mipmapper.hpp index 48066ba10d..7119917d50 100644 --- a/source/obs/gs/gs-mipmapper.hpp +++ b/source/obs/gs/gs-mipmapper.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/source/obs/gs/gs-rendertarget.cpp b/source/obs/gs/gs-rendertarget.cpp index 69eae603b6..d9e172d4d4 100644 --- a/source/obs/gs/gs-rendertarget.cpp +++ b/source/obs/gs/gs-rendertarget.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END diff --git a/source/obs/gs/gs-rendertarget.hpp b/source/obs/gs/gs-rendertarget.hpp index 4afb10f82d..6a0496697d 100644 --- a/source/obs/gs/gs-rendertarget.hpp +++ b/source/obs/gs/gs-rendertarget.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END diff --git a/source/obs/gs/gs-sampler.cpp b/source/obs/gs/gs-sampler.cpp index c5eb9438b0..67153fcb9a 100644 --- a/source/obs/gs/gs-sampler.cpp +++ b/source/obs/gs/gs-sampler.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2018-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "gs-sampler.hpp" diff --git a/source/obs/gs/gs-sampler.hpp b/source/obs/gs/gs-sampler.hpp index eab8825a41..21095558e1 100644 --- a/source/obs/gs/gs-sampler.hpp +++ b/source/obs/gs/gs-sampler.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/source/obs/gs/gs-texture.cpp b/source/obs/gs/gs-texture.cpp index d6f4b38d36..ddb481e1cc 100644 --- a/source/obs/gs/gs-texture.cpp +++ b/source/obs/gs/gs-texture.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "gs-texture.hpp" diff --git a/source/obs/gs/gs-texture.hpp b/source/obs/gs/gs-texture.hpp index aba7b6b870..6efb27e14b 100644 --- a/source/obs/gs/gs-texture.hpp +++ b/source/obs/gs/gs-texture.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/source/obs/gs/gs-vertex.cpp b/source/obs/gs/gs-vertex.cpp index edbdb6463d..8f4bff362c 100644 --- a/source/obs/gs/gs-vertex.cpp +++ b/source/obs/gs/gs-vertex.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "gs-vertex.hpp" diff --git a/source/obs/gs/gs-vertex.hpp b/source/obs/gs/gs-vertex.hpp index e6ca003f79..61dfda85ec 100644 --- a/source/obs/gs/gs-vertex.hpp +++ b/source/obs/gs/gs-vertex.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/source/obs/gs/gs-vertexbuffer.cpp b/source/obs/gs/gs-vertexbuffer.cpp index 9f13691f9a..4b2ecbc579 100644 --- a/source/obs/gs/gs-vertexbuffer.cpp +++ b/source/obs/gs/gs-vertexbuffer.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END diff --git a/source/obs/gs/gs-vertexbuffer.hpp b/source/obs/gs/gs-vertexbuffer.hpp index 3127915cc8..b09d682059 100644 --- a/source/obs/gs/gs-vertexbuffer.hpp +++ b/source/obs/gs/gs-vertexbuffer.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END diff --git a/source/obs/obs-encoder-factory.cpp b/source/obs/obs-encoder-factory.cpp index 91a3438e24..d0f38667ad 100644 --- a/source/obs/obs-encoder-factory.cpp +++ b/source/obs/obs-encoder-factory.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "obs-encoder-factory.hpp" diff --git a/source/obs/obs-signal-handler.cpp b/source/obs/obs-signal-handler.cpp index 73f9acacb0..432101dfcb 100644 --- a/source/obs/obs-signal-handler.cpp +++ b/source/obs/obs-signal-handler.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "obs-signal-handler.hpp" diff --git a/source/obs/obs-source-active-child.cpp b/source/obs/obs-source-active-child.cpp index 469b6e43ad..f318f46760 100644 --- a/source/obs/obs-source-active-child.cpp +++ b/source/obs/obs-source-active-child.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2022-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "obs-source-active-child.hpp" diff --git a/source/obs/obs-source-active-reference.cpp b/source/obs/obs-source-active-reference.cpp index fcf393a72e..71a5fcee42 100644 --- a/source/obs/obs-source-active-reference.cpp +++ b/source/obs/obs-source-active-reference.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2022-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "obs-source-active-reference.hpp" diff --git a/source/obs/obs-source-active-reference.hpp b/source/obs/obs-source-active-reference.hpp index d7faa32451..41f5154b84 100644 --- a/source/obs/obs-source-active-reference.hpp +++ b/source/obs/obs-source-active-reference.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2022-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/source/obs/obs-source-factory.cpp b/source/obs/obs-source-factory.cpp index c7f43e2552..7a686beec9 100644 --- a/source/obs/obs-source-factory.cpp +++ b/source/obs/obs-source-factory.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "obs-source-factory.hpp" diff --git a/source/obs/obs-source-showing-reference.cpp b/source/obs/obs-source-showing-reference.cpp index bfd9e4b4f9..9d3c36adde 100644 --- a/source/obs/obs-source-showing-reference.cpp +++ b/source/obs/obs-source-showing-reference.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2022-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "obs-source-showing-reference.hpp" diff --git a/source/obs/obs-source-showing-reference.hpp b/source/obs/obs-source-showing-reference.hpp index c28f82eb9b..eadf3d1ea8 100644 --- a/source/obs/obs-source-showing-reference.hpp +++ b/source/obs/obs-source-showing-reference.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2022-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/source/obs/obs-source.cpp b/source/obs/obs-source.cpp index 51ea0ce198..2cad4ede40 100644 --- a/source/obs/obs-source.cpp +++ b/source/obs/obs-source.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2018-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "obs-source.hpp" diff --git a/source/obs/obs-source.hpp b/source/obs/obs-source.hpp index defdc68eb5..20f46c6ad3 100644 --- a/source/obs/obs-source.hpp +++ b/source/obs/obs-source.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/source/obs/obs-tools.cpp b/source/obs/obs-tools.cpp index a38834a453..134c8cf39a 100644 --- a/source/obs/obs-tools.cpp +++ b/source/obs/obs-tools.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2018-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "obs-tools.hpp" diff --git a/source/obs/obs-tools.hpp b/source/obs/obs-tools.hpp index 71ea270703..6260c3cbb5 100644 --- a/source/obs/obs-tools.hpp +++ b/source/obs/obs-tools.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/source/obs/obs-weak-source.cpp b/source/obs/obs-weak-source.cpp index cc5ff26aa8..e5fe792437 100644 --- a/source/obs/obs-weak-source.cpp +++ b/source/obs/obs-weak-source.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2022-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "obs-weak-source.hpp" diff --git a/source/plugin.hpp b/source/plugin.hpp index ef843a2b0e..6714e04a30 100644 --- a/source/plugin.hpp +++ b/source/plugin.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/source/strings.hpp b/source/strings.hpp index 403692d66c..c58446bb35 100644 --- a/source/strings.hpp +++ b/source/strings.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/source/ui/ui-about-entry.hpp b/source/ui/ui-about-entry.hpp index 84ce97a6f4..17fce27c75 100644 --- a/source/ui/ui-about-entry.hpp +++ b/source/ui/ui-about-entry.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/source/ui/ui-common.hpp b/source/ui/ui-common.hpp index de69ce1ed4..6e0160f7d3 100644 --- a/source/ui/ui-common.hpp +++ b/source/ui/ui-common.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/source/util/util-event.hpp b/source/util/util-event.hpp index c90f6cc46b..cbbbc5f3f2 100644 --- a/source/util/util-event.hpp +++ b/source/util/util-event.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END diff --git a/source/util/util-logging.cpp b/source/util/util-logging.cpp index 5152807de7..2c27b95966 100644 --- a/source/util/util-logging.cpp +++ b/source/util/util-logging.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2021 William Pettersson // AUTOGENERATED COPYRIGHT HEADER END diff --git a/source/util/util-threadpool.hpp b/source/util/util-threadpool.hpp index 853f52808a..fe7a4bfb5c 100644 --- a/source/util/util-threadpool.hpp +++ b/source/util/util-threadpool.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma once diff --git a/source/util/utility.cpp b/source/util/utility.cpp index 1e840fd923..767b3528f1 100644 --- a/source/util/utility.cpp +++ b/source/util/utility.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END diff --git a/source/util/utility.hpp b/source/util/utility.hpp index c39f724642..3666e2a66a 100644 --- a/source/util/utility.hpp +++ b/source/util/utility.hpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2018-2023 Michael Fabian 'Xaymar' Dirks // Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END diff --git a/source/windll.cpp b/source/windll.cpp index 0d561d4925..28b39e8984 100644 --- a/source/windll.cpp +++ b/source/windll.cpp @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "warning-disable.hpp" diff --git a/templates/config.hpp.in b/templates/config.hpp.in index edec16dc84..8a16f2464c 100644 --- a/templates/config.hpp.in +++ b/templates/config.hpp.in @@ -1,7 +1,6 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END -// Copyright (c) 2020 Michael Fabian Dirks // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/templates/macos/installer.pkgproj.in b/templates/macos/installer.pkgproj.in index 3c4f4ed01f..eae4d63f43 100644 --- a/templates/macos/installer.pkgproj.in +++ b/templates/macos/installer.pkgproj.in @@ -1,4 +1,5 @@ + diff --git a/templates/module.cpp.in b/templates/module.cpp.in index 3598f1f7d0..444726eaea 100644 --- a/templates/module.cpp.in +++ b/templates/module.cpp.in @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2018-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #include "warning-disable.hpp" diff --git a/templates/version.hpp.in b/templates/version.hpp.in index 436a2f313f..4e58cb6f0e 100644 --- a/templates/version.hpp.in +++ b/templates/version.hpp.in @@ -1,25 +1,6 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END -// Copyright (c) 2017 Michael Fabian Dirks -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. #pragma once #include "warning-disable.hpp" diff --git a/templates/windows/installer.iss.in b/templates/windows/installer.iss.in index 7192ec4bc7..957cb587a5 100644 --- a/templates/windows/installer.iss.in +++ b/templates/windows/installer.iss.in @@ -1,5 +1,5 @@ ; AUTOGENERATED COPYRIGHT HEADER START -; Copyright (C) 2022-2023 Michael Fabian 'Xaymar' Dirks +; Copyright (C) 2018-2023 Michael Fabian 'Xaymar' Dirks ; AUTOGENERATED COPYRIGHT HEADER END #define MyAppName "@PROJECT_TITLE@" diff --git a/templates/windows/version.rc.in b/templates/windows/version.rc.in index 13ed3225da..8834ffca3e 100644 --- a/templates/windows/version.rc.in +++ b/templates/windows/version.rc.in @@ -1,5 +1,5 @@ // AUTOGENERATED COPYRIGHT HEADER START -// Copyright (C) 2022-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2018-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END #pragma code_page(65001) From 92ddbd13304c87e07dc10583e39cf644294e2a69 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 05:33:08 +0200 Subject: [PATCH 41/66] Fix up some dependency logic in component resolving --- CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b5da48166c..0778b0cbec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1080,7 +1080,7 @@ function(streamfx_add_component COMPONENT_NAME) # If there is a resolver function, register it. if(_ARG_RESOLVER) - set_target_properties(${COMPONENT_TARGET} + set_target_properties(${COMPONENT_TARGET} PROPERTIES COMPONENT_RESOLVER "${_ARG_RESOLVER}" ) endif() @@ -1227,7 +1227,9 @@ function(streamfx_disable_component _NAME) ) streamfx_sanitize_name("${_NAME}" _NAME _TARGET _OPTION) - set(_TARGET "StreamFX_${_TARGET}") + if(NOT (_TARGET MATCHES "^StreamFX_")) + set(_TARGET "StreamFX_${_TARGET}") + endif() # If the component doesn't exist, skip it. if(NOT TARGET ${_TARGET}) @@ -1458,6 +1460,7 @@ while(_UNRESOLVED) foreach(_ENTITY ${_UNRESOLVED}) set(RENTITY "StreamFX_${_ENTITY}") + get_target_property(_ALIAS "${RENTITY}" COMPONENT_NAME) get_target_property(_LABEL "${RENTITY}" COMPONENT_LABEL) get_target_property(_OPTION "${RENTITY}" COMPONENT_OPTION) get_target_property(_DEPENDS "${RENTITY}" COMPONENT_DEPENDS) @@ -1520,6 +1523,9 @@ while(_UNRESOLVED) # Call Resolver function if(_RESOLVER) + set(COMPONENT_TARGET "${RENTITY}") + set(COMPONENT_ALIAS "${_ALIAS}") + set(COMPONENT_OPTION "${_OPTION}") cmake_language(CALL ${_RESOLVER}) endif() if(${_OPTION}_DISABLED) # Test for resolve disabling. From afcd5dfea972c4fde01f299bf882094e6bce9e53 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 05:33:40 +0200 Subject: [PATCH 42/66] nvidia: We only support Windows at the current time While a Linux version is (supposedly) available for this functionality, at the current time we have no integration for it. Nor do we have any way to test it either, so it is better to disable it for now. --- components/nvidia/CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/nvidia/CMakeLists.txt b/components/nvidia/CMakeLists.txt index 84e3caa667..8d76d06420 100644 --- a/components/nvidia/CMakeLists.txt +++ b/components/nvidia/CMakeLists.txt @@ -43,7 +43,6 @@ target_link_libraries(${COMPONENT_TARGET} NVIDIA::VFX ) -streamfx_add_component_dependency(Auto-Framing OPTIONAL) -streamfx_add_component_dependency(Denoising OPTIONAL) -streamfx_add_component_dependency(Upscaling OPTIONAL) -streamfx_add_component_dependency("Virtual Greenscreen" OPTIONAL) +if(NOT WINDOWS) + streamfx_disable_component("NVIDIA" REASON "NVIDIA integration is (currently) only available for Windows under Direct3D11.") +endif() From 3239f5e5b92358bab96f7440e612776928a6dcf4 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 05:34:04 +0200 Subject: [PATCH 43/66] virtual-greenscreen: Check if NVIDIA component is available --- components/virtual-greenscreen/CMakeLists.txt | 19 +++++++++++++-- .../filters/filter-virtual-greenscreen.cpp | 24 +++++++++---------- .../filters/filter-virtual-greenscreen.hpp | 8 +++---- 3 files changed, 33 insertions(+), 18 deletions(-) diff --git a/components/virtual-greenscreen/CMakeLists.txt b/components/virtual-greenscreen/CMakeLists.txt index 440f0bf83d..97c37ff123 100644 --- a/components/virtual-greenscreen/CMakeLists.txt +++ b/components/virtual-greenscreen/CMakeLists.txt @@ -3,7 +3,22 @@ # AUTOGENERATED COPYRIGHT HEADER END cmake_minimum_required(VERSION 3.26) -project("VirtualGreenscreen") +project("Virtual Greenscreen") list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") -streamfx_add_component("Virtual Greenscreen") +streamfx_add_component(${PROJECT_NAME} + RESOLVER streamfx_virtual_greenscreen_resolver +) +streamfx_add_component_dependency("NVIDIA" OPTIONAL) + +function(streamfx_virtual_greenscreen_resolver) + # Providers + #- NVIDIA + streamfx_enabled_component("NVIDIA" T_CHECK) + if(T_CHECK) + target_compile_definitions(${COMPONENT_TARGET} + ENABLE_NVIDIA + ) + endif() +endfunction() + diff --git a/components/virtual-greenscreen/source/filters/filter-virtual-greenscreen.cpp b/components/virtual-greenscreen/source/filters/filter-virtual-greenscreen.cpp index 392ea758ef..b17ffbd34f 100644 --- a/components/virtual-greenscreen/source/filters/filter-virtual-greenscreen.cpp +++ b/components/virtual-greenscreen/source/filters/filter-virtual-greenscreen.cpp @@ -30,7 +30,7 @@ #define ST_I18N_PROVIDER ST_I18N "." ST_KEY_PROVIDER #define ST_I18N_PROVIDER_NVIDIA_GREENSCREEN ST_I18N_PROVIDER ".NVIDIA.Greenscreen" -#ifdef ENABLE_FILTER_VIRTUAL_GREENSCREEN_NVIDIA +#ifdef ENABLE_NVIDIA #define ST_KEY_NVIDIA_GREENSCREEN "NVIDIA.Greenscreen" #define ST_I18N_NVIDIA_GREENSCREEN ST_I18N "." ST_KEY_NVIDIA_GREENSCREEN #define ST_KEY_NVIDIA_GREENSCREEN_MODE ST_KEY_NVIDIA_GREENSCREEN ".Mode" @@ -132,7 +132,7 @@ virtual_greenscreen_instance::~virtual_greenscreen_instance() // TODO: Make this asynchronous. switch (_provider) { -#ifdef ENABLE_FILTER_VIRTUAL_GREENSCREEN_NVIDIA +#ifdef ENABLE_NVIDIA case virtual_greenscreen_provider::NVIDIA_GREENSCREEN: nvvfxgs_unload(); break; @@ -168,7 +168,7 @@ void virtual_greenscreen_instance::update(obs_data_t* data) std::unique_lock ul(_provider_lock); switch (_provider) { -#ifdef ENABLE_FILTER_VIRTUAL_GREENSCREEN_NVIDIA +#ifdef ENABLE_NVIDIA case virtual_greenscreen_provider::NVIDIA_GREENSCREEN: nvvfxgs_update(data); break; @@ -182,7 +182,7 @@ void virtual_greenscreen_instance::update(obs_data_t* data) void streamfx::filter::virtual_greenscreen::virtual_greenscreen_instance::properties(obs_properties_t* properties) { switch (_provider_ui) { -#ifdef ENABLE_FILTER_VIRTUAL_GREENSCREEN_NVIDIA +#ifdef ENABLE_NVIDIA case virtual_greenscreen_provider::NVIDIA_GREENSCREEN: nvvfxgs_properties(properties); break; @@ -214,7 +214,7 @@ void virtual_greenscreen_instance::video_tick(float time) std::unique_lock ul(_provider_lock); switch (_provider) { -#ifdef ENABLE_FILTER_VIRTUAL_GREENSCREEN_NVIDIA +#ifdef ENABLE_NVIDIA case virtual_greenscreen_provider::NVIDIA_GREENSCREEN: nvvfxgs_size(); break; @@ -302,7 +302,7 @@ void virtual_greenscreen_instance::video_render(gs_effect_t* effect) ::streamfx::obs::gs::debug_marker profiler1{::streamfx::obs::gs::debug_color_convert, "Process"}; #endif switch (_provider) { -#ifdef ENABLE_FILTER_VIRTUAL_GREENSCREEN_NVIDIA +#ifdef ENABLE_NVIDIA case virtual_greenscreen_provider::NVIDIA_GREENSCREEN: nvvfxgs_process(_output_color, _output_alpha); break; @@ -394,7 +394,7 @@ void streamfx::filter::virtual_greenscreen::virtual_greenscreen_instance::task_s try { // Unload the previous provider. switch (spd->provider) { -#ifdef ENABLE_FILTER_VIRTUAL_GREENSCREEN_NVIDIA +#ifdef ENABLE_NVIDIA case virtual_greenscreen_provider::NVIDIA_GREENSCREEN: nvvfxgs_unload(); break; @@ -405,7 +405,7 @@ void streamfx::filter::virtual_greenscreen::virtual_greenscreen_instance::task_s // Load the new provider. switch (_provider) { -#ifdef ENABLE_FILTER_VIRTUAL_GREENSCREEN_NVIDIA +#ifdef ENABLE_NVIDIA case virtual_greenscreen_provider::NVIDIA_GREENSCREEN: nvvfxgs_load(); { @@ -430,7 +430,7 @@ void streamfx::filter::virtual_greenscreen::virtual_greenscreen_instance::task_s } } -#ifdef ENABLE_FILTER_VIRTUAL_GREENSCREEN_NVIDIA +#ifdef ENABLE_NVIDIA void streamfx::filter::virtual_greenscreen::virtual_greenscreen_instance::nvvfxgs_load() { _nvidia_fx = std::make_shared<::streamfx::nvidia::vfx::greenscreen>(); @@ -492,7 +492,7 @@ virtual_greenscreen_factory::virtual_greenscreen_factory() bool any_available = false; // 1. Try and load any configured providers. -#ifdef ENABLE_FILTER_VIRTUAL_GREENSCREEN_NVIDIA +#ifdef ENABLE_NVIDIA try { // Load CVImage and Video Effects SDK. _nvcuda = ::streamfx::nvidia::cuda::obs::get(); @@ -539,7 +539,7 @@ void virtual_greenscreen_factory::get_defaults2(obs_data_t* data) { obs_data_set_default_int(data, ST_KEY_PROVIDER, static_cast(virtual_greenscreen_provider::AUTOMATIC)); -#ifdef ENABLE_FILTER_VIRTUAL_GREENSCREEN_NVIDIA +#ifdef ENABLE_NVIDIA obs_data_set_default_int(data, ST_KEY_NVIDIA_GREENSCREEN_MODE, static_cast(::streamfx::nvidia::vfx::greenscreen_mode::QUALITY)); #endif } @@ -605,7 +605,7 @@ bool virtual_greenscreen_factory::on_manual_open(obs_properties_t* props, obs_pr bool streamfx::filter::virtual_greenscreen::virtual_greenscreen_factory::is_provider_available(virtual_greenscreen_provider provider) { switch (provider) { -#ifdef ENABLE_FILTER_VIRTUAL_GREENSCREEN_NVIDIA +#ifdef ENABLE_NVIDIA case virtual_greenscreen_provider::NVIDIA_GREENSCREEN: return _nvidia_available; #endif diff --git a/components/virtual-greenscreen/source/filters/filter-virtual-greenscreen.hpp b/components/virtual-greenscreen/source/filters/filter-virtual-greenscreen.hpp index 4d0c5ac164..48a0193662 100644 --- a/components/virtual-greenscreen/source/filters/filter-virtual-greenscreen.hpp +++ b/components/virtual-greenscreen/source/filters/filter-virtual-greenscreen.hpp @@ -16,7 +16,7 @@ #include #include "warning-enable.hpp" -#ifdef ENABLE_FILTER_VIRTUAL_GREENSCREEN_NVIDIA +#ifdef ENABLE_NVIDIA #include "nvidia/vfx/nvidia-vfx-greenscreen.hpp" #endif @@ -49,7 +49,7 @@ namespace streamfx::filter::virtual_greenscreen { std::shared_ptr<::streamfx::obs::gs::texture> _output_alpha; bool _dirty; -#ifdef ENABLE_FILTER_VIRTUAL_GREENSCREEN_NVIDIA +#ifdef ENABLE_NVIDIA std::shared_ptr<::streamfx::nvidia::vfx::greenscreen> _nvidia_fx; #endif @@ -72,7 +72,7 @@ namespace streamfx::filter::virtual_greenscreen { void switch_provider(virtual_greenscreen_provider provider); void task_switch_provider(util::threadpool::task_data_t data); -#ifdef ENABLE_FILTER_VIRTUAL_GREENSCREEN_NVIDIA +#ifdef ENABLE_NVIDIA void nvvfxgs_load(); void nvvfxgs_unload(); void nvvfxgs_size(); @@ -83,7 +83,7 @@ namespace streamfx::filter::virtual_greenscreen { }; class virtual_greenscreen_factory : public ::streamfx::obs::source_factory<::streamfx::filter::virtual_greenscreen::virtual_greenscreen_factory, ::streamfx::filter::virtual_greenscreen::virtual_greenscreen_instance> { -#ifdef ENABLE_FILTER_VIRTUAL_GREENSCREEN_NVIDIA +#ifdef ENABLE_NVIDIA bool _nvidia_available; std::shared_ptr<::streamfx::nvidia::cuda::obs> _nvcuda; std::shared_ptr<::streamfx::nvidia::cv::cv> _nvcvi; From 4ebc96997e301c33862025e2b5bdd9d2649a5d99 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 05:35:55 +0200 Subject: [PATCH 44/66] autoframing: Check if NVIDIA component is available --- components/autoframing/CMakeLists.txt | 17 +++++++++++++++- .../source/filters/filter-autoframing.cpp | 20 +++++++++---------- .../source/filters/filter-autoframing.hpp | 8 ++++---- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/components/autoframing/CMakeLists.txt b/components/autoframing/CMakeLists.txt index a99c2619ef..f373d5d3f5 100644 --- a/components/autoframing/CMakeLists.txt +++ b/components/autoframing/CMakeLists.txt @@ -6,4 +6,19 @@ cmake_minimum_required(VERSION 3.26) project("AutoFraming") list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") -streamfx_add_component("Auto-Framing") +streamfx_add_component("Auto-Framing" + RESOLVER streamfx_auto_framing_resolver +) +streamfx_add_component_dependency("NVIDIA" OPTIONAL) + +function(streamfx_auto_framing_resolver) + # Providers + #- NVIDIA + streamfx_enabled_component("NVIDIA" T_CHECK) + if(T_CHECK) + target_compile_definitions(${COMPONENT_TARGET} + PRIVATE ENABLE_NVIDIA + ) + endif() +endfunction() + diff --git a/components/autoframing/source/filters/filter-autoframing.cpp b/components/autoframing/source/filters/filter-autoframing.cpp index 60588b6038..e42245ed57 100644 --- a/components/autoframing/source/filters/filter-autoframing.cpp +++ b/components/autoframing/source/filters/filter-autoframing.cpp @@ -146,7 +146,7 @@ autoframing_instance::~autoframing_instance() // TODO: Make this asynchronous. switch (_provider) { -#ifdef ENABLE_FILTER_DENOISING_NVIDIA +#ifdef ENABLE_NVIDIA case tracking_provider::NVIDIA_FACEDETECTION: nvar_facedetection_unload(); break; @@ -358,7 +358,7 @@ void autoframing_instance::update(obs_data_t* data) std::unique_lock ul(_provider_lock); switch (_provider) { -#ifdef ENABLE_FILTER_UPSCALING_NVIDIA +#ifdef ENABLE_NVIDIA case tracking_provider::NVIDIA_FACEDETECTION: nvar_facedetection_update(data); break; @@ -375,7 +375,7 @@ void autoframing_instance::update(obs_data_t* data) void streamfx::filter::autoframing::autoframing_instance::properties(obs_properties_t* properties) { switch (_provider_ui) { -#ifdef ENABLE_FILTER_AUTOFRAMING_NVIDIA +#ifdef ENABLE_NVIDIA case tracking_provider::NVIDIA_FACEDETECTION: nvar_facedetection_properties(properties); break; @@ -490,7 +490,7 @@ void autoframing_instance::video_render(gs_effect_t* effect) std::unique_lock ul(_provider_lock); switch (_provider) { -#ifdef ENABLE_FILTER_DENOISING_NVIDIA +#ifdef ENABLE_NVIDIA case tracking_provider::NVIDIA_FACEDETECTION: nvar_facedetection_process(); break; @@ -864,7 +864,7 @@ void streamfx::filter::autoframing::autoframing_instance::task_switch_provider(u try { // Unload the previous provider. switch (spd->provider) { -#ifdef ENABLE_FILTER_AUTOFRAMING_NVIDIA +#ifdef ENABLE_NVIDIA case tracking_provider::NVIDIA_FACEDETECTION: nvar_facedetection_unload(); break; @@ -875,7 +875,7 @@ void streamfx::filter::autoframing::autoframing_instance::task_switch_provider(u // Load the new provider. switch (_provider) { -#ifdef ENABLE_FILTER_AUTOFRAMING_NVIDIA +#ifdef ENABLE_NVIDIA case tracking_provider::NVIDIA_FACEDETECTION: nvar_facedetection_load(); break; @@ -894,7 +894,7 @@ void streamfx::filter::autoframing::autoframing_instance::task_switch_provider(u } } -#ifdef ENABLE_FILTER_AUTOFRAMING_NVIDIA +#ifdef ENABLE_NVIDIA void streamfx::filter::autoframing::autoframing_instance::nvar_facedetection_load() { _nvidia_fx = std::make_shared<::streamfx::nvidia::ar::facedetection>(); @@ -1008,7 +1008,7 @@ autoframing_factory::autoframing_factory() bool any_available = false; // 1. Try and load any configured providers. -#ifdef ENABLE_FILTER_AUTOFRAMING_NVIDIA +#ifdef ENABLE_NVIDIA try { // Load CVImage and Video Effects SDK. _nvcuda = ::streamfx::nvidia::cuda::obs::get(); @@ -1213,7 +1213,7 @@ obs_properties_t* autoframing_factory::get_properties2(autoframing_instance* dat auto p = obs_properties_add_list(grp, ST_KEY_ADVANCED_PROVIDER, D_TRANSLATE(ST_I18N_ADVANCED_PROVIDER), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT); obs_property_set_modified_callback(p, modified_provider); obs_property_list_add_int(p, D_TRANSLATE(S_STATE_AUTOMATIC), static_cast(tracking_provider::AUTOMATIC)); -#ifdef ENABLE_FILTER_AUTOFRAMING_NVIDIA +#ifdef ENABLE_NVIDIA obs_property_list_add_int(p, D_TRANSLATE(ST_I18N_ADVANCED_PROVIDER_NVIDIA_FACEDETECTION), static_cast(tracking_provider::NVIDIA_FACEDETECTION)); #endif } @@ -1235,7 +1235,7 @@ bool streamfx::filter::autoframing::autoframing_factory::on_manual_open(obs_prop bool streamfx::filter::autoframing::autoframing_factory::is_provider_available(tracking_provider provider) { switch (provider) { -#ifdef ENABLE_FILTER_AUTOFRAMING_NVIDIA +#ifdef ENABLE_NVIDIA case tracking_provider::NVIDIA_FACEDETECTION: return _nvidia_available; #endif diff --git a/components/autoframing/source/filters/filter-autoframing.hpp b/components/autoframing/source/filters/filter-autoframing.hpp index 01983f6fc7..68cf16aaa5 100644 --- a/components/autoframing/source/filters/filter-autoframing.hpp +++ b/components/autoframing/source/filters/filter-autoframing.hpp @@ -19,7 +19,7 @@ #include #include "warning-enable.hpp" -#ifdef ENABLE_FILTER_AUTOFRAMING_NVIDIA +#ifdef ENABLE_NVIDIA #include "nvidia/ar/nvidia-ar-facedetection.hpp" #endif @@ -81,7 +81,7 @@ namespace streamfx::filter::autoframing { std::mutex _provider_lock; std::shared_ptr _provider_task; -#ifdef ENABLE_FILTER_AUTOFRAMING_NVIDIA +#ifdef ENABLE_NVIDIA std::shared_ptr<::streamfx::nvidia::ar::facedetection> _nvidia_fx; #endif @@ -135,7 +135,7 @@ namespace streamfx::filter::autoframing { void switch_provider(tracking_provider provider); void task_switch_provider(util::threadpool::task_data_t data); -#ifdef ENABLE_FILTER_AUTOFRAMING_NVIDIA +#ifdef ENABLE_NVIDIA void nvar_facedetection_load(); void nvar_facedetection_unload(); void nvar_facedetection_process(); @@ -145,7 +145,7 @@ namespace streamfx::filter::autoframing { }; class autoframing_factory : public obs::source_factory { -#ifdef ENABLE_FILTER_AUTOFRAMING_NVIDIA +#ifdef ENABLE_NVIDIA bool _nvidia_available; std::shared_ptr<::streamfx::nvidia::cuda::obs> _nvcuda; std::shared_ptr<::streamfx::nvidia::cv::cv> _nvcvi; From 34e754d474f713f881d8fb07169679d951ec93d5 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 05:37:41 +0200 Subject: [PATCH 45/66] upscaling: Check if NVIDIA component is available --- components/upscaling/CMakeLists.txt | 16 ++++++++++++- .../source/filters/filter-upscaling.cpp | 24 +++++++++---------- .../source/filters/filter-upscaling.hpp | 8 +++---- 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/components/upscaling/CMakeLists.txt b/components/upscaling/CMakeLists.txt index d498041c85..50c377f7a9 100644 --- a/components/upscaling/CMakeLists.txt +++ b/components/upscaling/CMakeLists.txt @@ -6,4 +6,18 @@ cmake_minimum_required(VERSION 3.26) project("Upscaling") list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") -streamfx_add_component("Upscaling") +streamfx_add_component("Upscaling" + RESOLVER streamfx_upscaling_resolver +) +streamfx_add_component_dependency("NVIDIA" OPTIONAL) + +function(streamfx_upscaling_resolver) + # Providers + #- NVIDIA + streamfx_enabled_component("NVIDIA" T_CHECK) + if(T_CHECK) + target_compile_definitions(${COMPONENT_TARGET} + ENABLE_NVIDIA + ) + endif() +endfunction() diff --git a/components/upscaling/source/filters/filter-upscaling.cpp b/components/upscaling/source/filters/filter-upscaling.cpp index c4dfe90e34..dd0d288d07 100644 --- a/components/upscaling/source/filters/filter-upscaling.cpp +++ b/components/upscaling/source/filters/filter-upscaling.cpp @@ -30,7 +30,7 @@ #define ST_I18N_PROVIDER ST_I18N "." ST_KEY_PROVIDER #define ST_I18N_PROVIDER_NVIDIA_SUPERRES ST_I18N_PROVIDER ".NVIDIA.SuperResolution" -#ifdef ENABLE_FILTER_UPSCALING_NVIDIA +#ifdef ENABLE_NVIDIA #define ST_KEY_NVIDIA_SUPERRES "NVIDIA.SuperRes" #define ST_I18N_NVIDIA_SUPERRES ST_I18N "." ST_KEY_NVIDIA_SUPERRES #define ST_KEY_NVIDIA_SUPERRES_STRENGTH "NVIDIA.SuperRes.Strength" @@ -123,7 +123,7 @@ upscaling_instance::~upscaling_instance() // TODO: Make this asynchronous. switch (_provider) { -#ifdef ENABLE_FILTER_UPSCALING_NVIDIA +#ifdef ENABLE_NVIDIA case upscaling_provider::NVIDIA_SUPERRESOLUTION: nvvfxsr_unload(); break; @@ -159,7 +159,7 @@ void upscaling_instance::update(obs_data_t* data) std::unique_lock ul(_provider_lock); switch (_provider) { -#ifdef ENABLE_FILTER_UPSCALING_NVIDIA +#ifdef ENABLE_NVIDIA case upscaling_provider::NVIDIA_SUPERRESOLUTION: nvvfxsr_update(data); break; @@ -173,7 +173,7 @@ void upscaling_instance::update(obs_data_t* data) void streamfx::filter::upscaling::upscaling_instance::properties(obs_properties_t* properties) { switch (_provider_ui) { -#ifdef ENABLE_FILTER_UPSCALING_NVIDIA +#ifdef ENABLE_NVIDIA case upscaling_provider::NVIDIA_SUPERRESOLUTION: nvvfxsr_properties(properties); break; @@ -206,7 +206,7 @@ void upscaling_instance::video_tick(float time) std::unique_lock ul(_provider_lock); switch (_provider) { -#ifdef ENABLE_FILTER_UPSCALING_NVIDIA +#ifdef ENABLE_NVIDIA case upscaling_provider::NVIDIA_SUPERRESOLUTION: nvvfxsr_size(); break; @@ -291,7 +291,7 @@ void upscaling_instance::video_render(gs_effect_t* effect) ::streamfx::obs::gs::debug_marker profiler1{::streamfx::obs::gs::debug_color_convert, "Process"}; #endif switch (_provider) { -#ifdef ENABLE_FILTER_UPSCALING_NVIDIA +#ifdef ENABLE_NVIDIA case upscaling_provider::NVIDIA_SUPERRESOLUTION: nvvfxsr_process(); break; @@ -384,7 +384,7 @@ void streamfx::filter::upscaling::upscaling_instance::task_switch_provider(util: try { // 3. Unload the previous provider. switch (spd->provider) { -#ifdef ENABLE_FILTER_UPSCALING_NVIDIA +#ifdef ENABLE_NVIDIA case upscaling_provider::NVIDIA_SUPERRESOLUTION: nvvfxsr_unload(); break; @@ -395,7 +395,7 @@ void streamfx::filter::upscaling::upscaling_instance::task_switch_provider(util: // 4. Load the new provider. switch (_provider) { -#ifdef ENABLE_FILTER_UPSCALING_NVIDIA +#ifdef ENABLE_NVIDIA case upscaling_provider::NVIDIA_SUPERRESOLUTION: nvvfxsr_load(); { @@ -420,7 +420,7 @@ void streamfx::filter::upscaling::upscaling_instance::task_switch_provider(util: } } -#ifdef ENABLE_FILTER_UPSCALING_NVIDIA +#ifdef ENABLE_NVIDIA void streamfx::filter::upscaling::upscaling_instance::nvvfxsr_load() { _nvidia_fx = std::make_shared<::streamfx::nvidia::vfx::superresolution>(); @@ -489,7 +489,7 @@ upscaling_factory::upscaling_factory() bool any_available = false; // 1. Try and load any configured providers. -#ifdef ENABLE_FILTER_UPSCALING_NVIDIA +#ifdef ENABLE_NVIDIA try { // Load CVImage and Video Effects SDK. _nvcuda = ::streamfx::nvidia::cuda::obs::get(); @@ -539,7 +539,7 @@ void upscaling_factory::get_defaults2(obs_data_t* data) { obs_data_set_default_int(data, ST_KEY_PROVIDER, static_cast(upscaling_provider::AUTOMATIC)); -#ifdef ENABLE_FILTER_UPSCALING_NVIDIA +#ifdef ENABLE_NVIDIA obs_data_set_default_double(data, ST_KEY_NVIDIA_SUPERRES_SCALE, 150.); obs_data_set_default_double(data, ST_KEY_NVIDIA_SUPERRES_STRENGTH, 0.); #endif @@ -606,7 +606,7 @@ bool upscaling_factory::on_manual_open(obs_properties_t* props, obs_property_t* bool streamfx::filter::upscaling::upscaling_factory::is_provider_available(upscaling_provider provider) { switch (provider) { -#ifdef ENABLE_FILTER_UPSCALING_NVIDIA +#ifdef ENABLE_NVIDIA case upscaling_provider::NVIDIA_SUPERRESOLUTION: return _nvidia_available; #endif diff --git a/components/upscaling/source/filters/filter-upscaling.hpp b/components/upscaling/source/filters/filter-upscaling.hpp index 19cf3817a9..18eed40311 100644 --- a/components/upscaling/source/filters/filter-upscaling.hpp +++ b/components/upscaling/source/filters/filter-upscaling.hpp @@ -16,7 +16,7 @@ #include #include "warning-enable.hpp" -#ifdef ENABLE_FILTER_UPSCALING_NVIDIA +#ifdef ENABLE_NVIDIA #include "nvidia/vfx/nvidia-vfx-superresolution.hpp" #endif @@ -49,7 +49,7 @@ namespace streamfx::filter::upscaling { std::shared_ptr<::streamfx::obs::gs::texture> _output; bool _dirty; -#ifdef ENABLE_FILTER_UPSCALING_NVIDIA +#ifdef ENABLE_NVIDIA std::shared_ptr<::streamfx::nvidia::vfx::superresolution> _nvidia_fx; #endif @@ -72,7 +72,7 @@ namespace streamfx::filter::upscaling { void switch_provider(upscaling_provider provider); void task_switch_provider(util::threadpool::task_data_t data); -#ifdef ENABLE_FILTER_UPSCALING_NVIDIA +#ifdef ENABLE_NVIDIA void nvvfxsr_load(); void nvvfxsr_unload(); void nvvfxsr_size(); @@ -83,7 +83,7 @@ namespace streamfx::filter::upscaling { }; class upscaling_factory : public ::streamfx::obs::source_factory<::streamfx::filter::upscaling::upscaling_factory, ::streamfx::filter::upscaling::upscaling_instance> { -#ifdef ENABLE_FILTER_UPSCALING_NVIDIA +#ifdef ENABLE_NVIDIA bool _nvidia_available; std::shared_ptr<::streamfx::nvidia::cuda::obs> _nvcuda; std::shared_ptr<::streamfx::nvidia::cv::cv> _nvcvi; From a63eb8b80a8fb7cfaab0c890c3c96ec2d2529c9e Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 05:40:01 +0200 Subject: [PATCH 46/66] denoising: Check if NVIDIA component is available --- components/denoising/CMakeLists.txt | 16 +++++++++++- .../source/filters/filter-denoising.cpp | 26 +++++++++---------- .../source/filters/filter-denoising.hpp | 8 +++--- 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/components/denoising/CMakeLists.txt b/components/denoising/CMakeLists.txt index 372c4435c1..a2051c3488 100644 --- a/components/denoising/CMakeLists.txt +++ b/components/denoising/CMakeLists.txt @@ -6,4 +6,18 @@ cmake_minimum_required(VERSION 3.26) project("Denoising") list(APPEND CMAKE_MESSAGE_INDENT "[${PROJECT_NAME}] ") -streamfx_add_component("Denoising") +streamfx_add_component("Denoising" + RESOLVER streamfx_denoising_resolver +) +streamfx_add_component_dependency("NVIDIA" OPTIONAL) + +function(streamfx_denoising_resolver) + # Providers + #- NVIDIA + streamfx_enabled_component("NVIDIA" T_CHECK) + if(T_CHECK) + target_compile_definitions(${COMPONENT_TARGET} + ENABLE_NVIDIA + ) + endif() +endfunction() diff --git a/components/denoising/source/filters/filter-denoising.cpp b/components/denoising/source/filters/filter-denoising.cpp index 42745b3741..bdcc6c7ecf 100644 --- a/components/denoising/source/filters/filter-denoising.cpp +++ b/components/denoising/source/filters/filter-denoising.cpp @@ -30,7 +30,7 @@ #define ST_I18N_PROVIDER ST_I18N "." ST_KEY_PROVIDER #define ST_I18N_PROVIDER_NVIDIA_DENOISING ST_I18N_PROVIDER ".NVIDIA.Denoising" -#ifdef ENABLE_FILTER_DENOISING_NVIDIA +#ifdef ENABLE_NVIDIA #define ST_KEY_NVIDIA_DENOISING "NVIDIA.Denoising" #define ST_I18N_NVIDIA_DENOISING ST_I18N "." ST_KEY_NVIDIA_DENOISING #define ST_KEY_NVIDIA_DENOISING_STRENGTH "NVIDIA.Denoising.Strength" @@ -121,7 +121,7 @@ denoising_instance::~denoising_instance() // TODO: Make this asynchronous. switch (_provider) { -#ifdef ENABLE_FILTER_DENOISING_NVIDIA +#ifdef ENABLE_NVIDIA case denoising_provider::NVIDIA_DENOISING: nvvfx_denoising_unload(); break; @@ -157,7 +157,7 @@ void denoising_instance::update(obs_data_t* data) std::unique_lock ul(_provider_lock); switch (_provider) { -#ifdef ENABLE_FILTER_DENOISING_NVIDIA +#ifdef ENABLE_NVIDIA case denoising_provider::NVIDIA_DENOISING: nvvfx_denoising_update(data); break; @@ -171,7 +171,7 @@ void denoising_instance::update(obs_data_t* data) void streamfx::filter::denoising::denoising_instance::properties(obs_properties_t* properties) { switch (_provider_ui) { -#ifdef ENABLE_FILTER_DENOISING_NVIDIA +#ifdef ENABLE_NVIDIA case denoising_provider::NVIDIA_DENOISING: nvvfx_denoising_properties(properties); break; @@ -208,7 +208,7 @@ void denoising_instance::video_tick(float time) std::unique_lock ul(_provider_lock); switch (_provider) { -#ifdef ENABLE_FILTER_DENOISING_NVIDIA +#ifdef ENABLE_NVIDIA case denoising_provider::NVIDIA_DENOISING: nvvfx_denoising_size(); break; @@ -252,7 +252,7 @@ void denoising_instance::video_render(gs_effect_t* effect) { // Allow the provider to restrict the size. switch (_provider) { -#ifdef ENABLE_FILTER_DENOISING_NVIDIA +#ifdef ENABLE_NVIDIA case denoising_provider::NVIDIA_DENOISING: nvvfx_denoising_size(); break; @@ -305,7 +305,7 @@ void denoising_instance::video_render(gs_effect_t* effect) ::streamfx::obs::gs::debug_marker profiler1{::streamfx::obs::gs::debug_color_convert, "Process"}; #endif switch (_provider) { -#ifdef ENABLE_FILTER_DENOISING_NVIDIA +#ifdef ENABLE_NVIDIA case denoising_provider::NVIDIA_DENOISING: nvvfx_denoising_process(); break; @@ -401,7 +401,7 @@ void streamfx::filter::denoising::denoising_instance::task_switch_provider(util: try { // 3. Unload the previous provider. switch (spd->provider) { -#ifdef ENABLE_FILTER_DENOISING_NVIDIA +#ifdef ENABLE_NVIDIA case denoising_provider::NVIDIA_DENOISING: nvvfx_denoising_unload(); break; @@ -412,7 +412,7 @@ void streamfx::filter::denoising::denoising_instance::task_switch_provider(util: // 4. Load the new provider. switch (_provider) { -#ifdef ENABLE_FILTER_DENOISING_NVIDIA +#ifdef ENABLE_NVIDIA case denoising_provider::NVIDIA_DENOISING: nvvfx_denoising_load(); break; @@ -431,7 +431,7 @@ void streamfx::filter::denoising::denoising_instance::task_switch_provider(util: } } -#ifdef ENABLE_FILTER_DENOISING_NVIDIA +#ifdef ENABLE_NVIDIA void streamfx::filter::denoising::denoising_instance::nvvfx_denoising_load() { _nvidia_fx = std::make_shared<::streamfx::nvidia::vfx::denoising>(); @@ -493,7 +493,7 @@ denoising_factory::denoising_factory() bool any_available = false; // 1. Try and load any configured providers. -#ifdef ENABLE_FILTER_DENOISING_NVIDIA +#ifdef ENABLE_NVIDIA try { // Load CVImage and Video Effects SDK. _nvcuda = ::streamfx::nvidia::cuda::obs::get(); @@ -543,7 +543,7 @@ void denoising_factory::get_defaults2(obs_data_t* data) { obs_data_set_default_int(data, ST_KEY_PROVIDER, static_cast(denoising_provider::AUTOMATIC)); -#ifdef ENABLE_FILTER_DENOISING_NVIDIA +#ifdef ENABLE_NVIDIA obs_data_set_default_double(data, ST_KEY_NVIDIA_DENOISING_STRENGTH, 1.); #endif } @@ -601,7 +601,7 @@ bool denoising_factory::on_manual_open(obs_properties_t* props, obs_property_t* bool streamfx::filter::denoising::denoising_factory::is_provider_available(denoising_provider provider) { switch (provider) { -#ifdef ENABLE_FILTER_DENOISING_NVIDIA +#ifdef ENABLE_NVIDIA case denoising_provider::NVIDIA_DENOISING: return _nvidia_available; #endif diff --git a/components/denoising/source/filters/filter-denoising.hpp b/components/denoising/source/filters/filter-denoising.hpp index 50c7eb728d..555d40a1d8 100644 --- a/components/denoising/source/filters/filter-denoising.hpp +++ b/components/denoising/source/filters/filter-denoising.hpp @@ -16,7 +16,7 @@ #include #include "warning-enable.hpp" -#ifdef ENABLE_FILTER_DENOISING_NVIDIA +#ifdef ENABLE_NVIDIA #include "nvidia/vfx/nvidia-vfx-denoising.hpp" #endif @@ -48,7 +48,7 @@ namespace streamfx::filter::denoising { std::shared_ptr<::streamfx::obs::gs::texture> _output; bool _dirty; -#ifdef ENABLE_FILTER_DENOISING_NVIDIA +#ifdef ENABLE_NVIDIA std::shared_ptr<::streamfx::nvidia::vfx::denoising> _nvidia_fx; #endif @@ -71,7 +71,7 @@ namespace streamfx::filter::denoising { void switch_provider(denoising_provider provider); void task_switch_provider(util::threadpool::task_data_t data); -#ifdef ENABLE_FILTER_DENOISING_NVIDIA +#ifdef ENABLE_NVIDIA void nvvfx_denoising_load(); void nvvfx_denoising_unload(); void nvvfx_denoising_size(); @@ -82,7 +82,7 @@ namespace streamfx::filter::denoising { }; class denoising_factory : public obs::source_factory<::streamfx::filter::denoising::denoising_factory, ::streamfx::filter::denoising::denoising_instance> { -#ifdef ENABLE_FILTER_DENOISING_NVIDIA +#ifdef ENABLE_NVIDIA bool _nvidia_available; std::shared_ptr<::streamfx::nvidia::cuda::obs> _nvcuda; std::shared_ptr<::streamfx::nvidia::cv::cv> _nvcvi; From 915c85e60e4b09bd48122175176d0bf8e747b334 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 06:51:56 +0200 Subject: [PATCH 47/66] core: Frontend and Updater are default features --- CMakeLists.txt | 6 ----- .../source/filters/filter-autoframing.cpp | 4 ---- .../source/filters/filter-autoframing.hpp | 2 -- components/blur/source/filter/filter-blur.cpp | 4 ---- components/blur/source/filter/filter-blur.hpp | 2 -- .../source/filters/filter-color-grade.cpp | 4 ---- .../source/filters/filter-color-grade.hpp | 2 -- .../source/filters/filter-denoising.cpp | 4 ---- .../source/filters/filter-denoising.hpp | 2 -- .../source/filters/filter-dynamic-mask.cpp | 4 ---- .../source/filters/filter-dynamic-mask.hpp | 2 -- .../ffmpeg/source/encoders/encoder-ffmpeg.cpp | 4 ---- .../ffmpeg/source/encoders/encoder-ffmpeg.hpp | 2 -- .../mirror/source/sources/source-mirror.cpp | 4 ---- .../mirror/source/sources/source-mirror.hpp | 2 -- .../source/filters/filter-sdf-effects.cpp | 4 ---- .../source/filters/filter-sdf-effects.hpp | 2 -- .../shader/source/filters/filter-shader.cpp | 4 ---- .../shader/source/filters/filter-shader.hpp | 2 -- .../shader/source/sources/source-shader.cpp | 4 ---- .../shader/source/sources/source-shader.hpp | 2 -- .../source/transitions/transition-shader.cpp | 4 ---- .../source/transitions/transition-shader.hpp | 2 -- .../source/filter/filter-transform.cpp | 4 ---- .../source/filter/filter-transform.hpp | 2 -- .../source/filters/filter-upscaling.cpp | 4 ---- .../source/filters/filter-upscaling.hpp | 2 -- .../filters/filter-virtual-greenscreen.cpp | 4 ---- .../filters/filter-virtual-greenscreen.hpp | 2 -- source/plugin.cpp | 23 +------------------ source/plugin.hpp | 2 -- source/ui/ui.cpp | 13 ++--------- source/ui/ui.hpp | 5 ---- 33 files changed, 3 insertions(+), 130 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0778b0cbec..a882285f29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -643,9 +643,6 @@ list(APPEND PROJECT_PRIVATE_SOURCE "source/updater.hpp" "source/updater.cpp" ) -list(APPEND PROJECT_DEFINITIONS - ENABLE_UPDATER -) # Frontend list(APPEND PROJECT_UI @@ -667,9 +664,6 @@ list(APPEND PROJECT_UI_SOURCE list(APPEND PROJECT_INCLUDE_DIRS "source/ui" ) -list(APPEND PROJECT_DEFINITIONS - ENABLE_FRONTEND -) list(APPEND PROJECT_UI_SOURCE "source/ui/ui-updater.hpp" diff --git a/components/autoframing/source/filters/filter-autoframing.cpp b/components/autoframing/source/filters/filter-autoframing.cpp index e42245ed57..bb2accc991 100644 --- a/components/autoframing/source/filters/filter-autoframing.cpp +++ b/components/autoframing/source/filters/filter-autoframing.cpp @@ -1097,11 +1097,9 @@ obs_properties_t* autoframing_factory::get_properties2(autoframing_instance* dat { obs_properties_t* pr = obs_properties_create(); -#ifdef ENABLE_FRONTEND { obs_properties_add_button2(pr, S_MANUAL_OPEN, D_TRANSLATE(S_MANUAL_OPEN), autoframing_factory::on_manual_open, nullptr); } -#endif { auto grp = obs_properties_create(); @@ -1224,13 +1222,11 @@ obs_properties_t* autoframing_factory::get_properties2(autoframing_instance* dat return pr; } -#ifdef ENABLE_FRONTEND bool streamfx::filter::autoframing::autoframing_factory::on_manual_open(obs_properties_t* props, obs_property_t* property, void* data) { streamfx::open_url(HELP_URL); return false; } -#endif bool streamfx::filter::autoframing::autoframing_factory::is_provider_available(tracking_provider provider) { diff --git a/components/autoframing/source/filters/filter-autoframing.hpp b/components/autoframing/source/filters/filter-autoframing.hpp index 68cf16aaa5..b0246265a4 100644 --- a/components/autoframing/source/filters/filter-autoframing.hpp +++ b/components/autoframing/source/filters/filter-autoframing.hpp @@ -161,9 +161,7 @@ namespace streamfx::filter::autoframing { void get_defaults2(obs_data_t* data) override; obs_properties_t* get_properties2(autoframing_instance* data) override; -#ifdef ENABLE_FRONTEND static bool on_manual_open(obs_properties_t* props, obs_property_t* property, void* data); -#endif bool is_provider_available(tracking_provider); tracking_provider find_ideal_provider(); diff --git a/components/blur/source/filter/filter-blur.cpp b/components/blur/source/filter/filter-blur.cpp index 9067973bf2..04e19cd69f 100644 --- a/components/blur/source/filter/filter-blur.cpp +++ b/components/blur/source/filter/filter-blur.cpp @@ -745,11 +745,9 @@ obs_properties_t* blur_factory::get_properties2(blur_instance* data) obs_properties_t* pr = obs_properties_create(); obs_property_t* p = NULL; -#ifdef ENABLE_FRONTEND { obs_properties_add_button2(pr, S_MANUAL_OPEN, D_TRANSLATE(S_MANUAL_OPEN), streamfx::filter::blur::blur_factory::on_manual_open, nullptr); } -#endif // Blur Type and Sub-Type { @@ -840,7 +838,6 @@ std::string blur_factory::translate_string(const char* format, ...) return std::string(buffer.data(), buffer.data() + len); } -#ifdef ENABLE_FRONTEND bool blur_factory::on_manual_open(obs_properties_t* props, obs_property_t* property, void* data) { try { @@ -854,7 +851,6 @@ bool blur_factory::on_manual_open(obs_properties_t* props, obs_property_t* prope return false; } } -#endif std::shared_ptr blur_factory::instance() { diff --git a/components/blur/source/filter/filter-blur.hpp b/components/blur/source/filter/filter-blur.hpp index 3066ec87da..4477567f04 100644 --- a/components/blur/source/filter/filter-blur.hpp +++ b/components/blur/source/filter/filter-blur.hpp @@ -115,9 +115,7 @@ namespace streamfx::filter::blur { std::string translate_string(const char* format, ...); -#ifdef ENABLE_FRONTEND static bool on_manual_open(obs_properties_t* props, obs_property_t* property, void* data); -#endif public: // Singleton static std::shared_ptr instance(); diff --git a/components/color-grade/source/filters/filter-color-grade.cpp b/components/color-grade/source/filters/filter-color-grade.cpp index db78fced97..5bf62dcb67 100644 --- a/components/color-grade/source/filters/filter-color-grade.cpp +++ b/components/color-grade/source/filters/filter-color-grade.cpp @@ -613,11 +613,9 @@ obs_properties_t* color_grade_factory::get_properties2(color_grade_instance* dat { obs_properties_t* pr = obs_properties_create(); -#ifdef ENABLE_FRONTEND { obs_properties_add_button2(pr, S_MANUAL_OPEN, D_TRANSLATE(S_MANUAL_OPEN), streamfx::filter::color_grade::color_grade_factory::on_manual_open, nullptr); } -#endif { obs_properties_t* grp = obs_properties_create(); @@ -810,7 +808,6 @@ obs_properties_t* color_grade_factory::get_properties2(color_grade_instance* dat return pr; } -#ifdef ENABLE_FRONTEND bool color_grade_factory::on_manual_open(obs_properties_t* props, obs_property_t* property, void* data) { try { @@ -824,7 +821,6 @@ bool color_grade_factory::on_manual_open(obs_properties_t* props, obs_property_t return false; } } -#endif std::shared_ptr streamfx::filter::color_grade::color_grade_factory::instance() { diff --git a/components/color-grade/source/filters/filter-color-grade.hpp b/components/color-grade/source/filters/filter-color-grade.hpp index e9c867d5bc..dd6bc0bcdb 100644 --- a/components/color-grade/source/filters/filter-color-grade.hpp +++ b/components/color-grade/source/filters/filter-color-grade.hpp @@ -98,9 +98,7 @@ namespace streamfx::filter::color_grade { virtual obs_properties_t* get_properties2(color_grade_instance* data) override; -#ifdef ENABLE_FRONTEND static bool on_manual_open(obs_properties_t* props, obs_property_t* property, void* data); -#endif public: // Singleton static std::shared_ptr instance(); diff --git a/components/denoising/source/filters/filter-denoising.cpp b/components/denoising/source/filters/filter-denoising.cpp index bdcc6c7ecf..b211379ef9 100644 --- a/components/denoising/source/filters/filter-denoising.cpp +++ b/components/denoising/source/filters/filter-denoising.cpp @@ -565,11 +565,9 @@ obs_properties_t* denoising_factory::get_properties2(denoising_instance* data) { obs_properties_t* pr = obs_properties_create(); -#ifdef ENABLE_FRONTEND { obs_properties_add_button2(pr, S_MANUAL_OPEN, D_TRANSLATE(S_MANUAL_OPEN), denoising_factory::on_manual_open, nullptr); } -#endif if (data) { data->properties(pr); @@ -590,13 +588,11 @@ obs_properties_t* denoising_factory::get_properties2(denoising_instance* data) return pr; } -#ifdef ENABLE_FRONTEND bool denoising_factory::on_manual_open(obs_properties_t* props, obs_property_t* property, void* data) { streamfx::open_url(HELP_URL); return false; } -#endif bool streamfx::filter::denoising::denoising_factory::is_provider_available(denoising_provider provider) { diff --git a/components/denoising/source/filters/filter-denoising.hpp b/components/denoising/source/filters/filter-denoising.hpp index 555d40a1d8..a08a1e7e43 100644 --- a/components/denoising/source/filters/filter-denoising.hpp +++ b/components/denoising/source/filters/filter-denoising.hpp @@ -98,9 +98,7 @@ namespace streamfx::filter::denoising { virtual void get_defaults2(obs_data_t* data) override; virtual obs_properties_t* get_properties2(denoising_instance* data) override; -#ifdef ENABLE_FRONTEND static bool on_manual_open(obs_properties_t* props, obs_property_t* property, void* data); -#endif bool is_provider_available(denoising_provider); denoising_provider find_ideal_provider(); diff --git a/components/dynamic-mask/source/filters/filter-dynamic-mask.cpp b/components/dynamic-mask/source/filters/filter-dynamic-mask.cpp index b68cf0413f..a8ef204416 100644 --- a/components/dynamic-mask/source/filters/filter-dynamic-mask.cpp +++ b/components/dynamic-mask/source/filters/filter-dynamic-mask.cpp @@ -721,11 +721,9 @@ obs_properties_t* dynamic_mask_factory::get_properties2(dynamic_mask_instance* d _translation_cache.clear(); -#ifdef ENABLE_FRONTEND { obs_properties_add_button2(props, S_MANUAL_OPEN, D_TRANSLATE(S_MANUAL_OPEN), streamfx::filter::dynamic_mask::dynamic_mask_factory::on_manual_open, nullptr); } -#endif { // Input p = obs_properties_add_list(props, ST_KEY_INPUT, D_TRANSLATE(ST_I18N_INPUT), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING); @@ -806,7 +804,6 @@ std::string dynamic_mask_factory::translate_string(const char* format, ...) return std::string(buffer.data(), buffer.data() + len); } -#ifdef ENABLE_FRONTEND bool dynamic_mask_factory::on_manual_open(obs_properties_t* props, obs_property_t* property, void* data) { try { @@ -820,7 +817,6 @@ bool dynamic_mask_factory::on_manual_open(obs_properties_t* props, obs_property_ return false; } } -#endif std::shared_ptr dynamic_mask_factory::instance() { diff --git a/components/dynamic-mask/source/filters/filter-dynamic-mask.hpp b/components/dynamic-mask/source/filters/filter-dynamic-mask.hpp index 2982116f8e..297096ba9c 100644 --- a/components/dynamic-mask/source/filters/filter-dynamic-mask.hpp +++ b/components/dynamic-mask/source/filters/filter-dynamic-mask.hpp @@ -124,9 +124,7 @@ namespace streamfx::filter::dynamic_mask { std::string translate_string(const char* format, ...); -#ifdef ENABLE_FRONTEND static bool on_manual_open(obs_properties_t* props, obs_property_t* property, void* data); -#endif public: // Singleton static void initialize(); diff --git a/components/ffmpeg/source/encoders/encoder-ffmpeg.cpp b/components/ffmpeg/source/encoders/encoder-ffmpeg.cpp index 0af9c80389..9134253a88 100644 --- a/components/ffmpeg/source/encoders/encoder-ffmpeg.cpp +++ b/components/ffmpeg/source/encoders/encoder-ffmpeg.cpp @@ -1030,11 +1030,9 @@ obs_properties_t* ffmpeg_factory::get_properties2(instance_t* data) { obs_properties_t* props = obs_properties_create(); -#ifdef ENABLE_FRONTEND { obs_properties_add_button2(props, S_MANUAL_OPEN, D_TRANSLATE(S_MANUAL_OPEN), streamfx::encoder::ffmpeg::ffmpeg_factory::on_manual_open, this); } -#endif if (data) { data->get_properties(props); @@ -1108,14 +1106,12 @@ obs_properties_t* ffmpeg_factory::get_properties2(instance_t* data) return props; } -#ifdef ENABLE_FRONTEND bool ffmpeg_factory::on_manual_open(obs_properties_t* props, obs_property_t* property, void* data) { ffmpeg_factory* ptr = static_cast(data); streamfx::open_url(ptr->_handler->help(ptr)); return false; } -#endif const AVCodec* ffmpeg_factory::get_avcodec() { diff --git a/components/ffmpeg/source/encoders/encoder-ffmpeg.hpp b/components/ffmpeg/source/encoders/encoder-ffmpeg.hpp index d4e4cbcbd7..dafa76e274 100644 --- a/components/ffmpeg/source/encoders/encoder-ffmpeg.hpp +++ b/components/ffmpeg/source/encoders/encoder-ffmpeg.hpp @@ -129,9 +129,7 @@ namespace streamfx::encoder::ffmpeg { obs_properties_t* get_properties2(instance_t* data) override; -#ifdef ENABLE_FRONTEND static bool on_manual_open(obs_properties_t* props, obs_property_t* property, void* data); -#endif public: const AVCodec* get_avcodec(); diff --git a/components/mirror/source/sources/source-mirror.cpp b/components/mirror/source/sources/source-mirror.cpp index 5bc6a7b2be..cb63b5e16c 100644 --- a/components/mirror/source/sources/source-mirror.cpp +++ b/components/mirror/source/sources/source-mirror.cpp @@ -316,11 +316,9 @@ obs_properties_t* mirror_factory::get_properties2(mirror_instance* data) obs_properties_t* pr = obs_properties_create(); obs_property_t* p = nullptr; -#ifdef ENABLE_FRONTEND { obs_properties_add_button2(pr, S_MANUAL_OPEN, D_TRANSLATE(S_MANUAL_OPEN), streamfx::source::mirror::mirror_factory::on_manual_open, nullptr); } -#endif { p = obs_properties_add_list(pr, ST_KEY_SOURCE, D_TRANSLATE(ST_I18N_SOURCE), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING); @@ -365,7 +363,6 @@ obs_properties_t* mirror_factory::get_properties2(mirror_instance* data) return pr; } -#ifdef ENABLE_FRONTEND bool mirror_factory::on_manual_open(obs_properties_t* props, obs_property_t* property, void* data) { try { @@ -379,7 +376,6 @@ bool mirror_factory::on_manual_open(obs_properties_t* props, obs_property_t* pro return false; } } -#endif std::shared_ptr mirror_factory::instance() { diff --git a/components/mirror/source/sources/source-mirror.hpp b/components/mirror/source/sources/source-mirror.hpp index 88a06e1fcf..8d3dd8c624 100644 --- a/components/mirror/source/sources/source-mirror.hpp +++ b/components/mirror/source/sources/source-mirror.hpp @@ -81,9 +81,7 @@ namespace streamfx::source::mirror { virtual obs_properties_t* get_properties2(source::mirror::mirror_instance* data) override; -#ifdef ENABLE_FRONTEND static bool on_manual_open(obs_properties_t* props, obs_property_t* property, void* data); -#endif public: // Singleton static void initialize(); diff --git a/components/sdf-effects/source/filters/filter-sdf-effects.cpp b/components/sdf-effects/source/filters/filter-sdf-effects.cpp index d0fd68d1f4..bc2d0747a2 100644 --- a/components/sdf-effects/source/filters/filter-sdf-effects.cpp +++ b/components/sdf-effects/source/filters/filter-sdf-effects.cpp @@ -594,11 +594,9 @@ obs_properties_t* sdf_effects_factory::get_properties2(sdf_effects_instance* dat obs_properties_t* prs = obs_properties_create(); obs_property_t* p = nullptr; -#ifdef ENABLE_FRONTEND { obs_properties_add_button2(prs, S_MANUAL_OPEN, D_TRANSLATE(S_MANUAL_OPEN), streamfx::filter::sdf_effects::sdf_effects_factory::on_manual_open, nullptr); } -#endif { // Shadow Outer auto pr = obs_properties_create(); @@ -669,7 +667,6 @@ obs_properties_t* sdf_effects_factory::get_properties2(sdf_effects_instance* dat return prs; } -#ifdef ENABLE_FRONTEND bool sdf_effects_factory::on_manual_open(obs_properties_t* props, obs_property_t* property, void* data) { try { @@ -683,7 +680,6 @@ bool sdf_effects_factory::on_manual_open(obs_properties_t* props, obs_property_t return false; } } -#endif std::shared_ptr sdf_effects_factory::instance() { diff --git a/components/sdf-effects/source/filters/filter-sdf-effects.hpp b/components/sdf-effects/source/filters/filter-sdf-effects.hpp index 497873c667..3959bdbd43 100644 --- a/components/sdf-effects/source/filters/filter-sdf-effects.hpp +++ b/components/sdf-effects/source/filters/filter-sdf-effects.hpp @@ -91,9 +91,7 @@ namespace streamfx::filter::sdf_effects { virtual obs_properties_t* get_properties2(filter::sdf_effects::sdf_effects_instance* data) override; -#ifdef ENABLE_FRONTEND static bool on_manual_open(obs_properties_t* props, obs_property_t* property, void* data); -#endif public: // Singleton static void initialize(); diff --git a/components/shader/source/filters/filter-shader.cpp b/components/shader/source/filters/filter-shader.cpp index 031628969a..038bde9fdd 100644 --- a/components/shader/source/filters/filter-shader.cpp +++ b/components/shader/source/filters/filter-shader.cpp @@ -188,11 +188,9 @@ obs_properties_t* shader_factory::get_properties2(shader::shader_instance* data) auto pr = obs_properties_create(); obs_properties_set_param(pr, data, nullptr); -#ifdef ENABLE_FRONTEND { auto p = obs_properties_add_button2(pr, S_MANUAL_OPEN, D_TRANSLATE(S_MANUAL_OPEN), streamfx::filter::shader::shader_factory::on_manual_open, nullptr); } -#endif if (data) { reinterpret_cast(data)->properties(pr); @@ -201,7 +199,6 @@ obs_properties_t* shader_factory::get_properties2(shader::shader_instance* data) return pr; } -#ifdef ENABLE_FRONTEND bool shader_factory::on_manual_open(obs_properties_t* props, obs_property_t* property, void* data) { try { @@ -215,7 +212,6 @@ bool shader_factory::on_manual_open(obs_properties_t* props, obs_property_t* pro return false; } } -#endif std::shared_ptr shader_factory::instance() { diff --git a/components/shader/source/filters/filter-shader.hpp b/components/shader/source/filters/filter-shader.hpp index 5de3026c35..b52af30d2a 100644 --- a/components/shader/source/filters/filter-shader.hpp +++ b/components/shader/source/filters/filter-shader.hpp @@ -48,9 +48,7 @@ namespace streamfx::filter::shader { virtual obs_properties_t* get_properties2(filter::shader::shader_instance* data) override; -#ifdef ENABLE_FRONTEND static bool on_manual_open(obs_properties_t* props, obs_property_t* property, void* data); -#endif public: // Singleton static void initialize(); diff --git a/components/shader/source/sources/source-shader.cpp b/components/shader/source/sources/source-shader.cpp index 021c659244..04e518076d 100644 --- a/components/shader/source/sources/source-shader.cpp +++ b/components/shader/source/sources/source-shader.cpp @@ -142,11 +142,9 @@ obs_properties_t* shader_factory::get_properties2(shader_instance* data) auto pr = obs_properties_create(); obs_properties_set_param(pr, data, nullptr); -#ifdef ENABLE_FRONTEND { obs_properties_add_button2(pr, S_MANUAL_OPEN, D_TRANSLATE(S_MANUAL_OPEN), streamfx::source::shader::shader_factory::on_manual_open, nullptr); } -#endif if (data) { reinterpret_cast(data)->properties(pr); @@ -155,7 +153,6 @@ obs_properties_t* shader_factory::get_properties2(shader_instance* data) return pr; } -#ifdef ENABLE_FRONTEND bool shader_factory::on_manual_open(obs_properties_t* props, obs_property_t* property, void* data) { try { @@ -169,7 +166,6 @@ bool shader_factory::on_manual_open(obs_properties_t* props, obs_property_t* pro return false; } } -#endif std::shared_ptr shader_factory::instance() { diff --git a/components/shader/source/sources/source-shader.hpp b/components/shader/source/sources/source-shader.hpp index 5cf5284ce0..ee1db12a0a 100644 --- a/components/shader/source/sources/source-shader.hpp +++ b/components/shader/source/sources/source-shader.hpp @@ -47,9 +47,7 @@ namespace streamfx::source::shader { virtual obs_properties_t* get_properties2(source::shader::shader_instance* data) override; -#ifdef ENABLE_FRONTEND static bool on_manual_open(obs_properties_t* props, obs_property_t* property, void* data); -#endif public: // Singleton static std::shared_ptr instance(); diff --git a/components/shader/source/transitions/transition-shader.cpp b/components/shader/source/transitions/transition-shader.cpp index 0a38b96e44..cfa285a5db 100644 --- a/components/shader/source/transitions/transition-shader.cpp +++ b/components/shader/source/transitions/transition-shader.cpp @@ -149,11 +149,9 @@ obs_properties_t* shader_factory::get_properties2(shader::shader_instance* data) auto pr = obs_properties_create(); obs_properties_set_param(pr, data, nullptr); -#ifdef ENABLE_FRONTEND { obs_properties_add_button2(pr, S_MANUAL_OPEN, D_TRANSLATE(S_MANUAL_OPEN), streamfx::transition::shader::shader_factory::on_manual_open, nullptr); } -#endif if (data) { reinterpret_cast(data)->properties(pr); @@ -162,7 +160,6 @@ obs_properties_t* shader_factory::get_properties2(shader::shader_instance* data) return pr; } -#ifdef ENABLE_FRONTEND bool shader_factory::on_manual_open(obs_properties_t* props, obs_property_t* property, void* data) { try { @@ -176,7 +173,6 @@ bool shader_factory::on_manual_open(obs_properties_t* props, obs_property_t* pro return false; } } -#endif std::shared_ptr shader_factory::instance() { diff --git a/components/shader/source/transitions/transition-shader.hpp b/components/shader/source/transitions/transition-shader.hpp index a3efd2ce36..6cd0346355 100644 --- a/components/shader/source/transitions/transition-shader.hpp +++ b/components/shader/source/transitions/transition-shader.hpp @@ -47,9 +47,7 @@ namespace streamfx::transition::shader { virtual obs_properties_t* get_properties2(transition::shader::shader_instance* data) override; -#ifdef ENABLE_FRONTEND static bool on_manual_open(obs_properties_t* props, obs_property_t* property, void* data); -#endif public: // Singleton static std::shared_ptr instance(); diff --git a/components/transform/source/filter/filter-transform.cpp b/components/transform/source/filter/filter-transform.cpp index 52135aa677..9b9f0a87af 100644 --- a/components/transform/source/filter/filter-transform.cpp +++ b/components/transform/source/filter/filter-transform.cpp @@ -623,11 +623,9 @@ obs_properties_t* transform_factory::get_properties2(transform_instance* data) { obs_properties_t* pr = obs_properties_create(); -#ifdef ENABLE_FRONTEND { obs_properties_add_button2(pr, S_MANUAL_OPEN, D_TRANSLATE(S_MANUAL_OPEN), streamfx::filter::transform::transform_factory::on_manual_open, nullptr); } -#endif // Camera { @@ -794,7 +792,6 @@ obs_properties_t* transform_factory::get_properties2(transform_instance* data) return pr; } -#ifdef ENABLE_FRONTEND bool transform_factory::on_manual_open(obs_properties_t* props, obs_property_t* property, void* data) { try { @@ -808,7 +805,6 @@ bool transform_factory::on_manual_open(obs_properties_t* props, obs_property_t* return false; } } -#endif std::shared_ptr transform_factory::instance() { diff --git a/components/transform/source/filter/filter-transform.hpp b/components/transform/source/filter/filter-transform.hpp index afea575c30..6da0ddd49b 100644 --- a/components/transform/source/filter/filter-transform.hpp +++ b/components/transform/source/filter/filter-transform.hpp @@ -91,9 +91,7 @@ namespace streamfx::filter::transform { virtual obs_properties_t* get_properties2(filter::transform::transform_instance* data) override; -#ifdef ENABLE_FRONTEND static bool on_manual_open(obs_properties_t* props, obs_property_t* property, void* data); -#endif public: // Singleton static std::shared_ptr instance(); diff --git a/components/upscaling/source/filters/filter-upscaling.cpp b/components/upscaling/source/filters/filter-upscaling.cpp index dd0d288d07..3dafa52ed3 100644 --- a/components/upscaling/source/filters/filter-upscaling.cpp +++ b/components/upscaling/source/filters/filter-upscaling.cpp @@ -562,11 +562,9 @@ obs_properties_t* upscaling_factory::get_properties2(upscaling_instance* data) { obs_properties_t* pr = obs_properties_create(); -#ifdef ENABLE_FRONTEND { obs_properties_add_button2(pr, S_MANUAL_OPEN, D_TRANSLATE(S_MANUAL_OPEN), upscaling_factory::on_manual_open, nullptr); } -#endif if (data) { data->properties(pr); @@ -587,7 +585,6 @@ obs_properties_t* upscaling_factory::get_properties2(upscaling_instance* data) return pr; } -#ifdef ENABLE_FRONTEND bool upscaling_factory::on_manual_open(obs_properties_t* props, obs_property_t* property, void* data) { try { @@ -601,7 +598,6 @@ bool upscaling_factory::on_manual_open(obs_properties_t* props, obs_property_t* return false; } } -#endif bool streamfx::filter::upscaling::upscaling_factory::is_provider_available(upscaling_provider provider) { diff --git a/components/upscaling/source/filters/filter-upscaling.hpp b/components/upscaling/source/filters/filter-upscaling.hpp index 18eed40311..593544aa64 100644 --- a/components/upscaling/source/filters/filter-upscaling.hpp +++ b/components/upscaling/source/filters/filter-upscaling.hpp @@ -99,9 +99,7 @@ namespace streamfx::filter::upscaling { virtual void get_defaults2(obs_data_t* data) override; virtual obs_properties_t* get_properties2(upscaling_instance* data) override; -#ifdef ENABLE_FRONTEND static bool on_manual_open(obs_properties_t* props, obs_property_t* property, void* data); -#endif bool is_provider_available(upscaling_provider); upscaling_provider find_ideal_provider(); diff --git a/components/virtual-greenscreen/source/filters/filter-virtual-greenscreen.cpp b/components/virtual-greenscreen/source/filters/filter-virtual-greenscreen.cpp index b17ffbd34f..7210866a8a 100644 --- a/components/virtual-greenscreen/source/filters/filter-virtual-greenscreen.cpp +++ b/components/virtual-greenscreen/source/filters/filter-virtual-greenscreen.cpp @@ -561,11 +561,9 @@ obs_properties_t* virtual_greenscreen_factory::get_properties2(virtual_greenscre { obs_properties_t* pr = obs_properties_create(); -#ifdef ENABLE_FRONTEND { obs_properties_add_button2(pr, S_MANUAL_OPEN, D_TRANSLATE(S_MANUAL_OPEN), virtual_greenscreen_factory::on_manual_open, nullptr); } -#endif if (data) { data->properties(pr); @@ -586,7 +584,6 @@ obs_properties_t* virtual_greenscreen_factory::get_properties2(virtual_greenscre return pr; } -#ifdef ENABLE_FRONTEND bool virtual_greenscreen_factory::on_manual_open(obs_properties_t* props, obs_property_t* property, void* data) { try { @@ -600,7 +597,6 @@ bool virtual_greenscreen_factory::on_manual_open(obs_properties_t* props, obs_pr return false; } } -#endif bool streamfx::filter::virtual_greenscreen::virtual_greenscreen_factory::is_provider_available(virtual_greenscreen_provider provider) { diff --git a/components/virtual-greenscreen/source/filters/filter-virtual-greenscreen.hpp b/components/virtual-greenscreen/source/filters/filter-virtual-greenscreen.hpp index 48a0193662..0694dbaa4e 100644 --- a/components/virtual-greenscreen/source/filters/filter-virtual-greenscreen.hpp +++ b/components/virtual-greenscreen/source/filters/filter-virtual-greenscreen.hpp @@ -99,9 +99,7 @@ namespace streamfx::filter::virtual_greenscreen { virtual void get_defaults2(obs_data_t* data) override; virtual obs_properties_t* get_properties2(virtual_greenscreen_instance* data) override; -#ifdef ENABLE_FRONTEND static bool on_manual_open(obs_properties_t* props, obs_property_t* property, void* data); -#endif bool is_provider_available(virtual_greenscreen_provider); virtual_greenscreen_provider find_ideal_provider(); diff --git a/source/plugin.cpp b/source/plugin.cpp index 168fe4fb1b..444f3c379b 100644 --- a/source/plugin.cpp +++ b/source/plugin.cpp @@ -3,22 +3,13 @@ // AUTOGENERATED COPYRIGHT HEADER END #include "plugin.hpp" -#include "configuration.hpp" #include "gfx/gfx-opengl.hpp" #include "obs/gs/gs-helper.hpp" #include "obs/gs/gs-vertexbuffer.hpp" -#ifdef ENABLE_NVIDIA_CUDA -#include "nvidia/cuda/nvidia-cuda-obs.hpp" -#endif - -#ifdef ENABLE_FRONTEND +#include "configuration.hpp" #include "ui/ui.hpp" -#endif - -#ifdef ENABLE_UPDATER #include "updater.hpp" -#endif #include "warning-disable.hpp" #include @@ -78,16 +69,6 @@ MODULE_EXPORT bool obs_module_load(void) } } -#ifdef ENABLE_NVIDIA_CUDA - // Initialize CUDA if features requested it. - std::shared_ptr<::streamfx::nvidia::cuda::obs> cuda; - try { - cuda = ::streamfx::nvidia::cuda::obs::get(); - } catch (...) { - // If CUDA failed to load, it is considered safe to ignore. - } -#endif - // Run all initializers. for (auto kv : streamfx::get_initializers()) { for (auto init : kv.second) { @@ -175,10 +156,8 @@ std::filesystem::path streamfx::config_file_path(std::string_view file) } } -#ifdef ENABLE_FRONTEND bool streamfx::open_url(std::string_view url) { QUrl qurl = QString::fromUtf8(url.data()); return QDesktopServices::openUrl(qurl); } -#endif diff --git a/source/plugin.hpp b/source/plugin.hpp index 6714e04a30..c4ba46d8a2 100644 --- a/source/plugin.hpp +++ b/source/plugin.hpp @@ -40,7 +40,5 @@ namespace streamfx { std::filesystem::path data_file_path(std::string_view file); std::filesystem::path config_file_path(std::string_view file); -#ifdef ENABLE_FRONTEND bool open_url(std::string_view url); -#endif } // namespace streamfx diff --git a/source/ui/ui.cpp b/source/ui/ui.cpp index 2443c7b4b4..b977107c10 100644 --- a/source/ui/ui.cpp +++ b/source/ui/ui.cpp @@ -72,11 +72,7 @@ streamfx::ui::handler::handler() _about_action(), _about_dialog(), - _translator() -#ifdef ENABLE_UPDATER - , - _updater() -#endif + _translator(), _updater() { obs_frontend_add_event_callback(frontend_event_handler, this); } @@ -168,9 +164,7 @@ void streamfx::ui::handler::on_obs_loaded() } // Create the updater. -#ifdef ENABLE_UPDATER _updater = streamfx::ui::updater::instance(_menu); -#endif _menu->addSeparator(); @@ -204,10 +198,7 @@ void streamfx::ui::handler::on_obs_loaded() } // Let the Updater start its work. - -#ifdef ENABLE_UPDATER this->_updater->obs_ready(); -#endif } void streamfx::ui::handler::on_obs_exit() @@ -260,7 +251,7 @@ void streamfx::ui::handler::on_action_about(bool checked) std::shared_ptr streamfx::ui::handler::instance() { static std::weak_ptr winst; - static std::mutex mtx; + static std::mutex mtx; std::unique_lock lock(mtx); auto instance = winst.lock(); diff --git a/source/ui/ui.hpp b/source/ui/ui.hpp index b1da769586..13d5e02b3a 100644 --- a/source/ui/ui.hpp +++ b/source/ui/ui.hpp @@ -5,10 +5,7 @@ #pragma once #include "ui-common.hpp" #include "ui-about.hpp" - -#ifdef ENABLE_UPDATER #include "ui-updater.hpp" -#endif namespace streamfx::ui { class handler : public QObject { @@ -32,9 +29,7 @@ namespace streamfx::ui { QTranslator* _translator; -#ifdef ENABLE_UPDATER std::shared_ptr _updater; -#endif private: handler(); From df7072388462cf522709b398375fa0314f9a6bde Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 06:56:55 +0200 Subject: [PATCH 48/66] ffmpeg: Don't break on MacOS While AMF is not really available on MacOS, we still shouldn't just fail to compile because of it. Might as well do the test and if it doesn't work out, then we still behave the same as before. --- components/ffmpeg/source/encoders/ffmpeg/amf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/ffmpeg/source/encoders/ffmpeg/amf.cpp b/components/ffmpeg/source/encoders/ffmpeg/amf.cpp index 8968d906b6..f3d9380d19 100644 --- a/components/ffmpeg/source/encoders/ffmpeg/amf.cpp +++ b/components/ffmpeg/source/encoders/ffmpeg/amf.cpp @@ -135,7 +135,7 @@ bool streamfx::encoder::ffmpeg::amf::is_available() #else std::filesystem::path lib_name = std::filesystem::u8path("amfrt32.dll"); #endif -#elif defined(D_PLATFORM_LINUX) +#else #if defined(D_PLATFORM_64BIT) std::filesystem::path lib_name = std::filesystem::u8path("libamfrt64.so.1"); #else From b9b4dba686259633891784ce9882d331f90e1229 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 07:17:58 +0200 Subject: [PATCH 49/66] nvidia: Actually test for windows --- components/nvidia/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/nvidia/CMakeLists.txt b/components/nvidia/CMakeLists.txt index 8d76d06420..f0565c05ed 100644 --- a/components/nvidia/CMakeLists.txt +++ b/components/nvidia/CMakeLists.txt @@ -43,6 +43,6 @@ target_link_libraries(${COMPONENT_TARGET} NVIDIA::VFX ) -if(NOT WINDOWS) +if(NOT D_PLATFORM_WINDOWS) streamfx_disable_component("NVIDIA" REASON "NVIDIA integration is (currently) only available for Windows under Direct3D11.") endif() From 4982a7900edc6c9439ff2976558cb85383450b97 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 07:19:52 +0200 Subject: [PATCH 50/66] Fix incorrect target_compile_definitions calls --- components/autoframing/CMakeLists.txt | 2 +- components/denoising/CMakeLists.txt | 2 +- components/upscaling/CMakeLists.txt | 2 +- components/virtual-greenscreen/CMakeLists.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/autoframing/CMakeLists.txt b/components/autoframing/CMakeLists.txt index f373d5d3f5..3a2cc4c06f 100644 --- a/components/autoframing/CMakeLists.txt +++ b/components/autoframing/CMakeLists.txt @@ -16,7 +16,7 @@ function(streamfx_auto_framing_resolver) #- NVIDIA streamfx_enabled_component("NVIDIA" T_CHECK) if(T_CHECK) - target_compile_definitions(${COMPONENT_TARGET} + target_compile_definitions(${COMPONENT_TARGET} PRIVATE PRIVATE ENABLE_NVIDIA ) endif() diff --git a/components/denoising/CMakeLists.txt b/components/denoising/CMakeLists.txt index a2051c3488..f3ad6369ad 100644 --- a/components/denoising/CMakeLists.txt +++ b/components/denoising/CMakeLists.txt @@ -16,7 +16,7 @@ function(streamfx_denoising_resolver) #- NVIDIA streamfx_enabled_component("NVIDIA" T_CHECK) if(T_CHECK) - target_compile_definitions(${COMPONENT_TARGET} + target_compile_definitions(${COMPONENT_TARGET} PRIVATE ENABLE_NVIDIA ) endif() diff --git a/components/upscaling/CMakeLists.txt b/components/upscaling/CMakeLists.txt index 50c377f7a9..d280eb77bd 100644 --- a/components/upscaling/CMakeLists.txt +++ b/components/upscaling/CMakeLists.txt @@ -16,7 +16,7 @@ function(streamfx_upscaling_resolver) #- NVIDIA streamfx_enabled_component("NVIDIA" T_CHECK) if(T_CHECK) - target_compile_definitions(${COMPONENT_TARGET} + target_compile_definitions(${COMPONENT_TARGET} PRIVATE ENABLE_NVIDIA ) endif() diff --git a/components/virtual-greenscreen/CMakeLists.txt b/components/virtual-greenscreen/CMakeLists.txt index 97c37ff123..08ca26a693 100644 --- a/components/virtual-greenscreen/CMakeLists.txt +++ b/components/virtual-greenscreen/CMakeLists.txt @@ -16,7 +16,7 @@ function(streamfx_virtual_greenscreen_resolver) #- NVIDIA streamfx_enabled_component("NVIDIA" T_CHECK) if(T_CHECK) - target_compile_definitions(${COMPONENT_TARGET} + target_compile_definitions(${COMPONENT_TARGET} PRIVATE ENABLE_NVIDIA ) endif() From 7fb8c6fea2e3bcf3b45462d4aef2f87ed9e4afbb Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 07:49:53 +0200 Subject: [PATCH 51/66] nvidia: Require explicit set/get commands This addresses some unexpected behaviors, and might even fix a feature or two. --- .../nvidia/ar/nvidia-ar-facedetection.cpp | 13 +-- .../source/nvidia/ar/nvidia-ar-feature.cpp | 8 +- .../source/nvidia/ar/nvidia-ar-feature.hpp | 50 ++++----- .../nvidia/vfx/nvidia-vfx-denoising.cpp | 6 +- .../source/nvidia/vfx/nvidia-vfx-effect.cpp | 12 +-- .../source/nvidia/vfx/nvidia-vfx-effect.hpp | 100 +++++++++--------- .../nvidia/vfx/nvidia-vfx-greenscreen.cpp | 8 +- .../nvidia/vfx/nvidia-vfx-superresolution.cpp | 6 +- 8 files changed, 99 insertions(+), 104 deletions(-) diff --git a/components/nvidia/source/nvidia/ar/nvidia-ar-facedetection.cpp b/components/nvidia/source/nvidia/ar/nvidia-ar-facedetection.cpp index 20e8c4db51..fbf7384fa6 100644 --- a/components/nvidia/source/nvidia/ar/nvidia-ar-facedetection.cpp +++ b/components/nvidia/source/nvidia/ar/nvidia-ar-facedetection.cpp @@ -40,11 +40,6 @@ streamfx::nvidia::ar::facedetection::facedetection() : feature(FEATURE_FACE_DETE { D_LOG_DEBUG("Initializing... (Addr: 0x%" PRIuPTR ")", this); - // Assign CUDA Stream object. - if (auto err = set(P_NVAR_CONFIG "CUDAStream", _nvcuda->get_stream()); err != cv::result::SUCCESS) { - throw cv::exception("CUDAStream", err); - } - // Prepare initial memory _rects.resize(ST_MAX_TRACKED_FACES); _rects_confidence.resize(ST_MAX_TRACKED_FACES); @@ -86,10 +81,10 @@ void ar::facedetection::set_tracking_limit(size_t v) if (auto err = set_object(P_NVAR_OUTPUT "BoundingBoxes", reinterpret_cast(&_bboxes), sizeof(bounds_t)); err != cv::result::SUCCESS) { throw cv::exception("BoundingBoxes", err); } - if (auto err = set(P_NVAR_OUTPUT "BoundingBoxesConfidence", _rects_confidence); err != cv::result::SUCCESS) { + if (auto err = set_float32array(P_NVAR_OUTPUT "BoundingBoxesConfidence", _rects_confidence); err != cv::result::SUCCESS) { throw cv::exception("BoundingBoxesConfidence", err); } - if (auto err = set(P_NVAR_CONFIG "Temporal", (v == 1)); err != cv::result::SUCCESS) { + if (auto err = set_uint32(P_NVAR_CONFIG "Temporal", (v == 1)); err != cv::result::SUCCESS) { throw cv::exception("Temporal", err); } @@ -189,7 +184,7 @@ void ar::facedetection::resize(uint32_t width, uint32_t height) _source = std::make_shared<::streamfx::nvidia::cv::image>(width, height, ::streamfx::nvidia::cv::pixel_format::BGR, ::streamfx::nvidia::cv::component_type::UINT8, ::streamfx::nvidia::cv::component_layout::INTERLEAVED, ::streamfx::nvidia::cv::memory_location::GPU, 1); } - if (auto err = set(P_NVAR_INPUT "Image", _source); err != cv::result::SUCCESS) { + if (auto err = set_image(P_NVAR_INPUT "Image", _source); err != cv::result::SUCCESS) { throw cv::exception("Image", err); } @@ -203,7 +198,7 @@ void streamfx::nvidia::ar::facedetection::load() auto cctx = ::streamfx::nvidia::cuda::obs::get()->get_context()->enter(); // Assign CUDA Stream object. - if (auto err = set(P_NVAR_CONFIG "CUDAStream", _nvcuda->get_stream()); err != cv::result::SUCCESS) { + if (auto err = set_cuda_stream(P_NVAR_CONFIG "CUDAStream", _nvcuda->get_stream()); err != cv::result::SUCCESS) { throw cv::exception("CUDAStream", err); } diff --git a/components/nvidia/source/nvidia/ar/nvidia-ar-feature.cpp b/components/nvidia/source/nvidia/ar/nvidia-ar-feature.cpp index 45d3014956..f314924331 100644 --- a/components/nvidia/source/nvidia/ar/nvidia-ar-feature.cpp +++ b/components/nvidia/source/nvidia/ar/nvidia-ar-feature.cpp @@ -40,15 +40,15 @@ streamfx::nvidia::ar::feature::feature(feature_t feature) : _nvcuda(::streamfx:: _fx = std::shared_ptr(handle, [this](::streamfx::nvidia::ar::handle_t handle) { _nvar->NvAR_Destroy(handle); }); // Set CUDA stream and model directory. - set(P_NVAR_CONFIG "CUDAStream", _nvcuda->get_stream()); + set_cuda_stream(P_NVAR_CONFIG "CUDAStream", _nvcuda->get_stream()); _model_path = _nvar->get_model_path().generic_u8string(); - set(P_NVAR_CONFIG "ModelDir", _model_path); + set_string(P_NVAR_CONFIG "ModelDir", _model_path); } streamfx::nvidia::cv::result streamfx::nvidia::ar::feature::get(parameter_t param, std::string_view& value) { const char* cvalue = nullptr; - cv::result res = get(param, cvalue); + cv::result res = get_string(param, cvalue); if (res == cv::result::SUCCESS) { if (cvalue) { value = std::string_view(cvalue); @@ -62,7 +62,7 @@ streamfx::nvidia::cv::result streamfx::nvidia::ar::feature::get(parameter_t para streamfx::nvidia::cv::result streamfx::nvidia::ar::feature::get(parameter_t param, std::string& value) { const char* cvalue = nullptr; - cv::result res = get(param, cvalue); + cv::result res = get_string(param, cvalue); if (res == cv::result::SUCCESS) { if (cvalue) { value = cvalue; diff --git a/components/nvidia/source/nvidia/ar/nvidia-ar-feature.hpp b/components/nvidia/source/nvidia/ar/nvidia-ar-feature.hpp index 4261da2dca..d5d6793da9 100644 --- a/components/nvidia/source/nvidia/ar/nvidia-ar-feature.hpp +++ b/components/nvidia/source/nvidia/ar/nvidia-ar-feature.hpp @@ -32,58 +32,58 @@ namespace streamfx::nvidia::ar { } public /* Int32 */: - inline cv::result set(parameter_t param, uint32_t const value) + inline cv::result set_uint32(parameter_t param, uint32_t const value) { return _nvar->NvAR_SetU32(_fx.get(), param, value); } - inline cv::result get(parameter_t param, uint32_t* value) + inline cv::result get_uint32(parameter_t param, uint32_t* value) { return _nvar->NvAR_GetU32(_fx.get(), param, value); } - inline cv::result set(parameter_t param, int32_t const value) + inline cv::result set_int32(parameter_t param, int32_t const value) { return _nvar->NvAR_SetS32(_fx.get(), param, value); } - inline cv::result get(parameter_t param, int32_t* value) + inline cv::result get_int32(parameter_t param, int32_t* value) { return _nvar->NvAR_GetS32(_fx.get(), param, value); } public /* Int64 */: - inline cv::result set(parameter_t param, uint64_t const value) + inline cv::result set_uint64(parameter_t param, uint64_t const value) { return _nvar->NvAR_SetU64(_fx.get(), param, value); } - inline cv::result get(parameter_t param, uint64_t* value) + inline cv::result get_uint64(parameter_t param, uint64_t* value) { return _nvar->NvAR_GetU64(_fx.get(), param, value); } public /* Float32 */: - inline cv::result set(parameter_t param, float const value) + inline cv::result set_float32(parameter_t param, float const value) { return _nvar->NvAR_SetF32(_fx.get(), param, value); } - inline cv::result get(parameter_t param, float* value) + inline cv::result get_float32(parameter_t param, float* value) { return _nvar->NvAR_GetF32(_fx.get(), param, value); } - inline cv::result set(parameter_t param, float* const value, int32_t size) + inline cv::result set_float32array(parameter_t param, float* const value, int32_t size) { return _nvar->NvAR_SetF32Array(_fx.get(), param, value, static_cast(size)); } - inline cv::result get(parameter_t param, const float* value, int32_t size) + inline cv::result get_float32array(parameter_t param, const float* value, int32_t size) { return _nvar->NvAR_GetF32Array(_fx.get(), param, &value, &size); } - inline cv::result set(parameter_t param, std::vector const& value) + inline cv::result set_float32array(parameter_t param, std::vector const& value) { return _nvar->NvAR_SetF32Array(_fx.get(), param, value.data(), static_cast(value.size())); } - inline cv::result get(parameter_t param, std::vector& value) + inline cv::result get_float32array(parameter_t param, std::vector& value) { const float* data; int32_t size; @@ -98,71 +98,71 @@ namespace streamfx::nvidia::ar { } public /* Float64 */: - inline cv::result set(parameter_t param, double const value) + inline cv::result set_float64(parameter_t param, double const value) { return _nvar->NvAR_SetF64(_fx.get(), param, value); } - inline cv::result get(parameter_t param, double* value) + inline cv::result get_float64(parameter_t param, double* value) { return _nvar->NvAR_GetF64(_fx.get(), param, value); } public /* String */: - inline cv::result set(parameter_t param, const char* const value) + inline cv::result set_string(parameter_t param, const char* const value) { return _nvar->NvAR_SetString(_fx.get(), param, value); }; - inline cv::result get(parameter_t param, const char*& value) + inline cv::result get_string(parameter_t param, const char*& value) { return _nvar->NvAR_GetString(_fx.get(), param, &value); }; - inline cv::result set(parameter_t param, std::string_view const value) + inline cv::result set_string(parameter_t param, std::string_view const value) { return _nvar->NvAR_SetString(_fx.get(), param, value.data()); }; cv::result get(parameter_t param, std::string_view& value); - inline cv::result set(parameter_t param, std::string const& value) + inline cv::result set_string(parameter_t param, std::string const& value) { return _nvar->NvAR_SetString(_fx.get(), param, value.c_str()); }; cv::result get(parameter_t param, std::string& value); public /* CUDA Stream */: - inline cv::result set(parameter_t param, cuda::stream_t const value) + inline cv::result set_cuda_stream(parameter_t param, cuda::stream_t const value) { return _nvar->NvAR_SetCudaStream(_fx.get(), param, value); }; - inline cv::result get(parameter_t param, cuda::stream_t& value) + inline cv::result get_cuda_stream(parameter_t param, cuda::stream_t& value) { return _nvar->NvAR_GetCudaStream(_fx.get(), param, &value); }; - inline cv::result set(parameter_t param, std::shared_ptr<::streamfx::nvidia::cuda::stream> const value) + inline cv::result set_cuda_stream(parameter_t param, std::shared_ptr<::streamfx::nvidia::cuda::stream> const value) { return _nvar->NvAR_SetCudaStream(_fx.get(), param, value->get()); } //inline cv::result get(parameter_t param, std::shared_ptr<::streamfx::nvidia::cuda::stream> value); public /* CV Image */: - inline cv::result set(parameter_t param, cv::image_t& value) + inline cv::result set_image(parameter_t param, cv::image_t& value) { return _nvar->NvAR_SetObject(_fx.get(), param, &value, sizeof(cv::image_t)); }; - inline cv::result get(parameter_t param, cv::image_t*& value) + inline cv::result get_image(parameter_t param, cv::image_t*& value) { return _nvar->NvAR_GetObject(_fx.get(), param, reinterpret_cast(&value), sizeof(cv::image_t)); }; - inline cv::result set(parameter_t param, std::shared_ptr const value) + inline cv::result set_image(parameter_t param, std::shared_ptr const value) { return _nvar->NvAR_SetObject(_fx.get(), param, value->get_image(), sizeof(cv::image_t)); }; //inline cv::result get(parameter_t param, std::shared_ptr& value); public /* CV Texture */: - inline cv::result set(parameter_t param, std::shared_ptr const value) + inline cv::result set_image(parameter_t param, std::shared_ptr const value) { return _nvar->NvAR_SetObject(_fx.get(), param, value->get_image(), sizeof(cv::image_t)); }; diff --git a/components/nvidia/source/nvidia/vfx/nvidia-vfx-denoising.cpp b/components/nvidia/source/nvidia/vfx/nvidia-vfx-denoising.cpp index caecfa30af..c1e5e3739d 100644 --- a/components/nvidia/source/nvidia/vfx/nvidia-vfx-denoising.cpp +++ b/components/nvidia/source/nvidia/vfx/nvidia-vfx-denoising.cpp @@ -69,7 +69,7 @@ void streamfx::nvidia::vfx::denoising::set_strength(float strength) // Update Effect auto gctx = ::streamfx::obs::gs::context(); auto cctx = _nvcuda->get_context()->enter(); - if (auto res = set(PARAMETER_STRENGTH, _strength); res != ::streamfx::nvidia::cv::result::SUCCESS) { + if (auto res = set_float32(PARAMETER_STRENGTH, _strength); res != ::streamfx::nvidia::cv::result::SUCCESS) { D_LOG_ERROR("Failed to set '%s' to %1.3f.", PARAMETER_STRENGTH, _strength); }; } @@ -211,7 +211,7 @@ void streamfx::nvidia::vfx::denoising::resize(uint32_t width, uint32_t height) _source = std::make_shared<::streamfx::nvidia::cv::image>(width, height, ::streamfx::nvidia::cv::pixel_format::BGR, ::streamfx::nvidia::cv::component_type::FP32, ::streamfx::nvidia::cv::component_layout::PLANAR, ::streamfx::nvidia::cv::memory_location::GPU, 1); } - if (auto res = set(::streamfx::nvidia::vfx::PARAMETER_INPUT_IMAGE_0, _source); res != ::streamfx::nvidia::cv::result::SUCCESS) { + if (auto res = set_image(::streamfx::nvidia::vfx::PARAMETER_INPUT_IMAGE_0, _source); res != ::streamfx::nvidia::cv::result::SUCCESS) { D_LOG_ERROR("Failed to set input image due to error: %s", _nvcvi->NvCV_GetErrorStringFromCode(res)); _source.reset(); throw std::runtime_error("SetImage failed."); @@ -227,7 +227,7 @@ void streamfx::nvidia::vfx::denoising::resize(uint32_t width, uint32_t height) _destination = std::make_shared<::streamfx::nvidia::cv::image>(width, height, ::streamfx::nvidia::cv::pixel_format::BGR, ::streamfx::nvidia::cv::component_type::FP32, ::streamfx::nvidia::cv::component_layout::PLANAR, ::streamfx::nvidia::cv::memory_location::GPU, 1); } - if (auto res = set(::streamfx::nvidia::vfx::PARAMETER_OUTPUT_IMAGE_0, _destination); res != ::streamfx::nvidia::cv::result::SUCCESS) { + if (auto res = set_image(::streamfx::nvidia::vfx::PARAMETER_OUTPUT_IMAGE_0, _destination); res != ::streamfx::nvidia::cv::result::SUCCESS) { D_LOG_ERROR("Failed to set output image due to error: %s", _nvcvi->NvCV_GetErrorStringFromCode(res)); _destination.reset(); throw std::runtime_error("SetImage failed."); diff --git a/components/nvidia/source/nvidia/vfx/nvidia-vfx-effect.cpp b/components/nvidia/source/nvidia/vfx/nvidia-vfx-effect.cpp index d06f2724e6..0a8643ea12 100644 --- a/components/nvidia/source/nvidia/vfx/nvidia-vfx-effect.cpp +++ b/components/nvidia/source/nvidia/vfx/nvidia-vfx-effect.cpp @@ -51,21 +51,21 @@ streamfx::nvidia::vfx::effect::effect(effect_t effect) : _nvcuda(cuda::obs::get( _fx = std::shared_ptr(handle, [](::vfx::handle_t handle) { ::vfx::vfx::get()->NvVFX_DestroyEffect(handle); }); // Assign CUDA Stream object. - if (auto v = set(PARAMETER_CUDA_STREAM, _nvcuda->get_stream()); v != cv::result::SUCCESS) { + if (auto v = set_cuda_stream(PARAMETER_CUDA_STREAM, _nvcuda->get_stream()); v != cv::result::SUCCESS) { throw ::streamfx::nvidia::cv::exception(PARAMETER_CUDA_STREAM, v); } // Assign Model Directory. _model_path = _nvvfx->model_path().generic_u8string(); - if (auto v = set(PARAMETER_MODEL_DIRECTORY, _model_path); v != cv::result::SUCCESS) { + if (auto v = set_string(PARAMETER_MODEL_DIRECTORY, _model_path); v != cv::result::SUCCESS) { throw ::streamfx::nvidia::cv::exception(PARAMETER_MODEL_DIRECTORY, v); } } -cv::result streamfx::nvidia::vfx::effect::get(parameter_t param, std::string_view& value) +cv::result streamfx::nvidia::vfx::effect::get_string(parameter_t param, std::string_view& value) { const char* cvalue = nullptr; - cv::result res = get(param, cvalue); + cv::result res = get_string(param, cvalue); if (res == cv::result::SUCCESS) { if (cvalue) { value = std::string_view(cvalue); @@ -76,10 +76,10 @@ cv::result streamfx::nvidia::vfx::effect::get(parameter_t param, std::string_vie return res; } -cv::result streamfx::nvidia::vfx::effect::get(parameter_t param, std::string& value) +cv::result streamfx::nvidia::vfx::effect::get_string(parameter_t param, std::string& value) { const char* cvalue = nullptr; - cv::result res = get(param, cvalue); + cv::result res = get_string(param, cvalue); if (res == cv::result::SUCCESS) { if (cvalue) { value = cvalue; diff --git a/components/nvidia/source/nvidia/vfx/nvidia-vfx-effect.hpp b/components/nvidia/source/nvidia/vfx/nvidia-vfx-effect.hpp index 82084840af..2566eea9b8 100644 --- a/components/nvidia/source/nvidia/vfx/nvidia-vfx-effect.hpp +++ b/components/nvidia/source/nvidia/vfx/nvidia-vfx-effect.hpp @@ -39,137 +39,137 @@ namespace streamfx::nvidia::vfx { } public /* Int32 */: - inline cv::result set(parameter_t param, uint32_t const value) + inline cv::result set_uint32(parameter_t param, uint32_t const value) { return _nvvfx->NvVFX_SetU32(_fx.get(), param, value); - }; - inline cv::result get(parameter_t param, uint32_t& value) + } + inline cv::result get_uint32(parameter_t param, uint32_t& value) { return _nvvfx->NvVFX_GetU32(_fx.get(), param, &value); - }; + } - inline cv::result set(parameter_t param, int32_t const value) + inline cv::result set_int32(parameter_t param, int32_t const value) { return _nvvfx->NvVFX_SetS32(_fx.get(), param, value); - }; - inline cv::result get(parameter_t param, int32_t& value) + } + inline cv::result get_int32(parameter_t param, int32_t& value) { return _nvvfx->NvVFX_GetS32(_fx.get(), param, &value); - }; + } public /* Int64 */: - inline cv::result set(parameter_t param, uint64_t const value) + inline cv::result set_uint64(parameter_t param, uint64_t const value) { return _nvvfx->NvVFX_SetU64(_fx.get(), param, value); - }; - inline cv::result get(parameter_t param, uint64_t& value) + } + inline cv::result get_uint64(parameter_t param, uint64_t& value) { return _nvvfx->NvVFX_GetU64(_fx.get(), param, &value); - }; + } public /* Float32 */: - inline cv::result set(parameter_t param, float const value) + inline cv::result set_float32(parameter_t param, float const value) { return _nvvfx->NvVFX_SetF32(_fx.get(), param, value); - }; - inline cv::result get(parameter_t param, float& value) + } + inline cv::result get_float32(parameter_t param, float& value) { return _nvvfx->NvVFX_GetF32(_fx.get(), param, &value); - }; + } public /* Float64 */: - inline cv::result set(parameter_t param, double const value) + inline cv::result set_float64(parameter_t param, double const value) { return _nvvfx->NvVFX_SetF64(_fx.get(), param, value); - }; - inline cv::result get(parameter_t param, double& value) + } + inline cv::result get_float64(parameter_t param, double& value) { return _nvvfx->NvVFX_GetF64(_fx.get(), param, &value); - }; + } public /* String */: - inline cv::result set(parameter_t param, const char* const value) + inline cv::result set_string(parameter_t param, const char* const value) { return _nvvfx->NvVFX_SetString(_fx.get(), param, value); - }; - inline cv::result get(parameter_t param, const char*& value) + } + inline cv::result get_string(parameter_t param, const char*& value) { return _nvvfx->NvVFX_GetString(_fx.get(), param, &value); - }; + } - inline cv::result set(parameter_t param, std::string_view const& value) + inline cv::result set_string(parameter_t param, std::string_view const& value) { return _nvvfx->NvVFX_SetString(_fx.get(), param, value.data()); - }; - cv::result get(parameter_t param, std::string_view& value); + } + cv::result get_string(parameter_t param, std::string_view& value); - inline cv::result set(parameter_t param, std::string const& value) + inline cv::result set_string(parameter_t param, std::string const& value) { return _nvvfx->NvVFX_SetString(_fx.get(), param, value.c_str()); - }; - cv::result get(parameter_t param, std::string& value); + } + cv::result get_string(parameter_t param, std::string& value); public /* CUDA Stream */: - inline cv::result set(parameter_t param, cuda::stream_t const& value) + inline cv::result set_cuda_stream(parameter_t param, cuda::stream_t const& value) { return _nvvfx->NvVFX_SetCudaStream(_fx.get(), param, value); - }; - inline cv::result get(parameter_t param, cuda::stream_t& value) + } + inline cv::result get_cuda_stream(parameter_t param, cuda::stream_t& value) { return _nvvfx->NvVFX_GetCudaStream(_fx.get(), param, &value); - }; + } - inline cv::result set(parameter_t param, std::shared_ptr const& value) + inline cv::result set_cuda_stream(parameter_t param, std::shared_ptr const& value) { return _nvvfx->NvVFX_SetCudaStream(_fx.get(), param, value->get()); - }; + } //cv::result get_stream(parameter_t param, std::shared_ptr& value); public /* CV Image */: - inline cv::result set(parameter_t param, cv::image_t* value) + inline cv::result set_image(parameter_t param, cv::image_t* value) { return _nvvfx->NvVFX_SetImage(_fx.get(), param, value); - }; - inline cv::result get(parameter_t param, cv::image_t* value) + } + inline cv::result get_image(parameter_t param, cv::image_t* value) { return _nvvfx->NvVFX_GetImage(_fx.get(), param, value); - }; + } - inline cv::result set(parameter_t param, std::shared_ptr const& value) + inline cv::result set_image(parameter_t param, std::shared_ptr const& value) { return _nvvfx->NvVFX_SetImage(_fx.get(), param, value->get_image()); - }; - inline cv::result get(parameter_t param, std::shared_ptr& value) + } + inline cv::result get_image(parameter_t param, std::shared_ptr& value) { return _nvvfx->NvVFX_GetImage(_fx.get(), param, value->get_image()); - }; + } public /* CV Texture */: - inline cv::result set(parameter_t param, std::shared_ptr const& value) + inline cv::result set_image(parameter_t param, std::shared_ptr const& value) { return _nvvfx->NvVFX_SetImage(_fx.get(), param, value->get_image()); - }; + } //cv::result get(parameter_t param, std::shared_ptr& value); public /* Objects */: inline cv::result set_object(parameter_t param, void* const value) { return _nvvfx->NvVFX_SetObject(_fx.get(), param, value); - }; + } inline cv::result get_object(parameter_t param, void*& value) { return _nvvfx->NvVFX_GetObject(_fx.get(), param, &value); - }; + } public /* Control */: inline cv::result load() { return _nvvfx->NvVFX_Load(_fx.get()); - }; + } inline cv::result run(bool async = false) { return _nvvfx->NvVFX_Run(_fx.get(), async ? 1 : 0); - }; + } }; } // namespace streamfx::nvidia::vfx diff --git a/components/nvidia/source/nvidia/vfx/nvidia-vfx-greenscreen.cpp b/components/nvidia/source/nvidia/vfx/nvidia-vfx-greenscreen.cpp index f789a572b5..16fb594269 100644 --- a/components/nvidia/source/nvidia/vfx/nvidia-vfx-greenscreen.cpp +++ b/components/nvidia/source/nvidia/vfx/nvidia-vfx-greenscreen.cpp @@ -78,7 +78,7 @@ void streamfx::nvidia::vfx::greenscreen::size(std::pair& siz void streamfx::nvidia::vfx::greenscreen::set_mode(greenscreen_mode mode) { - set(PARAMETER_MODE, static_cast(mode)); + set_uint32(PARAMETER_MODE, static_cast(mode)); _dirty = true; } @@ -196,7 +196,7 @@ void streamfx::nvidia::vfx::greenscreen::resize(uint32_t width, uint32_t height) _source = std::make_shared<::streamfx::nvidia::cv::image>(in_size.first, in_size.second, ::streamfx::nvidia::cv::pixel_format::BGR, ::streamfx::nvidia::cv::component_type::UINT8, ::streamfx::nvidia::cv::component_layout::INTERLEAVED, ::streamfx::nvidia::cv::memory_location::GPU, 1); } - if (auto v = set(PARAMETER_INPUT_IMAGE_0, _source); v != ::streamfx::nvidia::cv::result::SUCCESS) { + if (auto v = set_image(PARAMETER_INPUT_IMAGE_0, _source); v != ::streamfx::nvidia::cv::result::SUCCESS) { throw ::streamfx::nvidia::cv::exception(PARAMETER_INPUT_IMAGE_0, v); } @@ -210,7 +210,7 @@ void streamfx::nvidia::vfx::greenscreen::resize(uint32_t width, uint32_t height) _destination = std::make_shared<::streamfx::nvidia::cv::image>(in_size.first, in_size.second, ::streamfx::nvidia::cv::pixel_format::A, ::streamfx::nvidia::cv::component_type::UINT8, ::streamfx::nvidia::cv::component_layout::INTERLEAVED, ::streamfx::nvidia::cv::memory_location::GPU, 1); } - if (auto v = set(PARAMETER_OUTPUT_IMAGE_0, _destination); v != ::streamfx::nvidia::cv::result::SUCCESS) { + if (auto v = set_image(PARAMETER_OUTPUT_IMAGE_0, _destination); v != ::streamfx::nvidia::cv::result::SUCCESS) { throw ::streamfx::nvidia::cv::exception(PARAMETER_OUTPUT_IMAGE_0, v); } @@ -234,7 +234,7 @@ void streamfx::nvidia::vfx::greenscreen::load() auto cctx = _nvcuda->get_context()->enter(); // Assign CUDA Stream object. - if (auto v = set(PARAMETER_CUDA_STREAM, _nvcuda->get_stream()); v != cv::result::SUCCESS) { + if (auto v = set_cuda_stream(PARAMETER_CUDA_STREAM, _nvcuda->get_stream()); v != cv::result::SUCCESS) { throw ::streamfx::nvidia::cv::exception(PARAMETER_CUDA_STREAM, v); } diff --git a/components/nvidia/source/nvidia/vfx/nvidia-vfx-superresolution.cpp b/components/nvidia/source/nvidia/vfx/nvidia-vfx-superresolution.cpp index 7b7fa8f4b3..fe2d687873 100644 --- a/components/nvidia/source/nvidia/vfx/nvidia-vfx-superresolution.cpp +++ b/components/nvidia/source/nvidia/vfx/nvidia-vfx-superresolution.cpp @@ -102,7 +102,7 @@ void streamfx::nvidia::vfx::superresolution::set_strength(float strength) uint32_t value = (_strength >= .5f) ? 1u : 0u; auto gctx = ::streamfx::obs::gs::context(); auto cctx = ::streamfx::nvidia::cuda::obs::get()->get_context()->enter(); - if (auto res = set(::streamfx::nvidia::vfx::PARAMETER_STRENGTH, value); res != ::streamfx::nvidia::cv::result::SUCCESS) { + if (auto res = set_float32(::streamfx::nvidia::vfx::PARAMETER_STRENGTH, value); res != ::streamfx::nvidia::cv::result::SUCCESS) { D_LOG_ERROR("Failed to set '%s' to %lu.", ::streamfx::nvidia::vfx::PARAMETER_STRENGTH, value); }; } @@ -311,7 +311,7 @@ void streamfx::nvidia::vfx::superresolution::resize(uint32_t width, uint32_t hei _source = std::make_shared<::streamfx::nvidia::cv::image>(_cache_input_size.first, _cache_input_size.second, ::streamfx::nvidia::cv::pixel_format::BGR, ::streamfx::nvidia::cv::component_type::FP32, ::streamfx::nvidia::cv::component_layout::PLANAR, ::streamfx::nvidia::cv::memory_location::GPU, 1); } - if (auto res = set(::streamfx::nvidia::vfx::PARAMETER_INPUT_IMAGE_0, _source); res != ::streamfx::nvidia::cv::result::SUCCESS) { + if (auto res = set_image(::streamfx::nvidia::vfx::PARAMETER_INPUT_IMAGE_0, _source); res != ::streamfx::nvidia::cv::result::SUCCESS) { D_LOG_ERROR("Failed to set input image due to error: %s", _nvcvi->NvCV_GetErrorStringFromCode(res)); throw std::runtime_error("SetImage failed."); } @@ -326,7 +326,7 @@ void streamfx::nvidia::vfx::superresolution::resize(uint32_t width, uint32_t hei _destination = std::make_shared<::streamfx::nvidia::cv::image>(_cache_output_size.first, _cache_output_size.second, ::streamfx::nvidia::cv::pixel_format::BGR, ::streamfx::nvidia::cv::component_type::FP32, ::streamfx::nvidia::cv::component_layout::PLANAR, ::streamfx::nvidia::cv::memory_location::GPU, 1); } - if (auto res = set(::streamfx::nvidia::vfx::PARAMETER_OUTPUT_IMAGE_0, _destination); res != ::streamfx::nvidia::cv::result::SUCCESS) { + if (auto res = set_image(::streamfx::nvidia::vfx::PARAMETER_OUTPUT_IMAGE_0, _destination); res != ::streamfx::nvidia::cv::result::SUCCESS) { D_LOG_ERROR("Failed to set output image due to error: %s", _nvcvi->NvCV_GetErrorStringFromCode(res)); throw std::runtime_error("SetImage failed."); } From ef55651d9c4d80255d6580c1b25b34db801bdffb Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 08:08:11 +0200 Subject: [PATCH 52/66] nvidia: Fix missing includes --- CMakeLists.txt | 22 +++++++++++++++---- .../nvidia/ar/nvidia-ar-facedetection.hpp | 0 .../nvidia/ar/nvidia-ar-feature.hpp | 0 .../nvidia/ar/nvidia-ar.hpp | 0 .../nvidia/cuda/nvidia-cuda-context.hpp | 0 .../nvidia/cuda/nvidia-cuda-gs-texture.hpp | 0 .../nvidia/cuda/nvidia-cuda-memory.hpp | 0 .../nvidia/cuda/nvidia-cuda-obs.hpp | 0 .../nvidia/cuda/nvidia-cuda-stream.hpp | 0 .../nvidia/cuda/nvidia-cuda.hpp | 0 .../nvidia/cv/nvidia-cv-image.hpp | 0 .../nvidia/cv/nvidia-cv-texture.hpp | 0 .../nvidia/cv/nvidia-cv.hpp | 0 .../nvidia/vfx/nvidia-vfx-denoising.hpp | 0 .../nvidia/vfx/nvidia-vfx-effect.hpp | 0 .../nvidia/vfx/nvidia-vfx-greenscreen.hpp | 0 .../nvidia/vfx/nvidia-vfx-superresolution.hpp | 0 .../nvidia/vfx/nvidia-vfx.hpp | 0 18 files changed, 18 insertions(+), 4 deletions(-) rename components/nvidia/{source => include}/nvidia/ar/nvidia-ar-facedetection.hpp (100%) rename components/nvidia/{source => include}/nvidia/ar/nvidia-ar-feature.hpp (100%) rename components/nvidia/{source => include}/nvidia/ar/nvidia-ar.hpp (100%) rename components/nvidia/{source => include}/nvidia/cuda/nvidia-cuda-context.hpp (100%) rename components/nvidia/{source => include}/nvidia/cuda/nvidia-cuda-gs-texture.hpp (100%) rename components/nvidia/{source => include}/nvidia/cuda/nvidia-cuda-memory.hpp (100%) rename components/nvidia/{source => include}/nvidia/cuda/nvidia-cuda-obs.hpp (100%) rename components/nvidia/{source => include}/nvidia/cuda/nvidia-cuda-stream.hpp (100%) rename components/nvidia/{source => include}/nvidia/cuda/nvidia-cuda.hpp (100%) rename components/nvidia/{source => include}/nvidia/cv/nvidia-cv-image.hpp (100%) rename components/nvidia/{source => include}/nvidia/cv/nvidia-cv-texture.hpp (100%) rename components/nvidia/{source => include}/nvidia/cv/nvidia-cv.hpp (100%) rename components/nvidia/{source => include}/nvidia/vfx/nvidia-vfx-denoising.hpp (100%) rename components/nvidia/{source => include}/nvidia/vfx/nvidia-vfx-effect.hpp (100%) rename components/nvidia/{source => include}/nvidia/vfx/nvidia-vfx-greenscreen.hpp (100%) rename components/nvidia/{source => include}/nvidia/vfx/nvidia-vfx-superresolution.hpp (100%) rename components/nvidia/{source => include}/nvidia/vfx/nvidia-vfx.hpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index a882285f29..3bae0e51fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1539,12 +1539,26 @@ endwhile() #- Linking target_link_libraries(StreamFX PRIVATE $) foreach(_ENTITY ${_RESOLVED}) - if(NOT TARGET StreamFX_${_ENTITY}) - continue() - endif() + set(RENTITY "StreamFX_${_ENTITY}") + get_target_property(_DEPENDS "${RENTITY}" COMPONENT_DEPENDS) # Finally if everything is correct, do things. - target_link_libraries(StreamFX PRIVATE $) + target_link_libraries(StreamFX PRIVATE $) + + if(_DEPENDS) + foreach(_DEPEND ${_DEPENDS}) + list(GET _DEPEND 0 _ENTITY2) + set(RENTITY2 "StreamFX_${_ENTITY2}") + + streamfx_enabled_component(${_ENTITY2} T_CHECK) + if(T_CHECK) + target_link_libraries(${RENTITY} + PUBLIC + $ + ) + endif() + endforeach() + endif() endforeach() ################################################################################ diff --git a/components/nvidia/source/nvidia/ar/nvidia-ar-facedetection.hpp b/components/nvidia/include/nvidia/ar/nvidia-ar-facedetection.hpp similarity index 100% rename from components/nvidia/source/nvidia/ar/nvidia-ar-facedetection.hpp rename to components/nvidia/include/nvidia/ar/nvidia-ar-facedetection.hpp diff --git a/components/nvidia/source/nvidia/ar/nvidia-ar-feature.hpp b/components/nvidia/include/nvidia/ar/nvidia-ar-feature.hpp similarity index 100% rename from components/nvidia/source/nvidia/ar/nvidia-ar-feature.hpp rename to components/nvidia/include/nvidia/ar/nvidia-ar-feature.hpp diff --git a/components/nvidia/source/nvidia/ar/nvidia-ar.hpp b/components/nvidia/include/nvidia/ar/nvidia-ar.hpp similarity index 100% rename from components/nvidia/source/nvidia/ar/nvidia-ar.hpp rename to components/nvidia/include/nvidia/ar/nvidia-ar.hpp diff --git a/components/nvidia/source/nvidia/cuda/nvidia-cuda-context.hpp b/components/nvidia/include/nvidia/cuda/nvidia-cuda-context.hpp similarity index 100% rename from components/nvidia/source/nvidia/cuda/nvidia-cuda-context.hpp rename to components/nvidia/include/nvidia/cuda/nvidia-cuda-context.hpp diff --git a/components/nvidia/source/nvidia/cuda/nvidia-cuda-gs-texture.hpp b/components/nvidia/include/nvidia/cuda/nvidia-cuda-gs-texture.hpp similarity index 100% rename from components/nvidia/source/nvidia/cuda/nvidia-cuda-gs-texture.hpp rename to components/nvidia/include/nvidia/cuda/nvidia-cuda-gs-texture.hpp diff --git a/components/nvidia/source/nvidia/cuda/nvidia-cuda-memory.hpp b/components/nvidia/include/nvidia/cuda/nvidia-cuda-memory.hpp similarity index 100% rename from components/nvidia/source/nvidia/cuda/nvidia-cuda-memory.hpp rename to components/nvidia/include/nvidia/cuda/nvidia-cuda-memory.hpp diff --git a/components/nvidia/source/nvidia/cuda/nvidia-cuda-obs.hpp b/components/nvidia/include/nvidia/cuda/nvidia-cuda-obs.hpp similarity index 100% rename from components/nvidia/source/nvidia/cuda/nvidia-cuda-obs.hpp rename to components/nvidia/include/nvidia/cuda/nvidia-cuda-obs.hpp diff --git a/components/nvidia/source/nvidia/cuda/nvidia-cuda-stream.hpp b/components/nvidia/include/nvidia/cuda/nvidia-cuda-stream.hpp similarity index 100% rename from components/nvidia/source/nvidia/cuda/nvidia-cuda-stream.hpp rename to components/nvidia/include/nvidia/cuda/nvidia-cuda-stream.hpp diff --git a/components/nvidia/source/nvidia/cuda/nvidia-cuda.hpp b/components/nvidia/include/nvidia/cuda/nvidia-cuda.hpp similarity index 100% rename from components/nvidia/source/nvidia/cuda/nvidia-cuda.hpp rename to components/nvidia/include/nvidia/cuda/nvidia-cuda.hpp diff --git a/components/nvidia/source/nvidia/cv/nvidia-cv-image.hpp b/components/nvidia/include/nvidia/cv/nvidia-cv-image.hpp similarity index 100% rename from components/nvidia/source/nvidia/cv/nvidia-cv-image.hpp rename to components/nvidia/include/nvidia/cv/nvidia-cv-image.hpp diff --git a/components/nvidia/source/nvidia/cv/nvidia-cv-texture.hpp b/components/nvidia/include/nvidia/cv/nvidia-cv-texture.hpp similarity index 100% rename from components/nvidia/source/nvidia/cv/nvidia-cv-texture.hpp rename to components/nvidia/include/nvidia/cv/nvidia-cv-texture.hpp diff --git a/components/nvidia/source/nvidia/cv/nvidia-cv.hpp b/components/nvidia/include/nvidia/cv/nvidia-cv.hpp similarity index 100% rename from components/nvidia/source/nvidia/cv/nvidia-cv.hpp rename to components/nvidia/include/nvidia/cv/nvidia-cv.hpp diff --git a/components/nvidia/source/nvidia/vfx/nvidia-vfx-denoising.hpp b/components/nvidia/include/nvidia/vfx/nvidia-vfx-denoising.hpp similarity index 100% rename from components/nvidia/source/nvidia/vfx/nvidia-vfx-denoising.hpp rename to components/nvidia/include/nvidia/vfx/nvidia-vfx-denoising.hpp diff --git a/components/nvidia/source/nvidia/vfx/nvidia-vfx-effect.hpp b/components/nvidia/include/nvidia/vfx/nvidia-vfx-effect.hpp similarity index 100% rename from components/nvidia/source/nvidia/vfx/nvidia-vfx-effect.hpp rename to components/nvidia/include/nvidia/vfx/nvidia-vfx-effect.hpp diff --git a/components/nvidia/source/nvidia/vfx/nvidia-vfx-greenscreen.hpp b/components/nvidia/include/nvidia/vfx/nvidia-vfx-greenscreen.hpp similarity index 100% rename from components/nvidia/source/nvidia/vfx/nvidia-vfx-greenscreen.hpp rename to components/nvidia/include/nvidia/vfx/nvidia-vfx-greenscreen.hpp diff --git a/components/nvidia/source/nvidia/vfx/nvidia-vfx-superresolution.hpp b/components/nvidia/include/nvidia/vfx/nvidia-vfx-superresolution.hpp similarity index 100% rename from components/nvidia/source/nvidia/vfx/nvidia-vfx-superresolution.hpp rename to components/nvidia/include/nvidia/vfx/nvidia-vfx-superresolution.hpp diff --git a/components/nvidia/source/nvidia/vfx/nvidia-vfx.hpp b/components/nvidia/include/nvidia/vfx/nvidia-vfx.hpp similarity index 100% rename from components/nvidia/source/nvidia/vfx/nvidia-vfx.hpp rename to components/nvidia/include/nvidia/vfx/nvidia-vfx.hpp From 1eecb35c8308ca72a86d83497dfb22b35cb6c63a Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 08:09:28 +0200 Subject: [PATCH 53/66] autoframing: I have no idea why this is necessary There does not appear to be a reason for this to cause a compiler error, but it does on MSVC. To be precise, the 'grp2' part causes it if there is not an underscore behind it. A classic "doesn't work without this comment" problem. --- .../source/filters/filter-autoframing.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/components/autoframing/source/filters/filter-autoframing.cpp b/components/autoframing/source/filters/filter-autoframing.cpp index bb2accc991..d3eafd8915 100644 --- a/components/autoframing/source/filters/filter-autoframing.cpp +++ b/components/autoframing/source/filters/filter-autoframing.cpp @@ -1142,26 +1142,26 @@ obs_properties_t* autoframing_factory::get_properties2(autoframing_instance* dat } { - auto grp2 = obs_properties_create(); - obs_properties_add_group(grp, ST_KEY_FRAMING_PADDING, D_TRANSLATE(ST_I18N_FRAMING_PADDING), OBS_GROUP_NORMAL, grp2); + auto grp2_ = obs_properties_create(); + obs_properties_add_group(grp, ST_KEY_FRAMING_PADDING, D_TRANSLATE(ST_I18N_FRAMING_PADDING), OBS_GROUP_NORMAL, grp2_); { - auto p = obs_properties_add_text(grp2, ST_KEY_FRAMING_PADDING ".X", "X", OBS_TEXT_DEFAULT); + auto p = obs_properties_add_text(grp2_, ST_KEY_FRAMING_PADDING ".X", "X", OBS_TEXT_DEFAULT); } { - auto p = obs_properties_add_text(grp2, ST_KEY_FRAMING_PADDING ".Y", "Y", OBS_TEXT_DEFAULT); + auto p = obs_properties_add_text(grp2_, ST_KEY_FRAMING_PADDING ".Y", "Y", OBS_TEXT_DEFAULT); } } { - auto grp2 = obs_properties_create(); - obs_properties_add_group(grp, ST_KEY_FRAMING_OFFSET, D_TRANSLATE(ST_I18N_FRAMING_OFFSET), OBS_GROUP_NORMAL, grp2); + auto grp2_ = obs_properties_create(); + obs_properties_add_group(grp, ST_KEY_FRAMING_OFFSET, D_TRANSLATE(ST_I18N_FRAMING_OFFSET), OBS_GROUP_NORMAL, grp2_); { - auto p = obs_properties_add_text(grp2, ST_KEY_FRAMING_OFFSET ".X", "X", OBS_TEXT_DEFAULT); + auto p = obs_properties_add_text(grp2_, ST_KEY_FRAMING_OFFSET ".X", "X", OBS_TEXT_DEFAULT); } { - auto p = obs_properties_add_text(grp2, ST_KEY_FRAMING_OFFSET ".Y", "Y", OBS_TEXT_DEFAULT); + auto p = obs_properties_add_text(grp2_, ST_KEY_FRAMING_OFFSET ".Y", "Y", OBS_TEXT_DEFAULT); } } From 0b99ef1be161233f0335dd5c03c5620ca9a2ae08 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 30 Sep 2023 09:07:36 +0200 Subject: [PATCH 54/66] nvidia: Fix header includes now that they're in include not source --- components/nvidia/source/nvidia/ar/nvidia-ar-facedetection.cpp | 2 +- components/nvidia/source/nvidia/ar/nvidia-ar-feature.cpp | 2 +- components/nvidia/source/nvidia/ar/nvidia-ar.cpp | 2 +- components/nvidia/source/nvidia/cuda/nvidia-cuda-context.cpp | 2 +- components/nvidia/source/nvidia/cuda/nvidia-cuda-gs-texture.cpp | 2 +- components/nvidia/source/nvidia/cuda/nvidia-cuda-memory.cpp | 2 +- components/nvidia/source/nvidia/cuda/nvidia-cuda-obs.cpp | 2 +- components/nvidia/source/nvidia/cuda/nvidia-cuda-stream.cpp | 2 +- components/nvidia/source/nvidia/cuda/nvidia-cuda.cpp | 2 +- components/nvidia/source/nvidia/cv/nvidia-cv-image.cpp | 2 +- components/nvidia/source/nvidia/cv/nvidia-cv-texture.cpp | 2 +- components/nvidia/source/nvidia/cv/nvidia-cv.cpp | 2 +- components/nvidia/source/nvidia/vfx/nvidia-vfx-denoising.cpp | 2 +- components/nvidia/source/nvidia/vfx/nvidia-vfx-effect.cpp | 2 +- components/nvidia/source/nvidia/vfx/nvidia-vfx-greenscreen.cpp | 2 +- .../nvidia/source/nvidia/vfx/nvidia-vfx-superresolution.cpp | 2 +- components/nvidia/source/nvidia/vfx/nvidia-vfx.cpp | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/components/nvidia/source/nvidia/ar/nvidia-ar-facedetection.cpp b/components/nvidia/source/nvidia/ar/nvidia-ar-facedetection.cpp index fbf7384fa6..a4ff3c3048 100644 --- a/components/nvidia/source/nvidia/ar/nvidia-ar-facedetection.cpp +++ b/components/nvidia/source/nvidia/ar/nvidia-ar-facedetection.cpp @@ -3,7 +3,7 @@ // Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END -#include "nvidia-ar-facedetection.hpp" +#include "nvidia/ar/nvidia-ar-facedetection.hpp" #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" diff --git a/components/nvidia/source/nvidia/ar/nvidia-ar-feature.cpp b/components/nvidia/source/nvidia/ar/nvidia-ar-feature.cpp index f314924331..6477bbe766 100644 --- a/components/nvidia/source/nvidia/ar/nvidia-ar-feature.cpp +++ b/components/nvidia/source/nvidia/ar/nvidia-ar-feature.cpp @@ -2,7 +2,7 @@ // Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END -#include "nvidia-ar-feature.hpp" +#include "nvidia/ar/nvidia-ar-feature.hpp" #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" #include "util/util-platform.hpp" diff --git a/components/nvidia/source/nvidia/ar/nvidia-ar.cpp b/components/nvidia/source/nvidia/ar/nvidia-ar.cpp index ebe95b3fd6..8a7982b250 100644 --- a/components/nvidia/source/nvidia/ar/nvidia-ar.cpp +++ b/components/nvidia/source/nvidia/ar/nvidia-ar.cpp @@ -2,7 +2,7 @@ // Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END -#include "nvidia-ar.hpp" +#include "nvidia/ar/nvidia-ar.hpp" #include "nvidia/cuda/nvidia-cuda-obs.hpp" #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" diff --git a/components/nvidia/source/nvidia/cuda/nvidia-cuda-context.cpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-context.cpp index 154d7169a8..f988d72129 100644 --- a/components/nvidia/source/nvidia/cuda/nvidia-cuda-context.cpp +++ b/components/nvidia/source/nvidia/cuda/nvidia-cuda-context.cpp @@ -2,7 +2,7 @@ // Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END -#include "nvidia-cuda-context.hpp" +#include "nvidia/cuda/nvidia-cuda-context.hpp" #include "util/util-logging.hpp" #include "warning-disable.hpp" diff --git a/components/nvidia/source/nvidia/cuda/nvidia-cuda-gs-texture.cpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-gs-texture.cpp index 72bbc7d4c9..0cd6cf8da5 100644 --- a/components/nvidia/source/nvidia/cuda/nvidia-cuda-gs-texture.cpp +++ b/components/nvidia/source/nvidia/cuda/nvidia-cuda-gs-texture.cpp @@ -3,7 +3,7 @@ // Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END -#include "nvidia-cuda-gs-texture.hpp" +#include "nvidia/cuda/nvidia-cuda-gs-texture.hpp" #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" diff --git a/components/nvidia/source/nvidia/cuda/nvidia-cuda-memory.cpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-memory.cpp index 33a7d09ed1..6705dd4493 100644 --- a/components/nvidia/source/nvidia/cuda/nvidia-cuda-memory.cpp +++ b/components/nvidia/source/nvidia/cuda/nvidia-cuda-memory.cpp @@ -2,7 +2,7 @@ // Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END -#include "nvidia-cuda-memory.hpp" +#include "nvidia/cuda/nvidia-cuda-memory.hpp" #include "util/util-logging.hpp" #include "warning-disable.hpp" diff --git a/components/nvidia/source/nvidia/cuda/nvidia-cuda-obs.cpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-obs.cpp index fef5d2e8ee..500546c531 100644 --- a/components/nvidia/source/nvidia/cuda/nvidia-cuda-obs.cpp +++ b/components/nvidia/source/nvidia/cuda/nvidia-cuda-obs.cpp @@ -2,7 +2,7 @@ // Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END -#include "nvidia-cuda-obs.hpp" +#include "nvidia/cuda/nvidia-cuda-obs.hpp" #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" diff --git a/components/nvidia/source/nvidia/cuda/nvidia-cuda-stream.cpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda-stream.cpp index 8665c3108b..f9ed36042e 100644 --- a/components/nvidia/source/nvidia/cuda/nvidia-cuda-stream.cpp +++ b/components/nvidia/source/nvidia/cuda/nvidia-cuda-stream.cpp @@ -2,7 +2,7 @@ // Copyright (C) 2017-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END -#include "nvidia-cuda-stream.hpp" +#include "nvidia/cuda/nvidia-cuda-stream.hpp" #include "util/util-logging.hpp" #include "warning-disable.hpp" diff --git a/components/nvidia/source/nvidia/cuda/nvidia-cuda.cpp b/components/nvidia/source/nvidia/cuda/nvidia-cuda.cpp index 944f1b4746..69d1e9c089 100644 --- a/components/nvidia/source/nvidia/cuda/nvidia-cuda.cpp +++ b/components/nvidia/source/nvidia/cuda/nvidia-cuda.cpp @@ -2,7 +2,7 @@ // Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END -#include "nvidia-cuda.hpp" +#include "nvidia/cuda/nvidia-cuda.hpp" #include "util/util-logging.hpp" #include "warning-disable.hpp" diff --git a/components/nvidia/source/nvidia/cv/nvidia-cv-image.cpp b/components/nvidia/source/nvidia/cv/nvidia-cv-image.cpp index 2c3561c9c2..a4b624101f 100644 --- a/components/nvidia/source/nvidia/cv/nvidia-cv-image.cpp +++ b/components/nvidia/source/nvidia/cv/nvidia-cv-image.cpp @@ -6,7 +6,7 @@ // - NVIDIA Video Effects SDK // - NVIDIA Augmented Reality SDK -#include "nvidia-cv-image.hpp" +#include "nvidia/cv/nvidia-cv-image.hpp" #include "nvidia/cuda/nvidia-cuda-obs.hpp" #include "obs/gs/gs-helper.hpp" diff --git a/components/nvidia/source/nvidia/cv/nvidia-cv-texture.cpp b/components/nvidia/source/nvidia/cv/nvidia-cv-texture.cpp index 935d187619..038765a14e 100644 --- a/components/nvidia/source/nvidia/cv/nvidia-cv-texture.cpp +++ b/components/nvidia/source/nvidia/cv/nvidia-cv-texture.cpp @@ -6,7 +6,7 @@ // - NVIDIA Video Effects SDK // - NVIDIA Augmented Reality SDK -#include "nvidia-cv-texture.hpp" +#include "nvidia/cv/nvidia-cv-texture.hpp" #include "nvidia/cuda/nvidia-cuda-obs.hpp" #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" diff --git a/components/nvidia/source/nvidia/cv/nvidia-cv.cpp b/components/nvidia/source/nvidia/cv/nvidia-cv.cpp index 0f35e13764..38737b49fb 100644 --- a/components/nvidia/source/nvidia/cv/nvidia-cv.cpp +++ b/components/nvidia/source/nvidia/cv/nvidia-cv.cpp @@ -6,7 +6,7 @@ // - NVIDIA Video Effects SDK // - NVIDIA Augmented Reality SDK -#include "nvidia-cv.hpp" +#include "nvidia/cv/nvidia-cv.hpp" #include "nvidia/cuda/nvidia-cuda-obs.hpp" #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" diff --git a/components/nvidia/source/nvidia/vfx/nvidia-vfx-denoising.cpp b/components/nvidia/source/nvidia/vfx/nvidia-vfx-denoising.cpp index c1e5e3739d..6ddbae628f 100644 --- a/components/nvidia/source/nvidia/vfx/nvidia-vfx-denoising.cpp +++ b/components/nvidia/source/nvidia/vfx/nvidia-vfx-denoising.cpp @@ -2,7 +2,7 @@ // Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END -#include "nvidia-vfx-denoising.hpp" +#include "nvidia/vfx/nvidia-vfx-denoising.hpp" #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" #include "util/utility.hpp" diff --git a/components/nvidia/source/nvidia/vfx/nvidia-vfx-effect.cpp b/components/nvidia/source/nvidia/vfx/nvidia-vfx-effect.cpp index 0a8643ea12..40abcbc23d 100644 --- a/components/nvidia/source/nvidia/vfx/nvidia-vfx-effect.cpp +++ b/components/nvidia/source/nvidia/vfx/nvidia-vfx-effect.cpp @@ -2,7 +2,7 @@ // Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END -#include "nvidia-vfx-effect.hpp" +#include "nvidia/vfx/nvidia-vfx-effect.hpp" #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" diff --git a/components/nvidia/source/nvidia/vfx/nvidia-vfx-greenscreen.cpp b/components/nvidia/source/nvidia/vfx/nvidia-vfx-greenscreen.cpp index 16fb594269..00ab4d1b65 100644 --- a/components/nvidia/source/nvidia/vfx/nvidia-vfx-greenscreen.cpp +++ b/components/nvidia/source/nvidia/vfx/nvidia-vfx-greenscreen.cpp @@ -2,7 +2,7 @@ // Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END -#include "nvidia-vfx-greenscreen.hpp" +#include "nvidia/vfx/nvidia-vfx-greenscreen.hpp" #include "nvidia/cv/nvidia-cv.hpp" #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" diff --git a/components/nvidia/source/nvidia/vfx/nvidia-vfx-superresolution.cpp b/components/nvidia/source/nvidia/vfx/nvidia-vfx-superresolution.cpp index fe2d687873..8664610b3d 100644 --- a/components/nvidia/source/nvidia/vfx/nvidia-vfx-superresolution.cpp +++ b/components/nvidia/source/nvidia/vfx/nvidia-vfx-superresolution.cpp @@ -3,7 +3,7 @@ // Copyright (C) 2022 lainon // AUTOGENERATED COPYRIGHT HEADER END -#include "nvidia-vfx-superresolution.hpp" +#include "nvidia/vfx/nvidia-vfx-superresolution.hpp" #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" #include "util/utility.hpp" diff --git a/components/nvidia/source/nvidia/vfx/nvidia-vfx.cpp b/components/nvidia/source/nvidia/vfx/nvidia-vfx.cpp index e5f3b5868f..78c70aff1c 100644 --- a/components/nvidia/source/nvidia/vfx/nvidia-vfx.cpp +++ b/components/nvidia/source/nvidia/vfx/nvidia-vfx.cpp @@ -2,7 +2,7 @@ // Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks // AUTOGENERATED COPYRIGHT HEADER END -#include "nvidia-vfx.hpp" +#include "nvidia/vfx/nvidia-vfx.hpp" #include "nvidia/cuda/nvidia-cuda-obs.hpp" #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" From 54b6df0fd0864f9a996d4887dea73e541bd3a9a1 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 1 Oct 2023 06:16:56 +0200 Subject: [PATCH 55/66] Potential fix for linker issues --- CMakeLists.txt | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bae0e51fc..64b93a178d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1050,7 +1050,7 @@ function(streamfx_add_component COMPONENT_NAME) set(COMPONENT_ALIAS "StreamFX::${COMPONENT_SANITIZED_NAME}") set(COMPONENT_ALIAS "${COMPONENT_ALIAS}" PARENT_SCOPE) - streamfx_add_library(${COMPONENT_TARGET} STATIC EXCLUDE_FROM_ALL) + streamfx_add_library(${COMPONENT_TARGET} OBJECT EXCLUDE_FROM_ALL) add_library(${COMPONENT_ALIAS} ALIAS ${COMPONENT_TARGET}) set_target_properties(${COMPONENT_TARGET} PROPERTIES COMPONENT_LABEL "${COMPONENT_NAME}" @@ -1059,7 +1059,10 @@ function(streamfx_add_component COMPONENT_NAME) ) # Always depend on StreamFX::Core - target_link_libraries(${COMPONENT_TARGET} PRIVATE $) + target_link_libraries(${COMPONENT_TARGET} + PUBLIC + StreamFX_Core + ) # Register the component globally. get_target_property(_DEPENDS StreamFX COMPONENT_DEPENDS) @@ -1537,14 +1540,12 @@ while(_UNRESOLVED) endwhile() #- Linking -target_link_libraries(StreamFX PRIVATE $) +target_link_libraries(StreamFX PUBLIC StreamFX_Core) foreach(_ENTITY ${_RESOLVED}) set(RENTITY "StreamFX_${_ENTITY}") get_target_property(_DEPENDS "${RENTITY}" COMPONENT_DEPENDS) # Finally if everything is correct, do things. - target_link_libraries(StreamFX PRIVATE $) - if(_DEPENDS) foreach(_DEPEND ${_DEPENDS}) list(GET _DEPEND 0 _ENTITY2) @@ -1554,11 +1555,16 @@ foreach(_ENTITY ${_RESOLVED}) if(T_CHECK) target_link_libraries(${RENTITY} PUBLIC - $ + ${RENTITY2} ) endif() endforeach() endif() + + target_link_libraries(StreamFX + PRIVATE + ${RENTITY} + ) endforeach() ################################################################################ From 2277c60e5e743c89f681061c536b98894f343eb5 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 1 Oct 2023 06:22:43 +0200 Subject: [PATCH 56/66] Opt for more modern linkers on CI --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 62642b51bb..a6bed3aef9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -359,6 +359,7 @@ jobs: echo "CMAKE_C_COMPILER=gcc-${compiler[1]}" >> "$GITHUB_ENV" echo "CMAKE_CXX_COMPILER=g++-${compiler[1]}" >> "$GITHUB_ENV" + echo "CMAKE_LINKER=gold" >> "$GITHUB_ENV" elif [[ "${compiler[0]}" == "Clang" ]]; then curl -jLo /tmp/llvm.sh "https://apt.llvm.org/llvm.sh" chmod +x /tmp/llvm.sh @@ -373,6 +374,7 @@ jobs: echo "CMAKE_C_COMPILER=clang-${compiler[1]}" >> "$GITHUB_ENV" echo "CMAKE_CXX_COMPILER=clang++-${compiler[1]}" >> "$GITHUB_ENV" + echo "CMAKE_LINKER=ld.lld-${compiler[1]}" >> "$GITHUB_ENV" else echo "Unknown Compiler" exit 1 From 34f030604039294932e969bffb98882863c3bee3 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 1 Oct 2023 06:16:37 +0200 Subject: [PATCH 57/66] Remove Qt 5.x and Ubuntu 20.04 builds --- .github/workflows/main.yml | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a6bed3aef9..1a15bb8ca3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -312,24 +312,13 @@ jobs: strategy: fail-fast: false matrix: - runner: [ "ubuntu-22.04", "ubuntu-20.04" ] - compiler: [ "GCC-12", "GCC-11", "Clang-16" ] - qt: [ 5, 6 ] + runner: [ "ubuntu-22.04" ] + compiler: [ "GCC-12", "Clang-16" ] + qt: [ 6 ] CMAKE_GENERATOR: [ "Ninja Multi-Config" ] - exclude: - - runner: "ubuntu-22.04" - qt: 5 - - runner: "ubuntu-22.04" - compiler: "GCC-11" - - runner: "ubuntu-20.04" - qt: 6 - - runner: "ubuntu-20.04" - compiler: "GCC-12" include: - runner: "ubuntu-22.04" name: "Ubuntu 22.04" - - runner: "ubuntu-20.04" - name: "Ubuntu 20.04" runs-on: "${{ matrix.runner }}" name: "${{ matrix.name }} (${{ matrix.compiler }}, Qt${{ matrix.qt }})" env: @@ -383,13 +372,8 @@ jobs: id: qt shell: bash run: | - if [[ ${{ matrix.qt }} -eq 5 ]]; then - sudo apt-get -y install -V \ - qtbase5-dev qtbase5-private-dev libqt5svg5-dev - elif [[ ${{ matrix.qt }} -eq 6 ]]; then - sudo apt-get -y install -V \ - qt6-base-dev qt6-base-private-dev libqt6svg6-dev libgles2-mesa-dev libegl1-mesa-dev libgl1-mesa-dev - fi + sudo apt-get -y install -V \ + qt6-base-dev qt6-base-private-dev libqt6svg6-dev libgles2-mesa-dev libegl1-mesa-dev libgl1-mesa-dev - name: "Dependency: Prebuilt OBS Studio Dependencies" id: obsdeps shell: bash From 9a8be4d8e71126dce97282195b295239d4877bd9 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Wed, 4 Oct 2023 06:32:12 +0200 Subject: [PATCH 58/66] Fix up bundles for MacOS installation --- CMakeLists.txt | 107 +++++++++++++++++++------------------------------ 1 file changed, 42 insertions(+), 65 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 64b93a178d..44ec0771ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -305,8 +305,6 @@ if(STANDALONE) set(STRUCTURE_UNIFIED CACHE BOOL "Install for use in a Plugin Manager") if(D_PLATFORM_LINUX) set(STRUCTURE_PACKAGEMANAGER CACHE BOOL "Install for use in a Package Manager (system-wide installation)") - elseif(D_PLATFORM_MAC) - set(STRUCTURE_BUNDLE ON CACHE BOOL "Install as a Loadable Bundle (.plugin)") endif() set(PACKAGE_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Where to place the packages?") @@ -1267,9 +1265,7 @@ else() ) endif() -if(D_PLATFORM_WINDOWS) - # Windows-exclusive - +if(D_PLATFORM_WINDOWS) # Windows-exclusive # Version Resource set(PROJECT_PRODUCT_NAME "${PROJECT_FULL_NAME}") set(PROJECT_COMPANY_NAME "${PROJECT_AUTHORS}") @@ -1286,57 +1282,22 @@ if(D_PLATFORM_WINDOWS) "templates/windows/version.rc.in" "${PROJECT_BINARY_DIR}/generated/version.rc" ) -elseif(D_PLATFORM_MAC) - # MacOS exclusive Changes - +elseif(D_PLATFORM_MAC) # MacOS exclusive Changes set_target_properties(StreamFX PROPERTIES # No automatic code signing in XCode XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "" XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO" + # @rpath in installed binaries INSTALL_RPATH "@executable_path/../Frameworks/;@loader_path/../Frameworks/;@loader_path/../Resources/" ) + if(STANDALONE) set_target_properties(StreamFX PROPERTIES # @rpath in built binaries BUILD_WITH_INSTALL_RPATH ON ) endif() - - # Bundle exporting - if(STRUCTURE_BUNDLE) - # Proper location for resources in Bundles - foreach(FILE IN LISTS PROJECT_DATA) - cmake_path(ABSOLUTE_PATH FILE OUTPUT_VARIABLE FILE_PATH) - cmake_path(RELATIVE_PATH FILE_PATH BASE_DIRECTORY "${PROJECT_SOURCE_DIR}/data/") - cmake_path(GET FILE_PATH PARENT_PATH FILE_PATH) - set_source_files_properties("${FILE}" PROPERTIES - MACOSX_PACKAGE_LOCATION "Resources/${FILE_PATH}" - ) - endforeach() - - # Bundle Icon - set_source_files_properties("media/icon.png" PROPERTIES - MACOSX_PACKAGE_LOCATION "Resources" - ) - - # Bundle Information - set(MACOSX_BUNDLE_BUNDLE_NAME "StreamFX") - set(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}") - set(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT}") - set(MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_IDENTIFER}") - set(MACOSX_BUNDLE_ICON_FILE "icon.png") - set(MACOSX_BUNDLE_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") - set(MACOSX_BUNDLE_LONG_VERSION_STRING "${_VERSION}") - set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}") - set_target_properties(StreamFX PROPERTIES - BUNDLE ON - BUNDLE_EXTENSION "plugin" - OUTPUT_NAME StreamFX - MACOSX_BUNDLE_INFO_PLIST "${PROJECT_SOURCE_DIR}/templates/macos/Info.plist.in" - XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${MACOSX_BUNDLE_GUI_IDENTIFIER}" - ) - endif() endif() # Set file version @@ -1669,29 +1630,45 @@ if(STANDALONE) ) endif() elseif(D_PLATFORM_MAC) - if(STRUCTURE_BUNDLE) - install( - TARGETS StreamFX - RUNTIME DESTINATION "." COMPONENT StreamFX - LIBRARY DESTINATION "." COMPONENT StreamFX - BUNDLE DESTINATION "." COMPONENT StreamFX - PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - ) - else() - install( - TARGETS StreamFX - RUNTIME DESTINATION "StreamFX/bin/" COMPONENT StreamFX - LIBRARY DESTINATION "StreamFX/bin/" COMPONENT StreamFX - PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - ) - install( - DIRECTORY "data/" - DESTINATION "StreamFX/data/" - COMPONENT StreamFX - FILE_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - DIRECTORY_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE + # Bundle Information + set(MACOSX_BUNDLE_BUNDLE_NAME "StreamFX") + set(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}") + set(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT}") + set(MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_IDENTIFER}") + set(MACOSX_BUNDLE_ICON_FILE "icon.png") + set(MACOSX_BUNDLE_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") + set(MACOSX_BUNDLE_LONG_VERSION_STRING "${_VERSION}") + set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}") + set_target_properties(StreamFX PROPERTIES + BUNDLE ON + BUNDLE_EXTENSION "plugin" + OUTPUT_NAME StreamFX + MACOSX_BUNDLE_INFO_PLIST "${PROJECT_SOURCE_DIR}/templates/macos/Info.plist.in" + XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${MACOSX_BUNDLE_GUI_IDENTIFIER}" + ) + + # Proper location for resources in Bundles + foreach(FILE IN LISTS PROJECT_DATA) + cmake_path(ABSOLUTE_PATH FILE OUTPUT_VARIABLE FILE_PATH) + cmake_path(RELATIVE_PATH FILE_PATH BASE_DIRECTORY "${PROJECT_SOURCE_DIR}/data/") + cmake_path(GET FILE_PATH PARENT_PATH FILE_PATH) + set_source_files_properties("${FILE}" PROPERTIES + MACOSX_PACKAGE_LOCATION "Resources/${FILE_PATH}" ) - endif() + endforeach() + + # Bundle Icon + set_source_files_properties("media/icon.png" PROPERTIES + MACOSX_PACKAGE_LOCATION "Resources" + ) + + install( + TARGETS StreamFX + RUNTIME DESTINATION "." COMPONENT StreamFX + LIBRARY DESTINATION "." COMPONENT StreamFX + BUNDLE DESTINATION "." COMPONENT StreamFX + PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE + ) endif() else() if(COMMAND setup_plugin_target) From 0efbaa6afb8e5765effe6bee985df306e16a8866 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Wed, 4 Oct 2023 06:35:20 +0200 Subject: [PATCH 59/66] Strip out unnecessary packaging logic --- CMakeLists.txt | 127 +++++++++++-------------------------------------- 1 file changed, 28 insertions(+), 99 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 44ec0771ac..3c60522998 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -302,7 +302,6 @@ endif() # Installation / Packaging if(STANDALONE) - set(STRUCTURE_UNIFIED CACHE BOOL "Install for use in a Plugin Manager") if(D_PLATFORM_LINUX) set(STRUCTURE_PACKAGEMANAGER CACHE BOOL "Install for use in a Package Manager (system-wide installation)") endif() @@ -1533,56 +1532,7 @@ endforeach() ################################################################################ if(STANDALONE) - if(STRUCTURE_UNIFIED) - install( - DIRECTORY "data/" - DESTINATION "data/" - FILE_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - DIRECTORY_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - ) - - if(D_PLATFORM_WINDOWS) - install( - TARGETS StreamFX - RUNTIME DESTINATION "bin/windows-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX - LIBRARY DESTINATION "bin/windows-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX - PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - ) - if(MSVC) - install( - FILES $ - DESTINATION "bin/windows-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" - COMPONENT StreamFX - OPTIONAL - ) - endif() - elseif(D_PLATFORM_LINUX) - install( - TARGETS StreamFX - RUNTIME DESTINATION "bin/linux-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX - LIBRARY DESTINATION "bin/linux-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX - PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - ) - elseif(D_PLATFORM_MAC) - install( - TARGETS StreamFX - RUNTIME DESTINATION "bin/mac-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX - LIBRARY DESTINATION "bin/mac-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX - PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE - ) - endif() - - install( - FILES LICENSE - DESTINATION "LICENSE" - COMPONENT StreamFX - ) - install( - FILES icon.png - DESTINATION "icon.png" - COMPONENT StreamFX - ) - elseif(D_PLATFORM_WINDOWS) + if(D_PLATFORM_WINDOWS) install( TARGETS StreamFX RUNTIME DESTINATION "obs-plugins/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX @@ -1692,59 +1642,38 @@ if(STANDALONE) endif() set(_PACKAGE_FULL_NAME "${PACKAGE_PREFIX}/${PACKAGE_NAME}-${_PACKAGE_SUFFIX_OVERRIDE}") - if(STRUCTURE_UNIFIED) - add_custom_target( - PACKAGE_ZIP - ${CMAKE_COMMAND} -E tar cfv "${_PACKAGE_FULL_NAME}.obs" --format=zip -- - "." - WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}" + if(D_PLATFORM_WINDOWS) + ## Installer (InnoSetup) + get_filename_component(ISS_FILES_DIR "${CMAKE_INSTALL_PREFIX}" ABSOLUTE) + file(TO_NATIVE_PATH "${ISS_FILES_DIR}" ISS_FILES_DIR) + + get_filename_component(ISS_PACKAGE_DIR "${PACKAGE_PREFIX}" ABSOLUTE) + file(TO_NATIVE_PATH "${ISS_PACKAGE_DIR}" ISS_PACKAGE_DIR) + + get_filename_component(ISS_SOURCE_DIR "${PROJECT_SOURCE_DIR}" ABSOLUTE) + file(TO_NATIVE_PATH "${ISS_SOURCE_DIR}" ISS_SOURCE_DIR) + + get_filename_component(ISS_MSVCHELPER_PATH "${msvc-redist-helper_BUILD_DIR}" ABSOLUTE) + file(TO_NATIVE_PATH "${ISS_MSVCHELPER_PATH}" ISS_MSVCHELPER_PATH) + + configure_file( + "templates/windows/installer.iss.in" + "installer.iss" ) - else() - add_custom_target( - PACKAGE_7Z - ${CMAKE_COMMAND} -E tar cfv "${_PACKAGE_FULL_NAME}.7z" --format=7zip -- - "." - WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}" + elseif(D_PLATFORM_MAC) + # .pkg Installer + set(PACKAGES_PATH_NAME "StreamFX") + set(PACKAGES_PATH_NAME "${PACKAGES_PATH_NAME}.plugin") + configure_file( + "templates/macos/installer.pkgproj.in" + "installer.pkgproj" ) + elseif(D_PLATFORM_LINUX) add_custom_target( - PACKAGE_ZIP - ${CMAKE_COMMAND} -E tar cfv "${_PACKAGE_FULL_NAME}.zip" --format=zip -- + PACKAGE + ${CMAKE_COMMAND} -E tar cfv "${_PACKAGE_FULL_NAME}.7z" --format=7zip -- "." WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}" ) - - # Windows - if(D_PLATFORM_WINDOWS) - ## Installer (InnoSetup) - get_filename_component(ISS_FILES_DIR "${CMAKE_INSTALL_PREFIX}" ABSOLUTE) - file(TO_NATIVE_PATH "${ISS_FILES_DIR}" ISS_FILES_DIR) - - get_filename_component(ISS_PACKAGE_DIR "${PACKAGE_PREFIX}" ABSOLUTE) - file(TO_NATIVE_PATH "${ISS_PACKAGE_DIR}" ISS_PACKAGE_DIR) - - get_filename_component(ISS_SOURCE_DIR "${PROJECT_SOURCE_DIR}" ABSOLUTE) - file(TO_NATIVE_PATH "${ISS_SOURCE_DIR}" ISS_SOURCE_DIR) - - get_filename_component(ISS_MSVCHELPER_PATH "${msvc-redist-helper_BUILD_DIR}" ABSOLUTE) - file(TO_NATIVE_PATH "${ISS_MSVCHELPER_PATH}" ISS_MSVCHELPER_PATH) - - configure_file( - "templates/windows/installer.iss.in" - "installer.iss" - ) - endif() - - # Apple MacOS - if(D_PLATFORM_MAC) - # .pkg Installer - set(PACKAGES_PATH_NAME "StreamFX") - if(STRUCTURE_BUNDLE) - set(PACKAGES_PATH_NAME "${PACKAGES_PATH_NAME}.plugin") - endif() - configure_file( - "templates/macos/installer.pkgproj.in" - "installer.pkgproj" - ) - endif() endif() endif() From 487769fd15180c6188fe47eefe206659a529f1a8 Mon Sep 17 00:00:00 2001 From: Isaac Nudelman Date: Tue, 3 Oct 2023 07:13:55 +0200 Subject: [PATCH 60/66] Fix link ordering errors with ld on Linux --- CMakeLists.txt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c60522998..05438c8f41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1047,7 +1047,7 @@ function(streamfx_add_component COMPONENT_NAME) set(COMPONENT_ALIAS "StreamFX::${COMPONENT_SANITIZED_NAME}") set(COMPONENT_ALIAS "${COMPONENT_ALIAS}" PARENT_SCOPE) - streamfx_add_library(${COMPONENT_TARGET} OBJECT EXCLUDE_FROM_ALL) + streamfx_add_library(${COMPONENT_TARGET} STATIC EXCLUDE_FROM_ALL) add_library(${COMPONENT_ALIAS} ALIAS ${COMPONENT_TARGET}) set_target_properties(${COMPONENT_TARGET} PROPERTIES COMPONENT_LABEL "${COMPONENT_NAME}" @@ -1056,10 +1056,7 @@ function(streamfx_add_component COMPONENT_NAME) ) # Always depend on StreamFX::Core - target_link_libraries(${COMPONENT_TARGET} - PUBLIC - StreamFX_Core - ) + target_link_libraries(${COMPONENT_TARGET} PRIVATE $) # Register the component globally. get_target_property(_DEPENDS StreamFX COMPONENT_DEPENDS) @@ -1500,7 +1497,6 @@ while(_UNRESOLVED) endwhile() #- Linking -target_link_libraries(StreamFX PUBLIC StreamFX_Core) foreach(_ENTITY ${_RESOLVED}) set(RENTITY "StreamFX_${_ENTITY}") get_target_property(_DEPENDS "${RENTITY}" COMPONENT_DEPENDS) @@ -1515,7 +1511,7 @@ foreach(_ENTITY ${_RESOLVED}) if(T_CHECK) target_link_libraries(${RENTITY} PUBLIC - ${RENTITY2} + $ ) endif() endforeach() @@ -1523,10 +1519,12 @@ foreach(_ENTITY ${_RESOLVED}) target_link_libraries(StreamFX PRIVATE - ${RENTITY} + $ ) endforeach() +target_link_libraries(StreamFX PUBLIC $) + ################################################################################ # Installation ################################################################################ From b5c4c274630bb7cac5191868e8966970fcc39186 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Wed, 4 Oct 2023 07:27:17 +0200 Subject: [PATCH 61/66] Switch to AsciiDoc --- README.ad | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 14 -------------- 2 files changed, 57 insertions(+), 14 deletions(-) create mode 100644 README.ad delete mode 100644 README.md diff --git a/README.ad b/README.ad new file mode 100644 index 0000000000..4aa5704872 --- /dev/null +++ b/README.ad @@ -0,0 +1,57 @@ +== image:https://raw.githubusercontent.com/Xaymar/obs-StreamFX/master/media/logo.png[alt="StreamFX"] +Upgrade your setup with several modern sources, filters, transitions and encoders using StreamFX! With several performant and flexible features, you will discover new ways to build your scenes, better ways to encode your content, and take your stream to the next level. Create cool new scenes with 3D effects, add glow or shadow, or blur out content - endless choices, and all of it at your fingertips. + +++++ +

+ +More Information
+CI Status +Crowdin Status + +

+++++ + +=== Support the development of StreamFX! +++++ + +Patreon + +++++ +Maintaining a project like StreamFX requires time and money, of which both are in short supply. If you use any feature of StreamFX, please consider supporting StreamFX via link:https://patreon.com/xaymar[Patreon]. Even as little as 1€ per month matters a lot, plus you get a number of benefits! + +=== License +Licensed under link:https://github.com/Xaymar/obs-StreamFX/blob/root/LICENSE[GPLv3 (or later), see LICENSE]. Additional works included are: + +[options="header"] +|================= +|Work |License |Author(s) + +|link:https://gen.glad.sh/[GLAD] +|link:https://github.com/Dav1dde/glad/blob/glad2/LICENSE[MIT License] +|link:https://github.com/Dav1dde/glad/graphs/contributors?type=a[Dav1dde, madebr, BtbN, and more] + +|link:https://github.com/nlohmann/json[JSON for Modern C++] +|link:https://github.com/nlohmann/json/blob/develop/LICENSE.MIT[MIT License] +|link:https://github.com/nlohmann/json/graphs/contributors?type=a[nlohmann, ChrisKtiching, nickaein, and more] + +|link:https://github.com/NVIDIA/MAXINE-AFX-SDK[NVIDIA Maxine Audio Effects SDK] +|link:https://github.com/NVIDIA/MAXINE-AFX-SDK/blob/master/LICENSE[MIT License] +|link:https://nvidia.com/[NVIDIA Corporation] + +|link:https://github.com/NVIDIA/MAXINE-AR-SDK[NVIDIA Maxine Augmented Reality SDK] +|link:https://github.com/NVIDIA/MAXINE-Ar-SDK/blob/master/LICENSE[MIT License] +|link:https://nvidia.com/[NVIDIA Corporation] + +|link:https://github.com/NVIDIA/MAXINE-VFX-SDK[NVIDIA Maxine Video Effects SDK] +|link:https://github.com/NVIDIA/MAXINE-VFX-SDK/blob/master/LICENSE[MIT License] +|link:https://nvidia.com/[NVIDIA Corporation] + +|link:https://github.com/obsproject/obs-studio[Open Broadcaster Software Studio] +|link:https://github.com/obsproject/obs-studio/blob/master/COPYING[GPL-2.0 (or later)] +|link:https://github.com/obsproject/obs-studio/graphs/contributors?type=a[jp9000, computerquip, and more] + +|link:https://www.qt.io/[Qt 6.x] +|link:https://www.qt.io/download-open-source[(L)GPL-3.0 (or later)] +|link:https://www.qt.io/[The Qt Company], and open source contributors + +|================= diff --git a/README.md b/README.md deleted file mode 100644 index 98a3d2b712..0000000000 --- a/README.md +++ /dev/null @@ -1,14 +0,0 @@ -![StreamFX Logo](https://raw.githubusercontent.com/Xaymar/obs-StreamFX/master/media/logo.png) -# StreamFX -Bring your setup to the modern day with StreamFX! With several super fast filters, new ways to build your scenes, and new encoders you can now take your stream even further. Create cool new scenes with 3D effects, make something glow or have a shadow, or blur out content - the choice is yours! - -[![CI](https://github.com/Xaymar/obs-StreamFX/actions/workflows/main.yml/badge.svg)](https://github.com/Xaymar/obs-StreamFX/actions) [![Crowdin](https://badges.crowdin.net/obs-stream-effects/localized.svg)](https://crowdin.com/project/obs-stream-effects) - -# Support the development of StreamFX! -[Patreon](https://patreon.com/join/xaymar) Maintaining a project like StreamFX requires time and money, of which both are in short supply. If you use any feature of StreamFX, please consider supporting StreamFX via [Patreon](https://patreon.com/xaymar). Even as little as 1€ per month matters a lot, plus you get a number of benefits! - -## Further Links -* [Wiki](https://github.com/Xaymar/obs-StreamFX/wiki) -* [Installation Guide](https://github.com/xaymar/obs-streamfx/wiki/Installation) -* See BUILDING.md -* See CONTRIBUTING.md From 69a6849033f00696168a34a46fe155f6c18c1743 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Wed, 4 Oct 2023 07:31:18 +0200 Subject: [PATCH 62/66] Github wants .adoc, not .ad --- README.ad => README.adoc | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README.ad => README.adoc (100%) diff --git a/README.ad b/README.adoc similarity index 100% rename from README.ad rename to README.adoc From b373ba17d3350b0c7e6430fad959e9c3f325e1f9 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Wed, 4 Oct 2023 07:31:29 +0200 Subject: [PATCH 63/66] Fix up copyright headers once again --- CMakeLists.txt | 1 + data/effects/shared.effect | 1 + 2 files changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 05438c8f41..3cd50dc0ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,7 @@ # Copyright (C) 2021 Christopher P Yarger # Copyright (C) 2022 Carsten Braun # Copyright (C) 2022 Romain Vigier +# Copyright (C) 2023 Isaac Nudelman # AUTOGENERATED COPYRIGHT HEADER END # CMake Setup diff --git a/data/effects/shared.effect b/data/effects/shared.effect index 812193ff99..120bc3feb7 100644 --- a/data/effects/shared.effect +++ b/data/effects/shared.effect @@ -1,5 +1,6 @@ // AUTOGENERATED COPYRIGHT HEADER START // Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks +// Copyright (C) 2023 brighten // AUTOGENERATED COPYRIGHT HEADER END //------------------------------------------------------------------------------ From 43dbd81d0eb729985ae475a0a53e68152e26e88c Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Wed, 4 Oct 2023 07:42:37 +0200 Subject: [PATCH 64/66] Don't set values that may have side effects during build tests --- .github/workflows/main.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1a15bb8ca3..1043ce6197 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -444,9 +444,6 @@ jobs: -DCMAKE_C_COMPILER="${{ env.CMAKE_C_COMPILER }}" \ -DCMAKE_CXX_COMPILER="${{ env.CMAKE_CXX_COMPILER }}" \ -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \ - -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/build/ci/install" \ - -DPACKAGE_NAME="streamfx-${{ env.PACKAGE_NAME }}" \ - -DPACKAGE_PREFIX="${{ github.workspace }}/build/package" \ -Dlibobs_DIR="${{ github.workspace }}/build/obs/install" - name: "Build: Debug" continue-on-error: true From e0ffe85a30e97196a0e9cc14d1c0386f9dab09ef Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Thu, 5 Oct 2023 07:36:34 +0200 Subject: [PATCH 65/66] Simplify the CMake file even more - target_sources(... PUBLIC ...) doesn't do what I thought it did, and has no useful purpose here. - Experimental features are an Alpha only thing, and Unstable features should not be part of a Candidate release. - ENABLE_LTO is not a flag anymore, as CMake has a global flag for it. While we haven't split out Core from the main file yet, and we still keep running into strange duplicate symbol or undefined symbol errors, this will hopefully simplify the CMake file further. End goal is to eventually split StreamFX into smaller sub-plugins that can operate mostly independently. At some point, the goal is to be able to soft-depend on other components, i.e. Blur can softly depend on Dynamic Mask, and then have extra features if the component is installed. This is not quite fleshed out yet, and I have no clear idea on how to make it work. --- CMakeLists.txt | 617 ++++++++++++----------------------- source/gfx/gfx-mipmapper.cpp | 14 +- 2 files changed, 224 insertions(+), 407 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3cd50dc0ec..109e05f4ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,11 @@ # Copyright (C) 2023 Isaac Nudelman # AUTOGENERATED COPYRIGHT HEADER END +# ToDo: +# - Explore RESOURCE property: https://cmake.org/cmake/help/latest/prop_tgt/RESOURCE.html +# - Explore PUBLIC_HEADER property: https://cmake.org/cmake/help/latest/prop_tgt/PUBLIC_HEADER.html + + # CMake Setup cmake_minimum_required(VERSION 3.26) list(APPEND CMAKE_MESSAGE_INDENT "[StreamFX] ") @@ -269,13 +274,13 @@ if(_VERSION_PRERELEASE STREQUAL "a") set(FEATURE_STABLE ON) elseif(_VERSION_PRERELEASE STREQUAL "b") set(FEATURE_DEPRECATED ON) - set(FEATURE_EXPERIMENTAL ON) + set(FEATURE_EXPERIMENTAL OFF) set(FEATURE_UNSTABLE ON) set(FEATURE_STABLE ON) elseif(_VERSION_PRERELEASE STREQUAL "c") set(FEATURE_DEPRECATED ON) set(FEATURE_EXPERIMENTAL OFF) - set(FEATURE_UNSTABLE ON) + set(FEATURE_UNSTABLE OFF) set(FEATURE_STABLE ON) else() set(FEATURE_DEPRECATED ON) @@ -288,7 +293,6 @@ endif() set(${PREFIX}VERSION "" CACHE STRING "Specify an override for the automatically detected version. Accepts a mixture of SemVer 2.0 and CMake Version.") # Compile/Link Related -set(${PREFIX}ENABLE_LTO ${D_HAS_IPO} CACHE BOOL "Enable Link Time Optimization for faster and smaller binaries.") set(${PREFIX}ENABLE_FASTMATH ON CACHE BOOL "Enable fast math optimizations, which sacrifice precision and stability.") if(D_PLATFORM_ARCH_X86) set(${PREFIX}TARGET_X86_64_V4 OFF CACHE BOOL "Target x86-64-v4 (x86-64-v3, AVX512F, AVX512BW, AVX512CD, AVX512DQ, AVX512VL).") @@ -438,308 +442,6 @@ find_package("Qt6" CONFIG ) -################################################################################ -# Code -################################################################################ -set(PROJECT_DATA ) -set(PROJECT_LIBRARIES ) -set(PROJECT_INCLUDE_DIRS ) -set(PROJECT_TEMPLATES ) -set(PROJECT_PRIVATE_GENERATED ) -set(PROJECT_PRIVATE_SOURCE ) -set(PROJECT_UI ) -set(PROJECT_UI_SOURCE ) -set(PROJECT_DEFINITIONS ) -set(PROJECT_MEDIA ) - -# Data -file(GLOB_RECURSE PROJECT_DATA "data/*") - -# Media -file(GLOB_RECURSE PROJECT_MEDIA "media/*") - -# Templates -file(GLOB_RECURSE PROJECT_TEMPLATES "templates/*") - -# Configure Files -configure_file( - "templates/config.hpp.in" - "generated/config.hpp" -) -LIST(APPEND PROJECT_TEMPLATES "templates/config.hpp.in") -LIST(APPEND PROJECT_PRIVATE_GENERATED "${PROJECT_BINARY_DIR}/generated/config.hpp") - -configure_file( - "templates/version.hpp.in" - "generated/version.hpp" -) -LIST(APPEND PROJECT_TEMPLATES "templates/version.hpp.in") -LIST(APPEND PROJECT_PRIVATE_GENERATED "${PROJECT_BINARY_DIR}/generated/version.hpp") - -configure_file( - "templates/module.cpp.in" - "generated/module.cpp" -) -LIST(APPEND PROJECT_TEMPLATES "templates/module.cpp.in") -LIST(APPEND PROJECT_PRIVATE_GENERATED "${PROJECT_BINARY_DIR}/generated/module.cpp") -# Minimum Dependencies -list(APPEND PROJECT_LIBRARIES OBS::libobs) - -# Dependencies -list(APPEND PROJECT_PRIVATE_SOURCE - "source/util/util-curl.hpp" - "source/util/util-curl.cpp" -) -list(APPEND PROJECT_LIBRARIES CURL::libcurl) - -list(APPEND PROJECT_INCLUDE_DIRS ${JSON_INCLUDE_DIR}) - -if(TRUE) # OpenGL - if(NOT TARGET khronos_glad) - add_library(khronos_glad STATIC - "${PROJECT_SOURCE_DIR}/third-party/khronos/glad/src/gl.c" - ) - target_include_directories(khronos_glad - PRIVATE - "${PROJECT_SOURCE_DIR}/third-party/khronos/glad/include" - INTERFACE - "${PROJECT_SOURCE_DIR}/third-party/khronos/glad/include" - PUBLIC - "${PROJECT_SOURCE_DIR}/third-party/khronos/glad/include" - ) - if(D_PLATFORM_WINDOWS) - target_sources(khronos_glad - PRIVATE - "${PROJECT_SOURCE_DIR}/third-party/khronos/glad/src/wgl.c" - ) - elseif(D_PLATFORM_LINUX) - target_sources(khronos_glad - PRIVATE - "${PROJECT_SOURCE_DIR}/third-party/khronos/glad/src/glx.c" - ) - endif() - - # Requires for shared/static mixing. - set_property(TARGET khronos_glad PROPERTY POSITION_INDEPENDENT_CODE ON) - endif() - - list(APPEND PROJECT_LIBRARIES khronos_glad) -endif() - -list(APPEND PROJECT_LIBRARIES OBS::obs-frontend-api) -list(APPEND PROJECT_UI_SOURCE - "source/obs/browser/obs-browser-panel.hpp" -) - -list(APPEND PROJECT_LIBRARIES Qt6::Core Qt6::Gui Qt6::Widgets) - -################################################################################ -# Features -################################################################################ - -# Core -list(APPEND PROJECT_PRIVATE_SOURCE - "source/warning-disable.hpp" - "source/warning-enable.hpp" - "source/configuration.hpp" - "source/configuration.cpp" - "source/common.hpp" - "source/strings.hpp" - "source/plugin.hpp" - "source/plugin.cpp" - "source/util/utility.hpp" - "source/util/utility.cpp" - "source/util/util-bitmask.hpp" - "source/util/util-event.hpp" - "source/util/util-library.cpp" - "source/util/util-library.hpp" - "source/util/util-logging.cpp" - "source/util/util-logging.hpp" - "source/util/util-platform.hpp" - "source/util/util-platform.cpp" - "source/util/util-threadpool.cpp" - "source/util/util-threadpool.hpp" - "source/gfx/gfx-util.hpp" - "source/gfx/gfx-util.cpp" - "source/gfx/gfx-mipmapper.hpp" - "source/gfx/gfx-mipmapper.cpp" - "source/gfx/gfx-opengl.hpp" - "source/gfx/gfx-opengl.cpp" - "source/gfx/gfx-source-texture.hpp" - "source/gfx/gfx-source-texture.cpp" - "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-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-tracker.hpp" - "source/obs/obs-source-tracker.cpp" - "source/obs/obs-tools.hpp" - "source/obs/obs-tools.cpp" - - # obs_encoder_info_t, obs_encoder_t, obs_weak_encoder_t - "source/obs/obs-encoder-factory.hpp" - "source/obs/obs-encoder-factory.cpp" - - # obs_source_info_t, obs_source_t, obs_weak_source_t - "source/obs/obs-source-factory.hpp" - "source/obs/obs-source-factory.cpp" - "source/obs/obs-source.hpp" - "source/obs/obs-source.cpp" - "source/obs/obs-source-active-child.hpp" - "source/obs/obs-source-active-child.cpp" - "source/obs/obs-source-active-reference.hpp" - "source/obs/obs-source-active-reference.cpp" - "source/obs/obs-source-showing-reference.hpp" - "source/obs/obs-source-showing-reference.cpp" - "source/obs/obs-weak-source.hpp" - "source/obs/obs-weak-source.cpp" -) -list(APPEND PROJECT_DATA - "data/effects/color_conversion_rgb_hsl.effect" - "data/effects/color_conversion_rgb_hsv.effect" - "data/effects/color_conversion_rgb_yuv.effect" - "data/effects/mipgen.effect" - "data/effects/pack-unpack.effect" - "data/effects/standard.effect" - "data/effects/shared.effect" - "data/locale/en-US.ini" -) -list(APPEND PROJECT_INCLUDE_DIRS - "${PROJECT_BINARY_DIR}/generated" - "${PROJECT_SOURCE_DIR}/source" -) - -# Profiling -list(APPEND PROJECT_PRIVATE_SOURCE - "source/util/util-profiler.cpp" - "source/util/util-profiler.hpp" -) - -# Updater -list(APPEND PROJECT_PRIVATE_SOURCE - "source/updater.hpp" - "source/updater.cpp" -) - -# Frontend -list(APPEND PROJECT_UI - "ui/streamfx.qrc" - "ui/about.ui" - "ui/about-entry.ui" -) -list(APPEND PROJECT_UI_SOURCE - "source/ui/ui-common.hpp" - "source/ui/ui.hpp" - "source/ui/ui.cpp" - "source/ui/ui-about.hpp" - "source/ui/ui-about.cpp" - "source/ui/ui-about-entry.hpp" - "source/ui/ui-about-entry.cpp" - "source/ui/ui-obs-browser-widget.hpp" - "source/ui/ui-obs-browser-widget.cpp" -) -list(APPEND PROJECT_INCLUDE_DIRS - "source/ui" -) - -list(APPEND PROJECT_UI_SOURCE - "source/ui/ui-updater.hpp" - "source/ui/ui-updater.cpp" -) -list(APPEND PROJECT_UI - "ui/updater.ui" -) - -################################################################################ -# Parts -################################################################################ - -# Windows -if(D_PLATFORM_WINDOWS) - # Disable/Enable a ton of things. - list(APPEND PROJECT_DEFINITIONS - # Microsoft Visual C++ - _CRT_SECURE_NO_WARNINGS - _ENABLE_EXTENDED_ALIGNED_STORAGE - # windows.h - WIN32_LEAN_AND_MEAN - NOGPICAPMASKS - NOVIRTUALKEYCODES - #NOWINMESSAGES - NOWINSTYLES - NOSYSMETRICS - NOMENUS - NOICONS - NOKEYSTATES - NOSYSCOMMANDS - NORASTEROPS - #NOSHOWWINDOW - NOATOM - NOCLIPBOARD - NOCOLOR - #NOCTLMGR - NODRAWTEXT - #NOGDI - NOKERNEL - #NOUSER - #NONLS - NOMB - NOMEMMGR - NOMETAFILE - NOMINMAX - #NOMSG - NOOPENFILE - NOSCROLL - NOSERVICE - NOSOUND - #NOTEXTMETRIC - NOWH - NOWINOFFSETS - NOCOMM - NOKANJI - #NOHELP - NOPROFILER - NODEFERWINDOWPOS - NOMCX - NOIME - NOMDI - NOINOUT - ) -endif() - -# GCC before 9.0, Clang before 9.0 -if((CMAKE_C_COMPILER_ID STREQUAL "GNU") - OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - OR (CMAKE_C_COMPILER_ID STREQUAL "Clang") - OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")) - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) - list(APPEND PROJECT_LIBRARIES - "stdc++fs" - ) - endif() -endif() - ################################################################################ # Helpers ################################################################################ @@ -772,6 +474,7 @@ function(streamfx_add_library TARGET_NAME TARGET_TYPE) # @rpath in installed binaries INSTALL_RPATH "@executable_path/../Frameworks/;@loader_path/../Frameworks/;@loader_path/../Resources/" ) + if(STANDALONE) set_target_properties(${TARGET_NAME} PROPERTIES # @rpath in built binaries @@ -1057,7 +760,7 @@ function(streamfx_add_component COMPONENT_NAME) ) # Always depend on StreamFX::Core - target_link_libraries(${COMPONENT_TARGET} PRIVATE $) + target_link_libraries(${COMPONENT_TARGET} PUBLIC $) # Register the component globally. get_target_property(_DEPENDS StreamFX COMPONENT_DEPENDS) @@ -1118,7 +821,6 @@ function(streamfx_add_component COMPONENT_NAME) ${USERINTERFACE} ${SOURCE_PRIVATE} ${GENERATED_PRIVATE} - PUBLIC ${SOURCE_PUBLIC} ${GENERATED_PUBLIC} ) @@ -1243,12 +945,6 @@ endfunction() ################################################################################ streamfx_add_library(StreamFX MODULE) # We are a module for libOBS. -target_include_directories(StreamFX PRIVATE - "source" - "include" - "${PROJECT_BINARY_DIR}/generated" -) - # Ensure there is at least one file. if(D_PLATFORM_WINDOWS) target_sources(StreamFX @@ -1262,6 +958,7 @@ else() ) endif() +# version.rc (can't be part of a static library) if(D_PLATFORM_WINDOWS) # Windows-exclusive # Version Resource set(PROJECT_PRODUCT_NAME "${PROJECT_FULL_NAME}") @@ -1272,36 +969,17 @@ if(D_PLATFORM_WINDOWS) # Windows-exclusive configure_file( "templates/windows/version.rc.in" - "generated/version.rc" + "version.rc" ) - target_sources(StreamFX - PRIVATE - "templates/windows/version.rc.in" - "${PROJECT_BINARY_DIR}/generated/version.rc" - ) -elseif(D_PLATFORM_MAC) # MacOS exclusive Changes - set_target_properties(StreamFX PROPERTIES - # No automatic code signing in XCode - XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "" - XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO" - - # @rpath in installed binaries - INSTALL_RPATH "@executable_path/../Frameworks/;@loader_path/../Frameworks/;@loader_path/../Resources/" + target_sources(StreamFX PRIVATE + "${PROJECT_BINARY_DIR}/version.rc" ) - - if(STANDALONE) - set_target_properties(StreamFX PROPERTIES - # @rpath in built binaries - BUILD_WITH_INSTALL_RPATH ON - ) - endif() endif() - -# Set file version set_target_properties(StreamFX PROPERTIES + # Version MACHO_COMPATIBILITY_VERSION ${_VERSION_MAJOR}.${_VERSION_MINOR} - MACHO_CURRENT_VERSION ${PROJECT_VERSION} SOVERSION ${_VERSION_MAJOR}.${_VERSION_MINOR} + MACHO_CURRENT_VERSION ${PROJECT_VERSION} VERSION ${PROJECT_VERSION} ) @@ -1311,66 +989,188 @@ set_target_properties(StreamFX PROPERTIES streamfx_add_library(StreamFX_Core STATIC EXCLUDE_FROM_ALL) add_library(StreamFX::Core ALIAS StreamFX_Core) -# Register the library +# Enable Qt +set_target_properties(StreamFX_Core PROPERTIES + AUTOUIC ON + AUTOUIC_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_SOURCE_DIR}/ui" + AUTOMOC ON + AUTORCC ON + AUTOGEN_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/qt" +) + +# Default Links target_link_libraries(StreamFX_Core - PRIVATE ${PROJECT_LIBRARIES} - PUBLIC OBS::libobs + PUBLIC + CURL::libcurl + Qt6::Core + Qt6::Gui + Qt6::Widgets + OBS::obs-frontend-api + OBS::libobs ) + +# Default Include Dirs target_include_directories(StreamFX_Core - PRIVATE ${PROJECT_INCLUDE_DIRS} + PRIVATE + "${PROJECT_SOURCE_DIR}/source/ui" + "${PROJECT_BINARY_DIR}/qt" PUBLIC "${PROJECT_SOURCE_DIR}/source" + "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/generated" -) -target_compile_definitions(StreamFX_Core - PRIVATE ${PROJECT_DEFINITIONS} + ${JSON_INCLUDE_DIR} ) -# Combine all variables that matter. -set(PROJECT_FILES - # Always exist - ${PROJECT_DATA} - ${PROJECT_PRIVATE_GENERATED} - ${PROJECT_PRIVATE_SOURCE} - ${PROJECT_TEMPLATES} - # UI-only (empty if not enabled) - ${PROJECT_UI} - ${PROJECT_UI_SOURCE} - # Media - ${PROJECT_MEDIA} -) - -# Set source groups for IDE generators. -source_group(TREE "${PROJECT_SOURCE_DIR}/data" PREFIX "Data" FILES ${PROJECT_DATA}) -source_group(TREE "${PROJECT_SOURCE_DIR}/source" PREFIX "Source" FILES ${PROJECT_PRIVATE_SOURCE} ${PROJECT_UI_SOURCE}) -source_group(TREE "${PROJECT_BINARY_DIR}/generated" PREFIX "Source" FILES ${PROJECT_PRIVATE_GENERATED}) +# Templates +file(GLOB_RECURSE PROJECT_TEMPLATES FOLLOW_SYMLINKS CONFIGURE_DEPENDS "templates/*") source_group(TREE "${PROJECT_SOURCE_DIR}/templates" PREFIX "Templates" FILES ${PROJECT_TEMPLATES}) -source_group(TREE "${PROJECT_SOURCE_DIR}/ui" PREFIX "User Interface" FILES ${PROJECT_UI}) -source_group(TREE "${PROJECT_SOURCE_DIR}/media" PREFIX "Media" FILES ${PROJECT_MEDIA}) - -# Prevent unwanted files from being built as source. -set_source_files_properties(${PROJECT_DATA} ${PROJECT_TEMPLATES} ${PROJECT_UI} ${PROJECT_MEDIA} PROPERTIES +set_source_files_properties(${PROJECT_TEMPLATES} PROPERTIES HEADER_FILE_ONLY ON + SKIP_AUTOGEN ON + SKIP_AUTOMOC ON + SKIP_AUTORCC ON + SKIP_AUTOUIC ON ) +target_sources(StreamFX_Core PRIVATE ${PROJECT_TEMPLATES}) -# Enable Qt if needed -set_target_properties(StreamFX_Core PROPERTIES - AUTOUIC ON - AUTOUIC_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_SOURCE_DIR}/ui" - AUTOMOC ON - AUTORCC ON - AUTOGEN_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated" +# Generated +#- config.hpp +configure_file( + "templates/config.hpp.in" + "generated/config.hpp" ) +#- version.hpp +configure_file( + "templates/version.hpp.in" + "generated/version.hpp" +) +#- module.cpp +configure_file( + "templates/module.cpp.in" + "generated/module.cpp" +) +#- Add all generated files +file(GLOB_RECURSE PROJECT_PRIVATE_GENERATED FOLLOW_SYMLINKS CONFIGURE_DEPENDS "${PROJECT_BINARY_DIR}/generated/*") +source_group(TREE "${PROJECT_BINARY_DIR}/generated" PREFIX "Private Files/Generated" FILES ${PROJECT_PRIVATE_GENERATED}) +set_source_files_properties(${PROJECT_PRIVATE_GENERATED} PROPERTIES + SKIP_AUTOGEN ON + SKIP_AUTOMOC ON + SKIP_AUTORCC ON + SKIP_AUTOUIC ON +) +target_sources(StreamFX_Core PRIVATE ${PROJECT_PRIVATE_GENERATED}) -# Prevent non-UI files from being Qt'd -set_source_files_properties(${PROJECT_DATA} ${PROJECT_TEMPLATES} ${PROJECT_MEDIA} ${PROJECT_PRIVATE_GENERATED} ${PROJECT_PRIVATE_SOURCE} PROPERTIES +# Source +file(GLOB_RECURSE PROJECT_PRIVATE FOLLOW_SYMLINKS CONFIGURE_DEPENDS "${PROJECT_SOURCE_DIR}/source/*") +list(REMOVE_ITEM PROJECT_PRIVATE "${PROJECT_SOURCE_DIR}/source/windll.cpp") # Only used by StreamFX, not part of StreamFX::Core +source_group(TREE "${PROJECT_SOURCE_DIR}/source" PREFIX "Private Files" FILES ${PROJECT_PRIVATE}) +set_source_files_properties(${PROJECT_PRIVATE} PROPERTIES SKIP_AUTOGEN ON SKIP_AUTOMOC ON SKIP_AUTORCC ON SKIP_AUTOUIC ON ) +target_sources(StreamFX_Core PRIVATE ${PROJECT_PRIVATE}) + +# User-Interface Source +file(GLOB_RECURSE PROJECT_PRIVATE_UI FOLLOW_SYMLINKS CONFIGURE_DEPENDS "${PROJECT_SOURCE_DIR}/source/ui/*") +list(APPEND PROJECT_PRIVATE_UI "${PROJECT_SOURCE_DIR}/source/obs/browser/obs-browser-panel.hpp") +set_source_files_properties(${PROJECT_PRIVATE_UI} PROPERTIES + SKIP_AUTOGEN OFF + SKIP_AUTOMOC OFF + SKIP_AUTORCC OFF + SKIP_AUTOUIC OFF +) + +# User-Interface Definitions +file(GLOB_RECURSE PROJECT_UI FOLLOW_SYMLINKS CONFIGURE_DEPENDS "${PROJECT_SOURCE_DIR}/ui/*") +source_group(TREE "${PROJECT_SOURCE_DIR}/ui" PREFIX "User-Interface Files" FILES ${PROJECT_UI}) +set_source_files_properties(${PROJECT_UI} PROPERTIES + HEADER_FILE_ONLY ON +) +target_sources(StreamFX_Core PRIVATE ${PROJECT_UI}) + +# Windows +if(D_PLATFORM_WINDOWS) + # Disable/Enable a ton of things. + target_compile_definitions(StreamFX_Core PRIVATE + # Microsoft Visual C++ + _CRT_SECURE_NO_WARNINGS + _ENABLE_EXTENDED_ALIGNED_STORAGE + # windows.h + WIN32_LEAN_AND_MEAN + NOGPICAPMASKS + NOVIRTUALKEYCODES + #NOWINMESSAGES + NOWINSTYLES + NOSYSMETRICS + NOMENUS + NOICONS + NOKEYSTATES + NOSYSCOMMANDS + NORASTEROPS + #NOSHOWWINDOW + NOATOM + NOCLIPBOARD + NOCOLOR + #NOCTLMGR + NODRAWTEXT + #NOGDI + NOKERNEL + #NOUSER + #NONLS + NOMB + NOMEMMGR + NOMETAFILE + NOMINMAX + #NOMSG + NOOPENFILE + NOSCROLL + NOSERVICE + NOSOUND + #NOTEXTMETRIC + NOWH + NOWINOFFSETS + NOCOMM + NOKANJI + #NOHELP + NOPROFILER + NODEFERWINDOWPOS + NOMCX + NOIME + NOMDI + NOINOUT + ) +endif() -target_sources(StreamFX_Core PRIVATE ${PROJECT_FILES}) +# OpenGL via GLAD +if(NOT TARGET StreamFX::GLAD) + add_library(StreamFX_GLAD STATIC + "${PROJECT_SOURCE_DIR}/third-party/khronos/glad/src/gl.c" + ) + target_include_directories(StreamFX_GLAD + PUBLIC + "${PROJECT_SOURCE_DIR}/third-party/khronos/glad/include" + ) + if(D_PLATFORM_WINDOWS) + target_sources(StreamFX_GLAD + PRIVATE + "${PROJECT_SOURCE_DIR}/third-party/khronos/glad/src/wgl.c" + ) + elseif(D_PLATFORM_LINUX) + target_sources(StreamFX_GLAD + PRIVATE + "${PROJECT_SOURCE_DIR}/third-party/khronos/glad/src/glx.c" + ) + endif() + + # Requires for shared/static mixing. + set_property(TARGET StreamFX_GLAD PROPERTY POSITION_INDEPENDENT_CODE ON) + + add_library(StreamFX::GLAD ALIAS StreamFX_GLAD) +endif() + +target_link_libraries(StreamFX_Core PUBLIC StreamFX::GLAD) ################################################################################ # Components @@ -1510,22 +1310,54 @@ foreach(_ENTITY ${_RESOLVED}) streamfx_enabled_component(${_ENTITY2} T_CHECK) if(T_CHECK) - target_link_libraries(${RENTITY} - PUBLIC - $ - ) + target_link_libraries(${RENTITY} PUBLIC $) endif() endforeach() endif() - target_link_libraries(StreamFX - PRIVATE - $ - ) + target_link_libraries(StreamFX PUBLIC $) endforeach() target_link_libraries(StreamFX PUBLIC $) +################################################################################ +# Resources +################################################################################ +# This needs to be handled separately, as CMake does not propagate Resources +# between dependencies. This feels like a bug in CMake, but it is better than +# not doing anything at all. Might eventually need to revise this when we start +# generating data files. + +# Data +file(GLOB_RECURSE PROJECT_DATA "data/*") +source_group(TREE "${PROJECT_SOURCE_DIR}/data" PREFIX "Data" FILES ${PROJECT_DATA}) +if(D_PLATFORM_MAC) + foreach(FILE IN LISTS PROJECT_DATA) # Data location + cmake_path(ABSOLUTE_PATH FILE OUTPUT_VARIABLE FILE_PATH) + cmake_path(RELATIVE_PATH FILE_PATH BASE_DIRECTORY "${PROJECT_SOURCE_DIR}/data/") + cmake_path(GET FILE_PATH PARENT_PATH FILE_PATH) + set_source_files_properties("${FILE}" PROPERTIES + MACOSX_PACKAGE_LOCATION "Resources/${FILE_PATH}" + ) + endforeach() +endif() + +# Media +file(GLOB_RECURSE PROJECT_MEDIA "media/*") +source_group(TREE "${PROJECT_SOURCE_DIR}/media" PREFIX "Media" FILES ${PROJECT_MEDIA}) +if(D_PLATFORM_MAC) + #- Bundle Icon location + set_source_files_properties("media/icon.png" PROPERTIES + MACOSX_PACKAGE_LOCATION "Resources" + ) +endif() + +# Add all Resources to StreamFX +set_source_files_properties(${PROJECT_DATA} ${PROJECT_MEDIA} PROPERTIES + HEADER_FILE_ONLY ON +) +target_sources(StreamFX PRIVATE ${PROJECT_DATA} ${PROJECT_MEDIA}) + ################################################################################ # Installation ################################################################################ @@ -1596,21 +1428,6 @@ if(STANDALONE) XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${MACOSX_BUNDLE_GUI_IDENTIFIER}" ) - # Proper location for resources in Bundles - foreach(FILE IN LISTS PROJECT_DATA) - cmake_path(ABSOLUTE_PATH FILE OUTPUT_VARIABLE FILE_PATH) - cmake_path(RELATIVE_PATH FILE_PATH BASE_DIRECTORY "${PROJECT_SOURCE_DIR}/data/") - cmake_path(GET FILE_PATH PARENT_PATH FILE_PATH) - set_source_files_properties("${FILE}" PROPERTIES - MACOSX_PACKAGE_LOCATION "Resources/${FILE_PATH}" - ) - endforeach() - - # Bundle Icon - set_source_files_properties("media/icon.png" PROPERTIES - MACOSX_PACKAGE_LOCATION "Resources" - ) - install( TARGETS StreamFX RUNTIME DESTINATION "." COMPONENT StreamFX diff --git a/source/gfx/gfx-mipmapper.cpp b/source/gfx/gfx-mipmapper.cpp index 9da7c9bc66..8664a47e2a 100644 --- a/source/gfx/gfx-mipmapper.cpp +++ b/source/gfx/gfx-mipmapper.cpp @@ -28,14 +28,14 @@ struct d3d_info { ID3D11Resource* target = nullptr; }; -void d3d_initialize(d3d_info& info, std::shared_ptr source, std::shared_ptr target) +static void d3d_initialize(d3d_info& info, std::shared_ptr source, std::shared_ptr target) { info.target = reinterpret_cast(gs_texture_get_obj(target->get_object())); info.device = reinterpret_cast(gs_get_device_obj()); info.device->GetImmediateContext(&info.context); } -void d3d_copy_subregion(d3d_info& info, std::shared_ptr source, uint32_t mip_level, uint32_t width, uint32_t height) +static void d3d_copy_subregion(d3d_info& info, std::shared_ptr source, uint32_t mip_level, uint32_t width, uint32_t height) { D3D11_BOX box = {0, 0, 0, width, height, 1}; auto source_ref = reinterpret_cast(gs_texture_get_obj(source->get_object())); @@ -49,7 +49,7 @@ struct opengl_info { GLuint fbo = 0; }; -std::string opengl_translate_error(GLenum error) +static std::string opengl_translate_error(GLenum error) { #define TRANSLATE_CASE(X) \ case X: \ @@ -70,7 +70,7 @@ std::string opengl_translate_error(GLenum error) #undef TRANSLATE_CASE } -std::string opengl_translate_framebuffer_status(GLenum error) +static std::string opengl_translate_framebuffer_status(GLenum error) { #define TRANSLATE_CASE(X) \ case X: \ @@ -106,19 +106,19 @@ std::string opengl_translate_framebuffer_status(GLenum error) throw std::runtime_error(sstr.str()); \ } -void opengl_initialize(opengl_info& info, std::shared_ptr source, std::shared_ptr target) +static void opengl_initialize(opengl_info& info, std::shared_ptr source, std::shared_ptr target) { info.target = *reinterpret_cast(gs_texture_get_obj(target->get_object())); glGenFramebuffers(1, &info.fbo); } -void opengl_finalize(opengl_info& info) +static void opengl_finalize(opengl_info& info) { glDeleteFramebuffers(1, &info.fbo); } -void opengl_copy_subregion(opengl_info& info, std::shared_ptr source, uint32_t mip_level, uint32_t width, uint32_t height) +static void opengl_copy_subregion(opengl_info& info, std::shared_ptr source, uint32_t mip_level, uint32_t width, uint32_t height) { GLuint source_ref = *reinterpret_cast(gs_texture_get_obj(source->get_object())); From bbcce86c475daf05cdb6edd8cc28742b8bd330ad Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Thu, 5 Oct 2023 09:02:51 +0200 Subject: [PATCH 66/66] Fix or disable some useless warnings --- CMakeLists.txt | 34 +++++++++++++++++++ .../ffmpeg/source/encoders/ffmpeg/nvenc.cpp | 4 +-- .../source/encoders/ffmpeg/prores_aw.cpp | 2 +- source/obs/gs/gs-mipmapper.cpp | 4 +-- 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 109e05f4ef..a49ca9081e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -530,6 +530,7 @@ function(streamfx_add_library TARGET_NAME TARGET_TYPE) "4505" "4514" "5245" + "5264" # Don't warn about unreferenced variables or parameters which are assigned/initialized. "4189" # Don't warn about not-explicitly-handled enumeration identifiers @@ -556,6 +557,10 @@ function(streamfx_add_library TARGET_NAME TARGET_TYPE) "5045" # Ignore inserted padding. "4324" + # Ignore non-standard nameless struct/union. + "4201" + # Intended behavior: Replace undefined macros with 0 + "4668" ) foreach(WARN ${DISABLED_WARNINGS}) target_compile_options(${TARGET_NAME} PRIVATE "/wd${WARN}") @@ -705,6 +710,35 @@ function(streamfx_add_library TARGET_NAME TARGET_TYPE) target_compile_options(${TARGET_NAME} PRIVATE "-Wall") target_compile_options(${TARGET_NAME} PRIVATE "-Wextra") + # - Disable useless warnings + set(DISABLED_WARNINGS + # Don't warn about unused variables, parameters, labels, functions, or typedefs. + "unused-function" + "unused-label" + "unused-local-typedefs" + "unused-parameter" + "unused-result" + "unused-const-variable" + "unused-variable" + "unused-value" + # Don't warn about unreferenced variables or parameters which are assigned/initialized. + "unused-but-set-parameter" + "unused-but-set-variable" + # Don't warn about not-explicitly-handled enumeration identifiers + "switch" + # Ignore automatic padding warnings. + "padded" + # Ignore implicit '= delete;'. + # Ignore extra arguments for printf + "format-extra-args" + # Ignore undefined, unused or unreferenced pre-processor macros + "unused-macros" + ) + foreach(WARN ${DISABLED_WARNINGS}) + target_compile_options(${TARGET_NAME} PRIVATE "-Wno-${WARN}") + endforeach() + + # - Require enabled instruction sets. if(${PREFIX}TARGET_NATIVE) target_compile_options(${TARGET_NAME} PRIVATE diff --git a/components/ffmpeg/source/encoders/ffmpeg/nvenc.cpp b/components/ffmpeg/source/encoders/ffmpeg/nvenc.cpp index 6e5d648643..b035850149 100644 --- a/components/ffmpeg/source/encoders/ffmpeg/nvenc.cpp +++ b/components/ffmpeg/source/encoders/ffmpeg/nvenc.cpp @@ -589,8 +589,8 @@ void nvenc::update(ffmpeg_factory* factory, ffmpeg_instance* instance, obs_data_ if (!context->internal) { if (streamfx::ffmpeg::tools::avoption_exists(context->priv_data, "multipass")) { // Multi-Pass - if (const char* v = obs_data_get_string(settings, ST_KEY_RATECONTROL_MULTIPASS); (v != nullptr) && (v[0] != '\0')) { - av_opt_set(context->priv_data, "multipass", v, AV_OPT_SEARCH_CHILDREN); + if (const char* v2 = obs_data_get_string(settings, ST_KEY_RATECONTROL_MULTIPASS); (v2 != nullptr) && (v2[0] != '\0')) { + av_opt_set(context->priv_data, "multipass", v2, AV_OPT_SEARCH_CHILDREN); av_opt_set_int(context->priv_data, "2pass", 0, AV_OPT_SEARCH_CHILDREN); } } else { diff --git a/components/ffmpeg/source/encoders/ffmpeg/prores_aw.cpp b/components/ffmpeg/source/encoders/ffmpeg/prores_aw.cpp index 1df3d5fe76..ea77f64cff 100644 --- a/components/ffmpeg/source/encoders/ffmpeg/prores_aw.cpp +++ b/components/ffmpeg/source/encoders/ffmpeg/prores_aw.cpp @@ -71,7 +71,7 @@ void prores_aw::update(ffmpeg_factory* factory, ffmpeg_instance* instance, obs_d void prores_aw::log(ffmpeg_factory* factory, ffmpeg_instance* instance, obs_data_t* settings) { DLOG_INFO("[%s] Apple ProRes:", factory->get_avcodec()->name); - ::streamfx::ffmpeg::tools::print_av_option_string(instance->get_avcodeccontext(), "profile", " Profile", [&factory, &instance](int64_t v) { + ::streamfx::ffmpeg::tools::print_av_option_string(instance->get_avcodeccontext(), "profile", " Profile", [&factory](int64_t v) { int val = static_cast(v); for (auto ptr = factory->get_avcodec()->profiles; (ptr->profile != FF_PROFILE_UNKNOWN) && (ptr != nullptr); ptr++) { if (ptr->profile == val) { diff --git a/source/obs/gs/gs-mipmapper.cpp b/source/obs/gs/gs-mipmapper.cpp index 6d0cc5d8cd..bcbe3a3e66 100644 --- a/source/obs/gs/gs-mipmapper.cpp +++ b/source/obs/gs/gs-mipmapper.cpp @@ -55,7 +55,7 @@ std::string opengl_translate_error(GLenum error) { #define TRANSLATE_CASE(X) \ case X: \ - return #X; + return #X; break; switch (error) { TRANSLATE_CASE(GL_NO_ERROR); @@ -76,7 +76,7 @@ std::string opengl_translate_framebuffer_status(GLenum error) { #define TRANSLATE_CASE(X) \ case X: \ - return #X; + return #X; break; switch (error) { TRANSLATE_CASE(GL_FRAMEBUFFER_COMPLETE);