plugins: Update CMakeLists.txt for included plugins
parent
dbdf5c7f7a
commit
49e9d49943
|
@ -1,84 +1,92 @@
|
|||
option(DISABLE_PLUGINS "Disable building of OBS plugins" OFF)
|
||||
if(DISABLE_PLUGINS)
|
||||
message(STATUS "DISABLE_PLUGINS is set; building of plugins is disabled.")
|
||||
return()
|
||||
option(ENABLE_PLUGINS "Enable building OBS plugins" ON)
|
||||
if(NOT ENABLE_PLUGINS)
|
||||
message(STATUS "OBS: building with plugins disabled")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
option(BUILD_CA_ENCODER "Build CoreAudio encoder module" ON)
|
||||
if (BUILD_CA_ENCODER)
|
||||
add_subdirectory(coreaudio-encoder)
|
||||
endif()
|
||||
add_subdirectory(win-wasapi)
|
||||
add_subdirectory(win-dshow)
|
||||
add_subdirectory(win-capture)
|
||||
add_subdirectory(decklink/win)
|
||||
add_subdirectory(win-mf)
|
||||
add_subdirectory(obs-qsv11)
|
||||
add_subdirectory(vlc-video)
|
||||
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/enc-amf/CMakeLists.txt")
|
||||
add_subdirectory(enc-amf)
|
||||
else()
|
||||
message(STATUS "enc-amf submodule not found! Please fetch submodules. enc-amf plugin disabled.")
|
||||
endif()
|
||||
if (MSVC)
|
||||
add_subdirectory(win-ivcam)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
add_subdirectory(coreaudio-encoder)
|
||||
add_subdirectory(mac-avcapture)
|
||||
add_subdirectory(mac-capture)
|
||||
add_subdirectory(mac-vth264)
|
||||
add_subdirectory(mac-syphon)
|
||||
option(BUILD_VIRTUALCAM "Build Virtualcam" ON)
|
||||
if(BUILD_VIRTUALCAM)
|
||||
add_subdirectory(mac-virtualcam)
|
||||
endif()
|
||||
add_subdirectory(decklink/mac)
|
||||
add_subdirectory(vlc-video)
|
||||
add_subdirectory(linux-jack)
|
||||
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
|
||||
add_subdirectory(linux-capture)
|
||||
add_subdirectory(linux-pulseaudio)
|
||||
add_subdirectory(linux-v4l2)
|
||||
add_subdirectory(linux-jack)
|
||||
add_subdirectory(linux-alsa)
|
||||
add_subdirectory(decklink/linux)
|
||||
add_subdirectory(vlc-video)
|
||||
add_subdirectory(sndio)
|
||||
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "FreeBSD")
|
||||
add_subdirectory(linux-capture)
|
||||
add_subdirectory(linux-pulseaudio)
|
||||
add_subdirectory(linux-v4l2)
|
||||
add_subdirectory(linux-jack)
|
||||
add_subdirectory(linux-alsa)
|
||||
add_subdirectory(vlc-video)
|
||||
add_subdirectory(oss-audio)
|
||||
add_subdirectory(sndio)
|
||||
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "OpenBSD")
|
||||
add_subdirectory(linux-capture)
|
||||
add_subdirectory(sndio)
|
||||
endif()
|
||||
function(check_obs_browser)
|
||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/obs-browser/CMakeLists.txt)
|
||||
add_subdirectory(obs-browser)
|
||||
else()
|
||||
message(FATAL_ERROR "OBS: obs-browser submodule not available")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
option(BUILD_BROWSER "Build browser plugin" ON)
|
||||
if (BUILD_BROWSER)
|
||||
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/obs-browser/CMakeLists.txt")
|
||||
add_subdirectory(obs-browser)
|
||||
set(BROWSER_AVAILABLE_INTERNAL ON CACHE BOOL "Internal global cmake variable" FORCE)
|
||||
else()
|
||||
message(FATAL_ERROR "obs-browser submodule not found! Please fetch submodules or set BUILD_BROWSER=OFF.")
|
||||
endif()
|
||||
else()
|
||||
set(BROWSER_AVAILABLE_INTERNAL OFF CACHE BOOL "Internal global cmake variable" FORCE)
|
||||
endif()
|
||||
function(check_obs_vst)
|
||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/obs-vst/CMakeLists.txt)
|
||||
add_subdirectory(obs-vst)
|
||||
else()
|
||||
message(FATAL_ERROR "OBS: obs-vst submodule not available")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
option(BUILD_VST "Build VST plugin" ON)
|
||||
if(BUILD_VST)
|
||||
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/obs-vst/CMakeLists.txt")
|
||||
add_subdirectory(obs-vst)
|
||||
else()
|
||||
message(FATAL_ERROR "obs-vst submodule not found! Please fetch submodules or set BUILD_VST=OFF.")
|
||||
endif()
|
||||
# APPLE/WIN32/UNIX are soft-deprecated:
|
||||
# https://discourse.cmake.org/t/platform-id-vs-win32-vs-cmake-system-name/1226/2
|
||||
if(OS_WINDOWS)
|
||||
add_subdirectory(coreaudio-encoder)
|
||||
add_subdirectory(win-wasapi)
|
||||
add_subdirectory(win-dshow)
|
||||
add_subdirectory(win-capture)
|
||||
add_subdirectory(decklink)
|
||||
add_subdirectory(win-mf)
|
||||
add_subdirectory(obs-qsv11)
|
||||
add_subdirectory(obs-text)
|
||||
add_subdirectory(vlc-video)
|
||||
|
||||
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/enc-amf/CMakeLists.txt")
|
||||
add_subdirectory(enc-amf)
|
||||
else()
|
||||
message(WARNING "OBS: enc-amf plugin not found")
|
||||
endif()
|
||||
if(MSVC)
|
||||
add_subdirectory(win-ivcam)
|
||||
endif()
|
||||
|
||||
check_obs_browser()
|
||||
check_obs_vst()
|
||||
elseif(OS_MACOS)
|
||||
add_subdirectory(coreaudio-encoder)
|
||||
add_subdirectory(mac-avcapture)
|
||||
add_subdirectory(mac-capture)
|
||||
add_subdirectory(mac-vth264)
|
||||
add_subdirectory(mac-syphon)
|
||||
add_subdirectory(mac-virtualcam)
|
||||
add_subdirectory(decklink)
|
||||
add_subdirectory(vlc-video)
|
||||
add_subdirectory(linux-jack)
|
||||
|
||||
check_obs_browser()
|
||||
check_obs_vst()
|
||||
elseif(OS_LINUX)
|
||||
add_subdirectory(linux-capture)
|
||||
add_subdirectory(linux-pulseaudio)
|
||||
add_subdirectory(linux-v4l2)
|
||||
add_subdirectory(linux-jack)
|
||||
add_subdirectory(linux-alsa)
|
||||
add_subdirectory(decklink)
|
||||
add_subdirectory(vlc-video)
|
||||
add_subdirectory(sndio)
|
||||
|
||||
check_obs_browser()
|
||||
check_obs_vst()
|
||||
elseif(OS_FREEBSD)
|
||||
add_subdirectory(linux-capture)
|
||||
add_subdirectory(linux-pulseaudio)
|
||||
add_subdirectory(linux-v4l2)
|
||||
add_subdirectory(linux-jack)
|
||||
add_subdirectory(linux-alsa)
|
||||
add_subdirectory(vlc-video)
|
||||
add_subdirectory(oss-audio)
|
||||
add_subdirectory(sndio)
|
||||
|
||||
message(STATUS "OBS: obs-browser plugin not available")
|
||||
message(STATUS "OBS: obs-vst plugin not available")
|
||||
elseif(OS_OPENBSD)
|
||||
add_subdirectory(linux-capture)
|
||||
add_subdirectory(sndio)
|
||||
|
||||
message(STATUS "OBS: obs-browser plugin not available")
|
||||
message(STATUS "OBS: obs-vst plugin not available")
|
||||
endif()
|
||||
|
||||
add_subdirectory(image-source)
|
||||
|
@ -88,7 +96,6 @@ add_subdirectory(obs-ffmpeg)
|
|||
add_subdirectory(obs-outputs)
|
||||
add_subdirectory(obs-filters)
|
||||
add_subdirectory(obs-transitions)
|
||||
add_subdirectory(obs-text)
|
||||
add_subdirectory(rtmp-services)
|
||||
add_subdirectory(text-freetype2)
|
||||
add_subdirectory(aja)
|
||||
|
|
|
@ -1,111 +1,68 @@
|
|||
project(aja)
|
||||
|
||||
if(DISABLE_AJA)
|
||||
message(STATUS "aja plugin disabled")
|
||||
return()
|
||||
option(ENABLE_AJA "Build OBS with aja support" ON)
|
||||
if(NOT ENABLE_AJA)
|
||||
message(STATUS "OBS: DISABLED aja")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
find_package(LibAJANTV2)
|
||||
if (NOT LIBAJANTV2_FOUND)
|
||||
message(STATUS "aja plugin disabled (deps not found)")
|
||||
return()
|
||||
else()
|
||||
message("aja plugin includes: ${LIBAJANTV2_INCLUDE_DIRS}")
|
||||
message("aja plugin libs: ${LIBAJANTV2_LIBRARIES}")
|
||||
message("aja plugin debug libs: ${LIBAJANTV2_DEBUG_LIBRARIES}")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "aja plugin disabled (32-bit not supported)")
|
||||
return()
|
||||
if(NOT OS_MACOS AND NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
message(
|
||||
STATUS "OBS: aja support not enabled (32-bit not supported)")
|
||||
set(ENABLE_AJA
|
||||
OFF
|
||||
CACHE BOOL "Build OBS with aja support" FORCE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(aja_INCLUDE_DIRS
|
||||
${LIBAJANTV2_INCLUDE_DIRS})
|
||||
set(aja_LIBRARIES
|
||||
$<IF:$<CONFIG:Debug>,${LIBAJANTV2_DEBUG_LIBRARIES},${LIBAJANTV2_LIBRARIES}>
|
||||
libobs)
|
||||
find_package(LibAJANTV2 REQUIRED)
|
||||
|
||||
set(aja_SOURCES
|
||||
main.cpp
|
||||
aja-card-manager.cpp
|
||||
aja-common.cpp
|
||||
aja-output.cpp
|
||||
aja-presets.cpp
|
||||
aja-props.cpp
|
||||
aja-routing.cpp
|
||||
aja-source.cpp
|
||||
aja-vpid-data.cpp
|
||||
aja-widget-io.cpp)
|
||||
add_library(aja MODULE)
|
||||
add_library(OBS::aja ALIAS aja)
|
||||
|
||||
set(aja_HEADERS
|
||||
aja-card-manager.hpp
|
||||
aja-common.hpp
|
||||
aja-enums.hpp
|
||||
aja-ui-props.hpp
|
||||
aja-output.hpp
|
||||
aja-presets.hpp
|
||||
aja-props.hpp
|
||||
aja-routing.hpp
|
||||
aja-source.hpp
|
||||
aja-vpid-data.hpp
|
||||
aja-widget-io.hpp)
|
||||
target_sources(
|
||||
aja
|
||||
PRIVATE main.cpp
|
||||
aja-card-manager.cpp
|
||||
aja-common.cpp
|
||||
aja-common.hpp
|
||||
aja-output.cpp
|
||||
aja-enums.hpp
|
||||
aja-output.hpp
|
||||
aja-presets.cpp
|
||||
aja-presets.hpp
|
||||
aja-props.cpp
|
||||
aja-props.hpp
|
||||
aja-routing.cpp
|
||||
aja-routing.hpp
|
||||
aja-source.cpp
|
||||
aja-source.hpp
|
||||
aja-vpid-data.cpp
|
||||
aja-vpid-data.hpp
|
||||
aja-widget-io.cpp
|
||||
aja-widget-io.hpp
|
||||
aja-card-manager.hpp
|
||||
aja-ui-props.hpp)
|
||||
|
||||
# macOS
|
||||
if(APPLE)
|
||||
set(aja_COMPILE_DEFS
|
||||
AJAMac
|
||||
AJA_MAC)
|
||||
target_link_libraries(aja PRIVATE OBS::libobs AJA::LibAJANTV2)
|
||||
|
||||
find_library(IOKIT_FRAMEWORK Iokit)
|
||||
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
|
||||
find_library(APPKIT_FRAMEWORK AppKit)
|
||||
if(OS_MACOS)
|
||||
find_library(IOKIT IOKit)
|
||||
find_library(COREFOUNDATION CoreFoundation)
|
||||
find_library(APPKIT AppKit)
|
||||
|
||||
list(APPEND aja_LIBRARIES
|
||||
${IOKIT_FRAMEWORK}
|
||||
${COREFOUNDATION_LIBRARY}
|
||||
${APPKIT_FRAMEWORK})
|
||||
# Windows
|
||||
elseif(WIN32)
|
||||
set(aja_COMPILE_DEFS
|
||||
AJA_WINDOWS
|
||||
_WINDOWS
|
||||
WIN32
|
||||
MSWindows)
|
||||
target_link_libraries(aja PRIVATE ${IOKIT} ${COREFOUNDATION} ${APPKIT})
|
||||
elseif(OS_WINDOWS)
|
||||
set(MODULE_DESCRIPTION "OBS AJA Windows module")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
||||
win-aja.rc)
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
list(APPEND aja_COMPILE_DEFS
|
||||
_DEBUG)
|
||||
else()
|
||||
list(APPEND aja_COMPILE_DEFS
|
||||
NDEBUG)
|
||||
endif()
|
||||
target_sources(aja PRIVATE win-aja.rc)
|
||||
|
||||
list(APPEND aja_LIBRARIES
|
||||
ws2_32.lib
|
||||
setupapi.lib
|
||||
Winmm.lib
|
||||
netapi32.lib
|
||||
Shlwapi.lib)
|
||||
|
||||
set(MODULE_DESCRIPTION "OBS AJA Windows module")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in win-aja.rc)
|
||||
list(APPEND aja_SOURCES
|
||||
win-aja.rc)
|
||||
# Linux
|
||||
elseif(UNIX AND NOT APPLE)
|
||||
set(aja_COMPILE_DEFS
|
||||
AJA_LINUX
|
||||
AJALinux)
|
||||
target_link_libraries(aja PRIVATE ws2_32.lib setupapi.lib Winmm.lib
|
||||
netapi32.lib Shlwapi.lib)
|
||||
endif()
|
||||
|
||||
add_library(aja MODULE ${aja_SOURCES} ${aja_HEADERS})
|
||||
set_target_properties(aja PROPERTIES FOLDER "plugins/aja" PREFIX "")
|
||||
|
||||
target_include_directories(aja PUBLIC ${aja_INCLUDE_DIRS})
|
||||
target_link_libraries(aja PUBLIC ${aja_LIBRARIES})
|
||||
target_compile_definitions(aja PUBLIC ${aja_COMPILE_DEFS})
|
||||
|
||||
set_target_properties(aja PROPERTIES FOLDER
|
||||
"plugins")
|
||||
|
||||
install_obs_plugin_with_data(aja data)
|
||||
setup_plugin_target(aja)
|
||||
|
|
|
@ -1,43 +1,53 @@
|
|||
project(coreaudio-encoder)
|
||||
|
||||
set(coreaudio-encoder_SOURCES
|
||||
encoder.cpp)
|
||||
|
||||
if (WIN32)
|
||||
# Set compiler flag before adding resource file
|
||||
if (MINGW)
|
||||
set_source_files_properties(${coreaudio-encoder_SOURCES}
|
||||
PROPERTIES COMPILE_FLAGS "-Wno-multichar")
|
||||
endif()
|
||||
|
||||
set(MODULE_DESCRIPTION "OBS Core Audio encoder")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in coreaudio-encoder.rc)
|
||||
list(APPEND coreaudio-encoder_SOURCES
|
||||
coreaudio-encoder.rc)
|
||||
set(coreaudio-encoder_HEADERS windows-imports.h)
|
||||
set(coreaudio-encoder_LIBS )
|
||||
else()
|
||||
find_library(COREFOUNDATION CoreFoundation)
|
||||
find_library(COREAUDIO CoreAudio)
|
||||
find_library(AUDIOTOOLBOX AudioToolbox)
|
||||
set(coreaudio-encoder_HEADERS )
|
||||
set(coreaudio-encoder_LIBS
|
||||
${COREFOUNDATION}
|
||||
${COREAUDIO}
|
||||
${AUDIOTOOLBOX})
|
||||
|
||||
include_directories(${COREFOUNDATION}
|
||||
${COREAUDIO}
|
||||
${AUDIOTOOLBOX})
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
option(ENABLE_COREAUDIO_ENCODER
|
||||
"Enable building with CoreAudio encoder (Windows)" ON)
|
||||
if(NOT ENABLE_COREAUDIO_ENCODER)
|
||||
message(STATUS "OBS: DISABLED coreaudio-encoder")
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_library(coreaudio-encoder MODULE
|
||||
${coreaudio-encoder_SOURCES}
|
||||
${coreaudio-encoder_HEADERS})
|
||||
add_library(coreaudio-encoder MODULE)
|
||||
add_library(OBS::coreaudio-encoder ALIAS coreaudio-encoder)
|
||||
|
||||
target_link_libraries(coreaudio-encoder
|
||||
libobs
|
||||
${coreaudio-encoder_LIBS})
|
||||
set_target_properties(coreaudio-encoder PROPERTIES FOLDER "plugins")
|
||||
target_sources(coreaudio-encoder PRIVATE encoder.cpp)
|
||||
|
||||
install_obs_plugin_with_data(coreaudio-encoder data)
|
||||
set_target_properties(
|
||||
coreaudio-encoder
|
||||
PROPERTIES OUTPUT_NAME "coreaudio-encoder"
|
||||
FOLDER "plugins"
|
||||
PREFIX "")
|
||||
|
||||
target_compile_features(coreaudio-encoder PRIVATE cxx_std_11)
|
||||
|
||||
target_link_libraries(coreaudio-encoder PRIVATE OBS::libobs)
|
||||
|
||||
if(OS_MACOS)
|
||||
find_library(COREFOUNDATION CoreFoundation)
|
||||
find_library(COREAUDIO CoreAudio)
|
||||
find_library(AUDIOTOOLBOX AudioToolbox)
|
||||
|
||||
mark_as_advanced(AUDIOTOOLBOX COREAUDIO COREFOUNDATION)
|
||||
|
||||
target_link_libraries(coreaudio-encoder PRIVATE ${COREFOUNDATION}
|
||||
${COREAUDIO} ${AUDIOTOOLBOX})
|
||||
|
||||
elseif(OS_WINDOWS)
|
||||
if(MINGW)
|
||||
set_source_files_properties(encoder.cpp PROPERTIES COMPILE_FLAGS
|
||||
-Wno-multichar)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(coreaudio-encoder PRIVATE UNICODE _UNICODE)
|
||||
|
||||
set(MODULE_DESCRIPTION "OBS CoreAudio encoder")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
||||
coreaudio-encoder.rc)
|
||||
|
||||
target_sources(coreaudio-encoder PRIVATE coreaudio-encoder.rc
|
||||
windows-imports.h)
|
||||
endif()
|
||||
|
||||
setup_plugin_target(coreaudio-encoder)
|
||||
|
|
|
@ -0,0 +1,106 @@
|
|||
project(decklink)
|
||||
|
||||
option(ENABLE_DECKLINK "Build OBS with Decklink support" ON)
|
||||
if(NOT ENABLE_DECKLINK)
|
||||
message(STATUS "OBS: DISABLED decklink support")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(OS_WINDOWS)
|
||||
include(IDLFileHelper)
|
||||
add_idl_files(win-decklink-sdk_GENERATED_FILES
|
||||
win/decklink-sdk/DeckLinkAPI.idl)
|
||||
endif()
|
||||
|
||||
add_library(decklink MODULE)
|
||||
add_library(OBS::decklink ALIAS decklink)
|
||||
|
||||
add_library(decklink-sdk INTERFACE)
|
||||
add_library(Decklink::SDK ALIAS decklink-sdk)
|
||||
|
||||
target_sources(
|
||||
decklink
|
||||
PRIVATE OBSVideoFrame.cpp
|
||||
OBSVideoFrame.h
|
||||
audio-repack.c
|
||||
audio-repack.h
|
||||
audio-repack.hpp
|
||||
const.h
|
||||
decklink-device.cpp
|
||||
decklink-device.hpp
|
||||
decklink-devices.cpp
|
||||
decklink-devices.hpp
|
||||
decklink-device-discovery.cpp
|
||||
decklink-device-discovery.hpp
|
||||
decklink-device-instance.cpp
|
||||
decklink-device-instance.hpp
|
||||
decklink-device-mode.cpp
|
||||
decklink-device-mode.hpp
|
||||
decklink-output.cpp
|
||||
decklink-source.cpp
|
||||
DecklinkBase.cpp
|
||||
DecklinkBase.h
|
||||
DecklinkInput.cpp
|
||||
DecklinkInput.hpp
|
||||
DecklinkOutput.cpp
|
||||
DecklinkOutput.hpp
|
||||
platform.hpp
|
||||
plugin-main.cpp
|
||||
util.cpp
|
||||
util.hpp)
|
||||
|
||||
target_include_directories(decklink-sdk INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
target_link_libraries(decklink PRIVATE OBS::libobs OBS::caption Decklink::SDK)
|
||||
|
||||
set_target_properties(decklink PROPERTIES FOLDER "plugins/decklink")
|
||||
|
||||
if(OS_WINDOWS)
|
||||
set(MODULE_DESCRIPTION "OBS DeckLink Windows module")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
||||
win-decklink.rc)
|
||||
|
||||
target_sources(decklink PRIVATE win/platform.cpp win-decklink.rc)
|
||||
|
||||
target_sources(decklink-sdk INTERFACE win/decklink-sdk/DeckLinkAPIVersion.h
|
||||
${win-decklink-sdk_GENERATED_FILES})
|
||||
|
||||
elseif(OS_MACOS)
|
||||
find_library(COREFOUNDATION CoreFoundation)
|
||||
mark_as_advanced(COREFOUNDATION)
|
||||
|
||||
target_sources(decklink PRIVATE mac/platform.cpp)
|
||||
|
||||
target_sources(
|
||||
decklink-sdk
|
||||
INTERFACE mac/decklink-sdk/DeckLinkAPIDispatch.cpp
|
||||
mac/decklink-sdk/DeckLinkAPI.h
|
||||
mac/decklink-sdk/DeckLinkAPIConfiguration.h
|
||||
mac/decklink-sdk/DeckLinkAPIDeckControl.h
|
||||
mac/decklink-sdk/DeckLinkAPIDiscovery.h
|
||||
mac/decklink-sdk/DeckLinkAPIModes.h
|
||||
mac/decklink-sdk/DeckLinkAPIStreaming.h
|
||||
mac/decklink-sdk/DeckLinkAPITypes.h
|
||||
mac/decklink-sdk/DeckLinkAPIVersion.h)
|
||||
|
||||
target_link_libraries(decklink PRIVATE ${COREFOUNDATION})
|
||||
|
||||
target_compile_features(decklink PRIVATE cxx_auto_type)
|
||||
elseif(OS_POSIX)
|
||||
target_sources(decklink PRIVATE linux/platform.cpp)
|
||||
|
||||
target_sources(
|
||||
decklink-sdk
|
||||
INTERFACE linux/decklink-sdk/DeckLinkAPIDispatch.cpp
|
||||
linux/decklink-sdk/DeckLinkAPI.h
|
||||
linux/decklink-sdk/DeckLinkAPIConfiguration.h
|
||||
linux/decklink-sdk/DeckLinkAPIDeckControl.h
|
||||
linux/decklink-sdk/DeckLinkAPIDiscovery.h
|
||||
linux/decklink-sdk/DeckLinkAPIModes.h
|
||||
linux/decklink-sdk/DeckLinkAPITypes.h
|
||||
linux/decklink-sdk/DeckLinkAPIVersion.h
|
||||
linux/decklink-sdk/LinuxCOM.h)
|
||||
endif()
|
||||
|
||||
setup_plugin_target(decklink)
|
||||
setup_target_resources(decklink "obs-plugins/decklink")
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "DecklinkBase.h"
|
||||
|
||||
#include "../../libobs/media-io/video-scaler.h"
|
||||
#include <media-io/video-scaler.h>
|
||||
|
||||
class DeckLinkOutput : public DecklinkBase {
|
||||
protected:
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
blog(level, "%s: " message, "decklink", ##__VA_ARGS__)
|
||||
|
||||
#include <obs-module.h>
|
||||
#include <media-io/video-scaler.h>
|
||||
#include "decklink-device.hpp"
|
||||
#include "../../libobs/media-io/video-scaler.h"
|
||||
#include "OBSVideoFrame.h"
|
||||
|
||||
class AudioRepacker;
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
#include "decklink-device-discovery.hpp"
|
||||
#include "decklink-devices.hpp"
|
||||
|
||||
#include "../../libobs/media-io/video-scaler.h"
|
||||
#include "../../libobs/util/util_uint64.h"
|
||||
#include <media-io/video-scaler.h>
|
||||
#include <util/util_uint64.h>
|
||||
|
||||
static void decklink_output_destroy(void *data)
|
||||
{
|
||||
|
|
|
@ -1,72 +0,0 @@
|
|||
project(linux-decklink)
|
||||
|
||||
if(DISABLE_DECKLINK)
|
||||
message(STATUS "decklink plugin disabled")
|
||||
return()
|
||||
endif()
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR}/deps/libcaption)
|
||||
|
||||
set(linux-decklink-sdk_HEADERS
|
||||
decklink-sdk/DeckLinkAPI.h
|
||||
decklink-sdk/DeckLinkAPIConfiguration.h
|
||||
decklink-sdk/DeckLinkAPIDeckControl.h
|
||||
decklink-sdk/DeckLinkAPIDiscovery.h
|
||||
decklink-sdk/DeckLinkAPIModes.h
|
||||
decklink-sdk/DeckLinkAPITypes.h
|
||||
decklink-sdk/DeckLinkAPIVersion.h
|
||||
decklink-sdk/LinuxCOM.h
|
||||
)
|
||||
|
||||
set(linux-decklink-sdk_SOURCES
|
||||
decklink-sdk/DeckLinkAPIDispatch.cpp
|
||||
)
|
||||
|
||||
set(linux-decklink_HEADERS
|
||||
../decklink-devices.hpp
|
||||
../const.h
|
||||
../DecklinkOutput.hpp
|
||||
../platform.hpp
|
||||
../DecklinkInput.hpp
|
||||
../DecklinkBase.h
|
||||
../decklink-device-instance.hpp
|
||||
../decklink-device-discovery.hpp
|
||||
../decklink-device.hpp
|
||||
../decklink-device-mode.hpp
|
||||
../audio-repack.h
|
||||
../audio-repack.hpp
|
||||
../util.hpp
|
||||
../OBSVideoFrame.h
|
||||
)
|
||||
|
||||
set(linux-decklink_SOURCES
|
||||
../plugin-main.cpp
|
||||
../decklink-devices.cpp
|
||||
../decklink-source.cpp
|
||||
../decklink-output.cpp
|
||||
../DecklinkOutput.cpp
|
||||
../DecklinkInput.cpp
|
||||
../DecklinkBase.cpp
|
||||
../decklink-device-instance.cpp
|
||||
../decklink-device-discovery.cpp
|
||||
../decklink-device.cpp
|
||||
../decklink-device-mode.cpp
|
||||
../audio-repack.c
|
||||
platform.cpp
|
||||
../util.cpp
|
||||
../OBSVideoFrame.cpp
|
||||
)
|
||||
|
||||
add_library(linux-decklink MODULE
|
||||
${linux-decklink_SOURCES}
|
||||
${linux-decklink_HEADERS}
|
||||
${linux-decklink-sdk_HEADERS}
|
||||
${linux-decklink-sdk_SOURCES}
|
||||
)
|
||||
|
||||
target_link_libraries(linux-decklink
|
||||
libobs
|
||||
caption)
|
||||
set_target_properties(linux-decklink PROPERTIES FOLDER "plugins/decklink")
|
||||
|
||||
install_obs_plugin_with_data(linux-decklink ../data)
|
|
@ -1,84 +0,0 @@
|
|||
project(mac-decklink)
|
||||
|
||||
if(DISABLE_DECKLINK)
|
||||
message(STATUS "decklink plugin disabled")
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
find_library(COREFOUNDATION CoreFoundation)
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR}/deps/libcaption)
|
||||
|
||||
set(mac-decklink-sdk_HEADERS
|
||||
decklink-sdk/DeckLinkAPI.h
|
||||
decklink-sdk/DeckLinkAPIConfiguration.h
|
||||
decklink-sdk/DeckLinkAPIDeckControl.h
|
||||
decklink-sdk/DeckLinkAPIDiscovery.h
|
||||
decklink-sdk/DeckLinkAPIModes.h
|
||||
decklink-sdk/DeckLinkAPIStreaming.h
|
||||
decklink-sdk/DeckLinkAPITypes.h
|
||||
decklink-sdk/DeckLinkAPIVersion.h)
|
||||
|
||||
set(mac-decklink-sdk_SOURCES
|
||||
decklink-sdk/DeckLinkAPIDispatch.cpp
|
||||
)
|
||||
|
||||
set(mac-decklink_HEADERS
|
||||
../decklink-devices.hpp
|
||||
../const.h
|
||||
../DecklinkOutput.hpp
|
||||
../platform.hpp
|
||||
../DecklinkInput.hpp
|
||||
../DecklinkBase.h
|
||||
../decklink-device-instance.hpp
|
||||
../decklink-device-discovery.hpp
|
||||
../decklink-device.hpp
|
||||
../decklink-device-mode.hpp
|
||||
../audio-repack.h
|
||||
../audio-repack.hpp
|
||||
../util.hpp
|
||||
../OBSVideoFrame.h
|
||||
)
|
||||
|
||||
set(mac-decklink_SOURCES
|
||||
../plugin-main.cpp
|
||||
../decklink-devices.cpp
|
||||
../decklink-output.cpp
|
||||
../decklink-source.cpp
|
||||
../DecklinkOutput.cpp
|
||||
../DecklinkInput.cpp
|
||||
../DecklinkBase.cpp
|
||||
../decklink-device-instance.cpp
|
||||
../decklink-device-discovery.cpp
|
||||
../decklink-device.cpp
|
||||
../decklink-device-mode.cpp
|
||||
../audio-repack.c
|
||||
platform.cpp
|
||||
../util.cpp
|
||||
../OBSVideoFrame.cpp
|
||||
)
|
||||
|
||||
list(APPEND decklink_HEADERS ${decklink_UI_HEADERS})
|
||||
|
||||
include_directories(
|
||||
${COREFOUNDATION}
|
||||
)
|
||||
|
||||
list(APPEND mac-decklink_HEADERS ${decklink_UI_HEADERS})
|
||||
|
||||
add_library(mac-decklink MODULE
|
||||
${mac-decklink_SOURCES}
|
||||
${mac-decklink_HEADERS}
|
||||
${mac-decklink-sdk_HEADERS}
|
||||
${mac-decklink-sdk_SOURCES}
|
||||
)
|
||||
|
||||
target_link_libraries(mac-decklink
|
||||
libobs
|
||||
${COREFOUNDATION}
|
||||
caption)
|
||||
set_target_properties(mac-decklink PROPERTIES FOLDER "plugins/decklink")
|
||||
|
||||
install_obs_plugin_with_data(mac-decklink ../data)
|
|
@ -1,77 +0,0 @@
|
|||
project(win-decklink)
|
||||
|
||||
if(DISABLE_DECKLINK)
|
||||
message(STATUS "decklink plugin disabled")
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(IDLFileHelper)
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR}/deps/libcaption)
|
||||
|
||||
set(win-decklink-sdk_IDLS
|
||||
decklink-sdk/DeckLinkAPI.idl
|
||||
)
|
||||
|
||||
set(win-decklink-sdk_HEADERS
|
||||
decklink-sdk/DeckLinkAPIVersion.h
|
||||
)
|
||||
|
||||
set(win-decklink_HEADERS
|
||||
../decklink-devices.hpp
|
||||
../DecklinkOutput.hpp
|
||||
../const.h
|
||||
../platform.hpp
|
||||
../DecklinkInput.hpp
|
||||
../DecklinkBase.h
|
||||
../decklink-device-instance.hpp
|
||||
../decklink-device-discovery.hpp
|
||||
../decklink-device.hpp
|
||||
../decklink-device-mode.hpp
|
||||
../audio-repack.h
|
||||
../audio-repack.hpp
|
||||
../util.hpp
|
||||
../OBSVideoFrame.h
|
||||
)
|
||||
|
||||
set(MODULE_DESCRIPTION "OBS DeckLink Windows module")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in win-decklink.rc)
|
||||
set(win-decklink_SOURCES
|
||||
../plugin-main.cpp
|
||||
../decklink-devices.cpp
|
||||
../DecklinkOutput.cpp
|
||||
../decklink-source.cpp
|
||||
../decklink-output.cpp
|
||||
../DecklinkInput.cpp
|
||||
../DecklinkBase.cpp
|
||||
../decklink-device-instance.cpp
|
||||
../decklink-device-discovery.cpp
|
||||
../decklink-device.cpp
|
||||
../decklink-device-mode.cpp
|
||||
../audio-repack.c
|
||||
platform.cpp
|
||||
../util.cpp
|
||||
win-decklink.rc
|
||||
../OBSVideoFrame.cpp)
|
||||
|
||||
add_idl_files(win-decklink-sdk_GENERATED_FILES
|
||||
${win-decklink-sdk_IDLS}
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
add_library(win-decklink MODULE
|
||||
${win-decklink_SOURCES}
|
||||
${win-decklink_HEADERS}
|
||||
${win-decklink-sdk_HEADERS}
|
||||
${win-decklink-sdk_GENERATED_FILES}
|
||||
)
|
||||
|
||||
target_link_libraries(win-decklink
|
||||
libobs
|
||||
caption)
|
||||
set_target_properties(win-decklink PROPERTIES FOLDER "plugins/decklink")
|
||||
|
||||
install_obs_plugin_with_data(win-decklink ../data)
|
|
@ -1,27 +1,25 @@
|
|||
project(image-source)
|
||||
|
||||
if(MSVC)
|
||||
set(image-source_PLATFORM_DEPS
|
||||
w32-pthreads)
|
||||
add_library(image-source MODULE)
|
||||
add_library(OBS::image-source ALIAS image-source)
|
||||
|
||||
target_sources(image-source PRIVATE image-source.c color-source.c
|
||||
obs-slideshow.c)
|
||||
|
||||
target_link_libraries(image-source PRIVATE OBS::libobs)
|
||||
|
||||
if(OS_WINDOWS)
|
||||
if(MSVC)
|
||||
target_link_libraries(image-source PRIVATE OBS::w32-pthreads)
|
||||
endif()
|
||||
|
||||
set(MODULE_DESCRIPTION "OBS image module")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
||||
image-source.rc)
|
||||
|
||||
target_sources(image-source PRIVATE image-source.rc)
|
||||
endif()
|
||||
|
||||
set(image-source_SOURCES
|
||||
image-source.c
|
||||
color-source.c
|
||||
obs-slideshow.c)
|
||||
set_target_properties(image-source PROPERTIES FOLDER "plugins" PREFIX "")
|
||||
|
||||
if(WIN32)
|
||||
set(MODULE_DESCRIPTION "OBS image module")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in image-source.rc)
|
||||
list(APPEND image-source_SOURCES
|
||||
image-source.rc)
|
||||
endif()
|
||||
|
||||
add_library(image-source MODULE
|
||||
${image-source_SOURCES})
|
||||
target_link_libraries(image-source
|
||||
libobs
|
||||
${image-source_PLATFORM_DEPS})
|
||||
set_target_properties(image-source PROPERTIES FOLDER "plugins")
|
||||
|
||||
install_obs_plugin_with_data(image-source data)
|
||||
setup_plugin_target(image-source)
|
||||
|
|
|
@ -1,35 +1,20 @@
|
|||
project(linux-alsa)
|
||||
|
||||
if(DISABLE_ALSA)
|
||||
message(STATUS "ALSA support disabled")
|
||||
return()
|
||||
option(ENABLE_ALSA "Build OBS with ALSA support" ON)
|
||||
if(NOT ENABLE_ALSA)
|
||||
message(STATUS "OBS: DISABLED alsa")
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_package(ALSA)
|
||||
if(NOT ALSA_FOUND AND ENABLE_ALSA)
|
||||
message(FATAL_ERROR "ALSA not found but set as enabled")
|
||||
elseif(NOT ALSA_FOUND)
|
||||
message(STATUS "ALSA not found, disabling ALSA plugin")
|
||||
return()
|
||||
endif()
|
||||
find_package(ALSA REQUIRED)
|
||||
|
||||
include_directories(
|
||||
SYSTEM "${CMAKE_SOURCE_DIR}/libobs"
|
||||
${ALSA_INCLUDE_DIR}
|
||||
)
|
||||
add_library(linux-alsa MODULE)
|
||||
add_library(OBS::alsa ALIAS linux-alsa)
|
||||
|
||||
set(linux-alsa_SOURCES
|
||||
linux-alsa.c
|
||||
alsa-input.c
|
||||
)
|
||||
target_sources(linux-alsa PRIVATE linux-alsa.c alsa-input.c)
|
||||
|
||||
target_link_libraries(linux-alsa PRIVATE OBS::libobs ALSA::ALSA)
|
||||
|
||||
add_library(linux-alsa MODULE
|
||||
${linux-alsa_SOURCES}
|
||||
)
|
||||
target_link_libraries(linux-alsa
|
||||
libobs
|
||||
${ALSA_LIBRARY}
|
||||
)
|
||||
set_target_properties(linux-alsa PROPERTIES FOLDER "plugins")
|
||||
|
||||
install_obs_plugin_with_data(linux-alsa data)
|
||||
setup_plugin_target(linux-alsa)
|
||||
|
|
|
@ -1,107 +1,79 @@
|
|||
project(linux-capture)
|
||||
|
||||
find_package(X11 REQUIRED)
|
||||
if(NOT X11_Xcomposite_FOUND)
|
||||
message(STATUS "Xcomposite library not found, linux-capture plugin disabled")
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_package(XCB COMPONENTS XCB RANDR SHM XFIXES XINERAMA REQUIRED)
|
||||
find_package(X11_XCB REQUIRED)
|
||||
|
||||
set(linux-capture_INCLUDES
|
||||
"${CMAKE_SOURCE_DIR}/libobs"
|
||||
${X11_Xcomposite_INCLUDE_PATH}
|
||||
${X11_X11_INCLUDE_PATH}
|
||||
${XCB_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(linux-capture_SOURCES
|
||||
linux-capture.c
|
||||
xcursor.c
|
||||
xcursor-xcb.c
|
||||
xhelpers.c
|
||||
xshm-input.c
|
||||
xcomposite-main.cpp
|
||||
xcompcap-main.cpp
|
||||
xcompcap-helper.cpp
|
||||
)
|
||||
set(linux-capture_HEADERS
|
||||
xcursor.h
|
||||
xcursor-xcb.h
|
||||
xhelpers.h
|
||||
xcompcap-main.hpp
|
||||
xcompcap-helper.hpp
|
||||
)
|
||||
|
||||
set(linux-capture_LIBRARIES
|
||||
libobs
|
||||
glad
|
||||
${X11_LIBRARIES}
|
||||
${X11_Xfixes_LIB}
|
||||
${X11_X11_LIB}
|
||||
${X11_Xcomposite_LIB}
|
||||
${XCB_LIBRARIES}
|
||||
)
|
||||
|
||||
option(ENABLE_PIPEWIRE "Enable PipeWire support" ON)
|
||||
if(ENABLE_PIPEWIRE)
|
||||
find_package(PipeWire 0.3.32 QUIET)
|
||||
find_package(Libdrm QUIET) # we require libdrm/drm_fourcc.h to build
|
||||
find_package(Gio QUIET)
|
||||
|
||||
if(NOT PIPEWIRE_FOUND)
|
||||
message(FATAL_ERROR "PipeWire library not found! Please install PipeWire or set ENABLE_PIPEWIRE=OFF")
|
||||
elseif(NOT GIO_FOUND)
|
||||
message(FATAL_ERROR "Gio library not found! Please install GLib2 (or Gio) or set ENABLE_PIPEWIRE=OFF")
|
||||
elseif(NOT LIBDRM_INCLUDE_DIRS)
|
||||
message(FATAL_ERROR "libdrm headers not found! Please install libdrm or set ENABLE_PIPEWIRE=OFF")
|
||||
endif()
|
||||
|
||||
add_definitions(-DENABLE_PIPEWIRE)
|
||||
|
||||
set(linux-capture_INCLUDES
|
||||
${linux-capture_INCLUDES}
|
||||
${GIO_INCLUDE_DIRS}
|
||||
${PIPEWIRE_INCLUDE_DIRS}
|
||||
${DRM_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
add_definitions(
|
||||
${GIO_DEFINITIONS}
|
||||
${PIPEWIRE_DEFINITIONS}
|
||||
)
|
||||
|
||||
set(linux-capture_SOURCES
|
||||
${linux-capture_SOURCES}
|
||||
pipewire.c
|
||||
pipewire-capture.c
|
||||
portal.c
|
||||
)
|
||||
set(linux-capture_HEADERS
|
||||
${linux-capture_HEADERS}
|
||||
pipewire.h
|
||||
pipewire-capture.h
|
||||
portal.h
|
||||
)
|
||||
set(linux-capture_LIBRARIES
|
||||
${linux-capture_LIBRARIES}
|
||||
${GIO_LIBRARIES}
|
||||
${PIPEWIRE_LIBRARIES}
|
||||
)
|
||||
if(NOT ENABLE_PIPEWIRE)
|
||||
message(STATUS "OBS: - PipeWire support disabled")
|
||||
endif()
|
||||
|
||||
include_directories(SYSTEM
|
||||
${linux-capture_INCLUDES}
|
||||
)
|
||||
add_library(linux-capture MODULE
|
||||
${linux-capture_SOURCES}
|
||||
${linux-capture_HEADERS}
|
||||
)
|
||||
target_link_libraries(linux-capture
|
||||
${linux-capture_LIBRARIES}
|
||||
)
|
||||
find_package(X11 REQUIRED)
|
||||
if(NOT TARGET X11::Xcomposite)
|
||||
message(
|
||||
FATAL_ERROR "OBS: DISABLED linux-capture - Xcomposite library not found")
|
||||
endif()
|
||||
find_package(XCB COMPONENTS XCB XFIXES RANDR SHM XINERAMA)
|
||||
|
||||
add_library(linux-capture MODULE)
|
||||
add_library(OBS::capture ALIAS linux-capture)
|
||||
|
||||
target_sources(
|
||||
linux-capture
|
||||
PRIVATE linux-capture.c
|
||||
xcursor.c
|
||||
xcursor.h
|
||||
xcursor-xcb.c
|
||||
xcursor-xcb.h
|
||||
xhelpers.c
|
||||
xhelpers.h
|
||||
xshm-input.c
|
||||
xcomposite-main.cpp
|
||||
xcompcap-main.cpp
|
||||
xcompcap-main.hpp
|
||||
xcompcap-helper.cpp
|
||||
xcompcap-helper.hpp)
|
||||
|
||||
target_link_libraries(
|
||||
linux-capture
|
||||
PRIVATE OBS::libobs
|
||||
OBS::obsglad
|
||||
X11::X11
|
||||
X11::Xfixes
|
||||
X11::Xcomposite
|
||||
XCB::XCB
|
||||
XCB::XFIXES
|
||||
XCB::RANDR
|
||||
XCB::SHM
|
||||
XCB::XINERAMA)
|
||||
|
||||
set_target_properties(linux-capture PROPERTIES FOLDER "plugins")
|
||||
|
||||
install_obs_plugin_with_data(linux-capture data)
|
||||
if(ENABLE_PIPEWIRE)
|
||||
find_package(PipeWire 0.3.32 QUIET)
|
||||
find_package(Gio QUIET)
|
||||
find_package(Libdrm QUIET)
|
||||
|
||||
if(NOT TARGET PipeWire::PipeWire)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"OBS: - PipeWire library not found! Please install PipeWire or set ENABLE_PIPEWIRE=OFF"
|
||||
)
|
||||
elseif(NOT TARGET GIO::GIO)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"OBS: - Gio library not found! Please install GLib2 (or Gio) or set ENABLE_PIPEWIRE=OFF"
|
||||
)
|
||||
elseif(NOT TARGET Libdrm::Libdrm)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"OBS: - libdrm headers not found! Please install libdrm or set ENABLE_PIPEWIRE=OFF"
|
||||
)
|
||||
endif()
|
||||
|
||||
target_sources(linux-capture PRIVATE pipewire.c pipewire.h pipewire-capture.c
|
||||
pipewire-capture.h portal.c portal.h)
|
||||
|
||||
target_link_libraries(linux-capture PRIVATE PipeWire::PipeWire GIO::GIO
|
||||
Libdrm::Libdrm)
|
||||
target_compile_definitions(linux-capture PRIVATE ENABLE_PIPEWIRE)
|
||||
endif()
|
||||
|
||||
setup_plugin_target(linux-capture)
|
||||
|
|
|
@ -1,36 +1,21 @@
|
|||
project(linux-jack)
|
||||
|
||||
if(DISABLE_JACK)
|
||||
message(STATUS "JACK support disabled")
|
||||
return()
|
||||
option(ENABLE_JACK "Build OBS with JACK support" OFF)
|
||||
if(NOT ENABLE_JACK)
|
||||
message(STATUS "OBS: DISABLED linux-jack")
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_package(Jack)
|
||||
if(NOT JACK_FOUND AND ENABLE_JACK)
|
||||
message(FATAL_ERROR "JACK Audio Connection Kit not found but set as enabled")
|
||||
elseif(NOT JACK_FOUND)
|
||||
message(STATUS "JACK Audio Connection Kit not found, disabling JACK plugin")
|
||||
return()
|
||||
endif()
|
||||
find_package(Jack REQUIRED)
|
||||
|
||||
include_directories(
|
||||
SYSTEM "${CMAKE_SOURCE_DIR}/libobs"
|
||||
${JACK_INCLUDE_DIR}
|
||||
)
|
||||
add_library(linux-jack MODULE)
|
||||
add_library(OBS::jack ALIAS linux-jack)
|
||||
|
||||
set(linux-jack_SOURCES
|
||||
linux-jack.c
|
||||
jack-wrapper.c
|
||||
jack-input.c
|
||||
)
|
||||
target_sources(linux-jack PRIVATE linux-jack.c jack-wrapper.c jack-input.c)
|
||||
|
||||
add_library(linux-jack MODULE
|
||||
${linux-jack_SOURCES}
|
||||
)
|
||||
target_link_libraries(linux-jack
|
||||
libobs
|
||||
${JACK_LIBRARIES}
|
||||
)
|
||||
set_target_properties(linux-jack PROPERTIES FOLDER "plugins")
|
||||
target_link_libraries(linux-jack PRIVATE OBS::libobs Jack::Jack)
|
||||
|
||||
install_obs_plugin_with_data(linux-jack data)
|
||||
set_target_properties(linux-jack PROPERTIES FOLDER "plugins" PROJECT_LABEL
|
||||
"JACK Audio")
|
||||
|
||||
setup_plugin_target(linux-jack)
|
||||
|
|
|
@ -1,36 +1,25 @@
|
|||
project(linux-pulseaudio)
|
||||
|
||||
if(DISABLE_PULSEAUDIO)
|
||||
message(STATUS "PulseAudio support disabled")
|
||||
return()
|
||||
option(ENABLE_PULSEAUDIO "Enable PulseAudio support" ON)
|
||||
|
||||
if(NOT ENABLE_PULSEAUDIO)
|
||||
message(STATUS "OBS: DISABLED linux-pulseaudio")
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_package(PulseAudio)
|
||||
if(NOT PULSEAUDIO_FOUND AND ENABLE_PULSEAUDIO)
|
||||
message(FATAL_ERROR "PulseAudio not found but set as enabled")
|
||||
elseif(NOT PULSEAUDIO_FOUND)
|
||||
message(STATUS "PulseAudio not found, disabling PulseAudio plugin")
|
||||
return()
|
||||
endif()
|
||||
find_package(PulseAudio REQUIRED)
|
||||
|
||||
include_directories(
|
||||
SYSTEM "${CMAKE_SOURCE_DIR}/libobs"
|
||||
${PULSEAUDIO_INCLUDE_DIR}
|
||||
)
|
||||
add_library(linux-pulseaudio MODULE)
|
||||
add_library(OBS::pulseaudio ALIAS linux-pulseaudio)
|
||||
|
||||
set(linux-pulseaudio_SOURCES
|
||||
linux-pulseaudio.c
|
||||
pulse-wrapper.c
|
||||
pulse-input.c
|
||||
)
|
||||
target_sources(linux-pulseaudio PRIVATE linux-pulseaudio.c pulse-wrapper.c
|
||||
pulse-input.c)
|
||||
|
||||
target_include_directories(linux-pulseaudio PRIVATE ${PULSEAUDIO_INCLUDE_DIR})
|
||||
|
||||
target_link_libraries(linux-pulseaudio PRIVATE OBS::libobs
|
||||
${PULSEAUDIO_LIBRARY})
|
||||
|
||||
add_library(linux-pulseaudio MODULE
|
||||
${linux-pulseaudio_SOURCES}
|
||||
)
|
||||
target_link_libraries(linux-pulseaudio
|
||||
libobs
|
||||
${PULSEAUDIO_LIBRARY}
|
||||
)
|
||||
set_target_properties(linux-pulseaudio PROPERTIES FOLDER "plugins")
|
||||
|
||||
install_obs_plugin_with_data(linux-pulseaudio data)
|
||||
setup_plugin_target(linux-pulseaudio)
|
||||
|
|
|
@ -1,62 +1,35 @@
|
|||
project(linux-v4l2)
|
||||
|
||||
if(DISABLE_V4L2)
|
||||
message(STATUS "v4l2 plugin disabled")
|
||||
return()
|
||||
option(ENABLE_V4L2 "Build OBS with v4l2 support" ON)
|
||||
if(NOT ENABLE_V4L2)
|
||||
message(STATUS "OBS: DISABLED linux-v4l2")
|
||||
return()
|
||||
endif()
|
||||
|
||||
option(ENABLE_UDEV "Build linux-v4l2 with UDEV support" ON)
|
||||
|
||||
if(ENABLE_V4L2)
|
||||
find_package(Libv4l2 REQUIRED)
|
||||
else()
|
||||
find_package(Libv4l2)
|
||||
if(NOT LIBV4L2_FOUND)
|
||||
message(STATUS "libv4l2 not found, disabling v4l2 plugin")
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
find_package(Libv4l2 REQUIRED)
|
||||
find_package(FFmpeg REQUIRED COMPONENTS avcodec avutil avformat)
|
||||
|
||||
if(DISABLE_UDEV)
|
||||
add_definitions(-DHAVE_UDEV)
|
||||
else()
|
||||
find_package(UDev)
|
||||
if(NOT UDEV_FOUND)
|
||||
message(STATUS "udev disabled for v4l2 plugin")
|
||||
else()
|
||||
set(linux-v4l2-udev_SOURCES
|
||||
v4l2-udev.c
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
add_library(linux-v4l2 MODULE)
|
||||
add_library(OBS::v4l2 ALIAS linux-v4l2)
|
||||
|
||||
find_package(FFmpeg REQUIRED
|
||||
COMPONENTS avcodec avutil avformat)
|
||||
target_sources(linux-v4l2 PRIVATE linux-v4l2.c v4l2-controls.c v4l2-input.c
|
||||
v4l2-helpers.c v4l2-output.c v4l2-mjpeg.c)
|
||||
|
||||
include_directories(
|
||||
SYSTEM "${CMAKE_SOURCE_DIR}/libobs"
|
||||
${LIBV4L2_INCLUDE_DIRS}
|
||||
${FFMPEG_INCLUDE_DIRS}
|
||||
)
|
||||
target_link_libraries(
|
||||
linux-v4l2 PRIVATE OBS::libobs LIB4L2::LIB4L2 FFmpeg::avcodec
|
||||
FFmpeg::avformat FFmpeg::avutil)
|
||||
|
||||
set(linux-v4l2_SOURCES
|
||||
linux-v4l2.c
|
||||
v4l2-controls.c
|
||||
v4l2-input.c
|
||||
v4l2-helpers.c
|
||||
v4l2-output.c
|
||||
v4l2-mjpeg.c
|
||||
${linux-v4l2-udev_SOURCES}
|
||||
)
|
||||
|
||||
add_library(linux-v4l2 MODULE
|
||||
${linux-v4l2_SOURCES}
|
||||
)
|
||||
target_link_libraries(linux-v4l2
|
||||
libobs
|
||||
${LIBV4L2_LIBRARIES}
|
||||
${UDEV_LIBRARIES}
|
||||
${FFMPEG_LIBRARIES}
|
||||
)
|
||||
set_target_properties(linux-v4l2 PROPERTIES FOLDER "plugins")
|
||||
|
||||
install_obs_plugin_with_data(linux-v4l2 data)
|
||||
if(NOT ENABLE_UDEV)
|
||||
target_compile_definitions(linux-v4l2 PRIVATE HAVE_UDEV)
|
||||
else()
|
||||
find_package(Udev REQUIRED)
|
||||
target_sources(linux-v4l2 PRIVATE v4l2-udev.c)
|
||||
|
||||
target_link_libraries(linux-v4l2 PRIVATE Udev::Udev)
|
||||
endif()
|
||||
|
||||
setup_plugin_target(linux-v4l2)
|
||||
|
|
|
@ -5,41 +5,31 @@ find_library(COCOA Cocoa)
|
|||
find_library(COREFOUNDATION CoreFoundation)
|
||||
find_library(COREMEDIA CoreMedia)
|
||||
find_library(COREVIDEO CoreVideo)
|
||||
find_library(COCOA Cocoa)
|
||||
find_library(COREMEDIAIO CoreMediaIO)
|
||||
|
||||
include_directories(${AVFOUNDATION}
|
||||
${COCOA}
|
||||
${COREFOUNDATION}
|
||||
${COREMEDIA}
|
||||
${COREVIDEO}
|
||||
${COREMEDIAIO}
|
||||
${COCOA})
|
||||
mark_as_advanced(AVFOUNDATION COCOA COREFOUNDATION COREMEDIA COREMEDIAIO
|
||||
COREVIDEO)
|
||||
|
||||
set(mac-avcapture_HEADERS
|
||||
left-right.hpp
|
||||
scope-guard.hpp
|
||||
)
|
||||
add_library(mac-avcapture MODULE)
|
||||
add_library(OBS::avcapture ALIAS mac-avcapture)
|
||||
|
||||
set(mac-avcapture_SOURCES
|
||||
av-capture.mm)
|
||||
target_sources(mac-avcapture PRIVATE av-capture.mm left-right.hpp
|
||||
scope-guard.hpp)
|
||||
|
||||
set_source_files_properties(av-capture.mm
|
||||
PROPERTIES COMPILE_FLAGS "-fobjc-arc")
|
||||
target_compile_features(mac-avcapture PRIVATE cxx_std_11)
|
||||
|
||||
add_library(mac-avcapture MODULE
|
||||
${mac-avcapture_SOURCES}
|
||||
${mac-avcapture_HEADERS})
|
||||
set_source_files_properties(av-capture.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
|
||||
|
||||
target_link_libraries(mac-avcapture
|
||||
libobs
|
||||
${AVFOUNDATION}
|
||||
${COCOA}
|
||||
${COREFOUNDATION}
|
||||
${COREMEDIA}
|
||||
${COREVIDEO}
|
||||
${COREMEDIAIO}
|
||||
${COCOA})
|
||||
set_target_properties(mac-avcapture PROPERTIES FOLDER "plugins")
|
||||
target_link_libraries(
|
||||
mac-avcapture
|
||||
PRIVATE OBS::libobs
|
||||
${AVFOUNDATION}
|
||||
${COCOA}
|
||||
${COREFOUNDATION}
|
||||
${COREMEDIA}
|
||||
${COREVIDEO}
|
||||
${COREMEDIAIO})
|
||||
|
||||
install_obs_plugin_with_data(mac-avcapture data)
|
||||
set_target_properties(mac-avcapture PROPERTIES FOLDER "plugins" PREFIX "")
|
||||
|
||||
setup_plugin_target(mac-avcapture)
|
||||
|
|
|
@ -6,34 +6,23 @@ find_library(COREFOUNDATION CoreFoundation)
|
|||
find_library(IOSURF IOSurface)
|
||||
find_library(COCOA Cocoa)
|
||||
|
||||
include_directories(${COREAUDIO}
|
||||
${AUDIOUNIT}
|
||||
${COREFOUNDATION}
|
||||
${IOSURF}
|
||||
${COCOA})
|
||||
add_library(mac-capture MODULE)
|
||||
add_library(OBS::capture ALIAS mac-capture)
|
||||
|
||||
set(mac-capture_HEADERS
|
||||
audio-device-enum.h
|
||||
window-utils.h)
|
||||
target_sources(
|
||||
mac-capture
|
||||
PRIVATE plugin-main.c
|
||||
audio-device-enum.c
|
||||
audio-device-enum.h
|
||||
mac-audio.c
|
||||
mac-display-capture.m
|
||||
mac-window-capture.m
|
||||
window-utils.m
|
||||
window-utils.h)
|
||||
|
||||
set(mac-capture_SOURCES
|
||||
plugin-main.c
|
||||
audio-device-enum.c
|
||||
mac-audio.c
|
||||
mac-display-capture.m
|
||||
mac-window-capture.m
|
||||
window-utils.m)
|
||||
target_link_libraries(mac-capture PRIVATE OBS::libobs ${COREAUDIO} ${AUDIOUNIT}
|
||||
${COREFOUNDATION} ${IOSURF} ${COCOA})
|
||||
|
||||
add_library(mac-capture MODULE
|
||||
${mac-capture_SOURCES}
|
||||
${mac-capture_HEADERS})
|
||||
target_link_libraries(mac-capture
|
||||
libobs
|
||||
${COREAUDIO}
|
||||
${AUDIOUNIT}
|
||||
${COREFOUNDATION}
|
||||
${IOSURF}
|
||||
${COCOA})
|
||||
set_target_properties(mac-capture PROPERTIES FOLDER "plugins")
|
||||
set_target_properties(mac-capture PROPERTIES FOLDER "plugins" PREFIX "")
|
||||
|
||||
install_obs_plugin_with_data(mac-capture data)
|
||||
setup_plugin_target(mac-capture)
|
||||
|
|
|
@ -1,87 +1,86 @@
|
|||
project(mac-syphon)
|
||||
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
||||
find_library(COCOA Cocoa)
|
||||
find_library(IOSURF IOSurface)
|
||||
find_library(SCRIPTINGBRIDGE ScriptingBridge)
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
||||
include_directories(${COCOA}
|
||||
${IOSURF}
|
||||
${SCRIPTINGBIRDGE}
|
||||
${OPENGL_INCLUDE_DIR})
|
||||
mark_as_advanced(COCOA IOSURF SCRIPTINGBRIDGE)
|
||||
|
||||
set(syphon_HEADERS
|
||||
syphon-framework/Syphon_Prefix.pch
|
||||
syphon-framework/Syphon.h
|
||||
syphon-framework/SyphonBuildMacros.h
|
||||
syphon-framework/SyphonCFMessageReceiver.h
|
||||
syphon-framework/SyphonCFMessageSender.h
|
||||
syphon-framework/SyphonClient.h
|
||||
syphon-framework/SyphonClientConnectionManager.h
|
||||
syphon-framework/SyphonDispatch.h
|
||||
syphon-framework/SyphonIOSurfaceImage.h
|
||||
syphon-framework/SyphonImage.h
|
||||
syphon-framework/SyphonMachMessageReceiver.h
|
||||
syphon-framework/SyphonMachMessageSender.h
|
||||
syphon-framework/SyphonMessageQueue.h
|
||||
syphon-framework/SyphonMessageReceiver.h
|
||||
syphon-framework/SyphonMessageSender.h
|
||||
syphon-framework/SyphonMessaging.h
|
||||
syphon-framework/SyphonOpenGLFunctions.h
|
||||
syphon-framework/SyphonPrivate.h
|
||||
syphon-framework/SyphonServer.h
|
||||
syphon-framework/SyphonServerConnectionManager.h
|
||||
syphon-framework/SyphonServerDirectory.h
|
||||
)
|
||||
add_library(mac-syphon MODULE)
|
||||
add_library(OBS::syphon ALIAS mac-syphon)
|
||||
|
||||
set(syphon_SOURCES
|
||||
syphon-framework/SyphonCFMessageReceiver.m
|
||||
syphon-framework/SyphonCFMessageSender.m
|
||||
syphon-framework/SyphonClient.m
|
||||
syphon-framework/SyphonClientConnectionManager.m
|
||||
syphon-framework/SyphonDispatch.c
|
||||
syphon-framework/SyphonImage.m
|
||||
syphon-framework/SyphonIOSurfaceImage.m
|
||||
syphon-framework/SyphonMachMessageReceiver.m
|
||||
syphon-framework/SyphonMachMessageSender.m
|
||||
syphon-framework/SyphonMessageQueue.m
|
||||
syphon-framework/SyphonMessageReceiver.m
|
||||
syphon-framework/SyphonMessageSender.m
|
||||
syphon-framework/SyphonMessaging.m
|
||||
syphon-framework/SyphonOpenGLFunctions.c
|
||||
syphon-framework/SyphonPrivate.m
|
||||
syphon-framework/SyphonServer.m
|
||||
syphon-framework/SyphonServerConnectionManager.m
|
||||
syphon-framework/SyphonServerDirectory.m
|
||||
)
|
||||
add_library(syphon-framework STATIC)
|
||||
add_library(Syphon::Framework ALIAS syphon-framework)
|
||||
|
||||
add_library(syphon-framework ${syphon_HEADERS}
|
||||
${syphon_SOURCES})
|
||||
target_sources(mac-syphon PRIVATE syphon.m plugin-main.c)
|
||||
|
||||
set(mac-syphon_HEADERS
|
||||
)
|
||||
target_sources(
|
||||
syphon-framework
|
||||
PRIVATE syphon-framework/Syphon_Prefix.pch
|
||||
syphon-framework/Syphon.h
|
||||
syphon-framework/SyphonBuildMacros.h
|
||||
syphon-framework/SyphonCFMessageReceiver.m
|
||||
syphon-framework/SyphonCFMessageReceiver.h
|
||||
syphon-framework/SyphonCFMessageSender.h
|
||||
syphon-framework/SyphonCFMessageSender.m
|
||||
syphon-framework/SyphonClient.m
|
||||
syphon-framework/SyphonClient.h
|
||||
syphon-framework/SyphonClientConnectionManager.m
|
||||
syphon-framework/SyphonClientConnectionManager.h
|
||||
syphon-framework/SyphonDispatch.c
|
||||
syphon-framework/SyphonDispatch.h
|
||||
syphon-framework/SyphonIOSurfaceImage.m
|
||||
syphon-framework/SyphonIOSurfaceImage.h
|
||||
syphon-framework/SyphonImage.m
|
||||
syphon-framework/SyphonImage.h
|
||||
syphon-framework/SyphonMachMessageReceiver.m
|
||||
syphon-framework/SyphonMachMessageReceiver.h
|
||||
syphon-framework/SyphonMachMessageSender.m
|
||||
syphon-framework/SyphonMachMessageSender.h
|
||||
syphon-framework/SyphonMessageQueue.m
|
||||
syphon-framework/SyphonMessageQueue.h
|
||||
syphon-framework/SyphonMessageReceiver.m
|
||||
syphon-framework/SyphonMessageReceiver.h
|
||||
syphon-framework/SyphonMessageSender.m
|
||||
syphon-framework/SyphonMessageSender.h
|
||||
syphon-framework/SyphonMessaging.m
|
||||
syphon-framework/SyphonMessaging.h
|
||||
syphon-framework/SyphonOpenGLFunctions.c
|
||||
syphon-framework/SyphonOpenGLFunctions.h
|
||||
syphon-framework/SyphonPrivate.m
|
||||
syphon-framework/SyphonPrivate.h
|
||||
syphon-framework/SyphonServer.m
|
||||
syphon-framework/SyphonServer.h
|
||||
syphon-framework/SyphonServerConnectionManager.m
|
||||
syphon-framework/SyphonServerConnectionManager.h
|
||||
syphon-framework/SyphonServerDirectory.m
|
||||
syphon-framework/SyphonServerDirectory.h)
|
||||
|
||||
set(mac-syphon_SOURCES
|
||||
syphon.m
|
||||
plugin-main.c)
|
||||
target_link_libraries(mac-syphon PRIVATE OBS::libobs Syphon::Framework
|
||||
${SCRIPTINGBRIDGE})
|
||||
|
||||
add_definitions(-DSYPHON_UNIQUE_CLASS_NAME_PREFIX=OBS_ -include
|
||||
${PROJECT_SOURCE_DIR}/syphon-framework/Syphon_Prefix.pch)
|
||||
target_link_libraries(syphon-framework PUBLIC OpenGL::GL ${COCOA} ${IOSURF})
|
||||
|
||||
add_library(mac-syphon MODULE
|
||||
${mac-syphon_SOURCES}
|
||||
${mac-syphon_HEADERS})
|
||||
target_compile_options(
|
||||
mac-syphon
|
||||
PRIVATE -include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/syphon-framework/Syphon_Prefix.pch
|
||||
-fobjc-arc)
|
||||
|
||||
target_link_libraries(mac-syphon
|
||||
libobs
|
||||
syphon-framework
|
||||
${COCOA}
|
||||
${IOSURF}
|
||||
${SCRIPTINGBRIDGE}
|
||||
${OPENGL_gl_LIBRARY})
|
||||
target_compile_options(
|
||||
syphon-framework
|
||||
PRIVATE -include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/syphon-framework/Syphon_Prefix.pch
|
||||
-Wno-deprecated-declarations)
|
||||
|
||||
set_property (TARGET mac-syphon APPEND_STRING PROPERTY
|
||||
COMPILE_FLAGS "-fobjc-arc")
|
||||
set_target_properties(mac-syphon PROPERTIES FOLDER "plugins")
|
||||
target_compile_definitions(syphon-framework
|
||||
PUBLIC "SYPHON_UNIQUE_CLASS_NAME_PREFIX=OBS_")
|
||||
|
||||
install_obs_plugin_with_data(mac-syphon data)
|
||||
set_target_properties(mac-syphon PROPERTIES FOLDER "plugins" PREFIX "")
|
||||
|
||||
set_target_properties(syphon-framework PROPERTIES FOLDER "plugins/mac-syphon"
|
||||
PREFIX "")
|
||||
|
||||
setup_plugin_target(mac-syphon)
|
||||
|
|
|
@ -1,2 +1,9 @@
|
|||
option(ENABLE_VIRTUALCAM "Build OBS Virtualcam" ON)
|
||||
|
||||
if(NOT ENABLE_VIRTUALCAM)
|
||||
message(STATUS "OBS: DISABLED mac-virtualcam")
|
||||
return()
|
||||
endif()
|
||||
|
||||
add_subdirectory(src/obs-plugin)
|
||||
add_subdirectory(src/dal-plugin)
|
||||
|
|
|
@ -1,101 +1,65 @@
|
|||
# Universal build for Apple Silicon
|
||||
# Build DAL plugin universal to ensure compatibility with Rosetta-translated
|
||||
# apps on arm64 hosts
|
||||
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")
|
||||
|
||||
project(mac-dal-plugin)
|
||||
|
||||
find_library(APPKIT AppKit)
|
||||
find_library(COREFOUNDATION CoreFoundation)
|
||||
find_library(COREVIDEO CoreVideo)
|
||||
find_library(COCOA Cocoa)
|
||||
find_library(COREMEDIA CoreMedia)
|
||||
find_library(COREMEDIAIO CoreMediaIO)
|
||||
find_library(IOKIT IOKit)
|
||||
find_library(COREVIDEO CoreVideo)
|
||||
|
||||
include_directories(${APPKIT}
|
||||
${COREFOUNDATION}
|
||||
${COREVIDEO}
|
||||
${COREMEDIA}
|
||||
${COREMEDIAIO}
|
||||
${IOSURFACE}
|
||||
./
|
||||
../common)
|
||||
mark_as_advanced(COCOA COREMEDIA COREMEDIAIO COREVIDEO)
|
||||
|
||||
set(mac-dal-plugin_HEADERS
|
||||
Defines.h
|
||||
Logging.h
|
||||
OBSDALPlugInInterface.h
|
||||
OBSDALObjectStore.h
|
||||
OBSDALPlugIn.h
|
||||
OBSDALDevice.h
|
||||
OBSDALStream.h
|
||||
CMSampleBufferUtils.h
|
||||
OBSDALMachClient.h
|
||||
../common/MachProtocol.h)
|
||||
add_library(mac-dal-plugin MODULE)
|
||||
add_library(OBS::mac-dal-plugin ALIAS mac-dal-plugin)
|
||||
|
||||
set(mac-dal-plugin_SOURCES
|
||||
OBSDALPlugInMain.mm
|
||||
OBSDALPlugInInterface.mm
|
||||
OBSDALObjectStore.mm
|
||||
OBSDALPlugIn.mm
|
||||
OBSDALDevice.mm
|
||||
OBSDALStream.mm
|
||||
CMSampleBufferUtils.mm
|
||||
OBSDALMachClient.mm)
|
||||
target_sources(
|
||||
mac-dal-plugin
|
||||
PRIVATE OBSDALPlugIn.mm
|
||||
OBSDALPlugIn.h
|
||||
OBSDALPlugInMain.mm
|
||||
OBSDALPlugInInterface.mm
|
||||
OBSDALPlugInInterface.h
|
||||
OBSDALObjectStore.mm
|
||||
OBSDALObjectStore.h
|
||||
OBSDALDevice.mm
|
||||
OBSDALDevice.h
|
||||
OBSDALMachClient.mm
|
||||
OBSDALMachClient.h
|
||||
CMSampleBufferUtils.mm
|
||||
OBSDALStream.mm
|
||||
OBSDALStream.h
|
||||
CMSampleBufferUtils.h
|
||||
Defines.h
|
||||
Logging.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../common/MachProtocol.h)
|
||||
|
||||
add_library(mac-dal-plugin MODULE
|
||||
${mac-dal-plugin_SOURCES}
|
||||
${mac-dal-plugin_HEADERS})
|
||||
target_include_directories(
|
||||
mac-dal-plugin
|
||||
PRIVATE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/../common")
|
||||
|
||||
set_target_properties(mac-dal-plugin PROPERTIES
|
||||
FOLDER "plugins"
|
||||
BUNDLE TRUE
|
||||
OUTPUT_NAME "obs-mac-virtualcam"
|
||||
COMPILE_FLAGS "-std=gnu++14 -stdlib=libc++ -fobjc-arc -fobjc-weak")
|
||||
target_compile_options(mac-dal-plugin PRIVATE -fobjc-arc -fobjc-weak)
|
||||
|
||||
if (XCODE)
|
||||
set(TARGET_DIR "${CMAKE_CURRENT_BINARY_DIR}/Debug")
|
||||
else (XCODE)
|
||||
set(TARGET_DIR "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
endif (XCODE)
|
||||
target_link_libraries(mac-dal-plugin PRIVATE ${COCOA} ${COREMEDIA}
|
||||
${COREMEDIAIO} ${COREVIDEO})
|
||||
|
||||
target_link_libraries(mac-dal-plugin
|
||||
${APPKIT}
|
||||
${COREFOUNDATION}
|
||||
${COREVIDEO}
|
||||
${COREMEDIA}
|
||||
${COREMEDIAIO}
|
||||
${IOKIT})
|
||||
set(MACOSX_PLUGIN_BUNDLE_TYPE "BNDL")
|
||||
target_sources(mac-dal-plugin PRIVATE placeholder.png)
|
||||
set_source_files_properties(placeholder.png PROPERTIES MACOSX_PACKAGE_LOCATION
|
||||
"Resources")
|
||||
source_group("Resources" FILES placeholder.png)
|
||||
|
||||
add_custom_command(TARGET mac-dal-plugin
|
||||
POST_BUILD
|
||||
COMMAND rm -rf ${TARGET_DIR}/obs-mac-virtualcam.plugin || true
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${TARGET_DIR}/obs-mac-virtualcam.bundle ${TARGET_DIR}/obs-mac-virtualcam.plugin
|
||||
COMMENT "Rename bundle to plugin"
|
||||
)
|
||||
set_target_properties(
|
||||
mac-dal-plugin
|
||||
PROPERTIES BUNDLE ON
|
||||
BUNDLE_EXTENSION "plugin"
|
||||
OUTPUT_NAME "obs-mac-virtualcam"
|
||||
FOLDER "plugins"
|
||||
VERSION "0"
|
||||
SOVERSION "0"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../../"
|
||||
MACOSX_BUNDLE_INFO_PLIST
|
||||
"${CMAKE_SOURCE_DIR}/cmake/bundle/macOS/Virtualcam-Info.plist.in")
|
||||
|
||||
# Note: Xcode seems to run a command `builtin-infoPlistUtility` to generate the Info.plist, but I'm
|
||||
# not sure where to find that binary. If we had access to it, the command would look something like:
|
||||
# builtin-infoPlistUtility ${PROJECT_SOURCE_DIR}/../common/CoreMediaIO/DeviceAbstractionLayer/Devices/Sample/PlugIn/SampleVCam-Info.plist -producttype com.apple.product-type.bundle -expandbuildsettings -platform macosx -o mac-virtualcam.bundle/Contents/Info.plist
|
||||
# Instead, just copy in one that was already generated from Xcode.
|
||||
add_custom_command(TARGET mac-dal-plugin
|
||||
POST_BUILD
|
||||
COMMAND cp ${PROJECT_SOURCE_DIR}/Info.plist ${TARGET_DIR}/obs-mac-virtualcam.plugin/Contents/Info.plist
|
||||
COMMAND mkdir ${TARGET_DIR}/obs-mac-virtualcam.plugin/Contents/Resources
|
||||
COMMAND cp ${PROJECT_SOURCE_DIR}/placeholder.png ${TARGET_DIR}/obs-mac-virtualcam.plugin/Contents/Resources/placeholder.png
|
||||
COMMAND /usr/bin/plutil -insert CFBundleVersion -string "${OBS_VERSION}" ${TARGET_DIR}/obs-mac-virtualcam.plugin/Contents/Info.plist
|
||||
COMMAND /usr/bin/plutil -insert CFBundleShortVersionString -string "${OBS_VERSION}" ${TARGET_DIR}/obs-mac-virtualcam.plugin/Contents/Info.plist
|
||||
DEPENDS {PROJECT_SOURCE_DIR}/Info.plist
|
||||
COMMENT "Copy in Info.plist"
|
||||
)
|
||||
|
||||
add_custom_command(TARGET mac-dal-plugin
|
||||
POST_BUILD
|
||||
COMMAND /usr/bin/codesign --force --deep --sign - --timestamp=none ${TARGET_DIR}/obs-mac-virtualcam.plugin
|
||||
COMMENT "Codesign plugin"
|
||||
)
|
||||
|
||||
add_custom_command(TARGET mac-dal-plugin
|
||||
POST_BUILD
|
||||
COMMAND rm -rf "${OBS_OUTPUT_DIR}/$<CONFIGURATION>/data/obs-mac-virtualcam.plugin" || true
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${TARGET_DIR}/obs-mac-virtualcam.plugin "${OBS_OUTPUT_DIR}/$<CONFIGURATION>/data/obs-plugins/mac-virtualcam/obs-mac-virtualcam.plugin"
|
||||
COMMENT "Copy plugin to destination"
|
||||
)
|
||||
setup_binary_target(mac-dal-plugin)
|
||||
|
|
|
@ -1,33 +1,32 @@
|
|||
project(mac-virtualcam)
|
||||
|
||||
find_library(APPKIT AppKit)
|
||||
find_library(COREFOUNDATION CoreFoundation)
|
||||
|
||||
include_directories(${APPKIT}
|
||||
${COREFOUNDATION}
|
||||
../common)
|
||||
mark_as_advanced(APPKIT)
|
||||
|
||||
set(mac-virtualcam_HEADERS
|
||||
Defines.h
|
||||
OBSDALMachServer.h
|
||||
../common/MachProtocol.h)
|
||||
add_library(mac-virtualcam MODULE)
|
||||
add_library(OBS::virtualcam ALIAS mac-virtualcam)
|
||||
|
||||
set(mac-virtualcam_SOURCES
|
||||
plugin-main.mm
|
||||
OBSDALMachServer.mm)
|
||||
target_sources(
|
||||
mac-virtualcam PRIVATE Defines.h plugin-main.mm OBSDALMachServer.mm
|
||||
OBSDALMachServer.h ../common/MachProtocol.h)
|
||||
|
||||
add_library(mac-virtualcam MODULE
|
||||
${mac-virtualcam_SOURCES}
|
||||
${mac-virtualcam_HEADERS})
|
||||
target_include_directories(
|
||||
mac-virtualcam
|
||||
PRIVATE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/../common")
|
||||
|
||||
target_link_libraries(mac-virtualcam
|
||||
libobs
|
||||
${APPKIT}
|
||||
${COREFOUNDATION})
|
||||
target_link_libraries(mac-virtualcam PRIVATE OBS::libobs OBS::frontend-api
|
||||
${APPKIT})
|
||||
|
||||
set_target_properties(mac-virtualcam PROPERTIES
|
||||
FOLDER "plugins"
|
||||
COMPILE_FLAGS "-std=gnu++14 -stdlib=libc++ -fobjc-arc -fobjc-weak"
|
||||
)
|
||||
target_compile_features(mac-virtualcam PRIVATE cxx_deleted_functions
|
||||
cxx_rvalue_references cxx_std_17)
|
||||
|
||||
install_obs_plugin_with_data(mac-virtualcam data)
|
||||
target_compile_options(mac-virtualcam PRIVATE -fobjc-arc -fobjc-weak)
|
||||
|
||||
set_target_properties(
|
||||
mac-virtualcam
|
||||
PROPERTIES FOLDER "plugins"
|
||||
PREFIX ""
|
||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../../")
|
||||
|
||||
setup_plugin_target(mac-virtualcam)
|
||||
|
|
|
@ -36,34 +36,28 @@ static bool check_dal_plugin()
|
|||
@"/Library/CoreMediaIO/Plug-Ins/DAL/obs-mac-virtualcam.plugin/Contents/Info.plist"]];
|
||||
NSString *dalPluginVersion = [dalPluginInfoPlist
|
||||
valueForKey:@"CFBundleShortVersionString"];
|
||||
const char *obsVersion = obs_get_version_string();
|
||||
NSString *dalPluginBuild =
|
||||
[dalPluginInfoPlist valueForKey:@"CFBundleVersion"];
|
||||
|
||||
NSString *obsVersion = [[[NSBundle mainBundle] infoDictionary]
|
||||
objectForKey:@"CFBundleShortVersionString"];
|
||||
NSString *obsBuild = [[[NSBundle mainBundle] infoDictionary]
|
||||
objectForKey:(NSString *)kCFBundleVersionKey];
|
||||
dalPluginUpdateNeeded =
|
||||
![dalPluginVersion isEqualToString:@(obsVersion)];
|
||||
!([dalPluginVersion isEqualToString:obsVersion] &&
|
||||
[dalPluginBuild isEqualToString:obsBuild]);
|
||||
}
|
||||
|
||||
if (!dalPluginInstalled || dalPluginUpdateNeeded) {
|
||||
// TODO: Remove this distinction once OBS is built into an app bundle by cmake by default
|
||||
NSString *dalPluginSourcePath;
|
||||
NSRunningApplication *app =
|
||||
[NSRunningApplication currentApplication];
|
||||
|
||||
if ([app bundleIdentifier] != nil) {
|
||||
NSURL *bundleURL = [app bundleURL];
|
||||
NSString *pluginPath =
|
||||
@"Contents/Resources/data/obs-plugins/mac-virtualcam/obs-mac-virtualcam.plugin";
|
||||
NSURL *bundleURL = [[NSBundle mainBundle] bundleURL];
|
||||
NSString *pluginPath =
|
||||
@"Contents/Resources/obs-mac-virtualcam.plugin";
|
||||
|
||||
NSURL *pluginUrl = [bundleURL
|
||||
URLByAppendingPathComponent:pluginPath];
|
||||
dalPluginSourcePath = [pluginUrl path];
|
||||
} else {
|
||||
dalPluginSourcePath = [[[[app executableURL]
|
||||
URLByAppendingPathComponent:
|
||||
@"../data/obs-plugins/mac-virtualcam/obs-mac-virtualcam.plugin"]
|
||||
path]
|
||||
stringByReplacingOccurrencesOfString:@"obs/"
|
||||
withString:@""];
|
||||
}
|
||||
NSURL *pluginUrl =
|
||||
[bundleURL URLByAppendingPathComponent:pluginPath];
|
||||
dalPluginSourcePath = [pluginUrl path];
|
||||
|
||||
NSString *createPluginDirCmd =
|
||||
(!dalPluginDirExists)
|
||||
|
|
|
@ -7,27 +7,24 @@ find_library(COREVIDEO CoreVideo)
|
|||
find_library(VIDEOTOOLBOX VideoToolbox)
|
||||
find_library(COREMEDIA CoreMedia)
|
||||
|
||||
include_directories(${AVFOUNDATION}
|
||||
${COCOA}
|
||||
${COREFOUNDATION}
|
||||
${COREVIDEO}
|
||||
${VIDEOTOOLBOX}
|
||||
${COREMEDIA})
|
||||
mark_as_advanced(AVFOUNDATION COCOA COREFOUNDATION COREVIDEO VIDEOTOOLBOX
|
||||
COREMEDIA)
|
||||
|
||||
set(mac-vth264_SOURCES
|
||||
encoder.c)
|
||||
add_library(mac-vth264 MODULE)
|
||||
add_library(OBS::vth264 ALIAS mac-vth264)
|
||||
|
||||
add_library(mac-vth264 MODULE
|
||||
${mac-vth264_SOURCES})
|
||||
target_sources(mac-vth264 PRIVATE encoder.c)
|
||||
|
||||
target_link_libraries(mac-vth264
|
||||
libobs
|
||||
${AVFOUNDATION}
|
||||
${COCOA}
|
||||
${COREFOUNDATION}
|
||||
${COREVIDEO}
|
||||
${VIDEOTOOLBOX}
|
||||
${COREMEDIA})
|
||||
set_target_properties(mac-vth264 PROPERTIES FOLDER "plugins")
|
||||
target_link_libraries(
|
||||
mac-vth264
|
||||
PRIVATE OBS::libobs
|
||||
${AVFOUNDATION}
|
||||
${COCOA}
|
||||
${COREFOUNDATION}
|
||||
${COREVIDEO}
|
||||
${VIDEOTOOLBOX}
|
||||
${COREMEDIA})
|
||||
|
||||
install_obs_plugin_with_data(mac-vth264 data)
|
||||
set_target_properties(mac-vth264 PROPERTIES FOLDER "plugins" PREFIX "")
|
||||
|
||||
setup_plugin_target(mac-vth264)
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit cbce71dd826cafb7c75cf99cbc7ce101ea7d03c4
|
||||
Subproject commit 7d3ee397a8fc2ff7e26c5e4131ac94d586e329bb
|
|
@ -1,80 +1,77 @@
|
|||
project(obs-ffmpeg)
|
||||
|
||||
if(MSVC)
|
||||
set(obs-ffmpeg_PLATFORM_DEPS
|
||||
w32-pthreads)
|
||||
endif()
|
||||
|
||||
option(ENABLE_FFMPEG_LOGGING "Enables obs-ffmpeg logging" OFF)
|
||||
|
||||
find_package(FFmpeg REQUIRED
|
||||
COMPONENTS avcodec avfilter avdevice avutil swscale avformat swresample)
|
||||
include_directories(${FFMPEG_INCLUDE_DIRS})
|
||||
find_package(
|
||||
FFmpeg REQUIRED
|
||||
COMPONENTS avcodec
|
||||
avfilter
|
||||
avdevice
|
||||
avutil
|
||||
swscale
|
||||
avformat
|
||||
swresample)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
find_package(Libpci REQUIRED)
|
||||
include_directories(${LIBPCI_INCLUDE_DIRS})
|
||||
endif()
|
||||
add_library(obs-ffmpeg MODULE)
|
||||
add_library(OBS::ffmpeg ALIAS obs-ffmpeg)
|
||||
add_subdirectory(ffmpeg-mux)
|
||||
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/obs-ffmpeg-config.h.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/obs-ffmpeg-config.h")
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/obs-ffmpeg-config.h.in
|
||||
${CMAKE_BINARY_DIR}/config/obs-ffmpeg-config.h)
|
||||
|
||||
set(obs-ffmpeg_config_HEADERS
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/obs-ffmpeg-config.h")
|
||||
target_sources(
|
||||
obs-ffmpeg
|
||||
PRIVATE obs-ffmpeg.c
|
||||
obs-ffmpeg-audio-encoders.c
|
||||
obs-ffmpeg-av1.c
|
||||
obs-ffmpeg-nvenc.c
|
||||
obs-ffmpeg-output.c
|
||||
obs-ffmpeg-mux.c
|
||||
obs-ffmpeg-mux.h
|
||||
obs-ffmpeg-hls-mux.c
|
||||
obs-ffmpeg-source.c
|
||||
obs-ffmpeg-compat.h
|
||||
obs-ffmpeg-formats.h
|
||||
${CMAKE_BINARY_DIR}/config/obs-ffmpeg-config.h)
|
||||
|
||||
set(obs-ffmpeg_HEADERS
|
||||
obs-ffmpeg-compat.h
|
||||
obs-ffmpeg-formats.h
|
||||
obs-ffmpeg-mux.h)
|
||||
target_include_directories(obs-ffmpeg PRIVATE ${CMAKE_BINARY_DIR}/config)
|
||||
|
||||
set(obs-ffmpeg_SOURCES
|
||||
obs-ffmpeg.c
|
||||
obs-ffmpeg-audio-encoders.c
|
||||
obs-ffmpeg-nvenc.c
|
||||
obs-ffmpeg-av1.c
|
||||
obs-ffmpeg-output.c
|
||||
obs-ffmpeg-mux.c
|
||||
obs-ffmpeg-hls-mux.c
|
||||
obs-ffmpeg-source.c)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
list(APPEND obs-ffmpeg_SOURCES
|
||||
obs-ffmpeg-vaapi.c)
|
||||
LIST(APPEND obs-ffmpeg_PLATFORM_DEPS
|
||||
${LIBVA_LBRARIES}
|
||||
${LIBPCI_LIBRARIES})
|
||||
endif()
|
||||
target_link_libraries(
|
||||
obs-ffmpeg
|
||||
PRIVATE OBS::libobs
|
||||
OBS::media-playback
|
||||
OBS::opts-parser
|
||||
FFmpeg::avcodec
|
||||
FFmpeg::avfilter
|
||||
FFmpeg::avformat
|
||||
FFmpeg::avdevice
|
||||
FFmpeg::avutil
|
||||
FFmpeg::swscale
|
||||
FFmpeg::swresample)
|
||||
|
||||
if(ENABLE_FFMPEG_LOGGING)
|
||||
list(APPEND obs-ffmpeg_SOURCES
|
||||
obs-ffmpeg-logging.c)
|
||||
target_sources(obs-ffmpeg PRIVATE obs-ffmpeg-logging.c)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(MODULE_DESCRIPTION "OBS FFmpeg module")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in obs-ffmpeg.rc)
|
||||
list(APPEND obs-ffmpeg_SOURCES
|
||||
jim-nvenc.c
|
||||
jim-nvenc-helpers.c
|
||||
obs-ffmpeg.rc)
|
||||
list(APPEND obs-ffmpeg_HEADERS
|
||||
jim-nvenc.h)
|
||||
set_target_properties(obs-ffmpeg PROPERTIES FOLDER "plugins/obs-ffmpeg" PREFIX
|
||||
"")
|
||||
|
||||
if(OS_WINDOWS)
|
||||
if(MSVC)
|
||||
target_link_libraries(obs-ffmpeg PRIVATE OBS::w32-pthreads)
|
||||
endif()
|
||||
|
||||
set(MODULE_DESCRIPTION "OBS FFmpeg module")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
||||
obs-ffmpeg.rc)
|
||||
|
||||
target_sources(obs-ffmpeg PRIVATE jim-nvenc.c jim-nvenc.h jim-nvenc-helpers.c
|
||||
obs-ffmpeg.rc)
|
||||
|
||||
elseif(OS_POSIX AND NOT OS_MACOS)
|
||||
find_package(Libpci REQUIRED)
|
||||
target_sources(obs-ffmpeg PRIVATE obs-ffmpeg-vaapi.c)
|
||||
target_link_libraries(obs-ffmpeg PRIVATE LIBPCI::LIBPCI)
|
||||
endif()
|
||||
|
||||
add_library(obs-ffmpeg MODULE
|
||||
${obs-ffmpeg_config_HEADERS}
|
||||
${obs-ffmpeg_HEADERS}
|
||||
${obs-ffmpeg_SOURCES})
|
||||
target_link_libraries(obs-ffmpeg
|
||||
libobs
|
||||
opts-parser
|
||||
media-playback
|
||||
${obs-ffmpeg_PLATFORM_DEPS}
|
||||
${FFMPEG_LIBRARIES})
|
||||
set_target_properties(obs-ffmpeg PROPERTIES FOLDER "plugins/obs-ffmpeg")
|
||||
|
||||
install_obs_plugin_with_data(obs-ffmpeg data)
|
||||
|
||||
add_subdirectory(ffmpeg-mux)
|
||||
setup_plugin_target(obs-ffmpeg)
|
||||
|
|
|
@ -1,27 +1,21 @@
|
|||
project(obs-ffmpeg-mux)
|
||||
|
||||
if(DEBUG_FFMPEG_MUX)
|
||||
add_definitions(-DDEBUG_FFMPEG)
|
||||
option(ENABLE_FFMPEG_MUX_DEBUG "Enable FFmpeg-mux debugging" OFF)
|
||||
|
||||
find_package(FFmpeg REQUIRED COMPONENTS avcodec avutil avformat)
|
||||
|
||||
add_executable(obs-ffmpeg-mux)
|
||||
add_executable(OBS::ffmpeg-mux ALIAS obs-ffmpeg-mux)
|
||||
|
||||
target_sources(obs-ffmpeg-mux PRIVATE ffmpeg-mux.c ffmpeg-mux.h)
|
||||
|
||||
target_link_libraries(obs-ffmpeg-mux PRIVATE OBS::libobs FFmpeg::avcodec
|
||||
FFmpeg::avutil FFmpeg::avformat)
|
||||
|
||||
if(ENABLE_FFMPEG_MUX_DEBUG)
|
||||
target_compile_definitions(obs-ffmpeg-mux PRIVATE ENABLE_FFMPEG_MUX_DEBUG)
|
||||
endif()
|
||||
|
||||
find_package(FFmpeg REQUIRED
|
||||
COMPONENTS avcodec avutil avformat)
|
||||
include_directories(${FFMPEG_INCLUDE_DIRS})
|
||||
|
||||
set(obs-ffmpeg-mux_SOURCES
|
||||
ffmpeg-mux.c)
|
||||
|
||||
set(obs-ffmpeg-mux_HEADERS
|
||||
ffmpeg-mux.h)
|
||||
|
||||
add_executable(obs-ffmpeg-mux
|
||||
${obs-ffmpeg-mux_SOURCES}
|
||||
${obs-ffmpeg-mux_HEADERS})
|
||||
|
||||
target_link_libraries(obs-ffmpeg-mux
|
||||
libobs
|
||||
${FFMPEG_LIBRARIES})
|
||||
|
||||
set_target_properties(obs-ffmpeg-mux PROPERTIES FOLDER "plugins/obs-ffmpeg")
|
||||
|
||||
install_obs_core(obs-ffmpeg-mux)
|
||||
setup_binary_target(obs-ffmpeg-mux)
|
||||
|
|
|
@ -232,7 +232,7 @@ static bool get_audio_params(struct audio_params *audio, int *argc,
|
|||
static void ffmpeg_log_callback(void *param, int level, const char *format,
|
||||
va_list args)
|
||||
{
|
||||
#ifdef DEBUG_FFMPEG
|
||||
#ifdef ENABLE_FFMPEG_MUX_DEBUG
|
||||
char out_buffer[4096];
|
||||
struct dstr out = {0};
|
||||
|
||||
|
|
|
@ -1,131 +1,174 @@
|
|||
project(obs-filters)
|
||||
|
||||
option(DISABLE_SPEEXDSP "Disable building of the SpeexDSP-based Noise Suppression filter" OFF)
|
||||
option(ENABLE_SPEEXDSP
|
||||
"Enable building with SpeexDSP-based noise suppression filter" ON)
|
||||
option(ENABLE_RNNOISE "Enable building with RNNoise noise supression filter" ON)
|
||||
|
||||
if(DISABLE_SPEEXDSP)
|
||||
message(STATUS "SpeexDSP support disabled")
|
||||
set(LIBSPEEXDSP_FOUND FALSE)
|
||||
if(OS_WINDOWS)
|
||||
option(
|
||||
ENABLE_NVAFX
|
||||
"Enable building with NVIDIA Audio Effects SDK (requires redistributable to be installed)"
|
||||
ON)
|
||||
endif()
|
||||
|
||||
add_library(obs-filters MODULE)
|
||||
add_library(OBS::filters ALIAS obs-filters)
|
||||
|
||||
set(HAS_NOISEREDUCTION OFF)
|
||||
|
||||
if(NOT ENABLE_SPEEXDSP)
|
||||
message(STATUS "OBS: DISABLED SpeexDSP")
|
||||
else()
|
||||
find_package(Libspeexdsp)
|
||||
if(LIBSPEEXDSP_FOUND)
|
||||
add_definitions(-DLIBSPEEXDSP_ENABLED)
|
||||
endif()
|
||||
find_package(Libspeexdsp REQUIRED)
|
||||
|
||||
target_sources(obs-filters PRIVATE noise-suppress-filter.c)
|
||||
|
||||
target_link_libraries(obs-filters PRIVATE LibspeexDSP::LibspeexDSP)
|
||||
|
||||
target_compile_definitions(obs-filters PRIVATE LIBSPEEXDSP_ENABLED)
|
||||
|
||||
if(OS_WINDOWS)
|
||||
target_link_options(obs-filters PRIVATE "LINKER:/LTCG")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(Librnnoise QUIET)
|
||||
add_definitions(-DLIBRNNOISE_ENABLED)
|
||||
if(NOT LIBRNNOISE_FOUND)
|
||||
file(GLOB rnnoise_SOURCES
|
||||
"rnnoise/src/*.c"
|
||||
"rnnoise/src/*.h"
|
||||
"rnnoise/include/*.h")
|
||||
add_definitions(-DCOMPILE_OPUS)
|
||||
if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
|
||||
set_property(SOURCE ${rnnoise_SOURCES} PROPERTY COMPILE_FLAGS "-fvisibility=protected")
|
||||
endif()
|
||||
include_directories("rnnoise/include")
|
||||
source_group("rnnoise" FILES ${rnnoise_SOURCES})
|
||||
set(LIBRNNOISE_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
if(DISABLE_NVAFX)
|
||||
message(STATUS "NVIDIA Audio Effects SDK support disabled")
|
||||
set(LIBNVAFX_FOUND FALSE)
|
||||
else()
|
||||
message(STATUS "NVIDIA Audio Effects SDK support enabled; requires redist to be installed by end-user")
|
||||
add_definitions(-DLIBNVAFX_ENABLED)
|
||||
set(LIBNVAFX_FOUND TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(LIBSPEEXDSP_FOUND OR LIBRNNOISE_FOUND OR LIBNVAFX_FOUND)
|
||||
set(obs-filters_NOISEREDUCTION_SOURCES
|
||||
noise-suppress-filter.c)
|
||||
if(LIBNVAFX_FOUND)
|
||||
set(obs-filters_NOISEREDUCTION_HEADERS
|
||||
nvafx-load.h)
|
||||
else()
|
||||
set(obs-filters_NOISEREDUCTION_HEADERS)
|
||||
endif()
|
||||
set(obs-filters_NOISEREDUCTION_LIBRARIES
|
||||
${LIBSPEEXDSP_LIBRARIES} ${LIBRNNOISE_LIBRARIES})
|
||||
set(NOISEREDUCTION_ENABLED TRUE)
|
||||
if(NOT ENABLE_RNNOISE)
|
||||
message(STATUS "OBS: DISABLED RNNoise")
|
||||
else()
|
||||
set(NOISEREDUCTION_ENABLED FALSE)
|
||||
find_package(Librnnoise QUIET)
|
||||
|
||||
if(NOT TARGET Librnnoise::Librnnoise)
|
||||
message(STATUS "OBS: - using bundled RNNoise library")
|
||||
add_library(obs-rnnoise INTERFACE)
|
||||
add_library(Librnnoise::Librnnoise ALIAS obs-rnnoise)
|
||||
|
||||
set(_RNNOISE_SOURCES
|
||||
rnnoise/src/arch.h
|
||||
rnnoise/src/celt_lpc.c
|
||||
rnnoise/src/celt_lpc.h
|
||||
rnnoise/src/common.h
|
||||
rnnoise/src/denoise.c
|
||||
rnnoise/src/kiss_fft.c
|
||||
rnnoise/src/kiss_fft.h
|
||||
rnnoise/src/opus_types.h
|
||||
rnnoise/src/pitch.c
|
||||
rnnoise/src/pitch.h
|
||||
rnnoise/src/rnn_data.c
|
||||
rnnoise/src/rnn_data.h
|
||||
rnnoise/src/rnn_reader.c
|
||||
rnnoise/src/rnn.c
|
||||
rnnoise/src/rnn.h
|
||||
rnnoise/src/tansig_table.h
|
||||
rnnoise/src/_kiss_fft_guts.h
|
||||
rnnoise/include/rnnoise.h)
|
||||
|
||||
target_sources(obs-rnnoise INTERFACE ${_RNNOISE_SOURCES})
|
||||
|
||||
target_include_directories(
|
||||
obs-rnnoise INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/rnnoise/include")
|
||||
|
||||
target_compile_definitions(obs-rnnoise INTERFACE COMPILE_OPUS)
|
||||
|
||||
if(OS_LINUX)
|
||||
set_property(SOURCE ${_RNNOISE_SOURCES} PROPERTY COMPILE_FLAGS
|
||||
-fvisibility=hidden)
|
||||
endif()
|
||||
|
||||
source_group("rnnoise" FILES ${_RNNOISE_SOURCES})
|
||||
endif()
|
||||
|
||||
target_sources(obs-filters PRIVATE noise-suppress-filter.c)
|
||||
|
||||
target_link_libraries(obs-filters PRIVATE Librnnoise::Librnnoise)
|
||||
|
||||
target_compile_definitions(obs-filters PRIVATE LIBRNNOISE_ENABLED)
|
||||
endif()
|
||||
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/obs-filters-config.h.in"
|
||||
"${CMAKE_BINARY_DIR}/plugins/obs-filters/config/obs-filters-config.h")
|
||||
if(NOT ENABLE_NVAFX)
|
||||
message(STATUS "OBS: DISABLED NVidia Audio FX support")
|
||||
set(LIBNVAFX_FOUND OFF)
|
||||
else()
|
||||
message(STATUS "OBS: ENABLED NVidia Audio FX support")
|
||||
|
||||
set(obs-filters_config_HEADERS
|
||||
"${CMAKE_BINARY_DIR}/plugins/obs-filters/config/obs-filters-config.h")
|
||||
include_directories(${LIBSPEEXDSP_INCLUDE_DIRS} ${LIBRNNOISE_INCLUDE_DIRS}
|
||||
"${CMAKE_BINARY_DIR}/plugins/obs-filters/config")
|
||||
target_compile_definitions(obs-filters PRIVATE LIBNVAFX_ENABLED)
|
||||
|
||||
if(MSVC)
|
||||
set(obs-filters_PLATFORM_DEPS
|
||||
w32-pthreads)
|
||||
set(LIBNVAFX_FOUND ON)
|
||||
endif()
|
||||
|
||||
set(obs-filters_SOURCES
|
||||
obs-filters.c
|
||||
color-correction-filter.c
|
||||
async-delay-filter.c
|
||||
gpu-delay.c
|
||||
crop-filter.c
|
||||
scale-filter.c
|
||||
scroll-filter.c
|
||||
chroma-key-filter.c
|
||||
color-key-filter.c
|
||||
color-grade-filter.c
|
||||
sharpness-filter.c
|
||||
gain-filter.c
|
||||
noise-gate-filter.c
|
||||
mask-filter.c
|
||||
invert-audio-polarity.c
|
||||
compressor-filter.c
|
||||
limiter-filter.c
|
||||
expander-filter.c
|
||||
luma-key-filter.c)
|
||||
|
||||
set(obs-filters_data_EFFECTS
|
||||
data/blend_add_filter.effect
|
||||
data/blend_mul_filter.effect
|
||||
data/blend_sub_filter.effect
|
||||
data/chroma_key_filter.effect
|
||||
data/chroma_key_filter_v2.effect
|
||||
data/color_correction_filter.effect
|
||||
data/color_grade_filter.effect
|
||||
data/color_key_filter.effect
|
||||
data/color_key_filter_v2.effect
|
||||
data/crop_filter.effect
|
||||
data/luma_key_filter.effect
|
||||
data/luma_key_filter_v2.effect
|
||||
data/mask_alpha_filter.effect
|
||||
data/mask_color_filter.effect
|
||||
data/sharpness.effect)
|
||||
|
||||
if(WIN32)
|
||||
set(MODULE_DESCRIPTION "OBS A/V Filters")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in obs-filters.rc)
|
||||
list(APPEND obs-filters_SOURCES
|
||||
obs-filters.rc)
|
||||
if(TARGET Librnnoise::Librnnoise
|
||||
OR TARGET LibspeexDSP::LibspeexDSP
|
||||
OR LIBNVAFX_FOUND)
|
||||
target_compile_definitions(obs-filters PRIVATE HAS_NOISEREDUCTION)
|
||||
endif()
|
||||
|
||||
add_library(obs-filters MODULE
|
||||
${rnnoise_SOURCES}
|
||||
${obs-filters_SOURCES}
|
||||
${obs-filters_config_HEADERS}
|
||||
${obs-filters_data_EFFECTS}
|
||||
${obs-filters_NOISEREDUCTION_SOURCES}
|
||||
${obs-filters_NOISEREDUCTION_HEADERS})
|
||||
target_link_libraries(obs-filters
|
||||
libobs
|
||||
${obs-filters_PLATFORM_DEPS}
|
||||
${obs-filters_NOISEREDUCTION_LIBRARIES})
|
||||
set_target_properties(obs-filters PROPERTIES FOLDER "plugins")
|
||||
target_sources(
|
||||
obs-filters
|
||||
PRIVATE obs-filters.c
|
||||
color-correction-filter.c
|
||||
async-delay-filter.c
|
||||
gpu-delay.c
|
||||
crop-filter.c
|
||||
scale-filter.c
|
||||
scroll-filter.c
|
||||
chroma-key-filter.c
|
||||
color-key-filter.c
|
||||
color-grade-filter.c
|
||||
sharpness-filter.c
|
||||
gain-filter.c
|
||||
noise-gate-filter.c
|
||||
mask-filter.c
|
||||
invert-audio-polarity.c
|
||||
compressor-filter.c
|
||||
limiter-filter.c
|
||||
expander-filter.c
|
||||
luma-key-filter.c)
|
||||
|
||||
source_group("data\\Effect Files" FILES ${obs-filters_data_EFFECTS})
|
||||
if(NOT OS_MACOS)
|
||||
target_sources(
|
||||
obs-filters
|
||||
PRIVATE data/blend_add_filter.effect
|
||||
data/blend_mul_filter.effect
|
||||
data/blend_sub_filter.effect
|
||||
data/chroma_key_filter.effect
|
||||
data/chroma_key_filter_v2.effect
|
||||
data/color_correction_filter.effect
|
||||
data/color_grade_filter.effect
|
||||
data/color_key_filter.effect
|
||||
data/color_key_filter_v2.effect
|
||||
data/crop_filter.effect
|
||||
data/luma_key_filter.effect
|
||||
data/luma_key_filter_v2.effect
|
||||
data/mask_alpha_filter.effect
|
||||
data/mask_color_filter.effect
|
||||
data/sharpness.effect)
|
||||
|
||||
install_obs_plugin_with_data(obs-filters data)
|
||||
get_target_property(_SOURCES obs-filters SOURCES)
|
||||
set(_FILTERS ${_SOURCES})
|
||||
list(FILTER _FILTERS INCLUDE REGEX ".*\\.effect")
|
||||
|
||||
source_group(
|
||||
TREE "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
PREFIX "Effect Files"
|
||||
FILES ${_FILTERS})
|
||||
endif()
|
||||
|
||||
target_include_directories(
|
||||
obs-filters PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/config>)
|
||||
|
||||
target_link_libraries(obs-filters PRIVATE OBS::libobs)
|
||||
|
||||
set_target_properties(obs-filters PROPERTIES FOLDER "plugins" PREFIX "")
|
||||
|
||||
if(OS_WINDOWS)
|
||||
if(MSVC)
|
||||
target_link_libraries(obs-filters PRIVATE OBS::w32-pthreads)
|
||||
endif()
|
||||
|
||||
set(MODULE_DESCRIPTION "OBS A/V Filters")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
||||
obs-filters.rc)
|
||||
|
||||
target_sources(obs-filters PRIVATE obs-filters.rc)
|
||||
endif()
|
||||
|
||||
setup_plugin_target(obs-filters)
|
||||
|
|
|
@ -334,8 +334,8 @@ failure:
|
|||
}
|
||||
|
||||
static inline void alloc_channel(struct noise_suppress_data *ng,
|
||||
uint32_t sample_rate, size_t channel,
|
||||
size_t frames)
|
||||
uint32_t sample_rate OBS_UNUSED,
|
||||
size_t channel, size_t frames)
|
||||
{
|
||||
#ifdef LIBSPEEXDSP_ENABLED
|
||||
ng->spx_states[channel] =
|
||||
|
|
|
@ -8,4 +8,4 @@
|
|||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#define NOISEREDUCTION_ENABLED @NOISEREDUCTION_ENABLED@
|
||||
#cmakedefine HAS_NOISEREDUCTION
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#include <obs-module.h>
|
||||
#include "obs-filters-config.h"
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
OBS_MODULE_USE_DEFAULT_LOCALE("obs-filters", "en-US")
|
||||
|
@ -25,7 +24,7 @@ extern struct obs_source_info sharpness_filter_v2;
|
|||
extern struct obs_source_info chroma_key_filter;
|
||||
extern struct obs_source_info chroma_key_filter_v2;
|
||||
extern struct obs_source_info async_delay_filter;
|
||||
#if NOISEREDUCTION_ENABLED
|
||||
#if defined(HAS_NOISEREDUCTION)
|
||||
extern struct obs_source_info noise_suppress_filter;
|
||||
extern struct obs_source_info noise_suppress_filter_v2;
|
||||
extern bool load_nvafx(void);
|
||||
|
@ -58,7 +57,7 @@ bool obs_module_load(void)
|
|||
obs_register_source(&chroma_key_filter);
|
||||
obs_register_source(&chroma_key_filter_v2);
|
||||
obs_register_source(&async_delay_filter);
|
||||
#if NOISEREDUCTION_ENABLED
|
||||
#if defined(HAS_NOISEREDUCTION)
|
||||
#ifdef LIBNVAFX_ENABLED
|
||||
/* load nvidia audio fx dll */
|
||||
load_nvafx();
|
||||
|
|
|
@ -1,29 +1,21 @@
|
|||
project(obs-libfdk)
|
||||
|
||||
if(DISABLE_LIBFDK)
|
||||
message(STATUS "Libfdk support disabled")
|
||||
return()
|
||||
option(ENABLE_LIBFDK "Enable FDK AAC support" OFF)
|
||||
|
||||
if(NOT ENABLE_LIBFDK)
|
||||
message(STATUS "OBS: DISABLED obs-libfdk")
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_package(Libfdk QUIET)
|
||||
if(NOT LIBFDK_FOUND AND ENABLE_LIBFDK)
|
||||
message(FATAL_ERROR "Libfdk not found but set as enabled")
|
||||
elseif(NOT LIBFDK_FOUND)
|
||||
message(STATUS "Libfdk not found - obs-libfdk plugin disabled")
|
||||
return()
|
||||
endif()
|
||||
find_package(Libfdk REQUIRED)
|
||||
|
||||
include_directories(${LIBFDK_INCLUDE_DIRS})
|
||||
add_definitions(${LIBFDK_DEFINITIONS})
|
||||
add_library(obs-libfdk MODULE)
|
||||
add_library(OBS::libfdk ALIAS obs-libfdk)
|
||||
|
||||
set(obs-libfdk_SOURCES
|
||||
obs-libfdk.c)
|
||||
target_sources(obs-libfdk PRIVATE obs-libfdk.c)
|
||||
|
||||
add_library(obs-libfdk MODULE
|
||||
${obs-libfdk_SOURCES})
|
||||
target_link_libraries(obs-libfdk
|
||||
libobs
|
||||
${LIBFDK_LIBRARIES})
|
||||
set_target_properties(obs-libfdk PROPERTIES FOLDER "plugins")
|
||||
target_link_libraries(obs-libfdk PRIVATE OBS::libobs LibFDK::LibFDK)
|
||||
|
||||
install_obs_plugin_with_data(obs-libfdk data)
|
||||
set_target_properties(obs-libfdk PROPERTIES FOLDER "plugins" PREFIX "")
|
||||
|
||||
setup_plugin_target(obs-libfdk)
|
||||
|
|
|
@ -1,200 +1,186 @@
|
|||
project(obs-outputs)
|
||||
|
||||
set(WITH_RTMPS AUTO CACHE STRING "Enable RTMPS support with mbedTLS")
|
||||
set_property(CACHE WITH_RTMPS PROPERTY STRINGS AUTO ON OFF)
|
||||
|
||||
find_package(PkgConfig)
|
||||
|
||||
option(STATIC_MBEDTLS "Statically link mbedTLS into binary" OFF)
|
||||
|
||||
if (WITH_RTMPS STREQUAL "AUTO")
|
||||
find_package(MbedTLS)
|
||||
find_package(ZLIB)
|
||||
if (NOT MBEDTLS_FOUND OR NOT ZLIB_FOUND)
|
||||
set(WITH_RTMPS "OFF")
|
||||
message(WARNING "mbedTLS or zlib was not found, RTMPS will be auto-disabled")
|
||||
endif()
|
||||
if(NOT DEFINED ENABLE_RTMPS)
|
||||
set(ENABLE_RTMPS
|
||||
AUTO
|
||||
CACHE STRING "Enable RTMPS support with mbedTLS" FORCE)
|
||||
set_property(CACHE ENABLE_RTMPS PROPERTY STRINGS AUTO ON OFF)
|
||||
endif()
|
||||
|
||||
if (WITH_RTMPS)
|
||||
find_package(MbedTLS REQUIRED)
|
||||
find_package(ZLIB REQUIRED)
|
||||
add_definitions(-DCRYPTO -DUSE_MBEDTLS)
|
||||
include_directories(${MBEDTLS_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS})
|
||||
option(ENABLE_STATIC_MBEDTLS "Enable statically linking mbedTLS into binary"
|
||||
OFF)
|
||||
mark_as_advanced(ENABLE_STATIC_MBEDTLS)
|
||||
|
||||
add_library(obs-outputs MODULE)
|
||||
add_library(OBS::outputs ALIAS obs-outputs)
|
||||
|
||||
target_sources(
|
||||
obs-outputs
|
||||
PRIVATE obs-outputs.c
|
||||
obs-output-ver.h
|
||||
flv-mux.c
|
||||
flv-mux.h
|
||||
flv-output.c
|
||||
net-if.c
|
||||
net-if.h
|
||||
null-output.c
|
||||
rtmp-helpers.h
|
||||
rtmp-stream.c
|
||||
rtmp-stream.h
|
||||
rtmp-windows.c)
|
||||
|
||||
target_link_libraries(obs-outputs PRIVATE OBS::libobs)
|
||||
|
||||
set_target_properties(obs-outputs PROPERTIES FOLDER "plugins" PREFIX "")
|
||||
|
||||
if(OS_WINDOWS)
|
||||
set(MODULE_DESCRIPTION "OBS output module")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
||||
obs-outputs.rc)
|
||||
|
||||
target_sources(obs-outputs PRIVATE obs-outputs.rc)
|
||||
|
||||
if(MSVC)
|
||||
target_link_libraries(obs-outputs PRIVATE OBS::w32-pthreads)
|
||||
endif()
|
||||
|
||||
target_link_libraries(obs-outputs PRIVATE ws2_32 winmm Iphlpapi)
|
||||
endif()
|
||||
|
||||
if(ENABLE_RTMPS STREQUAL "AUTO" OR ENABLE_RTMPS STREQUAL "ON")
|
||||
find_package(MbedTLS)
|
||||
find_package(ZLIB)
|
||||
if(NOT MBEDTLS_FOUND OR NOT ZLIB_FOUND)
|
||||
if(ENABLE_RTMPS STREQUAL "ON")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"OBS: - mbedTLS or zlib not found, but required for RTMPS support."
|
||||
)
|
||||
return()
|
||||
else()
|
||||
message(
|
||||
WARNING
|
||||
"OBS: - mbedTLS or zlib was not found, RTMPS will be auto-disabled"
|
||||
)
|
||||
target_compile_definitions(obs-outputs PRIVATE NO_CRYPTO)
|
||||
endif()
|
||||
else()
|
||||
target_sources(
|
||||
obs-outputs
|
||||
PRIVATE librtmp/amf.c
|
||||
librtmp/amf.h
|
||||
librtmp/bytes.h
|
||||
librtmp/cencode.c
|
||||
librtmp/cencode.h
|
||||
librtmp/dh.h
|
||||
librtmp/dhgroups.h
|
||||
librtmp/handshake.h
|
||||
librtmp/hashswf.c
|
||||
librtmp/http.h
|
||||
librtmp/log.c
|
||||
librtmp/log.h
|
||||
librtmp/md5.c
|
||||
librtmp/md5.h
|
||||
librtmp/parseurl.c
|
||||
librtmp/rtmp.c
|
||||
librtmp/rtmp.h
|
||||
librtmp/rtmp_sys.h)
|
||||
|
||||
target_compile_definitions(obs-outputs PRIVATE USE_MBEDTLS CRYPTO)
|
||||
|
||||
target_link_libraries(obs-outputs PRIVATE Mbedtls::Mbedtls ZLIB::ZLIB)
|
||||
|
||||
if(OS_WINDOWS)
|
||||
target_link_libraries(obs-outputs PRIVATE crypt32)
|
||||
|
||||
elseif(OS_MACOS)
|
||||
find_library(FOUNDATION_FRAMEWORK Foundation)
|
||||
find_library(SECURITY_FRAMEWORK Security)
|
||||
mark_as_advanced(FOUNDATION_FRAMEWORK SECURITY_FRAMEWORK)
|
||||
|
||||
target_link_libraries(obs-outputs PRIVATE ${FOUNDATION_FRAMEWORK}
|
||||
${SECURITY_FRAMEWORK})
|
||||
set_target_properties(obs-outputs PROPERTIES CXX_VISIBILITY_PRESET hidden)
|
||||
|
||||
elseif(OS_POSIX)
|
||||
set_target_properties(obs-outputs PROPERTIES CXX_VISIBILITY_PRESET hidden)
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
add_definitions(-DNO_CRYPTO)
|
||||
target_compile_definitions(obs-outputs PRIVATE NO_CRYPTO)
|
||||
endif()
|
||||
|
||||
set(COMPILE_FTL FALSE)
|
||||
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(FTL libftl)
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(FTL QUIET libftl)
|
||||
endif()
|
||||
|
||||
if (FTL_FOUND)
|
||||
find_package(Libcurl REQUIRED)
|
||||
message(STATUS "Found ftl-sdk (system): ftl outputs enabled")
|
||||
|
||||
set(ftl_SOURCES ftl-stream.c)
|
||||
|
||||
include_directories(${LIBCURL_INCLUDE_DIRS} ${FTL_INCLUDE_DIRS})
|
||||
set(COMPILE_FTL TRUE)
|
||||
elseif (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ftl-sdk/CMakeLists.txt")
|
||||
find_package(Libcurl REQUIRED)
|
||||
message(STATUS "Found ftl-sdk: ftl outputs enabled")
|
||||
|
||||
add_definitions(-DFTL_STATIC_COMPILE)
|
||||
|
||||
include_directories(${LIBCURL_INCLUDE_DIRS})
|
||||
|
||||
set(ftl_SOURCES
|
||||
ftl-stream.c
|
||||
ftl-sdk/libftl/hmac/hmac.c
|
||||
ftl-sdk/libftl/hmac/sha2.c
|
||||
ftl-sdk/libftl/ftl-sdk.c
|
||||
ftl-sdk/libftl/handshake.c
|
||||
ftl-sdk/libftl/ingest.c
|
||||
ftl-sdk/libftl/ftl_helpers.c
|
||||
ftl-sdk/libftl/media.c
|
||||
ftl-sdk/libftl/gettimeofday/gettimeofday.c
|
||||
ftl-sdk/libftl/logging.c)
|
||||
set(ftl_HEADERS
|
||||
ftl-sdk/libftl/hmac/hmac.h
|
||||
ftl-sdk/libftl/hmac/sha2.h
|
||||
ftl-sdk/libftl/ftl.h
|
||||
ftl-sdk/libftl/ftl_private.h)
|
||||
set(ftl_IMPORTS
|
||||
${OBS_JANSSON_IMPORT}
|
||||
${LIBCURL_LIBRARIES})
|
||||
|
||||
if (WIN32)
|
||||
list(APPEND ftl_SOURCES
|
||||
ftl-sdk/libftl/win32/socket.c
|
||||
ftl-sdk/libftl/gettimeofday/gettimeofday.c
|
||||
ftl-sdk/libftl/win32/threads.c)
|
||||
list(APPEND ftl_HEADERS
|
||||
ftl-sdk/libftl/gettimeofday/gettimeofday.h
|
||||
ftl-sdk/libftl/win32/threads.h)
|
||||
|
||||
include_directories(ftl-sdk/libftl/win32)
|
||||
else()
|
||||
list(APPEND ftl_SOURCES
|
||||
ftl-sdk/libftl/posix/socket.c
|
||||
ftl-sdk/libftl/posix/threads.c)
|
||||
list(APPEND ftl_HEADERS
|
||||
ftl-sdk/libftl/posix/threads.h)
|
||||
|
||||
include_directories(ftl-sdk/libftl/posix)
|
||||
endif()
|
||||
|
||||
include_directories(ftl-sdk/libftl)
|
||||
|
||||
set(COMPILE_FTL TRUE)
|
||||
endif()
|
||||
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/obs-outputs-config.h.in"
|
||||
"${CMAKE_BINARY_DIR}/plugins/obs-outputs/config/obs-outputs-config.h")
|
||||
|
||||
include_directories("${CMAKE_BINARY_DIR}/plugins/obs-outputs/config")
|
||||
|
||||
if(WIN32)
|
||||
set(obs-outputs_PLATFORM_DEPS
|
||||
ws2_32
|
||||
winmm
|
||||
Iphlpapi)
|
||||
|
||||
if (WITH_RTMPS OR (WITH_RTMPS STREQUAL "AUTO"))
|
||||
SET(obs-outputs_PLATFORM_DEPS
|
||||
${obs-outputs_PLATFORM_DEPS}
|
||||
crypt32)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
set(obs-outputs_PLATFORM_DEPS
|
||||
${obs-outputs_PLATFORM_DEPS}
|
||||
w32-pthreads)
|
||||
endif()
|
||||
|
||||
if(APPLE AND (WITH_RTMPS OR (WITH_RTMPS STREQUAL "AUTO")))
|
||||
find_library(FOUNDATION_FRAMEWORK Foundation)
|
||||
find_library(SECURITY_FRAMEWORK Security)
|
||||
|
||||
set(obs-outputs_PLATFORM_DEPS
|
||||
${obs-outputs_PLATFORM_DEPS}
|
||||
${FOUNDATION_FRAMEWORK}
|
||||
${SECURITY_FRAMEWORK})
|
||||
endif()
|
||||
|
||||
set(obs-outputs_librtmp_HEADERS
|
||||
librtmp/amf.h
|
||||
librtmp/bytes.h
|
||||
librtmp/cencode.h
|
||||
librtmp/dh.h
|
||||
librtmp/dhgroups.h
|
||||
librtmp/handshake.h
|
||||
librtmp/http.h
|
||||
librtmp/log.h
|
||||
librtmp/md5.h
|
||||
librtmp/rtmp.h
|
||||
librtmp/rtmp_sys.h)
|
||||
set(obs-outputs_librtmp_SOURCES
|
||||
librtmp/amf.c
|
||||
librtmp/cencode.c
|
||||
librtmp/hashswf.c
|
||||
librtmp/log.c
|
||||
librtmp/md5.c
|
||||
librtmp/parseurl.c
|
||||
librtmp/rtmp.c)
|
||||
|
||||
if(NOT WIN32)
|
||||
set_source_files_properties(${obs-outputs_librtmp_SOURCES} PROPERTIES
|
||||
COMPILE_FLAGS "-fvisibility=hidden")
|
||||
endif()
|
||||
|
||||
set(obs-outputs_HEADERS
|
||||
"${CMAKE_BINARY_DIR}/plugins/obs-outputs/config/obs-outputs-config.h"
|
||||
obs-output-ver.h
|
||||
rtmp-helpers.h
|
||||
rtmp-stream.h
|
||||
net-if.h
|
||||
flv-mux.h)
|
||||
set(obs-outputs_SOURCES
|
||||
obs-outputs.c
|
||||
null-output.c
|
||||
rtmp-stream.c
|
||||
rtmp-windows.c
|
||||
flv-output.c
|
||||
flv-mux.c
|
||||
net-if.c)
|
||||
|
||||
if(WIN32)
|
||||
set(MODULE_DESCRIPTION "OBS output module")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in obs-outputs.rc)
|
||||
list(APPEND obs-outputs_SOURCES
|
||||
obs-outputs.rc)
|
||||
endif()
|
||||
|
||||
add_library(obs-outputs MODULE
|
||||
${ftl_SOURCES}
|
||||
${ftl_HEADERS}
|
||||
${obs-outputs_SOURCES}
|
||||
${obs-outputs_HEADERS}
|
||||
${obs-outputs_librtmp_SOURCES}
|
||||
${obs-outputs_librtmp_HEADERS})
|
||||
|
||||
if(FTL_FOUND)
|
||||
target_link_libraries(obs-outputs ${FTL_LIBRARIES})
|
||||
target_include_directories(obs-outputs PUBLIC ${FTL_INCLUDE_DIRS})
|
||||
find_package(CURL REQUIRED)
|
||||
message(STATUS "OBS: ENABLED ftl outputs (system ftl-sdk)")
|
||||
|
||||
target_sources(obs-outputs PRIVATE ftl-stream.c)
|
||||
|
||||
target_include_directories(obs-outputs PRIVATE ${FTL_INCLUDE_DIRS})
|
||||
|
||||
target_link_libraries(obs-outputs PRIVATE ${FTL_LIBRARIES} CURL::libcurl)
|
||||
|
||||
target_compile_features(obs-outputs PRIVATE c_std_11)
|
||||
|
||||
target_compile_definitions(obs-outputs PRIVATE FTL_FOUND)
|
||||
|
||||
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ftl-sdk/CMakeLists.txt")
|
||||
find_package(CURL REQUIRED)
|
||||
message(STATUS "OBS: ENABLED ftl ouputs (bundled ftl-sdk)")
|
||||
|
||||
target_compile_definitions(obs-outputs PRIVATE FTL_STATIC_COMPILE)
|
||||
|
||||
target_compile_features(obs-outputs PRIVATE c_std_11)
|
||||
|
||||
target_link_libraries(obs-outputs PRIVATE Jansson::Jansson CURL::libcurl)
|
||||
|
||||
target_sources(
|
||||
obs-outputs
|
||||
PRIVATE ftl-stream.c
|
||||
ftl-sdk/libftl/ftl.h
|
||||
ftl-sdk/libftl/ftl_private.h
|
||||
ftl-sdk/libftl/hmac/hmac.c
|
||||
ftl-sdk/libftl/hmac/hmac.h
|
||||
ftl-sdk/libftl/hmac/sha2.c
|
||||
ftl-sdk/libftl/hmac/sha2.h
|
||||
ftl-sdk/libftl/ftl-sdk.c
|
||||
ftl-sdk/libftl/handshake.c
|
||||
ftl-sdk/libftl/ingest.c
|
||||
ftl-sdk/libftl/ftl_helpers.c
|
||||
ftl-sdk/libftl/media.c
|
||||
ftl-sdk/libftl/gettimeofday/gettimeofday.c
|
||||
ftl-sdk/libftl/logging.c)
|
||||
|
||||
target_include_directories(obs-outputs
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/ftl-sdk/libftl)
|
||||
|
||||
if(OS_WINDOWS)
|
||||
target_sources(
|
||||
obs-outputs
|
||||
PRIVATE ftl-sdk/libftl/gettimeofday/gettimeofday.c
|
||||
ftl-sdk/libftl/gettimeofday/gettimeofday.h
|
||||
ftl-sdk/libftl/win32/socket.c
|
||||
ftl-sdk/libftl/win32/threads.c
|
||||
ftl-sdk/libftl/win32/threads.h)
|
||||
|
||||
target_include_directories(
|
||||
obs-outputs PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/ftl-sdk/libftl/win32)
|
||||
elseif(OS_POSIX)
|
||||
target_sources(
|
||||
obs-outputs
|
||||
PRIVATE ftl-sdk/libftl/posix/socket.c ftl-sdk/libftl/posix/threads.c
|
||||
ftl-sdk/libftl/posix/threads.h)
|
||||
|
||||
target_include_directories(
|
||||
obs-outputs PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/ftl-sdk/libftl/posix)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(obs-outputs PRIVATE FTL_FOUND)
|
||||
endif()
|
||||
|
||||
target_link_libraries(obs-outputs
|
||||
libobs
|
||||
${MBEDTLS_LIBRARIES}
|
||||
${ZLIB_LIBRARIES}
|
||||
${ftl_IMPORTS}
|
||||
${obs-outputs_PLATFORM_DEPS})
|
||||
set_target_properties(obs-outputs PROPERTIES FOLDER "plugins")
|
||||
|
||||
install_obs_plugin_with_data(obs-outputs data)
|
||||
setup_plugin_target(obs-outputs)
|
||||
|
|
|
@ -12,4 +12,4 @@
|
|||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#define COMPILE_FTL @COMPILE_FTL@
|
||||
#cmakedefine FTL_FOUND
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#include <obs-module.h>
|
||||
|
||||
#include "obs-outputs-config.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#include <mbedtls/threading.h>
|
||||
|
@ -17,7 +15,7 @@ MODULE_EXPORT const char *obs_module_description(void)
|
|||
extern struct obs_output_info rtmp_output_info;
|
||||
extern struct obs_output_info null_output_info;
|
||||
extern struct obs_output_info flv_output_info;
|
||||
#if COMPILE_FTL
|
||||
#if defined(FTL_FOUND)
|
||||
extern struct obs_output_info ftl_output_info;
|
||||
#endif
|
||||
|
||||
|
@ -67,7 +65,7 @@ bool obs_module_load(void)
|
|||
obs_register_output(&rtmp_output_info);
|
||||
obs_register_output(&null_output_info);
|
||||
obs_register_output(&flv_output_info);
|
||||
#if COMPILE_FTL
|
||||
#if defined(FTL_FOUND)
|
||||
obs_register_output(&ftl_output_info);
|
||||
#endif
|
||||
return true;
|
||||
|
|
|
@ -1,111 +1,129 @@
|
|||
option(ENABLE_QSV11 "Build Intel QSV11 Hardware Encoder." TRUE)
|
||||
|
||||
if(NOT ENABLE_QSV11)
|
||||
message(STATUS "NOT building Intel QSV11 Hardware Encoder.")
|
||||
return()
|
||||
message(STATUS "OBS: DISABLED obs-qsv11")
|
||||
return()
|
||||
endif()
|
||||
|
||||
project(obs-qsv11)
|
||||
|
||||
include_directories(libmfx/include/msdk/include)
|
||||
include_directories(libmfx/include)
|
||||
add_library(obs-qsv11 MODULE)
|
||||
add_library(OBS::qsv11 ALIAS obs-qsv11)
|
||||
|
||||
set(obs-qsv11_libmfx_SOURCES
|
||||
libmfx/src/main.cpp
|
||||
libmfx/src/mfx_critical_section.cpp
|
||||
libmfx/src/mfx_dispatcher.cpp
|
||||
libmfx/src/mfx_dispatcher_log.cpp
|
||||
libmfx/src/mfx_driver_store_loader.cpp
|
||||
libmfx/src/mfx_dxva2_device.cpp
|
||||
libmfx/src/mfx_function_table.cpp
|
||||
libmfx/src/mfx_library_iterator.cpp
|
||||
libmfx/src/mfx_load_dll.cpp
|
||||
libmfx/src/mfx_load_plugin.cpp
|
||||
libmfx/src/mfx_plugin_hive.cpp
|
||||
libmfx/src/mfx_win_reg_key.cpp
|
||||
)
|
||||
add_library(libmfx INTERFACE)
|
||||
add_library(OBS::libmfx ALIAS libmfx)
|
||||
|
||||
set(obs-qsv11_libmfx_HEADERS
|
||||
libmfx/include/msdk/include/mfxadapter.h
|
||||
libmfx/include/msdk/include/mfxastructures.h
|
||||
libmfx/include/msdk/include/mfxaudio.h
|
||||
libmfx/include/msdk/include/mfxaudio++.h
|
||||
libmfx/include/msdk/include/mfxcommon.h
|
||||
libmfx/include/msdk/include/mfxdefs.h
|
||||
libmfx/include/msdk/include/mfxjpeg.h
|
||||
libmfx/include/msdk/include/mfxmvc.h
|
||||
libmfx/include/msdk/include/mfxplugin.h
|
||||
libmfx/include/msdk/include/mfxplugin++.h
|
||||
libmfx/include/msdk/include/mfxsession.h
|
||||
libmfx/include/msdk/include/mfxstructures.h
|
||||
libmfx/include/msdk/include/mfxvideo.h
|
||||
libmfx/include/msdk/include/mfxvideo++.h
|
||||
libmfx/include/msdk/include/mfxvstructures.h
|
||||
libmfx/include/mfx_critical_section.h
|
||||
libmfx/include/mfx_dispatcher.h
|
||||
libmfx/include/mfx_dispatcher_defs.h
|
||||
libmfx/include/mfx_dispatcher_log.h
|
||||
libmfx/include/mfx_driver_store_loader.h
|
||||
libmfx/include/mfx_dxva2_device.h
|
||||
libmfx/include/mfx_exposed_functions_list.h
|
||||
libmfx/include/mfx_library_iterator.h
|
||||
libmfx/include/mfx_load_dll.h
|
||||
libmfx/include/mfx_load_plugin.h
|
||||
libmfx/include/mfx_plugin_hive.h
|
||||
libmfx/include/mfx_vector.h
|
||||
libmfx/include/mfx_win_reg_key.h
|
||||
libmfx/include/mfxaudio_exposed_functions_list.h
|
||||
)
|
||||
target_sources(
|
||||
libmfx
|
||||
INTERFACE libmfx/src/main.cpp
|
||||
libmfx/src/mfx_critical_section.cpp
|
||||
libmfx/src/mfx_dispatcher.cpp
|
||||
libmfx/src/mfx_dispatcher_log.cpp
|
||||
libmfx/src/mfx_driver_store_loader.cpp
|
||||
libmfx/src/mfx_dxva2_device.cpp
|
||||
libmfx/src/mfx_function_table.cpp
|
||||
libmfx/src/mfx_library_iterator.cpp
|
||||
libmfx/src/mfx_load_dll.cpp
|
||||
libmfx/src/mfx_load_plugin.cpp
|
||||
libmfx/src/mfx_plugin_hive.cpp
|
||||
libmfx/src/mfx_win_reg_key.cpp
|
||||
libmfx/include/msdk/include/mfxadapter.h
|
||||
libmfx/include/msdk/include/mfxastructures.h
|
||||
libmfx/include/msdk/include/mfxaudio.h
|
||||
libmfx/include/msdk/include/mfxaudio++.h
|
||||
libmfx/include/msdk/include/mfxcommon.h
|
||||
libmfx/include/msdk/include/mfxdefs.h
|
||||
libmfx/include/msdk/include/mfxjpeg.h
|
||||
libmfx/include/msdk/include/mfxmvc.h
|
||||
libmfx/include/msdk/include/mfxplugin.h
|
||||
libmfx/include/msdk/include/mfxplugin++.h
|
||||
libmfx/include/msdk/include/mfxsession.h
|
||||
libmfx/include/msdk/include/mfxstructures.h
|
||||
libmfx/include/msdk/include/mfxvideo.h
|
||||
libmfx/include/msdk/include/mfxvideo++.h
|
||||
libmfx/include/msdk/include/mfxvstructures.h
|
||||
libmfx/include/mfx_critical_section.h
|
||||
libmfx/include/mfx_dispatcher.h
|
||||
libmfx/include/mfx_dispatcher_defs.h
|
||||
libmfx/include/mfx_dispatcher_log.h
|
||||
libmfx/include/mfx_driver_store_loader.h
|
||||
libmfx/include/mfx_dxva2_device.h
|
||||
libmfx/include/mfx_exposed_functions_list.h
|
||||
libmfx/include/mfx_library_iterator.h
|
||||
libmfx/include/mfx_load_dll.h
|
||||
libmfx/include/mfx_load_plugin.h
|
||||
libmfx/include/mfx_plugin_hive.h
|
||||
libmfx/include/mfx_vector.h
|
||||
libmfx/include/mfx_win_reg_key.h
|
||||
libmfx/include/mfxaudio_exposed_functions_list.h)
|
||||
|
||||
set(obs-qsv11_SOURCES
|
||||
common_directx9.cpp
|
||||
common_directx11.cpp
|
||||
common_utils.cpp
|
||||
common_utils_windows.cpp
|
||||
device_directx9.cpp
|
||||
QSV_Encoder.cpp
|
||||
QSV_Encoder_Internal.cpp
|
||||
obs-qsv11.c
|
||||
obs-qsv11-plugin-main.c)
|
||||
target_include_directories(
|
||||
libmfx INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/libmfx/include/msdk/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libmfx/include)
|
||||
|
||||
if(WIN32)
|
||||
set(MODULE_DESCRIPTION "OBS QSV encoder")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in obs-qsv11.rc)
|
||||
list(APPEND obs-qsv11_SOURCES
|
||||
obs-qsv11.rc)
|
||||
endif()
|
||||
target_sources(
|
||||
obs-qsv11
|
||||
PRIVATE obs-qsv11.c
|
||||
obs-qsv11-plugin-main.c
|
||||
common_directx9.cpp
|
||||
common_directx9.h
|
||||
common_directx11.cpp
|
||||
common_directx11.h
|
||||
common_utils.cpp
|
||||
common_utils.h
|
||||
common_utils_windows.cpp
|
||||
device_directx9.cpp
|
||||
device_directx9.h
|
||||
QSV_Encoder.cpp
|
||||
QSV_Encoder.h
|
||||
QSV_Encoder_Internal.cpp
|
||||
QSV_Encoder_Internal.h
|
||||
bits/linux_defs.h
|
||||
bits/windows_defs.h)
|
||||
|
||||
set(obs-qsv11_HEADERS
|
||||
bits/linux_defs.h
|
||||
bits/windows_defs.h
|
||||
common_directx9.h
|
||||
common_directx11.h
|
||||
device_directx9.h
|
||||
common_utils.h
|
||||
QSV_Encoder.h
|
||||
QSV_Encoder_Internal.h)
|
||||
|
||||
add_library(obs-qsv11 MODULE
|
||||
${obs-qsv11_SOURCES}
|
||||
${obs-qsv11_HEADERS}
|
||||
${obs-qsv11_libmfx_SOURCES}
|
||||
${obs-qsv11_libmfx_HEADERS}
|
||||
)
|
||||
target_link_libraries(obs-qsv11
|
||||
libobs
|
||||
d3d9
|
||||
d3d11
|
||||
dxva2
|
||||
dxgi
|
||||
dxguid
|
||||
)
|
||||
target_link_libraries(
|
||||
obs-qsv11
|
||||
PRIVATE OBS::libobs
|
||||
OBS::libmfx
|
||||
d3d9
|
||||
d3d11
|
||||
dxva2
|
||||
dxgi
|
||||
dxguid)
|
||||
|
||||
target_compile_definitions(obs-qsv11 PRIVATE DX11_D3D)
|
||||
|
||||
if(OS_WINDOWS)
|
||||
set(MODULE_DESCRIPTION "OBS QSV encoder")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
||||
obs-qsv11.rc)
|
||||
|
||||
target_sources(obs-qsv11 PRIVATE obs-qsv11.rc)
|
||||
|
||||
target_compile_definitions(
|
||||
obs-qsv11 PRIVATE UNICODE _UNICODE _CRT_SECURE_NO_WARNINGS
|
||||
_CRT_NONSTDC_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
set_target_properties(obs-qsv11 PROPERTIES FOLDER "plugins")
|
||||
|
||||
source_group("obs-qsv11\\Source Files" FILES ${obs-qsv11_SOURCES})
|
||||
source_group("obs-qsv11\\Header Files" FILES ${obs-qsv11_HEADERS})
|
||||
source_group("libmfx\\Source Files" FILES ${obs-qsv11_libmfx_SOURCES})
|
||||
source_group("libmfx\\Header Files" FILES ${obs-qsv11_libmfx_HEADERS})
|
||||
file(GLOB _OBS_QSV11_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
|
||||
file(GLOB _OBS_QSV11_HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/*.hpp)
|
||||
|
||||
install_obs_plugin_with_data(obs-qsv11 data)
|
||||
source_group("obs-qsv11\\Source Files" FILES ${_OBS_QSV11_SOURCE_FILES})
|
||||
source_group("obs-qsv11\\Header Files" FILES ${_OBS_QSV11_HEADER_FILES})
|
||||
|
||||
get_target_property(_LIBMFX_SOURCES OBS::libmfx INTERFACE_SOURCES)
|
||||
|
||||
foreach(_LIBMFX_SOURCE ${_LIBMFX_SOURCES})
|
||||
get_filename_component(_EXT ${_LIBMFX_SOURCE} EXT)
|
||||
if(${_EXT} STREQUAL "hpp" OR ${_EXT} STREQUAL "h")
|
||||
source_group("libmfx\\Header Files" FILES ${_LIBMFX_SOURCE})
|
||||
elseif(${_EXT} STREQUAL "cpp" OR ${_EXT} STREQUAL "c")
|
||||
source_group("libmfx\\Source Files" FILES ${_LIBMFX_SOURCE})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
setup_plugin_target(obs-qsv11)
|
||||
|
|
|
@ -1,25 +1,22 @@
|
|||
if (NOT WIN32)
|
||||
return()
|
||||
endif()
|
||||
|
||||
project(obs-text)
|
||||
|
||||
if(WIN32)
|
||||
set(MODULE_DESCRIPTION "OBS GDI+ text module")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in obs-text.rc)
|
||||
set(obs-text_PLATFORM_SOURCES
|
||||
gdiplus/obs-text.cpp
|
||||
obs-text.rc)
|
||||
set(obs-text_PLATFORM_DEPS
|
||||
gdiplus)
|
||||
endif()
|
||||
add_library(obs-text MODULE)
|
||||
add_library(OBS::text ALIAS obs-text)
|
||||
|
||||
target_link_libraries(obs-text PRIVATE OBS::libobs)
|
||||
|
||||
add_library(obs-text MODULE
|
||||
${obs-text_PLATFORM_SOURCES}
|
||||
${obs-text_PLATFORM_HEADERS})
|
||||
target_link_libraries(obs-text
|
||||
libobs
|
||||
${obs-text_PLATFORM_DEPS})
|
||||
set_target_properties(obs-text PROPERTIES FOLDER "plugins")
|
||||
|
||||
install_obs_plugin_with_data(obs-text data)
|
||||
set(MODULE_DESCRIPTION "OBS GDI+ text module")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
||||
obs-text.rc)
|
||||
|
||||
target_sources(obs-text PRIVATE gdiplus/obs-text.cpp obs-text.rc)
|
||||
|
||||
target_link_libraries(obs-text PRIVATE gdiplus)
|
||||
|
||||
target_compile_definitions(
|
||||
obs-text PRIVATE UNICODE _UNICODE _CRT_SECURE_NO_WARNINGS
|
||||
_CRT_NONSTDC_NO_WARNINGS)
|
||||
|
||||
setup_plugin_target(obs-text)
|
||||
|
|
|
@ -1,27 +1,30 @@
|
|||
project(obs-transitions)
|
||||
|
||||
set(obs-transitions_SOURCES
|
||||
obs-transitions.c
|
||||
transition-slide.c
|
||||
transition-swipe.c
|
||||
transition-fade.c
|
||||
transition-cut.c
|
||||
transition-fade-to-color.c
|
||||
transition-luma-wipe.c
|
||||
transition-stinger.c
|
||||
)
|
||||
add_library(obs-transitions MODULE)
|
||||
add_library(OBS::transition ALIAS obs-transitions)
|
||||
|
||||
target_sources(
|
||||
obs-transitions
|
||||
PRIVATE obs-transitions.c
|
||||
transition-slide.c
|
||||
transition-swipe.c
|
||||
transition-fade.c
|
||||
transition-cut.c
|
||||
transition-fade-to-color.c
|
||||
transition-luma-wipe.c
|
||||
transition-stinger.c)
|
||||
|
||||
target_link_libraries(obs-transitions PRIVATE OBS::libobs)
|
||||
|
||||
if(OS_WINDOWS)
|
||||
set(MODULE_DESCRIPTION "OBS Transitions module")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
||||
obs-transitions.rc)
|
||||
|
||||
target_sources(obs-transitions PRIVATE obs-transitions.rc)
|
||||
|
||||
if(WIN32)
|
||||
set(MODULE_DESCRIPTION "OBS Transitions module")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in obs-transitions.rc)
|
||||
list(APPEND obs-transitions_SOURCES
|
||||
obs-transitions.rc)
|
||||
endif()
|
||||
|
||||
add_library(obs-transitions MODULE
|
||||
${obs-transitions_SOURCES})
|
||||
target_link_libraries(obs-transitions
|
||||
libobs)
|
||||
set_target_properties(obs-transitions PROPERTIES FOLDER "plugins")
|
||||
set_target_properties(obs-transitions PROPERTIES FOLDER "plugins" PREFIX "")
|
||||
|
||||
install_obs_plugin_with_data(obs-transitions data)
|
||||
setup_plugin_target(obs-transitions)
|
||||
|
|
|
@ -1,32 +1,31 @@
|
|||
project(obs-x264)
|
||||
|
||||
find_package(Libx264 REQUIRED)
|
||||
include_directories(${LIBX264_INCLUDE_DIRS})
|
||||
add_definitions(${LIBX264_DEFINITIONS})
|
||||
|
||||
set(obs-x264_SOURCES
|
||||
obs-x264.c
|
||||
obs-x264-plugin-main.c)
|
||||
add_library(obs-x264 MODULE)
|
||||
add_library(OBS::x264 ALIAS obs-x264)
|
||||
add_executable(obs-x264-test)
|
||||
|
||||
target_sources(obs-x264-test PRIVATE obs-x264-test.c)
|
||||
|
||||
target_link_libraries(obs-x264-test PRIVATE OBS::opts-parser)
|
||||
|
||||
target_sources(obs-x264 PRIVATE obs-x264.c obs-x264-plugin-main.c)
|
||||
|
||||
target_link_libraries(obs-x264 PRIVATE LIBX264::LIBX264 OBS::opts-parser)
|
||||
|
||||
set_target_properties(obs-x264 PROPERTIES FOLDER "plugins" PREFIX "")
|
||||
|
||||
if(OS_WINDOWS)
|
||||
set(MODULE_DESCRIPTION "OBS x264 encoder")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
||||
obs-x264.rc)
|
||||
|
||||
target_sources(obs-x264 PRIVATE obs-x264.rc)
|
||||
|
||||
if(WIN32)
|
||||
set(MODULE_DESCRIPTION "OBS x264 encoder")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in obs-x264.rc)
|
||||
list(APPEND obs-x264_SOURCES
|
||||
obs-x264.rc)
|
||||
endif()
|
||||
|
||||
add_library(obs-x264 MODULE
|
||||
${obs-x264_HEADERS}
|
||||
${obs-x264_SOURCES})
|
||||
target_link_libraries(obs-x264
|
||||
libobs
|
||||
opts-parser
|
||||
${LIBX264_LIBRARIES})
|
||||
set_target_properties(obs-x264 PROPERTIES FOLDER "plugins")
|
||||
|
||||
install_obs_plugin_with_data(obs-x264 data)
|
||||
|
||||
add_executable(obs-x264-test obs-x264-test.c)
|
||||
set_target_properties(obs-x264-test PROPERTIES FOLDER "plugins")
|
||||
target_link_libraries(obs-x264-test PRIVATE libobs opts-parser)
|
||||
add_test(NAME obs-x264-test COMMAND obs-x264-test)
|
||||
|
||||
setup_plugin_target(obs-x264)
|
||||
|
|
|
@ -1,37 +1,27 @@
|
|||
project(oss-audio)
|
||||
|
||||
if(DISABLE_OSS)
|
||||
message(STATUS "OSS support disabled")
|
||||
return()
|
||||
option(ENABLE_OSS "Enable building with OSS audio support" ON)
|
||||
|
||||
if(NOT ENABLE_OSS)
|
||||
message(STATUS "OBS: DISABLED oss-audio")
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_package(OSS)
|
||||
if(NOT OSS_FOUND AND ENABLE_OSS)
|
||||
message(FATAL_ERROR "OSS not found but set as enabled")
|
||||
elseif(NOT OSS_FOUND)
|
||||
message(STATUS "OSS not found, disabling OSS plugin")
|
||||
return()
|
||||
endif()
|
||||
find_package(OSS REQUIRED)
|
||||
|
||||
configure_file(oss-platform.h.in oss-platform.h)
|
||||
add_library(oss-audio MODULE)
|
||||
add_library(OBS::oss-audio ALIAS oss-audio)
|
||||
|
||||
include_directories(
|
||||
SYSTEM "${CMAKE_SOURCE_DIR}/libobs"
|
||||
"${OSS_INCLUDE_DIR}"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}"
|
||||
)
|
||||
target_sources(oss-audio PRIVATE oss-audio.c oss-input.c)
|
||||
|
||||
set(oss-audio_SOURCES
|
||||
oss-audio.c
|
||||
oss-input.c
|
||||
)
|
||||
target_link_libraries(oss-audio PRIVATE OBS::libobs OSS::OSS)
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/oss-platform.h.in oss-platform.h)
|
||||
|
||||
target_include_directories(oss-audio PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
target_sources(oss-audio PRIVATE oss-platform.h)
|
||||
|
||||
add_library(oss-audio MODULE
|
||||
${oss-audio_SOURCES}
|
||||
)
|
||||
target_link_libraries(oss-audio
|
||||
libobs
|
||||
)
|
||||
set_target_properties(oss-audio PROPERTIES FOLDER "plugins")
|
||||
|
||||
install_obs_plugin_with_data(oss-audio data)
|
||||
setup_plugin_target(oss-audio)
|
||||
|
|
|
@ -1,63 +1,50 @@
|
|||
project(rtmp-services)
|
||||
|
||||
find_package(Libcurl REQUIRED)
|
||||
|
||||
include_directories(${LIBCURL_INCLUDE_DIRS})
|
||||
|
||||
include_directories(${OBS_JANSSON_INCLUDE_DIRS})
|
||||
|
||||
set(rtmp-services_SOURCES
|
||||
service-specific/twitch.c
|
||||
service-specific/younow.c
|
||||
service-specific/nimotv.c
|
||||
service-specific/showroom.c
|
||||
service-specific/dacast.c
|
||||
rtmp-common.c
|
||||
rtmp-custom.c
|
||||
rtmp-services-main.c)
|
||||
|
||||
if(WIN32)
|
||||
set(MODULE_DESCRIPTION "OBS RTMP Services")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in rtmp-services.rc)
|
||||
list(APPEND rtmp-services_SOURCES
|
||||
rtmp-services.rc)
|
||||
endif()
|
||||
|
||||
set(rtmp-services_HEADERS
|
||||
service-specific/twitch.h
|
||||
service-specific/younow.h
|
||||
service-specific/nimotv.h
|
||||
service-specific/showroom.h
|
||||
service-specific/dacast.h
|
||||
rtmp-format-ver.h)
|
||||
option(ENABLE_SERVICE_UPDATES "Checks for service updates" OFF)
|
||||
|
||||
set(RTMP_SERVICES_URL
|
||||
"https://obsproject.com/obs2_update/rtmp-services"
|
||||
CACHE STRING "Default services package URL")
|
||||
option(CHECK_FOR_SERVICE_UPDATES "Checks for service updates" OFF)
|
||||
"https://obsproject.com/obs2_update/rtmp-services"
|
||||
CACHE STRING "Default services package URL" FORCE)
|
||||
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/lookup-config.h.in"
|
||||
"${CMAKE_BINARY_DIR}/plugins/rtmp-services/lookup-config.h")
|
||||
mark_as_advanced(RTMP_SERVICES_URL)
|
||||
|
||||
set(rtmp-services_config_HEADERS
|
||||
"${CMAKE_BINARY_DIR}/plugins/rtmp-services/lookup-config.h")
|
||||
add_library(rtmp-services MODULE)
|
||||
add_library(OBS::rtmp-services ALIAS rtmp-services)
|
||||
|
||||
add_library(rtmp-services MODULE
|
||||
${rtmp-services_SOURCES}
|
||||
${rtmp-services_HEADERS}
|
||||
${rtmp-services_config_HEADERS})
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lookup-config.h.in
|
||||
${CMAKE_BINARY_DIR}/config/lookup-config.h)
|
||||
|
||||
target_link_libraries(rtmp-services
|
||||
libobs
|
||||
file-updater
|
||||
${OBS_JANSSON_IMPORT}
|
||||
${LIBCURL_LIBRARIES})
|
||||
target_sources(
|
||||
rtmp-services
|
||||
PRIVATE service-specific/twitch.c
|
||||
service-specific/twitch.h
|
||||
service-specific/younow.c
|
||||
service-specific/younow.h
|
||||
service-specific/nimotv.c
|
||||
service-specific/nimotv.h
|
||||
service-specific/showroom.c
|
||||
service-specific/showroom.h
|
||||
service-specific/dacast.c
|
||||
service-specific/dacast.h
|
||||
rtmp-common.c
|
||||
rtmp-custom.c
|
||||
rtmp-services-main.c
|
||||
rtmp-format-ver.h
|
||||
${CMAKE_BINARY_DIR}/config/lookup-config.h)
|
||||
|
||||
set_target_properties(rtmp-services PROPERTIES FOLDER "plugins")
|
||||
target_include_directories(rtmp-services PRIVATE ${CMAKE_BINARY_DIR}/config)
|
||||
|
||||
target_include_directories(rtmp-services
|
||||
PUBLIC
|
||||
"$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/plugins/rtmp-services>")
|
||||
target_link_libraries(rtmp-services PRIVATE OBS::libobs OBS::file-updater
|
||||
Jansson::Jansson)
|
||||
|
||||
install_obs_plugin_with_data(rtmp-services data)
|
||||
if(OS_WINDOWS)
|
||||
set(MODULE_DESCRIPTION "OBS RTMP Services")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
||||
rtmp-services.rc)
|
||||
|
||||
target_sources(rtmp-services PRIVATE rtmp-services.rc)
|
||||
endif()
|
||||
|
||||
set_target_properties(rtmp-services PROPERTIES FOLDER "plugins" PREFIX "")
|
||||
|
||||
setup_plugin_target(rtmp-services)
|
||||
|
|
|
@ -17,4 +17,4 @@
|
|||
#endif
|
||||
|
||||
#define RTMP_SERVICES_URL "@RTMP_SERVICES_URL@"
|
||||
#define CHECK_FOR_SERVICE_UPDATES @CHECK_FOR_SERVICE_UPDATES@
|
||||
#cmakedefine ENABLE_SERVICE_UPDATES
|
||||
|
|
|
@ -84,7 +84,7 @@ bool obs_module_load(void)
|
|||
proc_handler_add(ph, "void twitch_ingests_refresh(int seconds)",
|
||||
refresh_callback, NULL);
|
||||
|
||||
#if !defined(_WIN32) || CHECK_FOR_SERVICE_UPDATES
|
||||
#if !defined(_WIN32) || defined(ENABLE_SERVICE_UPDATES)
|
||||
char *local_dir = obs_module_file("");
|
||||
char *cache_dir = obs_module_config_path("");
|
||||
char update_url[128];
|
||||
|
|
|
@ -1,35 +1,20 @@
|
|||
project(sndio)
|
||||
|
||||
if(DISABLE_SNDIO)
|
||||
message(STATUS "Sndio support disabled")
|
||||
return()
|
||||
option(ENABLE_SNDIO "Build OBS with sndio support" OFF)
|
||||
if(NOT ENABLE_SNDIO)
|
||||
message(STATUS "OBS: DISABLED sndio")
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_package(Sndio)
|
||||
if(NOT Sndio_FOUND AND ENABLE_SNDIO)
|
||||
message(FATAL_ERROR "Sndio not found but set as enabled")
|
||||
elseif(NOT Sndio_FOUND)
|
||||
message(STATUS "Sndio not found, disabling Sndio plugin")
|
||||
return()
|
||||
endif()
|
||||
find_package(Sndio REQUIRED)
|
||||
|
||||
include_directories(
|
||||
SYSTEM "${CMAKE_SOURCE_DIR}/libobs" SYSTEM "${CMAKE_SOURCE_DIR}/../../libobs"
|
||||
${Sndio_INCLUDE_DIRS}
|
||||
)
|
||||
add_library(sndio MODULE)
|
||||
add_library(OBS::sndio ALIAS sndio)
|
||||
|
||||
set(sndio_SOURCES
|
||||
sndio.c
|
||||
sndio-input.c
|
||||
)
|
||||
target_sources(sndio PRIVATE sndio.c sndio-input.c)
|
||||
|
||||
target_link_libraries(sndio PRIVATE OBS::libobs Sndio::Sndio)
|
||||
|
||||
add_library(sndio MODULE
|
||||
${sndio_SOURCES}
|
||||
)
|
||||
target_link_libraries(sndio
|
||||
libobs
|
||||
${Sndio_LIBRARIES}
|
||||
)
|
||||
set_target_properties(sndio PROPERTIES FOLDER "plugins")
|
||||
|
||||
install_obs_plugin_with_data(sndio data)
|
||||
setup_plugin_target(sndio)
|
||||
|
|
|
@ -1,89 +1,49 @@
|
|||
project(text-freetype2)
|
||||
|
||||
if(DISABLE_FREETYPE)
|
||||
message(STATUS "Freetype text plugin disabled")
|
||||
return()
|
||||
option(ENABLE_FREETYPE "Enable FreeType text plugin" ON)
|
||||
|
||||
if(NOT ENABLE_FREETYPE)
|
||||
message(STATUS "OBS: DISABLED text-freetype2")
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_package(Freetype QUIET)
|
||||
if(NOT FREETYPE_FOUND AND ENABLE_FREETYPE)
|
||||
message(FATAL_ERROR "Freetype library not found but set as enabled")
|
||||
elseif(NOT FREETYPE_FOUND)
|
||||
message(STATUS "Freetype library not found, Freetype text plugin disabled")
|
||||
return()
|
||||
find_package(Freetype REQUIRED)
|
||||
|
||||
add_library(text-freetype2 MODULE)
|
||||
add_library(OBS::text-freetype2 ALIAS text-freetype2)
|
||||
|
||||
target_sources(
|
||||
text-freetype2 PRIVATE find-font.h obs-convenience.c text-functionality.c
|
||||
text-freetype2.c obs-convenience.h text-freetype2.h)
|
||||
|
||||
target_link_libraries(text-freetype2 PRIVATE OBS::libobs Freetype::Freetype)
|
||||
|
||||
set_target_properties(text-freetype2 PROPERTIES FOLDER "plugins" PREFIX "")
|
||||
|
||||
if(OS_WINDOWS)
|
||||
set(MODULE_DESCRIPTION "OBS FreeType text module")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
||||
text-freetype2.rc)
|
||||
|
||||
target_sources(text-freetype2 PRIVATE find-font.c find-font-windows.c
|
||||
text-freetype2.rc)
|
||||
|
||||
elseif(OS_MACOS)
|
||||
find_package(Iconv REQUIRED)
|
||||
find_library(COCOA Cocoa)
|
||||
mark_as_advanced(COCOA)
|
||||
|
||||
target_sources(text-freetype2 PRIVATE find-font.c find-font-cocoa.m
|
||||
find-font-iconv.c)
|
||||
|
||||
target_link_libraries(text-freetype2 PRIVATE Iconv::Iconv ${COCOA})
|
||||
|
||||
elseif(OS_POSIX)
|
||||
find_package(Fontconfig REQUIRED)
|
||||
|
||||
target_sources(text-freetype2 PRIVATE find-font-unix.c)
|
||||
|
||||
target_link_libraries(text-freetype2 PRIVATE Fontconfig::Fontconfig)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(MODULE_DESCRIPTION "OBS Freetype text module")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in text-freetype2.rc)
|
||||
set(text-freetype2_PLATFORM_SOURCES
|
||||
find-font.c
|
||||
find-font-windows.c
|
||||
text-freetype2.rc)
|
||||
elseif(APPLE)
|
||||
find_package(Iconv QUIET)
|
||||
if(NOT ICONV_FOUND AND ENABLE_FREETYPE)
|
||||
message(FATAL_ERROR "Iconv library not found but plugin set as enabled")
|
||||
elseif(NOT ICONV_FOUND)
|
||||
message(STATUS "Iconv library not found, Freetype text plugin disabled")
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_library(COCOA Cocoa)
|
||||
|
||||
set(text-freetype2_PLATFORM_SOURCES
|
||||
find-font.c
|
||||
find-font-cocoa.m
|
||||
find-font-iconv.c)
|
||||
|
||||
include_directories(${COCOA}
|
||||
${ICONV_INCLUDE_DIRS})
|
||||
|
||||
set(text-freetype2_PLATFORM_DEPS
|
||||
${COCOA}
|
||||
${ICONV_LIBRARIES})
|
||||
else()
|
||||
find_package(Fontconfig QUIET)
|
||||
if(NOT FONTCONFIG_FOUND AND ENABLE_FREETYPE)
|
||||
message(FATAL_ERROR "fontconfig not found but plugin set as enabled")
|
||||
elseif(NOT FONTCONFIG_FOUND)
|
||||
message(STATUS "fontconfig not found, Freetype text plugin disabled")
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(text-freetype2_PLATFORM_SOURCES
|
||||
find-font-unix.c)
|
||||
|
||||
include_directories(${FONTCONFIG_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
include_directories(${FREETYPE_INCLUDE_DIRS})
|
||||
|
||||
set(text-freetype2_SOURCES
|
||||
find-font.h
|
||||
obs-convenience.c
|
||||
text-functionality.c
|
||||
text-freetype2.c
|
||||
obs-convenience.h
|
||||
text-freetype2.h)
|
||||
|
||||
add_library(text-freetype2 MODULE
|
||||
${text-freetype2_PLATFORM_SOURCES}
|
||||
${text-freetype2_SOURCES})
|
||||
target_link_libraries(text-freetype2
|
||||
libobs
|
||||
${text-freetype2_PLATFORM_DEPS}
|
||||
${FREETYPE_LIBRARIES})
|
||||
set_target_properties(text-freetype2 PROPERTIES FOLDER "plugins")
|
||||
|
||||
if(NOT WIN32)
|
||||
if(FONTCONFIG_FOUND)
|
||||
target_link_libraries(text-freetype2 ${FONTCONFIG_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(APPLE AND ICONV_FOUND)
|
||||
target_link_libraries(text-freetype2 ${ICONV_LIBRARIES})
|
||||
endif()
|
||||
|
||||
install_obs_plugin_with_data(text-freetype2 data)
|
||||
setup_plugin_target(text-freetype2)
|
||||
|
|
|
@ -1,51 +1,38 @@
|
|||
project(vlc-video)
|
||||
|
||||
if(DISABLE_VLC)
|
||||
message(STATUS "VLC video plugin disabled")
|
||||
return()
|
||||
option(ENABLE_VLC "Build OBS with VLC plugin support" ${OS_LINUX})
|
||||
if(NOT ENABLE_VLC)
|
||||
message(STATUS "OBS: DISABLED vlc-video")
|
||||
message(
|
||||
WARNING
|
||||
"VLC plugin supported is not enabled by default - please switch ENABLE_VLC to ON to enable this functionality."
|
||||
)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(ENABLE_VLC)
|
||||
find_package(LibVLC REQUIRED)
|
||||
else()
|
||||
find_package(LibVLC)
|
||||
if(NOT LibVLC_FOUND)
|
||||
message(STATUS "VLC video plugin disabled")
|
||||
return()
|
||||
endif()
|
||||
find_package(LibVLC REQUIRED)
|
||||
|
||||
add_library(vlc-video MODULE)
|
||||
add_library(OBS::vlc-video ALIAS vlc-video)
|
||||
|
||||
target_sources(vlc-video PRIVATE vlc-video-plugin.c vlc-video-plugin.h
|
||||
vlc-video-source.c)
|
||||
|
||||
target_link_libraries(vlc-video PRIVATE OBS::libobs VLC::LibVLC)
|
||||
|
||||
if(OS_WINDOWS)
|
||||
if(MSVC)
|
||||
target_link_libraries(vlc-video PRIVATE OBS::w32-pthreads)
|
||||
endif()
|
||||
|
||||
set(MODULE_DESCRIPTION "OBS VLC Plugin")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
||||
vlc-video.rc)
|
||||
|
||||
target_sources(vlc-video PRIVATE vlc-video.rc)
|
||||
|
||||
endif()
|
||||
|
||||
include_directories(${LIBVLC_INCLUDE_DIRS})
|
||||
add_definitions(${LIBVLC_DEFINITIONS})
|
||||
set_target_properties(vlc-video PROPERTIES FOLDER "plugins" PREFIX "")
|
||||
|
||||
if(MSVC)
|
||||
set(vlc-video_PLATFORM_DEPS
|
||||
w32-pthreads)
|
||||
endif()
|
||||
|
||||
set(vlc-video_HEADERS
|
||||
vlc-video-plugin.h
|
||||
)
|
||||
|
||||
set(vlc-video_SOURCES
|
||||
vlc-video-plugin.c
|
||||
vlc-video-source.c
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
set(MODULE_DESCRIPTION "OBS VLC module")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in vlc-video.rc)
|
||||
list(APPEND vlc-video_SOURCES
|
||||
vlc-video.rc)
|
||||
endif()
|
||||
|
||||
add_library(vlc-video MODULE
|
||||
${vlc-video_SOURCES}
|
||||
${vlc-video_HEADERS})
|
||||
# instead of linking vlc we load at runtime.
|
||||
target_link_libraries(vlc-video
|
||||
libobs
|
||||
${vlc-video_PLATFORM_DEPS})
|
||||
set_target_properties(vlc-video PROPERTIES FOLDER "plugins")
|
||||
|
||||
install_obs_plugin_with_data(vlc-video data)
|
||||
setup_plugin_target(vlc-video)
|
||||
|
|
|
@ -1,49 +1,50 @@
|
|||
project(win-capture)
|
||||
|
||||
if(MSVC)
|
||||
set(win-capture_PLATFORM_DEPS
|
||||
w32-pthreads)
|
||||
endif()
|
||||
add_library(win-capture MODULE)
|
||||
add_library(OBS::capture ALIAS win-capture)
|
||||
|
||||
set(win-capture_HEADERS
|
||||
nt-stuff.h
|
||||
obfuscate.h
|
||||
app-helpers.h
|
||||
hook-helpers.h
|
||||
inject-library.h
|
||||
cursor-capture.h
|
||||
graphics-hook-info.h
|
||||
graphics-hook-ver.h
|
||||
window-helpers.h
|
||||
dc-capture.h)
|
||||
target_sources(
|
||||
win-capture
|
||||
PRIVATE plugin-main.c
|
||||
app-helpers.c
|
||||
app-helpers.h
|
||||
cursor-capture.c
|
||||
cursor-capture.h
|
||||
dc-capture.c
|
||||
dc-capture.h
|
||||
duplicator-monitor-capture.c
|
||||
game-capture.c
|
||||
game-capture-file-init.c
|
||||
graphics-hook-info.h
|
||||
graphics-hook-ver.h
|
||||
hook-helpers.h
|
||||
inject-library.c
|
||||
inject-library.h
|
||||
load-graphics-offsets.c
|
||||
monitor-capture.c
|
||||
nt-stuff.c
|
||||
nt-stuff.h
|
||||
obfuscate.c
|
||||
obfuscate.h
|
||||
window-capture.c
|
||||
window-helpers.c
|
||||
window-helpers.h)
|
||||
|
||||
set(win-capture_SOURCES
|
||||
dc-capture.c
|
||||
obfuscate.c
|
||||
app-helpers.c
|
||||
inject-library.c
|
||||
cursor-capture.c
|
||||
game-capture.c
|
||||
window-helpers.c
|
||||
monitor-capture.c
|
||||
window-capture.c
|
||||
load-graphics-offsets.c
|
||||
game-capture-file-init.c
|
||||
duplicator-monitor-capture.c
|
||||
plugin-main.c
|
||||
nt-stuff.c)
|
||||
target_link_libraries(win-capture PRIVATE OBS::libobs OBS::ipc-util Dwmapi)
|
||||
|
||||
add_library(win-capture MODULE
|
||||
${win-capture_SOURCES}
|
||||
${win-capture_HEADERS})
|
||||
target_link_libraries(win-capture
|
||||
${win-capture_PLATFORM_DEPS}
|
||||
libobs
|
||||
Dwmapi
|
||||
ipc-util)
|
||||
set_target_properties(win-capture PROPERTIES FOLDER "plugins/win-capture")
|
||||
|
||||
install_obs_plugin_with_data(win-capture data)
|
||||
if(MSVC)
|
||||
target_link_libraries(win-capture PRIVATE OBS::w32-pthreads)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(
|
||||
win-capture PRIVATE UNICODE _UNICODE _CRT_SECURE_NO_WARNINGS
|
||||
_CRT_NONSTDC_NO_WARNINGS)
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY OBS_MODULE_LIST "win-capture")
|
||||
|
||||
setup_plugin_target(win-capture)
|
||||
|
||||
add_subdirectory(graphics-hook)
|
||||
add_subdirectory(get-graphics-offsets)
|
||||
|
|
|
@ -1,39 +1,37 @@
|
|||
project(get-graphics-offsets)
|
||||
|
||||
set(get-graphics-offsets_HEADERS
|
||||
../graphics-hook-info.h
|
||||
../hook-helpers.h
|
||||
get-graphics-offsets.h)
|
||||
add_executable(get-graphics-offsets)
|
||||
|
||||
set(get-graphics-offsets_SOURCES
|
||||
get-graphics-offsets.c
|
||||
dxgi-offsets.cpp
|
||||
d3d8-offsets.cpp
|
||||
d3d9-offsets.cpp)
|
||||
target_sources(
|
||||
get-graphics-offsets
|
||||
PRIVATE get-graphics-offsets.c
|
||||
get-graphics-offsets.h
|
||||
dxgi-offsets.cpp
|
||||
d3d8-offsets.cpp
|
||||
d3d9-offsets.cpp
|
||||
../graphics-hook-info.h
|
||||
../hook-helpers.h)
|
||||
|
||||
target_include_directories(get-graphics-offsets
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
|
||||
target_link_libraries(get-graphics-offsets d3d9.lib dxgi.lib d3d11.lib)
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options($<IF:$<CONFIG:Debug>,/MTd,/MT>)
|
||||
target_compile_options(get-graphics-offsets
|
||||
PRIVATE "$<IF:$<CONFIG:Debug>,/MTd,/MT>")
|
||||
add_target_resource(
|
||||
get-graphics-offsets "$<TARGET_PDB_FILE:get-graphics-offsets>"
|
||||
"obs-plugins/win-capture/")
|
||||
endif()
|
||||
|
||||
add_executable(get-graphics-offsets
|
||||
${get-graphics-offsets_SOURCES}
|
||||
${get-graphics-offsets_HEADERS})
|
||||
set_target_properties(get-graphics-offsets PROPERTIES FOLDER
|
||||
"plugins/win-capture")
|
||||
set_target_properties(
|
||||
get-graphics-offsets
|
||||
PROPERTIES OUTPUT_NAME
|
||||
"get-graphics-offsets$<IF:$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>,64,32>"
|
||||
)
|
||||
|
||||
target_link_libraries(get-graphics-offsets
|
||||
d3d9.lib
|
||||
dxgi.lib
|
||||
d3d11.lib)
|
||||
|
||||
set_target_properties(get-graphics-offsets PROPERTIES FOLDER "plugins/win-capture")
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_output_suffix "64")
|
||||
else()
|
||||
set(_output_suffix "32")
|
||||
endif()
|
||||
|
||||
set_target_properties(get-graphics-offsets
|
||||
PROPERTIES
|
||||
OUTPUT_NAME "get-graphics-offsets${_output_suffix}")
|
||||
|
||||
install_obs_datatarget(get-graphics-offsets "obs-plugins/win-capture")
|
||||
add_target_resource(get-graphics-offsets "$<TARGET_FILE:get-graphics-offsets>"
|
||||
"obs-plugins/win-capture/")
|
||||
|
|
|
@ -1,79 +1,74 @@
|
|||
project(graphics-hook)
|
||||
|
||||
set(COMPILE_D3D12_HOOK FALSE CACHE BOOL "Compile D3D12 hook support (required windows 10 SDK)")
|
||||
|
||||
find_package(Detours REQUIRED)
|
||||
find_package(Vulkan REQUIRED)
|
||||
include_directories(${VULKAN_INCLUDE_DIR})
|
||||
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/graphics-hook-config.h.in"
|
||||
"${CMAKE_BINARY_DIR}/plugins/win-capture/graphics-hook/config/graphics-hook-config.h")
|
||||
add_library(graphics-hook MODULE)
|
||||
add_library(OBS::graphics-hook ALIAS graphics-hook)
|
||||
|
||||
target_sources(
|
||||
graphics-hook
|
||||
PRIVATE graphics-hook.c
|
||||
graphics-hook.h
|
||||
gl-capture.c
|
||||
gl-decs.h
|
||||
d3d8-capture.cpp
|
||||
d3d9-capture.cpp
|
||||
d3d9-patches.hpp
|
||||
dxgi-capture.cpp
|
||||
d3d10-capture.cpp
|
||||
d3d11-capture.cpp
|
||||
d3d12-capture.cpp
|
||||
../obfuscate.c
|
||||
../obfuscate.h
|
||||
../graphics-hook-ver.h
|
||||
../graphics-hook-info.h
|
||||
../hook-helpers.h
|
||||
graphics-hook.rc)
|
||||
|
||||
set(graphics-hook_HEADERS
|
||||
"${CMAKE_BINARY_DIR}/plugins/win-capture/graphics-hook/config/graphics-hook-config.h"
|
||||
graphics-hook.h
|
||||
../graphics-hook-ver.h
|
||||
../graphics-hook-info.h
|
||||
../hook-helpers.h
|
||||
../obfuscate.h
|
||||
gl-decs.h
|
||||
d3d9-patches.hpp)
|
||||
target_include_directories(graphics-hook PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
|
||||
set(graphics-hook_SOURCES
|
||||
graphics-hook.c
|
||||
../obfuscate.c
|
||||
gl-capture.c
|
||||
d3d8-capture.cpp
|
||||
d3d9-capture.cpp
|
||||
dxgi-capture.cpp
|
||||
d3d10-capture.cpp
|
||||
d3d11-capture.cpp
|
||||
d3d12-capture.cpp)
|
||||
target_link_libraries(graphics-hook PRIVATE OBS::ipc-util Detours::Detours
|
||||
dxguid)
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options("$<IF:$<CONFIG:Debug>,/MTd,/MT>")
|
||||
target_compile_options(graphics-hook PRIVATE "$<IF:$<CONFIG:Debug>,/MTd,/MT>")
|
||||
add_target_resource(graphics-hook "$<TARGET_PDB_FILE:graphics-hook>"
|
||||
"obs-plugins/win-capture/")
|
||||
endif()
|
||||
|
||||
if (VULKAN_FOUND)
|
||||
list(APPEND graphics-hook_SOURCES
|
||||
vulkan-capture.c)
|
||||
list(APPEND graphics-hook_HEADERS
|
||||
vulkan-capture.h)
|
||||
set_target_properties(
|
||||
graphics-hook
|
||||
PROPERTIES FOLDER "plugins/win-capture"
|
||||
OUTPUT_NAME
|
||||
"graphics-hook$<IF:$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>,64,32>")
|
||||
|
||||
target_compile_definitions(graphics-hook PRIVATE COMPILE_D3D12_HOOK)
|
||||
|
||||
if(TARGET Vulkan::Vulkan)
|
||||
target_sources(graphics-hook PRIVATE vulkan-capture.c vulkan-capture.h)
|
||||
|
||||
target_link_libraries(graphics-hook PRIVATE Vulkan::Vulkan)
|
||||
|
||||
target_compile_definitions(graphics-hook PRIVATE COMPILE_VULKAN_HOOK)
|
||||
|
||||
add_target_resource(
|
||||
graphics-hook "${CMAKE_CURRENT_SOURCE_DIR}/obs-vulkan64.json"
|
||||
"obs-plugins/win-capture/")
|
||||
add_target_resource(
|
||||
graphics-hook "${CMAKE_CURRENT_SOURCE_DIR}/obs-vulkan32.json"
|
||||
"obs-plugins/win-capture/")
|
||||
add_custom_command(
|
||||
TARGET graphics-hook
|
||||
POST_BUILD
|
||||
COMMAND
|
||||
"${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/obs-vulkan64.json"
|
||||
"${OBS_OUTPUT_DIR}/$<CONFIGURATION>/data/obs-plugins/win-capture/obs-vulkan64.json"
|
||||
COMMAND
|
||||
"${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/obs-vulkan32.json"
|
||||
"${OBS_OUTPUT_DIR}/$<CONFIGURATION>/data/obs-plugins/win-capture/obs-vulkan32.json"
|
||||
VERBATIM)
|
||||
endif()
|
||||
|
||||
add_library(graphics-hook MODULE
|
||||
graphics-hook.rc
|
||||
${graphics-hook_SOURCES}
|
||||
${graphics-hook_HEADERS})
|
||||
|
||||
target_include_directories(graphics-hook PUBLIC
|
||||
${DETOURS_INCLUDE_DIR}
|
||||
"${CMAKE_BINARY_DIR}/plugins/win-capture/graphics-hook/config")
|
||||
|
||||
target_link_libraries(graphics-hook
|
||||
dxguid
|
||||
ipc-util
|
||||
${DETOURS_LIBRARIES})
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_output_suffix "64")
|
||||
else()
|
||||
set(_output_suffix "32")
|
||||
endif()
|
||||
|
||||
set_target_properties(graphics-hook
|
||||
PROPERTIES
|
||||
FOLDER "plugins/win-capture"
|
||||
OUTPUT_NAME "graphics-hook${_output_suffix}")
|
||||
|
||||
if (VULKAN_FOUND)
|
||||
add_custom_command(TARGET graphics-hook POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/obs-vulkan64.json" "${OBS_OUTPUT_DIR}/$<CONFIGURATION>/data/obs-plugins/win-capture/obs-vulkan64.json"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/obs-vulkan32.json" "${OBS_OUTPUT_DIR}/$<CONFIGURATION>/data/obs-plugins/win-capture/obs-vulkan32.json"
|
||||
VERBATIM)
|
||||
endif()
|
||||
install_obs_datatarget(graphics-hook "obs-plugins/win-capture")
|
||||
add_target_resource(graphics-hook "$<TARGET_FILE:graphics-hook>"
|
||||
"obs-plugins/win-capture/")
|
||||
|
|
|
@ -319,7 +319,7 @@ static inline bool attempt_hook(void)
|
|||
static bool d3d12_hooked = false;
|
||||
static bool dxgi_hooked = false;
|
||||
static bool gl_hooked = false;
|
||||
#if COMPILE_VULKAN_HOOK
|
||||
#ifdef COMPILE_VULKAN_HOOK
|
||||
static bool vulkan_hooked = false;
|
||||
if (!vulkan_hooked) {
|
||||
vulkan_hooked = hook_vulkan();
|
||||
|
@ -329,7 +329,7 @@ static inline bool attempt_hook(void)
|
|||
}
|
||||
#endif //COMPILE_VULKAN_HOOK
|
||||
|
||||
#if COMPILE_D3D12_HOOK
|
||||
#ifdef COMPILE_D3D12_HOOK
|
||||
if (!d3d12_hooked) {
|
||||
d3d12_hooked = hook_d3d12();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include "graphics-hook-config.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
/* conversion from data/function pointer */
|
||||
#pragma warning(disable : 4152)
|
||||
|
@ -53,7 +51,7 @@ extern bool hook_d3d9(void);
|
|||
extern bool hook_d3d12(void);
|
||||
extern bool hook_dxgi(void);
|
||||
extern bool hook_gl(void);
|
||||
#if COMPILE_VULKAN_HOOK
|
||||
#ifdef COMPILE_VULKAN_HOOK
|
||||
extern bool hook_vulkan(void);
|
||||
#endif
|
||||
|
||||
|
@ -62,7 +60,7 @@ extern void d3d10_free(void);
|
|||
extern void d3d11_capture(void *swap, void *backbuffer);
|
||||
extern void d3d11_free(void);
|
||||
|
||||
#if COMPILE_D3D12_HOOK
|
||||
#ifdef COMPILE_D3D12_HOOK
|
||||
extern void d3d12_capture(void *swap, void *backbuffer);
|
||||
extern void d3d12_free(void);
|
||||
#endif
|
||||
|
|
|
@ -1,32 +1,24 @@
|
|||
project(inject-helper)
|
||||
|
||||
set(inject-helper_HEADERS
|
||||
../inject-library.h
|
||||
../obfuscate.h)
|
||||
add_executable(inject-helper)
|
||||
|
||||
set(inject-helper_SOURCES
|
||||
../inject-library.c
|
||||
../obfuscate.c
|
||||
inject-helper.c)
|
||||
target_sources(
|
||||
inject-helper PRIVATE inject-helper.c ../inject-library.c ../inject-library.h
|
||||
../obfuscate.c ../obfuscate.h)
|
||||
|
||||
target_include_directories(inject-helper PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options($<IF:$<CONFIG:Debug>,/MTd,/MT>)
|
||||
target_compile_options(inject-helper PRIVATE "$<IF:$<CONFIG:Debug>,/MTd,/MT>")
|
||||
add_target_resource(inject-helper "$<TARGET_PDB_FILE:inject-helper>"
|
||||
"obs-plugins/win-capture/")
|
||||
endif()
|
||||
|
||||
add_executable(inject-helper
|
||||
${inject-helper_SOURCES})
|
||||
set_target_properties(
|
||||
inject-helper
|
||||
PROPERTIES FOLDER "plugins/win-capture"
|
||||
OUTPUT_NAME
|
||||
"inject-helper$<IF:$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>,64,32>")
|
||||
|
||||
target_link_libraries(inject-helper)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_output_suffix "64")
|
||||
else()
|
||||
set(_output_suffix "32")
|
||||
endif()
|
||||
|
||||
set_target_properties(inject-helper
|
||||
PROPERTIES
|
||||
FOLDER "plugins/win-capture"
|
||||
OUTPUT_NAME "inject-helper${_output_suffix}")
|
||||
|
||||
install_obs_datatarget(inject-helper "obs-plugins/win-capture")
|
||||
add_target_resource(inject-helper "$<TARGET_FILE:inject-helper>"
|
||||
"obs-plugins/win-capture/")
|
||||
|
|
|
@ -1,152 +1,188 @@
|
|||
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libdshowcapture/dshowcapture.hpp")
|
||||
message(STATUS "libdshowcapture submodule not found! Please fetch submodules. win-dshow plugin disabled.")
|
||||
return()
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"OBS: libdshowcapture submodule not found! Please fetch submodules. win-dshow plugin disabled."
|
||||
)
|
||||
return()
|
||||
endif()
|
||||
|
||||
option(ENABLE_VIRTUALCAM "Enable building with Virtual Camera (Windows)" ON)
|
||||
|
||||
if(NOT ENABLE_VIRTUALCAM)
|
||||
message(STATUS "OBS: DISABLED Windows Virtual Camera")
|
||||
endif()
|
||||
|
||||
if(ENABLE_VIRTUALCAM AND NOT VIRTUALCAM_GUID)
|
||||
set(VIRTUALCAM_GUID
|
||||
""
|
||||
CACHE STRING "Virtual Camera GUID" FORCE)
|
||||
mark_as_advanced(VIRTUALCAM_GUID)
|
||||
endif()
|
||||
|
||||
project(win-dshow)
|
||||
|
||||
find_package(FFmpeg REQUIRED COMPONENTS avcodec avutil)
|
||||
include_directories(${FFMPEG_INCLUDE_DIRS})
|
||||
|
||||
set(win-dshow_HEADERS
|
||||
encode-dstr.hpp
|
||||
ffmpeg-decode.h)
|
||||
add_library(win-dshow MODULE)
|
||||
add_library(OBS::dshow ALIAS win-dshow)
|
||||
|
||||
target_sources(
|
||||
win-dshow PRIVATE encode-dstr.hpp win-dshow.cpp win-dshow-encoder.cpp
|
||||
dshow-plugin.cpp ffmpeg-decode.c ffmpeg-decode.h)
|
||||
|
||||
add_library(libdshowcapture INTERFACE)
|
||||
add_library(OBS::libdshowcapture ALIAS libdshowcapture)
|
||||
|
||||
target_sources(
|
||||
libdshowcapture
|
||||
INTERFACE libdshowcapture/dshowcapture.hpp
|
||||
libdshowcapture/source/capture-filter.cpp
|
||||
libdshowcapture/source/capture-filter.hpp
|
||||
libdshowcapture/source/output-filter.cpp
|
||||
libdshowcapture/source/output-filter.hpp
|
||||
libdshowcapture/source/dshowcapture.cpp
|
||||
libdshowcapture/source/dshowencode.cpp
|
||||
libdshowcapture/source/device.cpp
|
||||
libdshowcapture/source/device.hpp
|
||||
libdshowcapture/source/encoder.cpp
|
||||
libdshowcapture/source/encoder.hpp
|
||||
libdshowcapture/source/dshow-base.cpp
|
||||
libdshowcapture/source/dshow-base.hpp
|
||||
libdshowcapture/source/dshow-demux.cpp
|
||||
libdshowcapture/source/dshow-demux.hpp
|
||||
libdshowcapture/source/dshow-device-defs.hpp
|
||||
libdshowcapture/source/dshow-enum.cpp
|
||||
libdshowcapture/source/dshow-enum.hpp
|
||||
libdshowcapture/source/dshow-formats.cpp
|
||||
libdshowcapture/source/dshow-formats.hpp
|
||||
libdshowcapture/source/dshow-media-type.cpp
|
||||
libdshowcapture/source/dshow-encoded-device.cpp
|
||||
libdshowcapture/source/dshow-media-type.hpp
|
||||
libdshowcapture/source/log.cpp
|
||||
libdshowcapture/source/log.hpp
|
||||
libdshowcapture/source/external/IVideoCaptureFilter.h)
|
||||
|
||||
target_include_directories(
|
||||
libdshowcapture INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/libdshowcapture)
|
||||
|
||||
set(MODULE_DESCRIPTION "OBS DirectShow module")
|
||||
|
||||
set(VIRTUALCAM_GUID "" CACHE STRING "VirtualCam GUID")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
||||
win-dshow.rc)
|
||||
|
||||
set(VIRTUALCAM_ENABLED FALSE)
|
||||
target_sources(win-dshow PRIVATE win-dshow.rc)
|
||||
|
||||
target_compile_definitions(
|
||||
win-dshow PRIVATE UNICODE _UNICODE _CRT_SECURE_NO_WARNINGS
|
||||
_CRT_NONSTDC_NO_WARNINGS)
|
||||
|
||||
set(VIRTUALCAM_AVAILABLE OFF)
|
||||
if(VIRTUALCAM_GUID STREQUAL "")
|
||||
message(STATUS "VirtualCam GUID not set! VirtualCam disabled.")
|
||||
message(
|
||||
WARNING
|
||||
"OBS: DISABLED Windows Virtual Camera - GUID not set - specify as 'VIRTUALCAM_GUID' to enable."
|
||||
)
|
||||
else()
|
||||
set(INVALID_GUID TRUE)
|
||||
set(INVALID_GUID ON)
|
||||
|
||||
string(REPLACE "-" ";" GUID_VALS ${VIRTUALCAM_GUID})
|
||||
string(REPLACE "-" ";" GUID_VALS ${VIRTUALCAM_GUID})
|
||||
|
||||
list(LENGTH GUID_VALS GUID_VAL_COUNT)
|
||||
if(GUID_VAL_COUNT EQUAL 5)
|
||||
string(REPLACE ";" "0" GUID_HEX ${GUID_VALS})
|
||||
string(REGEX MATCH "[0-9a-fA-F]+" GUID_ACTUAL_HEX ${GUID_HEX})
|
||||
if(GUID_ACTUAL_HEX STREQUAL GUID_HEX)
|
||||
list(GET GUID_VALS 0 GUID_VALS_DATA1)
|
||||
list(GET GUID_VALS 1 GUID_VALS_DATA2)
|
||||
list(GET GUID_VALS 2 GUID_VALS_DATA3)
|
||||
list(GET GUID_VALS 3 GUID_VALS_DATA4)
|
||||
list(GET GUID_VALS 4 GUID_VALS_DATA5)
|
||||
string(LENGTH ${GUID_VALS_DATA1} GUID_VALS_DATA1_LENGTH)
|
||||
string(LENGTH ${GUID_VALS_DATA2} GUID_VALS_DATA2_LENGTH)
|
||||
string(LENGTH ${GUID_VALS_DATA3} GUID_VALS_DATA3_LENGTH)
|
||||
string(LENGTH ${GUID_VALS_DATA4} GUID_VALS_DATA4_LENGTH)
|
||||
string(LENGTH ${GUID_VALS_DATA5} GUID_VALS_DATA5_LENGTH)
|
||||
if(GUID_VALS_DATA1_LENGTH EQUAL 8 AND
|
||||
GUID_VALS_DATA2_LENGTH EQUAL 4 AND
|
||||
GUID_VALS_DATA3_LENGTH EQUAL 4 AND
|
||||
GUID_VALS_DATA4_LENGTH EQUAL 4 AND
|
||||
GUID_VALS_DATA5_LENGTH EQUAL 12)
|
||||
set(GUID_VAL01 ${GUID_VALS_DATA1})
|
||||
set(GUID_VAL02 ${GUID_VALS_DATA2})
|
||||
set(GUID_VAL03 ${GUID_VALS_DATA3})
|
||||
string(SUBSTRING ${GUID_VALS_DATA4} 0 2 GUID_VAL04)
|
||||
string(SUBSTRING ${GUID_VALS_DATA4} 2 2 GUID_VAL05)
|
||||
string(SUBSTRING ${GUID_VALS_DATA5} 0 2 GUID_VAL06)
|
||||
string(SUBSTRING ${GUID_VALS_DATA5} 2 2 GUID_VAL07)
|
||||
string(SUBSTRING ${GUID_VALS_DATA5} 4 2 GUID_VAL08)
|
||||
string(SUBSTRING ${GUID_VALS_DATA5} 6 2 GUID_VAL09)
|
||||
string(SUBSTRING ${GUID_VALS_DATA5} 8 2 GUID_VAL10)
|
||||
string(SUBSTRING ${GUID_VALS_DATA5} 10 2 GUID_VAL11)
|
||||
set(VIRTUALCAM_ENABLED TRUE)
|
||||
set(INVALID_GUID FALSE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
list(LENGTH GUID_VALS GUID_VAL_COUNT)
|
||||
if(GUID_VAL_COUNT EQUAL 5)
|
||||
string(REPLACE ";" "0" GUID_HEX ${GUID_VALS})
|
||||
string(REGEX MATCH "[0-9a-fA-F]+" GUID_ACTUAL_HEX ${GUID_HEX})
|
||||
if(GUID_ACTUAL_HEX STREQUAL GUID_HEX)
|
||||
list(GET GUID_VALS 0 GUID_VALS_DATA1)
|
||||
list(GET GUID_VALS 1 GUID_VALS_DATA2)
|
||||
list(GET GUID_VALS 2 GUID_VALS_DATA3)
|
||||
list(GET GUID_VALS 3 GUID_VALS_DATA4)
|
||||
list(GET GUID_VALS 4 GUID_VALS_DATA5)
|
||||
string(LENGTH ${GUID_VALS_DATA1} GUID_VALS_DATA1_LENGTH)
|
||||
string(LENGTH ${GUID_VALS_DATA2} GUID_VALS_DATA2_LENGTH)
|
||||
string(LENGTH ${GUID_VALS_DATA3} GUID_VALS_DATA3_LENGTH)
|
||||
string(LENGTH ${GUID_VALS_DATA4} GUID_VALS_DATA4_LENGTH)
|
||||
string(LENGTH ${GUID_VALS_DATA5} GUID_VALS_DATA5_LENGTH)
|
||||
if(GUID_VALS_DATA1_LENGTH EQUAL 8
|
||||
AND GUID_VALS_DATA2_LENGTH EQUAL 4
|
||||
AND GUID_VALS_DATA3_LENGTH EQUAL 4
|
||||
AND GUID_VALS_DATA4_LENGTH EQUAL 4
|
||||
AND GUID_VALS_DATA5_LENGTH EQUAL 12)
|
||||
set(GUID_VAL01 ${GUID_VALS_DATA1})
|
||||
set(GUID_VAL02 ${GUID_VALS_DATA2})
|
||||
set(GUID_VAL03 ${GUID_VALS_DATA3})
|
||||
string(SUBSTRING ${GUID_VALS_DATA4} 0 2 GUID_VAL04)
|
||||
string(SUBSTRING ${GUID_VALS_DATA4} 2 2 GUID_VAL05)
|
||||
string(SUBSTRING ${GUID_VALS_DATA5} 0 2 GUID_VAL06)
|
||||
string(SUBSTRING ${GUID_VALS_DATA5} 2 2 GUID_VAL07)
|
||||
string(SUBSTRING ${GUID_VALS_DATA5} 4 2 GUID_VAL08)
|
||||
string(SUBSTRING ${GUID_VALS_DATA5} 6 2 GUID_VAL09)
|
||||
string(SUBSTRING ${GUID_VALS_DATA5} 8 2 GUID_VAL10)
|
||||
string(SUBSTRING ${GUID_VALS_DATA5} 10 2 GUID_VAL11)
|
||||
set(VIRTUALCAM_AVAILABLE ON)
|
||||
set(INVALID_GUID OFF)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(INVALID_GUID)
|
||||
message(WARNING "Invalid VirtualCam GUID! VirtualCam disabled.")
|
||||
message(
|
||||
WARNING "OBS: DISABLED Windows Virtual Camera - invalid GUID supplied")
|
||||
endif()
|
||||
|
||||
if(VIRTUALCAM_ENABLED)
|
||||
add_definitions(-DVIRTUALCAM_ENABLED)
|
||||
endif()
|
||||
target_link_libraries(
|
||||
win-dshow
|
||||
PRIVATE OBS::libobs
|
||||
OBS::w32-pthreads
|
||||
OBS::libdshowcapture
|
||||
setupapi
|
||||
strmiids
|
||||
ksuser
|
||||
winmm
|
||||
wmcodecdspuuid
|
||||
FFmpeg::avcodec
|
||||
FFmpeg::avutil)
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in win-dshow.rc)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/virtualcam-guid.h.in ${CMAKE_CURRENT_BINARY_DIR}/virtualcam-guid.h)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
file(GLOB _LIBOBS_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/libdshowcapture/*.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libdshowcapture/*.cpp)
|
||||
file(GLOB _LIBOBS_HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/libdshowcapture/*.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libdshowcapture/*.hpp)
|
||||
|
||||
set(win-dshow_SOURCES
|
||||
win-dshow.cpp
|
||||
win-dshow-encoder.cpp
|
||||
dshow-plugin.cpp
|
||||
ffmpeg-decode.c
|
||||
win-dshow.rc)
|
||||
source_group("libdshowcapture\\Source Files" FILES ${_LIBOBS_SOURCE_FILES})
|
||||
source_group("libdshowcapture\\Header Files" FILES ${_LIBOBS_HEADER_FILES})
|
||||
|
||||
if(VIRTUALCAM_ENABLED)
|
||||
set(virtualcam-output_SOURCES
|
||||
tiny-nv12-scale.c
|
||||
shared-memory-queue.c
|
||||
virtualcam.c)
|
||||
set(virtualcam-output_HEADERS
|
||||
tiny-nv12-scale.h
|
||||
shared-memory-queue.h)
|
||||
endif()
|
||||
|
||||
set(libdshowcapture_SOURCES
|
||||
libdshowcapture/source/capture-filter.cpp
|
||||
libdshowcapture/source/output-filter.cpp
|
||||
libdshowcapture/source/dshowcapture.cpp
|
||||
libdshowcapture/source/dshowencode.cpp
|
||||
libdshowcapture/source/device.cpp
|
||||
libdshowcapture/source/encoder.cpp
|
||||
libdshowcapture/source/dshow-base.cpp
|
||||
libdshowcapture/source/dshow-demux.cpp
|
||||
libdshowcapture/source/dshow-enum.cpp
|
||||
libdshowcapture/source/dshow-formats.cpp
|
||||
libdshowcapture/source/dshow-media-type.cpp
|
||||
libdshowcapture/source/dshow-encoded-device.cpp
|
||||
libdshowcapture/source/log.cpp)
|
||||
|
||||
set(libdshowcapture_HEADERS
|
||||
libdshowcapture/dshowcapture.hpp
|
||||
libdshowcapture/source/external/IVideoCaptureFilter.h
|
||||
libdshowcapture/source/capture-filter.hpp
|
||||
libdshowcapture/source/output-filter.hpp
|
||||
libdshowcapture/source/device.hpp
|
||||
libdshowcapture/source/encoder.hpp
|
||||
libdshowcapture/source/dshow-base.hpp
|
||||
libdshowcapture/source/dshow-demux.hpp
|
||||
libdshowcapture/source/dshow-device-defs.hpp
|
||||
libdshowcapture/source/dshow-enum.hpp
|
||||
libdshowcapture/source/dshow-formats.hpp
|
||||
libdshowcapture/source/dshow-media-type.hpp
|
||||
libdshowcapture/source/log.hpp)
|
||||
|
||||
add_library(win-dshow MODULE
|
||||
${win-dshow_SOURCES}
|
||||
${win-dshow_HEADERS}
|
||||
${virtualcam-output_SOURCES}
|
||||
${virtualcam-output_HEADERS}
|
||||
${libdshowcapture_SOURCES}
|
||||
${libdshowcapture_HEADERS})
|
||||
target_link_libraries(win-dshow
|
||||
libobs
|
||||
setupapi
|
||||
strmiids
|
||||
ksuser
|
||||
winmm
|
||||
wmcodecdspuuid
|
||||
w32-pthreads
|
||||
${FFMPEG_LIBRARIES})
|
||||
set_target_properties(win-dshow PROPERTIES FOLDER "plugins/win-dshow")
|
||||
|
||||
source_group("libdshowcapture\\Source Files" FILES ${libdshowcapture_SOURCES})
|
||||
source_group("libdshowcapture\\Header Files" FILES ${libdshowcapture_HEADERS})
|
||||
setup_plugin_target(win-dshow)
|
||||
|
||||
install_obs_plugin_with_data(win-dshow data)
|
||||
if(ENABLE_VIRTUALCAM AND VIRTUALCAM_AVAILABLE)
|
||||
target_sources(
|
||||
win-dshow PRIVATE tiny-nv12-scale.c tiny-nv12-scale.h shared-memory-queue.c
|
||||
shared-memory-queue.h virtualcam.c)
|
||||
|
||||
if(VIRTUALCAM_ENABLED)
|
||||
configure_file(virtualcam-install.bat.in "${CMAKE_CURRENT_BINARY_DIR}/data/virtualcam-install.bat")
|
||||
configure_file(virtualcam-uninstall.bat.in "${CMAKE_CURRENT_BINARY_DIR}/data/virtualcam-uninstall.bat")
|
||||
install_obs_data_from_abs_path(win-dshow "${CMAKE_CURRENT_BINARY_DIR}/data" "obs-plugins/win-dshow")
|
||||
add_subdirectory(virtualcam-module)
|
||||
target_compile_definitions(win-dshow PRIVATE VIRTUALCAM_AVAILABLE)
|
||||
|
||||
target_include_directories(win-dshow
|
||||
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/config)
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/virtualcam-guid.h.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/config/virtualcam-guid.h)
|
||||
|
||||
target_sources(win-dshow
|
||||
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/config/virtualcam-guid.h)
|
||||
|
||||
configure_file(virtualcam-install.bat.in
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/virtualcam-install.bat")
|
||||
|
||||
configure_file(virtualcam-uninstall.bat.in
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/virtualcam-uninstall.bat")
|
||||
|
||||
add_target_resource(
|
||||
win-dshow "${CMAKE_CURRENT_BINARY_DIR}/virtualcam-install.bat"
|
||||
"obs-plugins/win-dshow/")
|
||||
add_target_resource(
|
||||
win-dshow "${CMAKE_CURRENT_BINARY_DIR}/virtualcam-uninstall.bat"
|
||||
"obs-plugins/win-dshow/")
|
||||
|
||||
add_subdirectory(virtualcam-module)
|
||||
endif()
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
#include <obs-module.h>
|
||||
#include <strsafe.h>
|
||||
#include <strmif.h>
|
||||
#ifdef VIRTUALCAM_AVAILABLE
|
||||
#include "virtualcam-guid.h"
|
||||
#endif
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
OBS_MODULE_USE_DEFAULT_LOCALE("win-dshow", "en-US")
|
||||
|
@ -13,7 +15,7 @@ MODULE_EXPORT const char *obs_module_description(void)
|
|||
extern void RegisterDShowSource();
|
||||
extern void RegisterDShowEncoders();
|
||||
|
||||
#ifdef VIRTUALCAM_ENABLED
|
||||
#ifdef VIRTUALCAM_AVAILABLE
|
||||
extern "C" struct obs_output_info virtualcam_info;
|
||||
|
||||
static bool vcam_installed(bool b64)
|
||||
|
@ -42,7 +44,7 @@ bool obs_module_load(void)
|
|||
{
|
||||
RegisterDShowSource();
|
||||
RegisterDShowEncoders();
|
||||
#ifdef VIRTUALCAM_ENABLED
|
||||
#ifdef VIRTUALCAM_AVAILABLE
|
||||
obs_register_output(&virtualcam_info);
|
||||
|
||||
bool installed = vcam_installed(false);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <windows.h>
|
||||
#include <initguid.h>
|
||||
|
||||
#ifdef VIRTUALCAM_ENABLED
|
||||
#ifdef VIRTUALCAM_AVAILABLE
|
||||
DEFINE_GUID(CLSID_OBS_VirtualVideo,
|
||||
0x@GUID_VAL01@,
|
||||
0x@GUID_VAL02@,
|
||||
|
|
|
@ -2,84 +2,87 @@ cmake_minimum_required(VERSION 3.5)
|
|||
project(obs-virtualcam-module)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_output_suffix "64")
|
||||
set(_output_suffix "64")
|
||||
else()
|
||||
set(_output_suffix "32")
|
||||
set(_output_suffix "32")
|
||||
endif()
|
||||
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/virtualcam-module.def.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/virtualcam-module.def")
|
||||
add_library(obs-virtualcam-module MODULE)
|
||||
add_library(OBS::virtualcam-module ALIAS obs-virtualcam-module)
|
||||
|
||||
target_sources(
|
||||
obs-virtualcam-module
|
||||
PRIVATE sleepto.c
|
||||
sleepto.h
|
||||
placeholder.cpp
|
||||
virtualcam-module.cpp
|
||||
virtualcam-filter.cpp
|
||||
virtualcam-filter.hpp
|
||||
virtualcam-module.rc
|
||||
../shared-memory-queue.c
|
||||
../shared-memory-queue.h
|
||||
../tiny-nv12-scale.c
|
||||
../tiny-nv12-scale.h)
|
||||
|
||||
target_include_directories(obs-virtualcam-module
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
|
||||
set(MODULE_DESCRIPTION "OBS Virtual Camera output module")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in virtualcam-module.rc)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR}/..)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
||||
virtualcam-module.rc)
|
||||
|
||||
set(libdshowcapture_SOURCES
|
||||
../libdshowcapture/source/log.cpp
|
||||
../libdshowcapture/source/dshow-base.cpp
|
||||
../libdshowcapture/source/dshow-enum.cpp
|
||||
../libdshowcapture/source/dshow-formats.cpp
|
||||
../libdshowcapture/source/dshow-media-type.cpp
|
||||
../libdshowcapture/source/output-filter.cpp
|
||||
)
|
||||
target_sources(obs-virtualcam-module PRIVATE virtualcam-module.rc)
|
||||
|
||||
set(libdshowcapture_HEADERS
|
||||
../libdshowcapture/source/ComPtr.hpp
|
||||
../libdshowcapture/source/CoTaskMemPtr.hpp
|
||||
../libdshowcapture/source/log.hpp
|
||||
../libdshowcapture/source/dshow-base.hpp
|
||||
../libdshowcapture/source/dshow-enum.hpp
|
||||
../libdshowcapture/source/dshow-formats.hpp
|
||||
../libdshowcapture/source/dshow-media-type.hpp
|
||||
../libdshowcapture/source/output-filter.hpp
|
||||
../libdshowcapture/dshowcapture.hpp
|
||||
)
|
||||
target_link_libraries(
|
||||
obs-virtualcam-module PRIVATE OBS::libdshowcapture setupapi winmm strmiids
|
||||
gdiplus)
|
||||
|
||||
set(obs-virtualcam-module_SOURCES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/virtualcam-module.def"
|
||||
sleepto.c
|
||||
placeholder.cpp
|
||||
virtualcam-module.cpp
|
||||
virtualcam-filter.cpp
|
||||
virtualcam-module.rc
|
||||
../shared-memory-queue.c
|
||||
../tiny-nv12-scale.c
|
||||
)
|
||||
target_link_options(obs-virtualcam-module PRIVATE "LINKER:/ignore:4104")
|
||||
|
||||
set(obs-virtualcam-module_HEADERS
|
||||
sleepto.h
|
||||
virtualcam-filter.hpp
|
||||
../shared-memory-queue.h
|
||||
../tiny-nv12-scale.h
|
||||
)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/virtualcam-module.def.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/virtualcam-module.def)
|
||||
|
||||
target_sources(obs-virtualcam-module
|
||||
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/virtualcam-module.def)
|
||||
|
||||
target_include_directories(obs-virtualcam-module
|
||||
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../config)
|
||||
|
||||
target_compile_definitions(
|
||||
obs-virtualcam-module
|
||||
PRIVATE VIRTUALCAM_AVAILABLE UNICODE _UNICODE _CRT_SECURE_NO_WARNINGS
|
||||
_CRT_NONSTDC_NO_WARNINGS)
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options("$<IF:$<CONFIG:Debug>,/MTd,/MT>")
|
||||
target_compile_options(obs-virtualcam-module
|
||||
PRIVATE "$<IF:$<CONFIG:Debug>,/MTd,/MT>")
|
||||
add_target_resource(
|
||||
obs-virtualcam-module "$<TARGET_PDB_FILE:obs-virtualcam-module>"
|
||||
"obs-plugins/win-dshow/")
|
||||
|
||||
endif()
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR}/libobs/util)
|
||||
get_target_property(_LIBDSHOW_SOURCES OBS::libdshowcapture INTERFACE_SOURCES)
|
||||
|
||||
source_group("libdshowcapture\\Source Files" FILES ${libdshowcapture_SOURCES})
|
||||
source_group("libdshowcapture\\Header Files" FILES ${libdshowcapture_HEADERS})
|
||||
foreach(_LIBDSHOW_SOURCE ${_LIBDSHOW_SOURCES})
|
||||
get_filename_component(_EXT ${_LIBDSHOW_SOURCE} EXT)
|
||||
if(${_EXT} STREQUAL "hpp" OR ${_EXT} STREQUAL "h")
|
||||
source_group("libdshowcapture\\Header Files" FILES ${_LIBDSHOW_SOURCE})
|
||||
elseif(${_EXT} STREQUAL "cpp" OR ${_EXT} STREQUAL "c")
|
||||
source_group("libdshowcapture\\Source Files" FILES ${_LIBDSHOW_SOURCE})
|
||||
endif()
|
||||
endforeach()
|
||||
unset(_LIBDSHOW_SOURCE)
|
||||
unset(_LIBDSHOW_SOURCES)
|
||||
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${MAKE_MODULE_LINKER_FLAGS} /ignore:4104")
|
||||
set_target_properties(obs-virtualcam-module PROPERTIES FOLDER
|
||||
"plugins/win-dshow")
|
||||
|
||||
add_library(obs-virtualcam-module MODULE
|
||||
${libdshowcapture_SOURCES}
|
||||
${libdshowcapture_HEADERS}
|
||||
${obs-virtualcam-module_SOURCES}
|
||||
${obs-virtualcam-module_HEADERS})
|
||||
target_link_libraries(obs-virtualcam-module
|
||||
setupapi
|
||||
winmm
|
||||
strmiids
|
||||
gdiplus
|
||||
)
|
||||
set_target_properties(obs-virtualcam-module PROPERTIES FOLDER "plugins/win-dshow")
|
||||
set_target_properties(
|
||||
obs-virtualcam-module PROPERTIES OUTPUT_NAME
|
||||
"obs-virtualcam-module${_output_suffix}")
|
||||
|
||||
set_target_properties(obs-virtualcam-module
|
||||
PROPERTIES
|
||||
OUTPUT_NAME "obs-virtualcam-module${_output_suffix}")
|
||||
install_obs_datatarget(obs-virtualcam-module "obs-plugins/win-dshow")
|
||||
add_target_resource(
|
||||
obs-virtualcam-module "$<TARGET_FILE:obs-virtualcam-module>"
|
||||
"obs-plugins/win-dshow/")
|
||||
|
|
|
@ -1,64 +1,62 @@
|
|||
project(win-ivcam)
|
||||
option(ENABLE_IVCAM "Enable building with Realsense camera support" OFF)
|
||||
|
||||
if(DISABLE_IVCAM)
|
||||
message(STATUS "Realsense camera plugin disabled")
|
||||
return()
|
||||
if(NOT ENABLE_IVCAM)
|
||||
message(STATUS "OBS: DISABLED Realsense camera plugin support")
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_package(RSSDK QUIET)
|
||||
if(NOT RSSDK_FOUND AND ENABLE_IVCAM)
|
||||
message(FATAL_ERROR "RSSDK not found, but the realsense camera plugin is set as enabled")
|
||||
elseif(NOT RSSDK_FOUND)
|
||||
message(STATUS "RSSDK not found, Realsense camera plugin disabled")
|
||||
return()
|
||||
project(win-ivcam)
|
||||
|
||||
find_package(RSSDK REQUIRED)
|
||||
|
||||
if(NOT TARGET RSS::SDK)
|
||||
message(FATAL_ERROR "OBS: - RSSDK not found")
|
||||
endif()
|
||||
|
||||
include(IDLFileHelper)
|
||||
|
||||
set(win-ivcam_seg_library_IDLS
|
||||
seg_service/seg_service.idl
|
||||
)
|
||||
add_library(win-ivcam MODULE)
|
||||
add_library(OBS::ivcam ALIAS win-ivcam)
|
||||
|
||||
add_idl_files(win-ivcam_seg_library_GENERATED_FILES
|
||||
${win-ivcam_seg_library_IDLS})
|
||||
add_library(seglibrary INTERFACE)
|
||||
add_library(Intel::seglibrary ALIAS seglibrary)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
add_idl_files(win-ivcam_seg_library_GENERATED_FILES seg_service/seg_service.idl)
|
||||
|
||||
set(win-ivcam_seg_library_HEADERS
|
||||
seg_library/Dependencies.h
|
||||
seg_library/SegImage.h
|
||||
seg_library/SegServer.h
|
||||
seg_library/SegServerImpl.h
|
||||
seg_library/SegService.h
|
||||
)
|
||||
set(win-ivcam_seg_library_SOURCES
|
||||
seg_library/SerServer.cpp
|
||||
seg_library/SegServerImpl.cpp
|
||||
seg_library/SegImage.cpp
|
||||
${win-ivcam_seg_library_GENERATED_FILES}
|
||||
)
|
||||
target_sources(
|
||||
seglibrary
|
||||
INTERFACE seg_library/Dependencies.h
|
||||
seg_library/SerServer.cpp
|
||||
seg_library/SegServer.h
|
||||
seg_library/SegServerImpl.cpp
|
||||
seg_library/SegServerImpl.h
|
||||
seg_library/SegService.h
|
||||
seg_library/SegImage.cpp
|
||||
seg_library/SegImage.h
|
||||
${win-ivcam_seg_library_GENERATED_FILES})
|
||||
|
||||
set(MODULE_DESCRIPTION "OBS Intel(R) RealSense(TM) module")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in win-ivcam.rc)
|
||||
set(win-ivcam_SOURCES
|
||||
realsense.cpp
|
||||
win-ivcam.rc)
|
||||
|
||||
source_group("seg_library\\Source Files" FILES ${win-ivcam_seg_library_SOURCES})
|
||||
source_group("seg_library\\Header Files" FILES ${win-ivcam_seg_library_HEADERS})
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
||||
win-ivcam.rc)
|
||||
|
||||
add_library(win-ivcam MODULE
|
||||
${win-ivcam_seg_library_HEADERS}
|
||||
${win-ivcam_seg_library_SOURCES}
|
||||
${win-ivcam_SOURCES}
|
||||
)
|
||||
target_link_libraries(win-ivcam
|
||||
libobs)
|
||||
target_sources(win-ivcam PRIVATE realsense.cpp win-ivcam.rc)
|
||||
|
||||
install_obs_plugin(win-ivcam)
|
||||
target_link_libraries(win-ivcam OBS::libobs Intel::seglibrary)
|
||||
|
||||
get_target_property(_SEGLIBRARY_SOURCES INTEL::seglibrary INTERFACE_SOURCES)
|
||||
|
||||
foreach(_SEGLIBRARY_SOURCE ${_SEGLIBRARY_SOURCES})
|
||||
get_filename_component(_EXT ${_SEGLIBRARY_SOURCE} EXT)
|
||||
if(${_EXT} STREQUAL "hpp" OR ${_EXT} STREQUAL "h")
|
||||
source_group("seg_library\\Header Files" FILES ${_SEGLIBRARY_SOURCE})
|
||||
elseif(${_EXT} STREQUAL "cpp" OR ${_EXT} STREQUAL "c")
|
||||
source_group("seg_library\\Source Files" FILES ${_SEGLIBRARY_SOURCE})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
add_subdirectory(seg_service)
|
||||
add_subdirectory(seg_service)
|
||||
endif()
|
||||
|
||||
setup_plugin_target(win-ivcam)
|
||||
|
|
|
@ -1,46 +1,37 @@
|
|||
project(seg_service)
|
||||
|
||||
find_package(RSSDK REQUIRED)
|
||||
|
||||
if(NOT TARGET RSS::SDK)
|
||||
message(FATAL_ERROR "OBS: - RSSDK not found")
|
||||
endif()
|
||||
|
||||
include(IDLFileHelper)
|
||||
|
||||
set(seg_service_IDLS
|
||||
seg_service.idl
|
||||
)
|
||||
add_executable(seg_service WIN32)
|
||||
|
||||
add_idl_files_with_tlb(seg_service_GENERATED_FILES
|
||||
${seg_service_IDLS})
|
||||
target_sources(
|
||||
seg_service
|
||||
PRIVATE SegProc.rgs
|
||||
seg_service.rgs
|
||||
seg_service.cpp
|
||||
SegProc.cpp
|
||||
stdafx.cpp
|
||||
seg_service.rc
|
||||
resource.h
|
||||
SegProc.h
|
||||
stdafx.h
|
||||
targetver.h
|
||||
xdlldata.h)
|
||||
|
||||
include_directories(
|
||||
${RSSDK_INCLUDE_DIRS}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
add_idl_files_with_tlb(seg_service_GENERATED_FILES seg_service.idl)
|
||||
|
||||
set(seg_service_HEADERS
|
||||
resource.h
|
||||
SegProc.h
|
||||
stdafx.h
|
||||
targetver.h
|
||||
xdlldata.h
|
||||
)
|
||||
get_target_property(_RSSSDK_INCLUDE_DIRECTORY RSS::SDK
|
||||
INTERFACE_INCLUDE_DIRECTORIES)
|
||||
|
||||
set(seg_service_SOURCES
|
||||
SegProc.rgs
|
||||
seg_service.rgs
|
||||
seg_service.cpp
|
||||
SegProc.cpp
|
||||
stdafx.cpp
|
||||
seg_service.rc
|
||||
${seg_service_GENERATED_FILES}
|
||||
)
|
||||
target_include_directories(seg_service PRIVATE ${_RSSSDK_INCLUDE_DIRECTORY})
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options($<IF:$<CONFIG:Debug>,/MTd,/MT>)
|
||||
target_compile_definitions(seg_service
|
||||
PRIVATE "$<IF:$<CONFIG:Debug>,/MTd,/MT>")
|
||||
endif()
|
||||
|
||||
add_executable(seg_service WIN32
|
||||
${seg_service_SOURCES}
|
||||
${seg_service_HEADERS})
|
||||
|
||||
target_link_libraries(seg_service
|
||||
)
|
||||
|
||||
install_obs_datatarget(seg_service "obs-plugins/win-ivcam")
|
||||
|
|
|
@ -1,64 +1,49 @@
|
|||
option(ENABLE_WINMF "Enable building with deprecated win-mf plugin" OFF)
|
||||
mark_as_advanced(ENABLE_WINMF)
|
||||
|
||||
project(win-mf)
|
||||
|
||||
set(ENABLE_WINMF FALSE CACHE BOOL "Enables the now deprecated win-mf plugin")
|
||||
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/mf-config.hpp.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/mf-config.hpp")
|
||||
|
||||
set(win-mf_config_HEADERS
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/mf-config.hpp")
|
||||
add_library(win-mf MODULE)
|
||||
add_library(OBS::win-mf ALIAS win-mf)
|
||||
|
||||
set(MODULE_DESCRIPTION "OBS Windows Media Foundations H.264/AAC encoder")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in win-mf.rc)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
||||
win-mf.rc)
|
||||
|
||||
target_sources(win-mf PRIVATE win-mf.rc)
|
||||
|
||||
if(ENABLE_WINMF)
|
||||
set(win-mf_SOURCES
|
||||
mf-plugin.cpp
|
||||
mf-aac.cpp
|
||||
mf-aac-encoder.cpp
|
||||
mf-common.cpp
|
||||
mf-encoder-descriptor.cpp
|
||||
mf-h264.cpp
|
||||
mf-h264-encoder.cpp
|
||||
win-mf.rc)
|
||||
target_sources(
|
||||
win-mf
|
||||
PRIVATE mf-plugin.cpp
|
||||
mf-aac.cpp
|
||||
mf-aac-encoder.cpp
|
||||
mf-aac-encoder.hpp
|
||||
mf-common.cpp
|
||||
mf-common.hpp
|
||||
mf-encoder-descriptor.cpp
|
||||
mf-encoder-descriptor.hpp
|
||||
mf-h264.cpp
|
||||
mf-h264-encoder.cpp
|
||||
mf-h264-encoder.hpp)
|
||||
|
||||
set(win-mf_HEADERS
|
||||
mf-common.hpp
|
||||
mf-encoder-descriptor.hpp
|
||||
mf-aac-encoder.hpp
|
||||
mf-h264-encoder.hpp)
|
||||
target_link_libraries(
|
||||
win-mf
|
||||
PRIVATE d3d9
|
||||
dxva2
|
||||
uuid
|
||||
mfplat
|
||||
mfuuid
|
||||
mf
|
||||
wmcodecdspuuid)
|
||||
|
||||
set(win-mf_DEPS
|
||||
d3d9
|
||||
dxva2
|
||||
uuid
|
||||
mfplat
|
||||
mfuuid
|
||||
mf
|
||||
wmcodecdspuuid)
|
||||
target_compile_definitions(win-mf PRIVATE ENABLE_WINMF)
|
||||
else()
|
||||
set(win-mf_SOURCES
|
||||
mf-plugin.cpp
|
||||
win-mf.rc)
|
||||
target_sources(win-mf PRIVATE mf-plugin.cpp win-mf.rc)
|
||||
endif()
|
||||
|
||||
add_library(win-mf MODULE
|
||||
${win-mf_config_HEADERS}
|
||||
${win-mf_SOURCES}
|
||||
${win-mf_HEADERS})
|
||||
|
||||
target_link_libraries(win-mf
|
||||
${win-mf_DEPS}
|
||||
libobs)
|
||||
|
||||
target_include_directories(win-mf
|
||||
PUBLIC
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")
|
||||
target_link_libraries(win-mf PRIVATE OBS::libobs)
|
||||
|
||||
set_target_properties(win-mf PROPERTIES FOLDER "plugins")
|
||||
|
||||
if(ENABLE_WINMF)
|
||||
install_obs_plugin_with_data(win-mf data)
|
||||
else()
|
||||
install_obs_plugin(win-mf)
|
||||
endif()
|
||||
setup_plugin_target(win-mf)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include <obs-module.h>
|
||||
#include "mf-config.hpp"
|
||||
|
||||
#if ENABLE_WINMF
|
||||
#ifdef ENABLE_WINMF
|
||||
#include <util/profiler.h>
|
||||
#include "mf-common.hpp"
|
||||
|
||||
|
@ -12,7 +11,7 @@ extern void RegisterMFH264Encoders();
|
|||
|
||||
extern "C" bool obs_module_load(void)
|
||||
{
|
||||
#if ENABLE_WINMF
|
||||
#ifdef ENABLE_WINMF
|
||||
MFStartup(MF_VERSION, MFSTARTUP_FULL);
|
||||
|
||||
RegisterMFAACEncoder();
|
||||
|
@ -24,7 +23,7 @@ extern "C" bool obs_module_load(void)
|
|||
|
||||
extern "C" void obs_module_unload(void)
|
||||
{
|
||||
#if ENABLE_WINMF
|
||||
#ifdef ENABLE_WINMF
|
||||
MFShutdown();
|
||||
#endif
|
||||
}
|
||||
|
@ -35,6 +34,6 @@ MODULE_EXPORT const char *obs_module_description(void)
|
|||
return "Windows Media Foundations H.264/AAC encoder";
|
||||
}
|
||||
|
||||
#if ENABLE_WINMF
|
||||
#ifdef ENABLE_WINMF
|
||||
OBS_MODULE_USE_DEFAULT_LOCALE("win-mf", "en-US")
|
||||
#endif
|
||||
|
|
|
@ -1,22 +1,20 @@
|
|||
project(win-wasapi)
|
||||
|
||||
set(win-wasapi_HEADERS
|
||||
enum-wasapi.hpp)
|
||||
add_library(win-wasapi MODULE)
|
||||
add_library(OBS::wasapi ALIAS win-wasapi)
|
||||
|
||||
target_sources(win-wasapi PRIVATE win-wasapi.cpp enum-wasapi.cpp
|
||||
enum-wasapi.hpp plugin-main.cpp)
|
||||
|
||||
set(MODULE_DESCRIPTION "OBS WASAPI module")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in win-wasapi.rc)
|
||||
set(win-wasapi_SOURCES
|
||||
win-wasapi.cpp
|
||||
enum-wasapi.cpp
|
||||
plugin-main.cpp
|
||||
win-wasapi.rc)
|
||||
|
||||
add_library(win-wasapi MODULE
|
||||
${win-wasapi_SOURCES}
|
||||
${win-wasapi_HEADERS})
|
||||
target_link_libraries(win-wasapi
|
||||
Avrt
|
||||
libobs)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
||||
win-wasapi.rc)
|
||||
|
||||
target_sources(win-wasapi PRIVATE win-wasapi.rc)
|
||||
|
||||
target_link_libraries(win-wasapi PRIVATE OBS::libobs Avrt)
|
||||
|
||||
set_target_properties(win-wasapi PROPERTIES FOLDER "plugins")
|
||||
|
||||
install_obs_plugin_with_data(win-wasapi data)
|
||||
setup_plugin_target(win-wasapi)
|
||||
|
|
Loading…
Reference in New Issue