mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
cmake: Add changes for CMake build framework 3.0
New code path only taken if OBS_CMAKE_VERSION is set to 3.0.0 or greater, old functionality remains unchanged.
This commit is contained in:
@@ -17,10 +17,7 @@ target_sources(coreaudio-encoder PRIVATE encoder.cpp)
|
||||
target_link_libraries(coreaudio-encoder PRIVATE OBS::libobs)
|
||||
|
||||
if(OS_WINDOWS)
|
||||
target_compile_definitions(coreaudio-encoder PRIVATE UNICODE _UNICODE)
|
||||
|
||||
configure_file(cmake/windows/obs-module.rc.in coreaudio-encoder.rc)
|
||||
|
||||
target_sources(coreaudio-encoder PRIVATE coreaudio-encoder.rc windows-imports.h)
|
||||
elseif(OS_MACOS)
|
||||
# cmake-format: off
|
||||
|
||||
@@ -30,19 +30,21 @@ add_subdirectory(ffmpeg-mux)
|
||||
|
||||
target_sources(
|
||||
obs-ffmpeg
|
||||
PRIVATE obs-ffmpeg.c
|
||||
obs-ffmpeg-video-encoders.c
|
||||
PRIVATE # cmake-format: sortable
|
||||
$<$<BOOL:${ENABLE_FFMPEG_LOGGING}>:obs-ffmpeg-logging.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
|
||||
$<$<BOOL:${ENABLE_FFMPEG_LOGGING}>:obs-ffmpeg-logging.c>)
|
||||
obs-ffmpeg-hls-mux.c
|
||||
obs-ffmpeg-mux.c
|
||||
obs-ffmpeg-mux.h
|
||||
obs-ffmpeg-nvenc.c
|
||||
obs-ffmpeg-output.c
|
||||
obs-ffmpeg-source.c
|
||||
obs-ffmpeg-video-encoders.c
|
||||
obs-ffmpeg.c)
|
||||
|
||||
target_compile_definitions(obs-ffmpeg PRIVATE $<$<BOOL:${ENABLE_FFMPEG_LOGGING}>:ENABLE_FFMPEG_LOGGING>)
|
||||
|
||||
target_link_libraries(
|
||||
@@ -85,21 +87,20 @@ if(OS_WINDOWS)
|
||||
find_package(AMF 1.4.29 REQUIRED)
|
||||
find_package(FFnvcodec 12 REQUIRED)
|
||||
|
||||
add_library(obs-nvenc-version INTERFACE)
|
||||
add_library(OBS::obs-nvenc-version ALIAS obs-nvenc-version)
|
||||
target_sources(obs-nvenc-version INTERFACE obs-nvenc-ver.h)
|
||||
target_include_directories(obs-nvenc-version INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
add_subdirectory(obs-amf-test)
|
||||
add_subdirectory(obs-nvenc-test)
|
||||
|
||||
target_link_libraries(obs-ffmpeg PRIVATE OBS::w32-pthreads AMF::AMF FFnvcodec::FFnvcodec ws2_32)
|
||||
target_link_libraries(obs-ffmpeg PRIVATE OBS::obs-nvenc-version OBS::w32-pthreads AMF::AMF FFnvcodec::FFnvcodec
|
||||
ws2_32)
|
||||
|
||||
configure_file(cmake/windows/obs-module.rc.in obs-ffmpeg.rc)
|
||||
target_sources(
|
||||
obs-ffmpeg
|
||||
PRIVATE texture-amf.cpp
|
||||
texture-amf-opts.hpp
|
||||
obs-nvenc.c
|
||||
obs-nvenc.h
|
||||
obs-nvenc-helpers.c
|
||||
obs-nvenc-ver.h
|
||||
obs-ffmpeg.rc)
|
||||
target_sources(obs-ffmpeg PRIVATE obs-nvenc-helpers.c obs-nvenc.c obs-nvenc.h obs-ffmpeg.rc texture-amf-opts.hpp
|
||||
texture-amf.cpp)
|
||||
elseif(OS_LINUX OR OS_FREEBSD)
|
||||
find_package(Libva REQUIRED)
|
||||
find_package(Libpci REQUIRED)
|
||||
@@ -108,4 +109,6 @@ elseif(OS_LINUX OR OS_FREEBSD)
|
||||
target_link_libraries(obs-ffmpeg PRIVATE Libva::va Libva::drm Libpci::pci)
|
||||
endif()
|
||||
|
||||
# cmake-format: off
|
||||
set_target_properties_obs(obs-ffmpeg PROPERTIES FOLDER plugins/obs-ffmpeg PREFIX "")
|
||||
# cmake-format: on
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
project(obs-amf-test)
|
||||
cmake_minimum_required(VERSION 3.24...3.25)
|
||||
|
||||
add_executable(obs-amf-test)
|
||||
legacy_check()
|
||||
|
||||
find_package(AMF 1.4.29 REQUIRED)
|
||||
|
||||
target_include_directories(obs-amf-test PRIVATE ${CMAKE_SOURCE_DIR}/libobs)
|
||||
add_executable(obs-amf-test)
|
||||
add_executable(OBS::amf-test ALIAS obs-amf-test)
|
||||
|
||||
target_sources(obs-amf-test PRIVATE obs-amf-test.cpp)
|
||||
target_link_libraries(obs-amf-test d3d11 dxgi dxguid AMF::AMF)
|
||||
target_link_libraries(obs-amf-test PRIVATE OBS::COMutils AMF::AMF d3d11 dxgi dxguid)
|
||||
|
||||
set_target_properties(obs-amf-test PROPERTIES FOLDER "plugins/obs-ffmpeg")
|
||||
|
||||
setup_binary_target(obs-amf-test)
|
||||
# cmake-format: off
|
||||
set_target_properties_obs(obs-amf-test PROPERTIES FOLDER plugins/obs-ffmpeg)
|
||||
# cmake-format: on
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
project(obs-amf-test)
|
||||
|
||||
add_executable(obs-amf-test)
|
||||
|
||||
find_package(AMF 1.4.29 REQUIRED)
|
||||
|
||||
target_include_directories(obs-amf-test PRIVATE ${CMAKE_SOURCE_DIR}/libobs)
|
||||
|
||||
target_sources(obs-amf-test PRIVATE obs-amf-test.cpp)
|
||||
target_link_libraries(obs-amf-test d3d11 dxgi dxguid AMF::AMF)
|
||||
|
||||
set_target_properties(obs-amf-test PROPERTIES FOLDER "plugins/obs-ffmpeg")
|
||||
|
||||
setup_binary_target(obs-amf-test)
|
||||
@@ -1,12 +1,14 @@
|
||||
project(obs-nvenc-test)
|
||||
cmake_minimum_required(VERSION 3.24...3.25)
|
||||
|
||||
add_executable(obs-nvenc-test)
|
||||
legacy_check()
|
||||
|
||||
find_package(FFnvcodec 12 REQUIRED)
|
||||
|
||||
target_sources(obs-nvenc-test PRIVATE obs-nvenc-test.c ../obs-nvenc-ver.h)
|
||||
target_link_libraries(obs-nvenc-test d3d11 dxgi dxguid FFnvcodec::FFnvcodec)
|
||||
add_executable(obs-nvenc-test)
|
||||
|
||||
set_target_properties(obs-nvenc-test PROPERTIES FOLDER "plugins/obs-ffmpeg")
|
||||
target_sources(obs-nvenc-test PRIVATE obs-nvenc-test.c)
|
||||
target_link_libraries(obs-nvenc-test OBS::obs-nvenc-version FFnvcodec::FFnvcodec d3d11 dxgi dxguid)
|
||||
|
||||
setup_binary_target(obs-nvenc-test)
|
||||
# cmake-format: off
|
||||
set_target_properties_obs(obs-nvenc-test PROPERTIES FOLDER plugins/obs-ffmpeg)
|
||||
# cmake-format: on
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
project(obs-nvenc-test)
|
||||
|
||||
add_executable(obs-nvenc-test)
|
||||
|
||||
find_package(FFnvcodec 12 REQUIRED)
|
||||
|
||||
target_sources(obs-nvenc-test PRIVATE obs-nvenc-test.c ../obs-nvenc-ver.h)
|
||||
target_link_libraries(obs-nvenc-test d3d11 dxgi dxguid FFnvcodec::FFnvcodec)
|
||||
|
||||
set_target_properties(obs-nvenc-test PROPERTIES FOLDER "plugins/obs-ffmpeg")
|
||||
|
||||
setup_binary_target(obs-nvenc-test)
|
||||
@@ -3,7 +3,11 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include <ffnvcodec/nvEncodeAPI.h>
|
||||
#ifdef OBS_LEGACY
|
||||
#include "../obs-nvenc-ver.h"
|
||||
#else
|
||||
#include <obs-nvenc-ver.h>
|
||||
#endif
|
||||
|
||||
#include <dxgi.h>
|
||||
#include <d3d11.h>
|
||||
|
||||
@@ -10,20 +10,21 @@ target_link_libraries(ftl-sdk INTERFACE jansson::jansson CURL::libcurl)
|
||||
|
||||
target_sources(
|
||||
ftl-sdk
|
||||
INTERFACE ftl-stream.c
|
||||
INTERFACE # cmake-format: sortable
|
||||
ftl-sdk/libftl/ftl-sdk.c
|
||||
ftl-sdk/libftl/ftl.h
|
||||
ftl-sdk/libftl/ftl_helpers.c
|
||||
ftl-sdk/libftl/ftl_private.h
|
||||
ftl-sdk/libftl/gettimeofday/gettimeofday.c
|
||||
ftl-sdk/libftl/handshake.c
|
||||
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/logging.c
|
||||
ftl-sdk/libftl/media.c
|
||||
ftl-sdk/libftl/gettimeofday/gettimeofday.c
|
||||
ftl-sdk/libftl/logging.c)
|
||||
ftl-stream.c)
|
||||
|
||||
target_include_directories(ftl-sdk INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/ftl-sdk/libftl")
|
||||
|
||||
@@ -45,29 +46,25 @@ target_link_libraries(obs-outputs PRIVATE ftl-sdk)
|
||||
target_enable_feature(obs-outputs "FTL protocol support")
|
||||
|
||||
get_target_property(target_sources ftl-sdk INTERFACE_SOURCES)
|
||||
list(
|
||||
APPEND
|
||||
silence_ftl
|
||||
-Wno-unused-parameter
|
||||
-Wno-unused-variable
|
||||
-Wno-sign-compare
|
||||
-Wno-pointer-sign
|
||||
-Wno-int-conversion)
|
||||
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL AppleClang OR CMAKE_C_COMPILER_ID STREQUAL Clang)
|
||||
list(APPEND silence_ftl -Wno-incompatible-function-pointer-types -Wno-implicit-int-conversion -Wno-shorten-64-to-32
|
||||
-Wno-macro-redefined)
|
||||
elseif(CMAKE_C_COMPILER_ID STREQUAL GNU)
|
||||
list(APPEND silence_ftl -Wno-error=extra -Wno-error=incompatible-pointer-types -Wno-error=int-conversion
|
||||
-Wno-error=builtin-macro-redefined)
|
||||
if(NOT CMAKE_C_COMPILER_ID STREQUAL "MSVC")
|
||||
set(silence_ftl -Wno-error=unused-parameter -Wno-error=unused-variable -Wno-error=sign-compare
|
||||
-Wno-error=pointer-sign -Wno-error=int-conversion)
|
||||
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "(Apple)?Clang")
|
||||
list(APPEND silence_ftl -Wno-error=incompatible-function-pointer-types -Wno-error=implicit-int-conversion
|
||||
-Wno-shorten-64-to-32 -Wno-macro-redefined)
|
||||
elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
list(APPEND silence_ftl -Wno-error=extra -Wno-error=incompatible-pointer-types -Wno-error=int-conversion
|
||||
-Wno-error=builtin-macro-redefined)
|
||||
endif()
|
||||
|
||||
if((NOT CMAKE_C_COMPILER_ID STREQUAL "GNU") OR CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10)
|
||||
list(APPEND silence_ftl -Wno-error=enum-conversion)
|
||||
endif()
|
||||
set_source_files_properties(${target_sources} PROPERTIES COMPILE_OPTIONS "${silence_ftl}")
|
||||
endif()
|
||||
|
||||
if((NOT CMAKE_C_COMPILER_ID STREQUAL GNU) OR CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10)
|
||||
list(APPEND silence_ftl -Wno-error=enum-conversion)
|
||||
endif()
|
||||
|
||||
set_source_files_properties(${target_sources} PROPERTIES COMPILE_OPTIONS "${silence_ftl}")
|
||||
|
||||
set(target_headers ${target_sources})
|
||||
list(FILTER target_sources INCLUDE REGEX ".+ftl-sdk/.+\\.(m|c[cp]?p?|swift)")
|
||||
list(FILTER target_headers INCLUDE REGEX ".+ftl-sdk/.+\\.h(pp)?")
|
||||
|
||||
@@ -1,47 +1,20 @@
|
||||
option(ENABLE_QSV11 "Build Intel QSV11 Hardware Encoder." TRUE)
|
||||
cmake_minimum_required(VERSION 3.24...3.25)
|
||||
|
||||
legacy_check()
|
||||
|
||||
option(ENABLE_QSV11 "Build Intel QSV11 Hardware Encoder." TRUE)
|
||||
if(NOT ENABLE_QSV11)
|
||||
obs_status(DISABLED "obs-qsv11")
|
||||
target_disable_feature(obs-qsv11 "Intel QSV11 Hardware Encoder")
|
||||
target_disable(obs-qsv11)
|
||||
return()
|
||||
endif()
|
||||
|
||||
project(obs-qsv11)
|
||||
|
||||
add_library(obs-qsv11 MODULE)
|
||||
add_library(OBS::qsv11 ALIAS obs-qsv11)
|
||||
|
||||
add_library(libmfx INTERFACE)
|
||||
add_library(OBS::libmfx ALIAS libmfx)
|
||||
|
||||
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
|
||||
INTERFACE # cmake-format: sortable
|
||||
libmfx/include/mfx_critical_section.h
|
||||
libmfx/include/mfx_dispatcher.h
|
||||
libmfx/include/mfx_dispatcher_defs.h
|
||||
@@ -55,30 +28,66 @@ target_sources(
|
||||
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)
|
||||
libmfx/include/mfxaudio_exposed_functions_list.h
|
||||
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/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)
|
||||
|
||||
target_include_directories(libmfx INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/libmfx/include/msdk/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libmfx/include)
|
||||
target_include_directories(libmfx INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/libmfx/include/msdk/include"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/libmfx/include")
|
||||
|
||||
add_library(obs-qsv11 MODULE)
|
||||
add_library(OBS::qsv11 ALIAS obs-qsv11)
|
||||
|
||||
target_sources(
|
||||
obs-qsv11
|
||||
PRIVATE obs-qsv11.c
|
||||
obs-qsv11-plugin-main.c
|
||||
common_directx9.cpp
|
||||
common_directx9.h
|
||||
PRIVATE # cmake-format: sortable
|
||||
bits/linux_defs.h
|
||||
bits/windows_defs.h
|
||||
common_directx11.cpp
|
||||
common_directx11.h
|
||||
common_directx9.cpp
|
||||
common_directx9.h
|
||||
common_utils.cpp
|
||||
common_utils.h
|
||||
common_utils_windows.cpp
|
||||
device_directx9.cpp
|
||||
device_directx9.h
|
||||
obs-qsv11-plugin-main.c
|
||||
obs-qsv11.c
|
||||
QSV_Encoder.cpp
|
||||
QSV_Encoder.h
|
||||
QSV_Encoder_Internal.cpp
|
||||
QSV_Encoder_Internal.h
|
||||
bits/linux_defs.h
|
||||
bits/windows_defs.h)
|
||||
QSV_Encoder_Internal.h)
|
||||
|
||||
configure_file(cmake/windows/obs-module.rc.in obs-qsv11.rc)
|
||||
target_sources(obs-qsv11 PRIVATE obs-qsv11.rc)
|
||||
|
||||
target_compile_definitions(obs-qsv11 PRIVATE DX11_D3D)
|
||||
|
||||
target_link_libraries(
|
||||
obs-qsv11
|
||||
@@ -90,36 +99,14 @@ target_link_libraries(
|
||||
dxgi
|
||||
dxguid)
|
||||
|
||||
target_compile_definitions(obs-qsv11 PRIVATE DX11_D3D)
|
||||
add_subdirectory(obs-qsv-test)
|
||||
|
||||
if(OS_WINDOWS)
|
||||
add_subdirectory(obs-qsv-test)
|
||||
# cmake-format: off
|
||||
set_target_properties_obs(obs-qsv11 PROPERTIES FOLDER plugins/obs-qsv11 PREFIX "")
|
||||
# cmake-format: on
|
||||
|
||||
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/obs-qsv11")
|
||||
|
||||
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)
|
||||
|
||||
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)
|
||||
get_target_property(target_sources libmfx SOURCES)
|
||||
list(FILTER target_sources INCLUDE REGEX ".*\\.(m|c[cp]?p?|swift)")
|
||||
list(FILTER target_headers INCLUDE REGEX ".*\\.h(pp)?")
|
||||
source_group("libmfx\\Source Files" FILES ${target_sources})
|
||||
source_group("libmfx\\Header Files" FILES ${target_headers})
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
option(ENABLE_QSV11 "Build Intel QSV11 Hardware Encoder." TRUE)
|
||||
|
||||
if(NOT ENABLE_QSV11)
|
||||
obs_status(DISABLED "obs-qsv11")
|
||||
return()
|
||||
endif()
|
||||
|
||||
project(obs-qsv11)
|
||||
|
||||
add_library(obs-qsv11 MODULE)
|
||||
add_library(OBS::qsv11 ALIAS obs-qsv11)
|
||||
|
||||
add_library(libmfx INTERFACE)
|
||||
add_library(OBS::libmfx ALIAS libmfx)
|
||||
|
||||
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)
|
||||
|
||||
target_include_directories(libmfx INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/libmfx/include/msdk/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libmfx/include)
|
||||
|
||||
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)
|
||||
|
||||
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)
|
||||
add_subdirectory(obs-qsv-test)
|
||||
|
||||
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/obs-qsv11")
|
||||
|
||||
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)
|
||||
|
||||
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)
|
||||
@@ -0,0 +1,24 @@
|
||||
1 VERSIONINFO
|
||||
FILEVERSION ${OBS_VERSION_MAJOR},${OBS_VERSION_MINOR},${OBS_VERSION_PATCH},0
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "${OBS_COMPANY_NAME}"
|
||||
VALUE "FileDescription", "OBS QSV encoder"
|
||||
VALUE "FileVersion", "${OBS_VERSION_CANONICAL}"
|
||||
VALUE "ProductName", "${OBS_PRODUCT_NAME}"
|
||||
VALUE "ProductVersion", "${OBS_VERSION_CANONICAL}"
|
||||
VALUE "Comments", "${OBS_COMMENTS}"
|
||||
VALUE "LegalCopyright", "${OBS_LEGAL_COPYRIGHT}"
|
||||
VALUE "InternalName", "obs-qsv11"
|
||||
VALUE "OriginalFilename", "obs-qsv11"
|
||||
END
|
||||
END
|
||||
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0409, 0x04B0
|
||||
END
|
||||
END
|
||||
@@ -1,11 +1,12 @@
|
||||
project(obs-qsv-test)
|
||||
cmake_minimum_required(VERSION 3.24...3.25)
|
||||
|
||||
include_directories(SYSTEM ${CMAKE_SOURCE_DIR}/libobs)
|
||||
legacy_check()
|
||||
|
||||
add_executable(obs-qsv-test)
|
||||
|
||||
target_sources(obs-qsv-test PRIVATE obs-qsv-test.cpp)
|
||||
target_link_libraries(obs-qsv-test d3d11 dxgi dxguid OBS::libmfx)
|
||||
target_link_libraries(obs-qsv-test d3d11 dxgi dxguid OBS::libmfx OBS::COMutils)
|
||||
|
||||
set_target_properties(obs-qsv-test PROPERTIES FOLDER "plugins/obs-qsv11")
|
||||
|
||||
setup_binary_target(obs-qsv-test)
|
||||
# cmake-format: off
|
||||
set_target_properties_obs(obs-qsv-test PROPERTIES FOLDER plugins/obs-qsv11 PREFIX "")
|
||||
# cmake-format: on
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
project(obs-qsv-test)
|
||||
|
||||
include_directories(SYSTEM ${CMAKE_SOURCE_DIR}/libobs)
|
||||
|
||||
add_executable(obs-qsv-test)
|
||||
target_sources(obs-qsv-test PRIVATE obs-qsv-test.cpp)
|
||||
target_link_libraries(obs-qsv-test d3d11 dxgi dxguid OBS::libmfx)
|
||||
|
||||
set_target_properties(obs-qsv-test PROPERTIES FOLDER "plugins/obs-qsv11")
|
||||
|
||||
setup_binary_target(obs-qsv-test)
|
||||
@@ -1,19 +1,16 @@
|
||||
project(obs-text)
|
||||
cmake_minimum_required(VERSION 3.24...3.25)
|
||||
|
||||
legacy_check()
|
||||
|
||||
add_library(obs-text MODULE)
|
||||
add_library(OBS::text ALIAS obs-text)
|
||||
|
||||
target_link_libraries(obs-text PRIVATE OBS::libobs)
|
||||
|
||||
set_target_properties(obs-text PROPERTIES FOLDER "plugins")
|
||||
|
||||
set(MODULE_DESCRIPTION "OBS GDI+ text module")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in obs-text.rc)
|
||||
configure_file(cmake/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_link_libraries(obs-text PRIVATE OBS::libobs gdiplus)
|
||||
|
||||
target_compile_definitions(obs-text PRIVATE UNICODE _UNICODE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS)
|
||||
|
||||
setup_plugin_target(obs-text)
|
||||
# cmake-format: off
|
||||
set_target_properties_obs(obs-text PROPERTIES FOLDER plugins PREFIX "")
|
||||
# cmake-format: on
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
project(obs-text)
|
||||
|
||||
add_library(obs-text MODULE)
|
||||
add_library(OBS::text ALIAS obs-text)
|
||||
|
||||
target_link_libraries(obs-text PRIVATE OBS::libobs)
|
||||
|
||||
set_target_properties(obs-text PROPERTIES FOLDER "plugins")
|
||||
|
||||
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)
|
||||
@@ -0,0 +1,24 @@
|
||||
1 VERSIONINFO
|
||||
FILEVERSION ${OBS_VERSION_MAJOR},${OBS_VERSION_MINOR},${OBS_VERSION_PATCH},0
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "${OBS_COMPANY_NAME}"
|
||||
VALUE "FileDescription", "OBS GDI+ text module"
|
||||
VALUE "FileVersion", "${OBS_VERSION_CANONICAL}"
|
||||
VALUE "ProductName", "${OBS_PRODUCT_NAME}"
|
||||
VALUE "ProductVersion", "${OBS_VERSION_CANONICAL}"
|
||||
VALUE "Comments", "${OBS_COMMENTS}"
|
||||
VALUE "LegalCopyright", "${OBS_LEGAL_COPYRIGHT}"
|
||||
VALUE "InternalName", "obs-text"
|
||||
VALUE "OriginalFilename", "obs-text"
|
||||
END
|
||||
END
|
||||
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0409, 0x04B0
|
||||
END
|
||||
END
|
||||
@@ -1,62 +1,87 @@
|
||||
project(win-capture)
|
||||
cmake_minimum_required(VERSION 3.24...3.25)
|
||||
|
||||
if(OBS_CMAKE_VERSION VERSION_GREATER_EQUAL 3.0.0)
|
||||
add_library(hook-config INTERFACE)
|
||||
add_library(OBS::hook-config ALIAS hook-config)
|
||||
target_sources(hook-config INTERFACE graphics-hook-ver.h graphics-hook-info.h hook-helpers.h)
|
||||
target_include_directories(hook-config INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
add_library(inject-library INTERFACE)
|
||||
add_library(OBS::inject-library ALIAS inject-library)
|
||||
target_sources(inject-library INTERFACE inject-library.c inject-library.h)
|
||||
target_include_directories(inject-library INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
add_library(d3d8-api INTERFACE)
|
||||
add_library(OBS::d3d8-api ALIAS d3d8-api)
|
||||
target_sources(d3d8-api INTERFACE d3d8-api/d3d8.h d3d8-api/d3d8caps.h d3d8-api/d3d8types.h)
|
||||
target_include_directories(d3d8-api INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/d3d8-api")
|
||||
endif()
|
||||
|
||||
legacy_check()
|
||||
|
||||
option(ENABLE_COMPAT_UPDATES "Checks for service updates" OFF)
|
||||
|
||||
set(COMPAT_URL
|
||||
"https://obsproject.com/obs2_update/win-capture"
|
||||
CACHE STRING "Default services package URL")
|
||||
|
||||
# cmake-format: off
|
||||
set(COMPAT_URL "https://obsproject.com/obs2_update/win-capture" CACHE STRING "Default services package URL")
|
||||
mark_as_advanced(COMPAT_URL)
|
||||
# cmake-format: on
|
||||
|
||||
if(NOT TARGET OBS::ipc-util)
|
||||
add_subdirectory("${CMAKE_SOURCE_DIR}/deps/ipc-util" "${CMAKE_BINARY_DIR}/deps/ipc-util")
|
||||
endif()
|
||||
|
||||
if(NOT TARGET OBS::file-updater)
|
||||
add_subdirectory("${CMAKE_SOURCE_DIR}/deps/file-updater" "${CMAKE_BINARY_DIR}/deps/file-updater")
|
||||
endif()
|
||||
|
||||
find_package(jansson REQUIRED)
|
||||
|
||||
add_library(win-capture MODULE)
|
||||
add_library(OBS::capture ALIAS win-capture)
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/compat-config.h.in ${CMAKE_BINARY_DIR}/config/compat-config.h)
|
||||
|
||||
target_sources(
|
||||
win-capture
|
||||
PRIVATE plugin-main.c
|
||||
PRIVATE # cmake-format: sortable
|
||||
app-helpers.c
|
||||
app-helpers.h
|
||||
compat-format-ver.h
|
||||
compat-helpers.c
|
||||
compat-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
|
||||
game-capture.c
|
||||
load-graphics-offsets.c
|
||||
monitor-capture.c
|
||||
nt-stuff.c
|
||||
nt-stuff.h
|
||||
window-capture.c
|
||||
compat-helpers.c
|
||||
compat-helpers.h
|
||||
compat-format-ver.h
|
||||
../../libobs/util/windows/obfuscate.c
|
||||
../../libobs/util/windows/obfuscate.h
|
||||
${CMAKE_BINARY_DIR}/config/compat-config.h)
|
||||
plugin-main.c
|
||||
window-capture.c)
|
||||
|
||||
target_link_libraries(win-capture PRIVATE OBS::libobs OBS::ipc-util OBS::file-updater Jansson::Jansson)
|
||||
target_compile_definitions(
|
||||
win-capture PRIVATE COMPAT_URL="${COMPAT_URL}" "$<$<BOOL:${ENABLE_COMPAT_UPDATES}>:ENABLE_COMPAT_UPDATES>"
|
||||
OBS_VERSION="${OBS_VERSION_CANONICAL}")
|
||||
|
||||
set_target_properties(win-capture PROPERTIES FOLDER "plugins/win-capture")
|
||||
target_link_libraries(
|
||||
win-capture
|
||||
PRIVATE OBS::file-updater
|
||||
OBS::hook-config
|
||||
OBS::inject-library
|
||||
OBS::ipc-util
|
||||
OBS::libobs
|
||||
OBS::obfuscate
|
||||
OBS::w32-pthreads
|
||||
OBS::winrt-headers
|
||||
jansson::jansson)
|
||||
|
||||
if(MSVC)
|
||||
target_link_libraries(win-capture PRIVATE OBS::w32-pthreads)
|
||||
target_link_options(win-capture PRIVATE "LINKER:/IGNORE:4098")
|
||||
endif()
|
||||
target_link_options(win-capture PRIVATE /NODEFAULTLIB:msvcrtd.lib)
|
||||
|
||||
target_compile_definitions(win-capture PRIVATE UNICODE _UNICODE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS
|
||||
OBS_VERSION="${OBS_VERSION_CANONICAL}")
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY OBS_MODULE_LIST "win-capture")
|
||||
|
||||
setup_plugin_target(win-capture)
|
||||
# cmake-format: off
|
||||
set_target_properties_obs(win-capture PROPERTIES FOLDER plugins/win-capture PREFIX "")
|
||||
# cmake-format: on
|
||||
|
||||
add_subdirectory(graphics-hook)
|
||||
add_subdirectory(get-graphics-offsets)
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
add_subdirectory(graphics-hook)
|
||||
add_subdirectory(get-graphics-offsets)
|
||||
add_subdirectory(inject-helper)
|
||||
@@ -0,0 +1,63 @@
|
||||
project(win-capture)
|
||||
|
||||
option(ENABLE_COMPAT_UPDATES "Checks for service updates" OFF)
|
||||
|
||||
set(COMPAT_URL
|
||||
"https://obsproject.com/obs2_update/win-capture"
|
||||
CACHE STRING "Default services package URL")
|
||||
|
||||
mark_as_advanced(COMPAT_URL)
|
||||
|
||||
add_library(win-capture MODULE)
|
||||
add_library(OBS::capture ALIAS win-capture)
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/compat-config.h.in ${CMAKE_BINARY_DIR}/config/compat-config.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
|
||||
window-capture.c
|
||||
compat-helpers.c
|
||||
compat-helpers.h
|
||||
compat-format-ver.h
|
||||
../../libobs/util/windows/obfuscate.c
|
||||
../../libobs/util/windows/obfuscate.h
|
||||
${CMAKE_BINARY_DIR}/config/compat-config.h)
|
||||
|
||||
target_link_libraries(win-capture PRIVATE OBS::libobs OBS::ipc-util OBS::file-updater Jansson::Jansson)
|
||||
|
||||
set_target_properties(win-capture PROPERTIES FOLDER "plugins/win-capture")
|
||||
|
||||
if(MSVC)
|
||||
target_link_libraries(win-capture PRIVATE OBS::w32-pthreads)
|
||||
target_link_options(win-capture PRIVATE "LINKER:/IGNORE:4098")
|
||||
endif()
|
||||
|
||||
target_compile_definitions(win-capture PRIVATE UNICODE _UNICODE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS
|
||||
OBS_VERSION="${OBS_VERSION_CANONICAL}")
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY OBS_MODULE_LIST "win-capture")
|
||||
|
||||
setup_plugin_target(win-capture)
|
||||
|
||||
add_subdirectory(graphics-hook)
|
||||
add_subdirectory(get-graphics-offsets)
|
||||
add_subdirectory(inject-helper)
|
||||
@@ -5,8 +5,13 @@
|
||||
#include <util/threading.h>
|
||||
|
||||
#include "cursor-capture.h"
|
||||
#ifdef OBS_LEGACY
|
||||
#include "../../libobs/util/platform.h"
|
||||
#include "../../libobs-winrt/winrt-capture.h"
|
||||
#else
|
||||
#include <util/platform.h>
|
||||
#include <winrt-capture.h>
|
||||
#endif
|
||||
|
||||
#define do_log(level, format, ...) \
|
||||
blog(level, "[duplicator-monitor-capture: '%s'] " format, \
|
||||
|
||||
@@ -1,30 +1,22 @@
|
||||
project(get-graphics-offsets)
|
||||
cmake_minimum_required(VERSION 3.24...3.25)
|
||||
|
||||
add_library(_get-graphics-offsets INTERFACE)
|
||||
target_sources(_get-graphics-offsets INTERFACE d3d8-offsets.cpp d3d9-offsets.cpp dxgi-offsets.cpp
|
||||
get-graphics-offsets.c get-graphics-offsets.h)
|
||||
|
||||
target_compile_options(_get-graphics-offsets INTERFACE $<IF:$<CONFIG:Debug>,/MTd,/MT>)
|
||||
|
||||
target_link_libraries(_get-graphics-offsets INTERFACE OBS::hook-config OBS::d3d8-api d3d9.lib dxgi.lib d3d11.lib)
|
||||
|
||||
legacy_check()
|
||||
|
||||
add_executable(get-graphics-offsets)
|
||||
target_link_libraries(get-graphics-offsets PRIVATE _get-graphics-offsets)
|
||||
|
||||
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)
|
||||
include(cmake/32bit.cmake)
|
||||
|
||||
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)
|
||||
target_compile_options(get-graphics-offsets PRIVATE "$<IF:$<CONFIG:Debug>,/MTd,/MT>")
|
||||
endif()
|
||||
|
||||
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>")
|
||||
|
||||
set(OBS_PLUGIN_DESTINATION "${OBS_DATA_DESTINATION}/obs-plugins/win-capture/")
|
||||
setup_plugin_target(get-graphics-offsets)
|
||||
# cmake-format: off
|
||||
set_target_properties_obs(get-graphics-offsets PROPERTIES FOLDER plugins/win-capture OUTPUT_NAME get-graphics-offsets64)
|
||||
# cmake-format: on
|
||||
|
||||
add_dependencies(win-capture get-graphics-offsets)
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
project(get-graphics-offsets)
|
||||
|
||||
add_executable(get-graphics-offsets)
|
||||
target_link_libraries(get-graphics-offsets PRIVATE _get-graphics-offsets)
|
||||
set_property(TARGET get-graphics-offsets PROPERTY OUTPUT_NAME get-graphics-offsets32)
|
||||
@@ -0,0 +1,5 @@
|
||||
add_custom_command(
|
||||
TARGET get-graphics-offsets
|
||||
POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_SOURCE_DIR}/build_x86 --config $<CONFIG> -t get-graphics-offsets
|
||||
COMMENT "Build 32-bit get-graphics-offsets")
|
||||
@@ -0,0 +1,33 @@
|
||||
project(get-graphics-offsets)
|
||||
|
||||
add_executable(get-graphics-offsets)
|
||||
|
||||
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}/..
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../d3d8-api)
|
||||
|
||||
target_link_libraries(get-graphics-offsets d3d9.lib dxgi.lib d3d11.lib)
|
||||
|
||||
target_compile_definitions(get-graphics-offsets PRIVATE OBS_LEGACY)
|
||||
|
||||
if(MSVC)
|
||||
target_compile_options(get-graphics-offsets PRIVATE "$<IF:$<CONFIG:Debug>,/MTd,/MT>")
|
||||
endif()
|
||||
|
||||
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>")
|
||||
|
||||
set(OBS_PLUGIN_DESTINATION "${OBS_DATA_DESTINATION}/obs-plugins/win-capture/")
|
||||
setup_plugin_target(get-graphics-offsets)
|
||||
|
||||
add_dependencies(win-capture get-graphics-offsets)
|
||||
@@ -1,6 +1,10 @@
|
||||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
#ifdef OBS_LEGACY
|
||||
#include "../d3d8-api/d3d8.h"
|
||||
#else
|
||||
#include <d3d8.h>
|
||||
#endif
|
||||
#include "get-graphics-offsets.h"
|
||||
|
||||
typedef IDirect3D8 *(WINAPI *d3d8create_t)(UINT);
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#ifdef OBS_LEGACY
|
||||
#include "../graphics-hook-info.h"
|
||||
#else
|
||||
#include <graphics-hook-info.h>
|
||||
#endif
|
||||
|
||||
#define DUMMY_WNDCLASS "get_addrs_wndclass"
|
||||
|
||||
|
||||
@@ -1,57 +1,57 @@
|
||||
project(graphics-hook)
|
||||
cmake_minimum_required(VERSION 3.24...3.25)
|
||||
|
||||
find_package(Detours REQUIRED)
|
||||
find_package(Vulkan REQUIRED)
|
||||
|
||||
if(NOT TARGET OBS::ipc-util)
|
||||
add_subdirectory("${CMAKE_SOURCE_DIR}/deps/ipc-util" "${CMAKE_BINARY_DIR}/deps/ipc-util")
|
||||
endif()
|
||||
|
||||
if(NOT TARGET OBS::obfuscate)
|
||||
add_subdirectory("${CMAKE_SOURCE_DIR}/libobs" "${CMAKE_BINARY_DIR}/libobs")
|
||||
endif()
|
||||
|
||||
add_library(_graphics-hook INTERFACE)
|
||||
|
||||
target_sources(
|
||||
_graphics-hook
|
||||
INTERFACE d3d8-capture.cpp
|
||||
d3d9-capture.cpp
|
||||
d3d9-patches.hpp
|
||||
d3d10-capture.cpp
|
||||
d3d11-capture.cpp
|
||||
d3d12-capture.cpp
|
||||
dxgi-capture.cpp
|
||||
gl-capture.c
|
||||
gl-decs.h
|
||||
graphics-hook.c
|
||||
graphics-hook.h
|
||||
graphics-hook.rc)
|
||||
|
||||
target_compile_definitions(_graphics-hook INTERFACE COMPILE_D3D12_HOOK)
|
||||
target_compile_options(_graphics-hook INTERFACE $<IF:$<CONFIG:Debug>,/MTd,/MT>)
|
||||
|
||||
target_link_libraries(_graphics-hook INTERFACE OBS::d3d8-api OBS::hook-config OBS::ipc-util OBS::obfuscate
|
||||
Detours::Detours dxguid)
|
||||
target_link_options(_graphics-hook INTERFACE /IGNORE:4099)
|
||||
|
||||
if(TARGET Vulkan::Vulkan)
|
||||
target_sources(_graphics-hook INTERFACE vulkan-capture.c vulkan-capture.h)
|
||||
target_link_libraries(_graphics-hook INTERFACE Vulkan::Vulkan)
|
||||
target_compile_definitions(_graphics-hook INTERFACE COMPILE_VULKAN_HOOK)
|
||||
endif()
|
||||
|
||||
legacy_check()
|
||||
|
||||
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
|
||||
../../../libobs/util/windows/obfuscate.c
|
||||
../../../libobs/util/windows/obfuscate.h
|
||||
../graphics-hook-ver.h
|
||||
../graphics-hook-info.h
|
||||
../hook-helpers.h
|
||||
graphics-hook.rc)
|
||||
target_link_libraries(graphics-hook PRIVATE _graphics-hook)
|
||||
|
||||
target_include_directories(graphics-hook PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
include(cmake/32bit.cmake)
|
||||
|
||||
target_link_libraries(graphics-hook PRIVATE OBS::ipc-util Detours::Detours dxguid)
|
||||
target_link_options(graphics-hook PRIVATE "LINKER:/IGNORE:4099")
|
||||
|
||||
if(MSVC)
|
||||
target_compile_options(graphics-hook PRIVATE "$<IF:$<CONFIG:Debug>,/MTd,/MT>")
|
||||
endif()
|
||||
|
||||
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/")
|
||||
endif()
|
||||
|
||||
set(OBS_PLUGIN_DESTINATION "${OBS_DATA_DESTINATION}/obs-plugins/win-capture/")
|
||||
setup_plugin_target(graphics-hook)
|
||||
# cmake-format: off
|
||||
set_target_properties_obs(graphics-hook PROPERTIES FOLDER "plugins/win-capture" OUTPUT_NAME graphics-hook64)
|
||||
# cmake-format: on
|
||||
|
||||
add_dependencies(win-capture graphics-hook)
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
project(graphics-hook)
|
||||
|
||||
if(NOT TARGET OBS::obfuscate)
|
||||
add_subdirectory("${CMAKE_SOURCE_DIR}/libobs" "${CMAKE_BINARY_DIR}/libobs")
|
||||
endif()
|
||||
|
||||
add_library(graphics-hook MODULE)
|
||||
target_link_libraries(graphics-hook PRIVATE _graphics-hook)
|
||||
set_property(TARGET graphics-hook PROPERTY OUTPUT_NAME graphics-hook32)
|
||||
@@ -0,0 +1,5 @@
|
||||
add_custom_command(
|
||||
TARGET graphics-hook
|
||||
POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_SOURCE_DIR}/build_x86 --config $<CONFIG> -t graphics-hook
|
||||
COMMENT "Build 32-bit graphics-hook")
|
||||
@@ -0,0 +1,58 @@
|
||||
project(graphics-hook)
|
||||
|
||||
find_package(Detours REQUIRED)
|
||||
find_package(Vulkan REQUIRED)
|
||||
|
||||
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
|
||||
../../../libobs/util/windows/obfuscate.c
|
||||
../../../libobs/util/windows/obfuscate.h
|
||||
../graphics-hook-ver.h
|
||||
../graphics-hook-info.h
|
||||
../hook-helpers.h
|
||||
graphics-hook.rc)
|
||||
|
||||
target_include_directories(graphics-hook PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_SOURCE_DIR}/libobs
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../d3d8-api)
|
||||
|
||||
target_link_libraries(graphics-hook PRIVATE OBS::ipc-util Detours::Detours dxguid)
|
||||
target_link_options(graphics-hook PRIVATE "LINKER:/IGNORE:4099")
|
||||
|
||||
if(MSVC)
|
||||
target_compile_options(graphics-hook PRIVATE "$<IF:$<CONFIG:Debug>,/MTd,/MT>")
|
||||
endif()
|
||||
|
||||
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 OBS_LEGACY)
|
||||
|
||||
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/")
|
||||
endif()
|
||||
|
||||
set(OBS_PLUGIN_DESTINATION "${OBS_DATA_DESTINATION}/obs-plugins/win-capture/")
|
||||
setup_plugin_target(graphics-hook)
|
||||
|
||||
add_dependencies(win-capture graphics-hook)
|
||||
@@ -1,6 +1,10 @@
|
||||
#include <dxgi.h>
|
||||
|
||||
#ifdef OBS_LEGACY
|
||||
#include "../d3d8-api/d3d8.h"
|
||||
#else
|
||||
#include <d3d8.h>
|
||||
#endif
|
||||
#include "graphics-hook.h"
|
||||
|
||||
#include <detours.h>
|
||||
|
||||
@@ -2,8 +2,13 @@
|
||||
#include <psapi.h>
|
||||
#include <inttypes.h>
|
||||
#include "graphics-hook.h"
|
||||
#ifdef OBS_LEGACY
|
||||
#include "../graphics-hook-ver.h"
|
||||
#include "../../libobs/util/windows/obfuscate.h"
|
||||
#else
|
||||
#include <graphics-hook-ver.h>
|
||||
#include <util/windows/obfuscate.h>
|
||||
#endif
|
||||
|
||||
#define DEBUG_OUTPUT
|
||||
|
||||
|
||||
@@ -5,7 +5,11 @@
|
||||
#pragma warning(disable : 4152)
|
||||
#endif
|
||||
|
||||
#ifdef OBS_LEGACY
|
||||
#include "../graphics-hook-info.h"
|
||||
#else
|
||||
#include <graphics-hook-info.h>
|
||||
#endif
|
||||
#include <ipc-util/pipe.h>
|
||||
#include <psapi.h>
|
||||
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
project(inject-helper)
|
||||
cmake_minimum_required(VERSION 3.24...3.25)
|
||||
|
||||
add_executable(inject-helper)
|
||||
|
||||
target_sources(inject-helper PRIVATE inject-helper.c ../inject-library.c ../inject-library.h
|
||||
../../../libobs/util/windows/obfuscate.c ../../../libobs/util/windows/obfuscate.h)
|
||||
|
||||
target_include_directories(inject-helper PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
|
||||
if(MSVC)
|
||||
target_compile_options(inject-helper PRIVATE "$<IF:$<CONFIG:Debug>,/MTd,/MT>")
|
||||
if(NOT TARGET OBS::obfuscate)
|
||||
add_subdirectory("${CMAKE_SOURCE_DIR}/libobs" "${CMAKE_BINARY_DIR}/libobs")
|
||||
endif()
|
||||
|
||||
set_target_properties(inject-helper PROPERTIES FOLDER "plugins/win-capture"
|
||||
OUTPUT_NAME "inject-helper$<IF:$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>,64,32>")
|
||||
add_library(_inject-helper INTERFACE)
|
||||
target_sources(_inject-helper INTERFACE inject-helper.c)
|
||||
target_compile_options(_inject-helper INTERFACE $<IF:$<CONFIG:Debug>,/MTd,/MT>)
|
||||
target_link_libraries(_inject-helper INTERFACE OBS::inject-library OBS::obfuscate)
|
||||
|
||||
set(OBS_PLUGIN_DESTINATION "${OBS_DATA_DESTINATION}/obs-plugins/win-capture/")
|
||||
setup_plugin_target(inject-helper)
|
||||
legacy_check()
|
||||
|
||||
add_executable(inject-helper)
|
||||
target_link_libraries(inject-helper PRIVATE _inject-helper)
|
||||
|
||||
include(cmake/32bit.cmake)
|
||||
|
||||
# cmake-format: off
|
||||
set_target_properties_obs(inject-helper PROPERTIES FOLDER plugins/win-capture OUTPUT_NAME inject-helper64)
|
||||
# cmake-format: on
|
||||
|
||||
add_dependencies(win-capture inject-helper)
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
project(inject-helper)
|
||||
|
||||
add_executable(inject-helper)
|
||||
target_link_libraries(inject-helper PRIVATE _inject-helper)
|
||||
set_property(TARGET inject-helper PROPERTY OUTPUT_NAME inject-helper32)
|
||||
@@ -0,0 +1,5 @@
|
||||
add_custom_command(
|
||||
TARGET inject-helper
|
||||
POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_SOURCE_DIR}/build_x86 --config $<CONFIG> -t inject-helper
|
||||
COMMENT "Build 32-bit inject-helper")
|
||||
@@ -0,0 +1,21 @@
|
||||
project(inject-helper)
|
||||
|
||||
add_executable(inject-helper)
|
||||
|
||||
target_sources(inject-helper PRIVATE inject-helper.c ../inject-library.c ../inject-library.h
|
||||
../../../libobs/util/windows/obfuscate.c ../../../libobs/util/windows/obfuscate.h)
|
||||
|
||||
target_include_directories(inject-helper PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_SOURCE_DIR}/libobs)
|
||||
|
||||
target_compile_definitions(inject-helper PRIVATE OBS_LEGACY)
|
||||
if(MSVC)
|
||||
target_compile_options(inject-helper PRIVATE "$<IF:$<CONFIG:Debug>,/MTd,/MT>")
|
||||
endif()
|
||||
|
||||
set_target_properties(inject-helper PROPERTIES FOLDER "plugins/win-capture"
|
||||
OUTPUT_NAME "inject-helper$<IF:$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>,64,32>")
|
||||
|
||||
set(OBS_PLUGIN_DESTINATION "${OBS_DATA_DESTINATION}/obs-plugins/win-capture/")
|
||||
setup_plugin_target(inject-helper)
|
||||
|
||||
add_dependencies(win-capture inject-helper)
|
||||
@@ -4,8 +4,13 @@
|
||||
#include <windows.h>
|
||||
#include <shellapi.h>
|
||||
#include <stdbool.h>
|
||||
#ifdef OBS_LEGACY
|
||||
#include "../../../libobs/util/windows/obfuscate.h"
|
||||
#include "../inject-library.h"
|
||||
#else
|
||||
#include <util/windows/obfuscate.h>
|
||||
#include <inject-library.h>
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && !defined(inline)
|
||||
#define inline __inline
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#include <windows.h>
|
||||
#include <stdbool.h>
|
||||
#ifdef OBS_LEGACY
|
||||
#include "../../libobs/util/windows/obfuscate.h"
|
||||
#else
|
||||
#include <util/windows/obfuscate.h>
|
||||
#endif
|
||||
#include "inject-library.h"
|
||||
|
||||
typedef HANDLE(WINAPI *create_remote_thread_t)(HANDLE, LPSECURITY_ATTRIBUTES,
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
|
||||
#include "compat-helpers.h"
|
||||
#include "compat-format-ver.h"
|
||||
#ifdef OBS_LEGACY
|
||||
#include "compat-config.h"
|
||||
#endif
|
||||
|
||||
#define WIN_CAPTURE_LOG_STRING "[win-capture plugin] "
|
||||
#define WIN_CAPTURE_VER_STRING "win-capture plugin (libobs " OBS_VERSION ")"
|
||||
|
||||
@@ -4,8 +4,13 @@
|
||||
#include <util/windows/window-helpers.h>
|
||||
#include "dc-capture.h"
|
||||
#include "compat-helpers.h"
|
||||
#ifdef OBS_LEGACY
|
||||
#include "../../libobs/util/platform.h"
|
||||
#include "../../libobs-winrt/winrt-capture.h"
|
||||
#else
|
||||
#include <util/platform.h>
|
||||
#include <winrt-capture.h>
|
||||
#endif
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
|
||||
@@ -1,215 +1,48 @@
|
||||
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libdshowcapture/dshowcapture.hpp")
|
||||
obs_status(FATAL_ERROR "libdshowcapture submodule not found! Please fetch submodules. win-dshow plugin disabled.")
|
||||
return()
|
||||
cmake_minimum_required(VERSION 3.24...3.25)
|
||||
|
||||
if(OBS_CMAKE_VERSION VERSION_GREATER_EQUAL 3.0.0)
|
||||
add_library(obs-virtualcam-interface INTERFACE)
|
||||
add_library(OBS::virtualcam-interface ALIAS obs-virtualcam-interface)
|
||||
|
||||
target_sources(obs-virtualcam-interface INTERFACE shared-memory-queue.c shared-memory-queue.h tiny-nv12-scale.c
|
||||
tiny-nv12-scale.h)
|
||||
target_include_directories(obs-virtualcam-interface INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
include(cmake/libdshowcapture.cmake)
|
||||
add_subdirectory(virtualcam-module)
|
||||
endif()
|
||||
|
||||
option(ENABLE_VIRTUALCAM "Enable building with Virtual Camera (Windows)" ON)
|
||||
legacy_check()
|
||||
|
||||
if(NOT ENABLE_VIRTUALCAM)
|
||||
obs_status(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)
|
||||
find_package(FFmpeg REQUIRED avcodec avutil)
|
||||
|
||||
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-external INTERFACE)
|
||||
add_library(libdshowcapture INTERFACE)
|
||||
add_library(OBS::libdshowcapture-external ALIAS libdshowcapture-external)
|
||||
add_library(OBS::libdshowcapture ALIAS libdshowcapture)
|
||||
|
||||
target_sources(
|
||||
libdshowcapture-external
|
||||
INTERFACE libdshowcapture/external/capture-device-support/Library/EGAVResult.cpp
|
||||
libdshowcapture/external/capture-device-support/Library/ElgatoUVCDevice.cpp
|
||||
libdshowcapture/external/capture-device-support/Library/win/EGAVHIDImplementation.cpp
|
||||
libdshowcapture/external/capture-device-support/SampleCode/DriverInterface.cpp)
|
||||
|
||||
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/device-vendor.cpp
|
||||
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
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libdshowcapture/external/capture-device-support/Library)
|
||||
|
||||
target_compile_definitions(libdshowcapture-external INTERFACE _UP_WINDOWS=1)
|
||||
target_compile_definitions(libdshowcapture INTERFACE _UP_WINDOWS=1)
|
||||
target_compile_options(libdshowcapture-external INTERFACE /wd4018)
|
||||
|
||||
set(MODULE_DESCRIPTION "OBS DirectShow module")
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in win-dshow.rc)
|
||||
target_sources(win-dshow PRIVATE dshow-plugin.cpp encode-dstr.hpp ffmpeg-decode.c ffmpeg-decode.h win-dshow-encoder.cpp
|
||||
win-dshow.cpp)
|
||||
|
||||
configure_file(cmake/windows/obs-module.rc.in win-dshow.rc)
|
||||
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(ENABLE_VIRTUALCAM)
|
||||
if(VIRTUALCAM_GUID STREQUAL "")
|
||||
obs_status(WARNING "Windows Virtual Camera - GUID not set. Specify as 'VIRTUALCAM_GUID' to enable.")
|
||||
else()
|
||||
set(INVALID_GUID ON)
|
||||
|
||||
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_AVAILABLE ON)
|
||||
set(INVALID_GUID OFF)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(INVALID_GUID)
|
||||
obs_status(WARNING "Windows Virtual Camera - invalid GUID supplied")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_link_libraries(
|
||||
win-dshow
|
||||
PRIVATE OBS::libobs
|
||||
OBS::w32-pthreads
|
||||
OBS::libdshowcapture-external
|
||||
OBS::libdshowcapture
|
||||
setupapi
|
||||
strmiids
|
||||
ksuser
|
||||
winmm
|
||||
wmcodecdspuuid
|
||||
FFmpeg::avcodec
|
||||
FFmpeg::avutil)
|
||||
|
||||
source_group(
|
||||
"libdshowcapture-external\\Source Files"
|
||||
FILES libdshowcapture/external/capture-device-support/Library/EGAVResult.cpp
|
||||
libdshowcapture/external/capture-device-support/Library/ElgatoUVCDevice.cpp
|
||||
libdshowcapture/external/capture-device-support/Library/win/EGAVHIDImplementation.cpp
|
||||
libdshowcapture/external/capture-device-support/SampleCode/DriverInterface.cpp)
|
||||
source_group(
|
||||
"libdshowcapture\\Source Files"
|
||||
FILES libdshowcapture/source/capture-filter.cpp
|
||||
libdshowcapture/source/output-filter.cpp
|
||||
libdshowcapture/source/dshowcapture.cpp
|
||||
libdshowcapture/source/dshowencode.cpp
|
||||
libdshowcapture/source/device.cpp
|
||||
libdshowcapture/source/device-vendor.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)
|
||||
source_group(
|
||||
"libdshowcapture\\Header Files"
|
||||
FILES libdshowcapture/dshowcapture.hpp
|
||||
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
|
||||
libdshowcapture/source/external/IVideoCaptureFilter.h)
|
||||
|
||||
set_target_properties(win-dshow PROPERTIES FOLDER "plugins/win-dshow")
|
||||
|
||||
setup_plugin_target(win-dshow)
|
||||
|
||||
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)
|
||||
FFmpeg::avutil
|
||||
strmiids
|
||||
winmm)
|
||||
|
||||
if(TARGET OBS::virtualcam AND TARGET OBS::virtualcam-guid)
|
||||
target_sources(win-dshow PRIVATE virtualcam.c)
|
||||
target_link_libraries(win-dshow PRIVATE OBS::virtualcam-interface OBS::virtualcam-guid)
|
||||
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)
|
||||
add_dependencies(win-dshow obs-virtualcam-module)
|
||||
endif()
|
||||
|
||||
# cmake-format: off
|
||||
set_target_properties_obs(win-dshow PROPERTIES FOLDER plugins/win-dshow PREFIX "")
|
||||
# cmake-format: on
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libdshowcapture/dshowcapture.hpp")
|
||||
obs_status(FATAL_ERROR "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)
|
||||
obs_status(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)
|
||||
|
||||
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-external INTERFACE)
|
||||
add_library(libdshowcapture INTERFACE)
|
||||
add_library(OBS::libdshowcapture-external ALIAS libdshowcapture-external)
|
||||
add_library(OBS::libdshowcapture ALIAS libdshowcapture)
|
||||
|
||||
target_sources(
|
||||
libdshowcapture-external
|
||||
INTERFACE libdshowcapture/external/capture-device-support/Library/EGAVResult.cpp
|
||||
libdshowcapture/external/capture-device-support/Library/ElgatoUVCDevice.cpp
|
||||
libdshowcapture/external/capture-device-support/Library/win/EGAVHIDImplementation.cpp
|
||||
libdshowcapture/external/capture-device-support/SampleCode/DriverInterface.cpp)
|
||||
|
||||
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/device-vendor.cpp
|
||||
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
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libdshowcapture/external/capture-device-support/Library)
|
||||
|
||||
target_compile_definitions(libdshowcapture-external INTERFACE _UP_WINDOWS=1)
|
||||
target_compile_definitions(libdshowcapture INTERFACE _UP_WINDOWS=1)
|
||||
target_compile_options(libdshowcapture-external INTERFACE /wd4018)
|
||||
|
||||
set(MODULE_DESCRIPTION "OBS DirectShow module")
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in win-dshow.rc)
|
||||
|
||||
target_sources(win-dshow PRIVATE win-dshow.rc)
|
||||
|
||||
target_compile_definitions(win-dshow PRIVATE UNICODE _UNICODE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS
|
||||
OBS_LEGACY)
|
||||
|
||||
set(VIRTUALCAM_AVAILABLE OFF)
|
||||
if(ENABLE_VIRTUALCAM)
|
||||
if(VIRTUALCAM_GUID STREQUAL "")
|
||||
obs_status(WARNING "Windows Virtual Camera - GUID not set. Specify as 'VIRTUALCAM_GUID' to enable.")
|
||||
else()
|
||||
set(INVALID_GUID ON)
|
||||
|
||||
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_AVAILABLE ON)
|
||||
set(INVALID_GUID OFF)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(INVALID_GUID)
|
||||
obs_status(WARNING "Windows Virtual Camera - invalid GUID supplied")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_link_libraries(
|
||||
win-dshow
|
||||
PRIVATE OBS::libobs
|
||||
OBS::w32-pthreads
|
||||
OBS::libdshowcapture-external
|
||||
OBS::libdshowcapture
|
||||
setupapi
|
||||
strmiids
|
||||
ksuser
|
||||
winmm
|
||||
wmcodecdspuuid
|
||||
FFmpeg::avcodec
|
||||
FFmpeg::avutil)
|
||||
|
||||
source_group(
|
||||
"libdshowcapture-external\\Source Files"
|
||||
FILES libdshowcapture/external/capture-device-support/Library/EGAVResult.cpp
|
||||
libdshowcapture/external/capture-device-support/Library/ElgatoUVCDevice.cpp
|
||||
libdshowcapture/external/capture-device-support/Library/win/EGAVHIDImplementation.cpp
|
||||
libdshowcapture/external/capture-device-support/SampleCode/DriverInterface.cpp)
|
||||
source_group(
|
||||
"libdshowcapture\\Source Files"
|
||||
FILES libdshowcapture/source/capture-filter.cpp
|
||||
libdshowcapture/source/output-filter.cpp
|
||||
libdshowcapture/source/dshowcapture.cpp
|
||||
libdshowcapture/source/dshowencode.cpp
|
||||
libdshowcapture/source/device.cpp
|
||||
libdshowcapture/source/device-vendor.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)
|
||||
source_group(
|
||||
"libdshowcapture\\Header Files"
|
||||
FILES libdshowcapture/dshowcapture.hpp
|
||||
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
|
||||
libdshowcapture/source/external/IVideoCaptureFilter.h)
|
||||
|
||||
set_target_properties(win-dshow PROPERTIES FOLDER "plugins/win-dshow")
|
||||
|
||||
setup_plugin_target(win-dshow)
|
||||
|
||||
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)
|
||||
|
||||
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-module/virtualcam-install.bat.in "${CMAKE_CURRENT_BINARY_DIR}/virtualcam-install.bat")
|
||||
|
||||
configure_file(virtualcam-module/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()
|
||||
@@ -0,0 +1,56 @@
|
||||
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/device-vendor.cpp
|
||||
libdshowcapture/source/device.cpp
|
||||
libdshowcapture/source/device.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-encoded-device.cpp
|
||||
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-media-type.hpp
|
||||
libdshowcapture/source/dshowcapture.cpp
|
||||
libdshowcapture/source/dshowencode.cpp
|
||||
libdshowcapture/source/encoder.cpp
|
||||
libdshowcapture/source/encoder.hpp
|
||||
libdshowcapture/source/external/IVideoCaptureFilter.h
|
||||
libdshowcapture/source/log.cpp
|
||||
libdshowcapture/source/log.hpp
|
||||
libdshowcapture/source/output-filter.cpp
|
||||
libdshowcapture/source/output-filter.hpp
|
||||
libdshowcapture/external/capture-device-support/Library/EGAVResult.cpp
|
||||
libdshowcapture/external/capture-device-support/Library/ElgatoUVCDevice.cpp
|
||||
libdshowcapture/external/capture-device-support/Library/win/EGAVHIDImplementation.cpp
|
||||
libdshowcapture/external/capture-device-support/SampleCode/DriverInterface.cpp)
|
||||
|
||||
target_include_directories(
|
||||
libdshowcapture INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/libdshowcapture"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/libdshowcapture/external/capture-device-support/Library")
|
||||
|
||||
target_compile_definitions(libdshowcapture INTERFACE _UP_WINDOWS=1)
|
||||
target_compile_options(libdshowcapture INTERFACE /wd4018)
|
||||
|
||||
get_target_property(target_sources libdshowcapture INTERFACE_SOURCES)
|
||||
set(target_headers ${target_sources})
|
||||
set(target_external_sources ${target_sources})
|
||||
|
||||
list(FILTER target_external_sources INCLUDE REGEX ".+external/.+/.+\\.cpp")
|
||||
list(FILTER target_sources EXCLUDE REGEX ".+external/.+/.+\\.cpp")
|
||||
list(FILTER target_sources INCLUDE REGEX ".*\\.(m|c[cp]?p?|swift)")
|
||||
list(FILTER target_headers INCLUDE REGEX ".*\\.h(pp)?")
|
||||
|
||||
source_group("libdshowcapture-external\\Source Files" FILES ${target_external_sources})
|
||||
source_group("libdshowcapture\\Source Files" FILES ${target_sources})
|
||||
source_group("libdshowcapture\\Header Files" FILES ${target_headers})
|
||||
@@ -0,0 +1,24 @@
|
||||
1 VERSIONINFO
|
||||
FILEVERSION ${OBS_VERSION_MAJOR},${OBS_VERSION_MINOR},${OBS_VERSION_PATCH},0
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "${OBS_COMPANY_NAME}"
|
||||
VALUE "FileDescription", "OBS DirectShow module"
|
||||
VALUE "FileVersion", "${OBS_VERSION_CANONICAL}"
|
||||
VALUE "ProductName", "${OBS_PRODUCT_NAME}"
|
||||
VALUE "ProductVersion", "${OBS_VERSION_CANONICAL}"
|
||||
VALUE "Comments", "${OBS_COMMENTS}"
|
||||
VALUE "LegalCopyright", "${OBS_LEGAL_COPYRIGHT}"
|
||||
VALUE "InternalName", "win-dshow"
|
||||
VALUE "OriginalFilename", "win-dshow"
|
||||
END
|
||||
END
|
||||
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0409, 0x04B0
|
||||
END
|
||||
END
|
||||
@@ -1,59 +1,97 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(obs-virtualcam-module)
|
||||
cmake_minimum_required(VERSION 3.24...3.25)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_output_suffix "64")
|
||||
else()
|
||||
set(_output_suffix "32")
|
||||
if(OBS_CMAKE_VERSION VERSION_GREATER_EQUAL 3.0.0)
|
||||
option(ENABLE_VIRTUALCAM "Enable Windows Virtual Camera" ON)
|
||||
if(NOT ENABLE_VIRTUALCAM)
|
||||
target_disable_feature(obs-virtualcam-module "Virtual Camera Support")
|
||||
target_disable(obs-virtualcam-module)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT VIRTUALCAM_GUID)
|
||||
# cmake-format: off
|
||||
set(VIRTUALCAM_GUID "" CACHE STRING "Virtual Camera GUID" FORCE)
|
||||
mark_as_advanced(VIRTUALCAM_GUID)
|
||||
# cmake-format: on
|
||||
|
||||
message(WARNING "Empty Virtual Camera GUID set.")
|
||||
target_disable_feature(obs-virtualcam-module "Virtual Camera Support (empty GUID)")
|
||||
return()
|
||||
else()
|
||||
set(VALID_GUID FALSE)
|
||||
check_uuid(${VIRTUALCAM_GUID} VALID_GUID)
|
||||
|
||||
if(NOT VALID_GUID)
|
||||
message(WARNING "Invalid Virtual Camera GUID set.")
|
||||
target_disable_feature(obs-virtualcam-module "Virtual Camera Support (invalid GUID)")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# DirectShow API requires separate GUID tokens
|
||||
string(REPLACE "-" ";" GUID_VALS ${VIRTUALCAM_GUID})
|
||||
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)
|
||||
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)
|
||||
endif()
|
||||
|
||||
add_library(obs-virtualcam-guid INTERFACE)
|
||||
add_library(OBS::virtualcam-guid ALIAS obs-virtualcam-guid)
|
||||
|
||||
configure_file(virtualcam-guid.h.in virtualcam-guid.h)
|
||||
target_sources(obs-virtualcam-guid INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/virtualcam-guid.h")
|
||||
target_include_directories(obs-virtualcam-guid INTERFACE "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
|
||||
add_library(_virtualcam INTERFACE)
|
||||
|
||||
configure_file(cmake/windows/obs-module.rc.in virtualcam-module.rc)
|
||||
target_sources(_virtualcam INTERFACE placeholder.cpp sleepto.c sleepto.h virtualcam-filter.cpp virtualcam-filter.hpp
|
||||
virtualcam-module.cpp)
|
||||
target_include_directories(_virtualcam INTERFACE "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
target_compile_definitions(_virtualcam INTERFACE VIRTUALCAM_AVAILABLE)
|
||||
target_compile_options(_virtualcam INTERFACE $<IF:$<CONFIG:Debug>,/MTd,/MT>)
|
||||
|
||||
target_link_libraries(
|
||||
_virtualcam
|
||||
INTERFACE OBS::virtualcam-interface
|
||||
OBS::virtualcam-guid
|
||||
OBS::libdshowcapture
|
||||
OBS::winhandle
|
||||
gdiplus
|
||||
strmiids
|
||||
winmm)
|
||||
endif()
|
||||
|
||||
legacy_check()
|
||||
|
||||
add_library(obs-virtualcam-module MODULE)
|
||||
add_library(OBS::virtualcam-module ALIAS obs-virtualcam-module)
|
||||
add_library(OBS::virtualcam 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_sources(obs-virtualcam-module PRIVATE cmake/windows/virtualcam-module64.def)
|
||||
target_link_libraries(obs-virtualcam-module PRIVATE _virtualcam)
|
||||
|
||||
target_include_directories(obs-virtualcam-module PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
configure_file(virtualcam-install.bat.in virtualcam-install.bat)
|
||||
target_add_resource(obs-virtualcam-module "${CMAKE_CURRENT_BINARY_DIR}/virtualcam-install.bat"
|
||||
"${OBS_DATA_DESTINATION}/obs-plugins/win-dshow")
|
||||
|
||||
set(MODULE_DESCRIPTION "OBS Virtual Camera output module")
|
||||
configure_file(virtualcam-uninstall.bat.in virtualcam-uninstall.bat)
|
||||
target_add_resource(obs-virtualcam-module "${CMAKE_CURRENT_BINARY_DIR}/virtualcam-uninstall.bat"
|
||||
"${OBS_DATA_DESTINATION}/obs-plugins/win-dshow")
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in virtualcam-module.rc)
|
||||
include(cmake/32bit.cmake)
|
||||
|
||||
target_sources(obs-virtualcam-module PRIVATE virtualcam-module.rc)
|
||||
|
||||
target_link_libraries(obs-virtualcam-module PRIVATE OBS::libdshowcapture OBS::libdshowcapture-external setupapi winmm
|
||||
strmiids gdiplus)
|
||||
|
||||
target_link_options(obs-virtualcam-module PRIVATE "LINKER:/ignore:4104")
|
||||
|
||||
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)
|
||||
target_compile_options(obs-virtualcam-module PRIVATE "$<IF:$<CONFIG:Debug>,/MTd,/MT>")
|
||||
add_target_resource(win-dshow "$<TARGET_PDB_FILE:obs-virtualcam-module>" "obs-plugins/win-dshow/" OPTIONAL)
|
||||
|
||||
endif()
|
||||
|
||||
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}")
|
||||
|
||||
add_target_resource(win-dshow "$<TARGET_FILE:obs-virtualcam-module>" "obs-plugins/win-dshow/")
|
||||
# cmake-format: off
|
||||
set_target_properties_obs(obs-virtualcam-module PROPERTIES FOLDER plugins/win-dshow OUTPUT_NAME obs-virtualcam-module64)
|
||||
# cmake-format: on
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
option(ENABLE_VIRTUALCAM "Enable Windows Virtual Camera" ON)
|
||||
if(NOT ENABLE_VIRTUALCAM)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT VIRTUALCAM_GUID)
|
||||
set(VIRTUALCAM_GUID
|
||||
""
|
||||
CACHE STRING "Virtual Camera GUID" FORCE)
|
||||
mark_as_advanced(VIRTUALCAM_GUID)
|
||||
|
||||
message(WARNING "Empty Virtual Camera GUID set.")
|
||||
return()
|
||||
else()
|
||||
set(VALID_GUID FALSE)
|
||||
check_uuid(${VIRTUALCAM_GUID} VALID_GUID)
|
||||
|
||||
if(NOT VALID_GUID)
|
||||
message(WARNING "Invalid Virtual Camera GUID set.")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# DirectShow API requires separate GUID tokens
|
||||
string(REPLACE "-" ";" GUID_VALS ${VIRTUALCAM_GUID})
|
||||
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)
|
||||
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)
|
||||
endif()
|
||||
|
||||
add_library(obs-virtualcam-module MODULE)
|
||||
add_library(OBS::virtualcam ALIAS obs-virtualcam-module)
|
||||
|
||||
target_sources(obs-virtualcam-module PRIVATE cmake/windows/virtualcam-module32.def)
|
||||
target_link_libraries(obs-virtualcam-module PRIVATE _virtualcam)
|
||||
|
||||
set_property(TARGET obs-virtualcam-module PROPERTY OUTPUT_NAME obs-virtualcam-module32)
|
||||
@@ -0,0 +1,5 @@
|
||||
add_custom_command(
|
||||
TARGET obs-virtualcam-module
|
||||
POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_SOURCE_DIR}/build_x86 --config $<CONFIG> -t obs-virtualcam-module
|
||||
COMMENT "Build 32-bit obs-virtualcam")
|
||||
@@ -0,0 +1,60 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(obs-virtualcam-module)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_output_suffix "64")
|
||||
else()
|
||||
set(_output_suffix "32")
|
||||
endif()
|
||||
|
||||
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/bundle/windows/obs-module.rc.in virtualcam-module.rc)
|
||||
|
||||
target_sources(obs-virtualcam-module PRIVATE virtualcam-module.rc)
|
||||
|
||||
target_link_libraries(obs-virtualcam-module PRIVATE OBS::libdshowcapture OBS::libdshowcapture-external setupapi winmm
|
||||
strmiids gdiplus)
|
||||
|
||||
target_link_options(obs-virtualcam-module PRIVATE "LINKER:/ignore:4104")
|
||||
|
||||
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
|
||||
${CMAKE_SOURCE_DIR}/libobs)
|
||||
|
||||
target_compile_definitions(obs-virtualcam-module PRIVATE VIRTUALCAM_AVAILABLE UNICODE _UNICODE _CRT_SECURE_NO_WARNINGS
|
||||
_CRT_NONSTDC_NO_WARNINGS OBS_LEGACY)
|
||||
|
||||
if(MSVC)
|
||||
target_compile_options(obs-virtualcam-module PRIVATE "$<IF:$<CONFIG:Debug>,/MTd,/MT>")
|
||||
add_target_resource(win-dshow "$<TARGET_PDB_FILE:obs-virtualcam-module>" "obs-plugins/win-dshow/" OPTIONAL)
|
||||
|
||||
endif()
|
||||
|
||||
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}")
|
||||
|
||||
add_target_resource(win-dshow "$<TARGET_FILE:obs-virtualcam-module>" "obs-plugins/win-dshow/")
|
||||
@@ -0,0 +1,24 @@
|
||||
1 VERSIONINFO
|
||||
FILEVERSION ${OBS_VERSION_MAJOR},${OBS_VERSION_MINOR},${OBS_VERSION_PATCH},0
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "${OBS_COMPANY_NAME}"
|
||||
VALUE "FileDescription", "OBS Virtual Camera output module"
|
||||
VALUE "FileVersion", "${OBS_VERSION_CANONICAL}"
|
||||
VALUE "ProductName", "${OBS_PRODUCT_NAME}"
|
||||
VALUE "ProductVersion", "${OBS_VERSION_CANONICAL}"
|
||||
VALUE "Comments", "${OBS_COMMENTS}"
|
||||
VALUE "LegalCopyright", "${OBS_LEGAL_COPYRIGHT}"
|
||||
VALUE "InternalName", "${PROJECT_NAME}"
|
||||
VALUE "OriginalFilename", "${PROJECT_NAME}"
|
||||
END
|
||||
END
|
||||
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0409, 0x04B0
|
||||
END
|
||||
END
|
||||
@@ -0,0 +1,8 @@
|
||||
LIBRARY obs-virtualcam-module32.dll
|
||||
EXPORTS
|
||||
DllMain PRIVATE
|
||||
DllGetClassObject PRIVATE
|
||||
DllCanUnloadNow PRIVATE
|
||||
DllRegisterServer PRIVATE
|
||||
DllUnregisterServer PRIVATE
|
||||
DllInstall PRIVATE
|
||||
@@ -0,0 +1,8 @@
|
||||
LIBRARY obs-virtualcam-module64.dll
|
||||
EXPORTS
|
||||
DllMain PRIVATE
|
||||
DllGetClassObject PRIVATE
|
||||
DllCanUnloadNow PRIVATE
|
||||
DllRegisterServer PRIVATE
|
||||
DllUnregisterServer PRIVATE
|
||||
DllInstall PRIVATE
|
||||
@@ -3,12 +3,22 @@
|
||||
#include <windows.h>
|
||||
#include <cstdint>
|
||||
#include <thread>
|
||||
|
||||
#ifdef OBS_LEGACY
|
||||
#include "../shared-memory-queue.h"
|
||||
#include "../tiny-nv12-scale.h"
|
||||
#include "../libdshowcapture/source/output-filter.hpp"
|
||||
#include "../libdshowcapture/source/dshow-formats.hpp"
|
||||
#include "../../../libobs/util/windows/WinHandle.hpp"
|
||||
#include "../../../libobs/util/threading-windows.h"
|
||||
#else
|
||||
#include <shared-memory-queue.h>
|
||||
#include <tiny-nv12-scale.h>
|
||||
#include <libdshowcapture/source/output-filter.hpp>
|
||||
#include <libdshowcapture/source/dshow-formats.hpp>
|
||||
#include <util/windows/WinHandle.hpp>
|
||||
#include <util/threading-windows.h>
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
int cx;
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
project(win-wasapi)
|
||||
cmake_minimum_required(VERSION 3.24...3.25)
|
||||
|
||||
legacy_check()
|
||||
|
||||
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/bundle/windows/obs-module.rc.in win-wasapi.rc)
|
||||
target_sources(win-wasapi PRIVATE enum-wasapi.cpp enum-wasapi.hpp plugin-main.cpp win-wasapi.cpp)
|
||||
|
||||
configure_file(cmake/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")
|
||||
|
||||
setup_plugin_target(win-wasapi)
|
||||
# cmake-format: off
|
||||
set_target_properties_obs(win-wasapi PROPERTIES FOLDER plugins PREFIX "")
|
||||
# cmake-format: on
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
project(win-wasapi)
|
||||
|
||||
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/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")
|
||||
|
||||
setup_plugin_target(win-wasapi)
|
||||
@@ -0,0 +1,24 @@
|
||||
1 VERSIONINFO
|
||||
FILEVERSION ${OBS_VERSION_MAJOR},${OBS_VERSION_MINOR},${OBS_VERSION_PATCH},0
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "${OBS_COMPANY_NAME}"
|
||||
VALUE "FileDescription", "OBS WASAPI module"
|
||||
VALUE "FileVersion", "${OBS_VERSION_CANONICAL}"
|
||||
VALUE "ProductName", "${OBS_PRODUCT_NAME}"
|
||||
VALUE "ProductVersion", "${OBS_VERSION_CANONICAL}"
|
||||
VALUE "Comments", "${OBS_COMMENTS}"
|
||||
VALUE "LegalCopyright", "${OBS_LEGAL_COPYRIGHT}"
|
||||
VALUE "InternalName", "win-wasapi"
|
||||
VALUE "OriginalFilename", "win-wasapi"
|
||||
END
|
||||
END
|
||||
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0409, 0x04B0
|
||||
END
|
||||
END
|
||||
Reference in New Issue
Block a user