libobs: Update CMakeLists.txt for libobs and associated libraries
Also updates libobs-opengl, libobs-d3d11, libobs-winrtmaster
parent
49e9d49943
commit
1fd7770548
|
@ -1,59 +1,57 @@
|
||||||
project(libobs-d3d11)
|
project(libobs-d3d11)
|
||||||
|
|
||||||
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/libobs")
|
add_library(libobs-d3d11 MODULE)
|
||||||
|
add_library(OBS::libobs-d3d11 ALIAS libobs-d3d11)
|
||||||
|
|
||||||
add_definitions(-DLIBOBS_EXPORTS)
|
target_sources(
|
||||||
|
libobs-d3d11
|
||||||
|
PRIVATE d3d11-indexbuffer.cpp
|
||||||
|
d3d11-samplerstate.cpp
|
||||||
|
d3d11-shader.cpp
|
||||||
|
d3d11-shaderprocessor.cpp
|
||||||
|
d3d11-shaderprocessor.hpp
|
||||||
|
d3d11-stagesurf.cpp
|
||||||
|
d3d11-subsystem.cpp
|
||||||
|
d3d11-subsystem.hpp
|
||||||
|
d3d11-texture2d.cpp
|
||||||
|
d3d11-texture3d.cpp
|
||||||
|
d3d11-vertexbuffer.cpp
|
||||||
|
d3d11-duplicator.cpp
|
||||||
|
d3d11-rebuild.cpp
|
||||||
|
d3d11-zstencilbuffer.cpp
|
||||||
|
intel-nv12-support.hpp)
|
||||||
|
|
||||||
set(MODULE_DESCRIPTION "OBS Library D3D11 wrapper")
|
set(MODULE_DESCRIPTION "OBS Library D3D11 wrapper")
|
||||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in libobs-d3d11.rc)
|
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
||||||
|
libobs-d3d11.rc)
|
||||||
|
|
||||||
if(NOT DEFINED GPU_PRIORITY_VAL OR "${GPU_PRIORITY_VAL}" STREQUAL "" OR
|
target_include_directories(libobs-d3d11 PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
"${GPU_PRIORITY_VAL}" STREQUAL "0")
|
|
||||||
set(USE_GPU_PRIORITY FALSE)
|
target_sources(libobs-d3d11 PRIVATE libobs-d3d11.rc)
|
||||||
set(GPU_PRIORITY_VAL "0")
|
|
||||||
|
target_compile_features(libobs-d3d11 PRIVATE cxx_std_17)
|
||||||
|
|
||||||
|
target_compile_definitions(
|
||||||
|
libobs-d3d11 PRIVATE UNICODE _UNICODE _CRT_SECURE_NO_WARNINGS
|
||||||
|
_CRT_NONSTDC_NO_WARNINGS)
|
||||||
|
|
||||||
|
if(NOT DEFINED GPU_PRIORITY_VAL
|
||||||
|
OR "x${GPU_PRIORITY_VAL}x" STREQUAL "xx"
|
||||||
|
OR "${GPU_PRIORITY_VAL}" STREQUAL "0")
|
||||||
|
target_compile_definitions(libobs-d3d11 PRIVATE USE_GPU_PRIORITY=FALSE
|
||||||
|
GPU_PRIORITY_VAL=0)
|
||||||
else()
|
else()
|
||||||
set(USE_GPU_PRIORITY TRUE)
|
target_compile_definitions(
|
||||||
|
libobs-d3d11 PRIVATE USE_GPU_PRIORITY=TRUE
|
||||||
|
GPU_PRIORITY_VAL=${GPU_PRIORITY_VAL})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
configure_file(
|
target_link_libraries(libobs-d3d11 PRIVATE OBS::libobs d3d9 d3d11 dxgi)
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/d3d11-config.h.in"
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/d3d11-config.h")
|
|
||||||
|
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
set_target_properties(
|
||||||
|
libobs-d3d11
|
||||||
|
PROPERTIES OUTPUT_NAME libobs-d3d11
|
||||||
|
FOLDER "core"
|
||||||
|
PREFIX "")
|
||||||
|
|
||||||
set(libobs-d3d11_SOURCES
|
setup_binary_target(libobs-d3d11)
|
||||||
d3d11-indexbuffer.cpp
|
|
||||||
d3d11-samplerstate.cpp
|
|
||||||
d3d11-shader.cpp
|
|
||||||
d3d11-shaderprocessor.cpp
|
|
||||||
d3d11-stagesurf.cpp
|
|
||||||
d3d11-subsystem.cpp
|
|
||||||
d3d11-texture2d.cpp
|
|
||||||
d3d11-texture3d.cpp
|
|
||||||
d3d11-vertexbuffer.cpp
|
|
||||||
d3d11-duplicator.cpp
|
|
||||||
d3d11-rebuild.cpp
|
|
||||||
d3d11-zstencilbuffer.cpp
|
|
||||||
libobs-d3d11.rc)
|
|
||||||
|
|
||||||
set(libobs-d3d11_HEADERS
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/d3d11-config.h
|
|
||||||
intel-nv12-support.hpp
|
|
||||||
d3d11-shaderprocessor.hpp
|
|
||||||
d3d11-subsystem.hpp)
|
|
||||||
|
|
||||||
add_library(libobs-d3d11 MODULE
|
|
||||||
${libobs-d3d11_SOURCES}
|
|
||||||
${libobs-d3d11_HEADERS})
|
|
||||||
set_target_properties(libobs-d3d11
|
|
||||||
PROPERTIES
|
|
||||||
FOLDER "core"
|
|
||||||
OUTPUT_NAME libobs-d3d11
|
|
||||||
PREFIX "")
|
|
||||||
target_link_libraries(libobs-d3d11
|
|
||||||
libobs
|
|
||||||
d3d9
|
|
||||||
d3d11
|
|
||||||
dxgi)
|
|
||||||
|
|
||||||
install_obs_core(libobs-d3d11)
|
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
#include <winternl.h>
|
#include <winternl.h>
|
||||||
#include <d3d9.h>
|
#include <d3d9.h>
|
||||||
#include "d3d11-subsystem.hpp"
|
#include "d3d11-subsystem.hpp"
|
||||||
#include "d3d11-config.h"
|
|
||||||
#include "intel-nv12-support.hpp"
|
#include "intel-nv12-support.hpp"
|
||||||
|
|
||||||
struct UnsupportedHWError : HRError {
|
struct UnsupportedHWError : HRError {
|
||||||
|
|
|
@ -1,127 +1,73 @@
|
||||||
project(libobs-opengl)
|
project(libobs-opengl)
|
||||||
|
|
||||||
|
add_library(libobs-opengl SHARED)
|
||||||
|
add_library(OBS::libobs-opengl ALIAS libobs-opengl)
|
||||||
|
|
||||||
find_package(OpenGL REQUIRED)
|
target_sources(
|
||||||
include_directories(${OPENGL_INCLUDE_DIR})
|
libobs-opengl
|
||||||
|
PRIVATE gl-helpers.c
|
||||||
|
gl-helpers.h
|
||||||
|
gl-indexbuffer.c
|
||||||
|
gl-shader.c
|
||||||
|
gl-shaderparser.c
|
||||||
|
gl-shaderparser.h
|
||||||
|
gl-stagesurf.c
|
||||||
|
gl-subsystem.c
|
||||||
|
gl-subsystem.h
|
||||||
|
gl-texture2d.c
|
||||||
|
gl-texture3d.c
|
||||||
|
gl-texturecube.c
|
||||||
|
gl-vertexbuffer.c
|
||||||
|
gl-zstencil.c)
|
||||||
|
|
||||||
add_definitions(-DLIBOBS_EXPORTS)
|
target_link_libraries(libobs-opengl PRIVATE OBS::libobs OBS::obsglad)
|
||||||
|
|
||||||
if(WIN32)
|
set_target_properties(
|
||||||
set(MODULE_DESCRIPTION "OBS Library OpenGL wrapper")
|
libobs-opengl
|
||||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in libobs-opengl.rc)
|
PROPERTIES FOLDER "core"
|
||||||
set(libobs-opengl_PLATFORM_SOURCES
|
VERSION "${OBS_VERSION_MAJOR}"
|
||||||
gl-windows.c
|
SOVERSION "1")
|
||||||
libobs-opengl.rc)
|
|
||||||
elseif(APPLE)
|
|
||||||
set(libobs-opengl_PLATFORM_SOURCES
|
|
||||||
gl-cocoa.m)
|
|
||||||
|
|
||||||
find_library(COCOA Cocoa)
|
if(OS_WINDOWS)
|
||||||
include_directories(${COCOA})
|
set(MODULE_DESCRIPTION "OBS Library OpenGL wrapper")
|
||||||
mark_as_advanced(COCOA)
|
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
||||||
|
libobs-opengl.rc)
|
||||||
|
|
||||||
find_library(IOSURF IOSurface)
|
target_sources(libobs-opengl PRIVATE gl-windows.c libobs-opengl.rc)
|
||||||
include_directories(${IOSURF})
|
|
||||||
mark_as_advanced(${IOSURF})
|
|
||||||
|
|
||||||
set(libobs-opengl_PLATFORM_DEPS
|
elseif(OS_MACOS)
|
||||||
${COCOA}
|
find_library(COCOA Cocoa)
|
||||||
${IOSURF}
|
find_library(IOSURF IOSurface)
|
||||||
${OPENGL_gl_LIBRARY})
|
|
||||||
else()
|
|
||||||
find_package(XCB COMPONENTS XCB REQUIRED)
|
|
||||||
find_package(X11_XCB REQUIRED)
|
|
||||||
|
|
||||||
include_directories(
|
target_sources(libobs-opengl PRIVATE gl-cocoa.m)
|
||||||
${XCB_INCLUDE_DIRS}
|
|
||||||
${X11_XCB_INCLUDE_DIRS})
|
|
||||||
|
|
||||||
add_definitions(
|
target_link_libraries(libobs-opengl PRIVATE ${COCOA} ${IOSURF})
|
||||||
${XCB_DEFINITIONS}
|
|
||||||
${X11_XCB_DEFINITIONS})
|
|
||||||
|
|
||||||
set(libobs-opengl_PLATFORM_DEPS
|
set_target_properties(libobs-opengl PROPERTIES PREFIX "")
|
||||||
${XCB_LIBRARIES}
|
|
||||||
${X11_XCB_LIBRARIES})
|
|
||||||
|
|
||||||
set(libobs-opengl_PLATFORM_SOURCES
|
elseif(OS_POSIX)
|
||||||
gl-egl-common.c
|
find_package(X11 REQUIRED)
|
||||||
gl-nix.c
|
find_package(XCB COMPONENTS XCB)
|
||||||
gl-x11-egl.c
|
find_package(X11_XCB REQUIRED)
|
||||||
gl-x11-glx.c)
|
|
||||||
|
|
||||||
if(ENABLE_WAYLAND)
|
target_sources(libobs-opengl PRIVATE gl-egl-common.c gl-nix.c gl-x11-egl.c
|
||||||
find_package(EGL REQUIRED)
|
gl-x11-glx.c)
|
||||||
find_package(Wayland REQUIRED)
|
|
||||||
|
|
||||||
include_directories(
|
target_link_libraries(libobs-opengl PRIVATE XCB::XCB X11::X11_xcb)
|
||||||
${WAYLAND_CLIENT_INCLUDE_DIRS}
|
|
||||||
${WAYLAND_EGL_INCLUDE_DIRS}
|
|
||||||
${EGL_INCLUDE_DIRS})
|
|
||||||
|
|
||||||
add_definitions(
|
set_target_properties(libobs-opengl PROPERTIES PREFIX "")
|
||||||
${WAYLAND_DEFINITIONS})
|
|
||||||
|
|
||||||
set(libobs-opengl_PLATFORM_DEPS
|
if(ENABLE_WAYLAND)
|
||||||
${libobs-opengl_PLATFORM_DEPS}
|
find_package(
|
||||||
${WAYLAND_CLIENT_LIBRARIES}
|
OpenGL
|
||||||
${WAYLAND_EGL_LIBRARIES}
|
COMPONENTS EGL
|
||||||
${EGL_LIBRARIES})
|
REQUIRED)
|
||||||
|
find_package(Wayland REQUIRED)
|
||||||
|
|
||||||
set(libobs-opengl_PLATFORM_SOURCES
|
target_sources(libobs-opengl PRIVATE gl-wayland-egl.c)
|
||||||
${libobs-opengl_PLATFORM_SOURCES}
|
|
||||||
gl-wayland-egl.c)
|
target_link_libraries(libobs-opengl PRIVATE OpenGL::EGL Wayland::EGL)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(libobs-opengl_SOURCES
|
setup_binary_target(libobs-opengl)
|
||||||
${libobs-opengl_PLATFORM_SOURCES}
|
|
||||||
gl-helpers.c
|
|
||||||
gl-indexbuffer.c
|
|
||||||
gl-shader.c
|
|
||||||
gl-shaderparser.c
|
|
||||||
gl-stagesurf.c
|
|
||||||
gl-subsystem.c
|
|
||||||
gl-texture2d.c
|
|
||||||
gl-texture3d.c
|
|
||||||
gl-texturecube.c
|
|
||||||
gl-vertexbuffer.c
|
|
||||||
gl-zstencil.c)
|
|
||||||
|
|
||||||
set(libobs-opengl_HEADERS
|
|
||||||
gl-helpers.h
|
|
||||||
gl-shaderparser.h
|
|
||||||
gl-subsystem.h)
|
|
||||||
|
|
||||||
if(WIN32 OR APPLE)
|
|
||||||
add_library(libobs-opengl MODULE
|
|
||||||
${libobs-opengl_SOURCES}
|
|
||||||
${libobs-opengl_HEADERS})
|
|
||||||
else()
|
|
||||||
add_library(libobs-opengl SHARED
|
|
||||||
${libobs-opengl_SOURCES}
|
|
||||||
${libobs-opengl_HEADERS})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WIN32 OR APPLE)
|
|
||||||
set_target_properties(libobs-opengl
|
|
||||||
PROPERTIES
|
|
||||||
FOLDER "core"
|
|
||||||
OUTPUT_NAME libobs-opengl
|
|
||||||
PREFIX "")
|
|
||||||
else()
|
|
||||||
set_target_properties(libobs-opengl
|
|
||||||
PROPERTIES
|
|
||||||
FOLDER "core"
|
|
||||||
OUTPUT_NAME obs-opengl
|
|
||||||
VERSION 0.0
|
|
||||||
SOVERSION 0
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_link_libraries(libobs-opengl
|
|
||||||
libobs
|
|
||||||
glad
|
|
||||||
${libobs-opengl_PLATFORM_DEPS})
|
|
||||||
|
|
||||||
install_obs_core(libobs-opengl)
|
|
||||||
|
|
|
@ -1,41 +1,32 @@
|
||||||
project(libobs-winrt)
|
project(libobs-winrt)
|
||||||
|
|
||||||
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/libobs")
|
add_library(libobs-winrt MODULE)
|
||||||
|
add_library(OBS::libobs-winrt ALIAS libobs-winrt)
|
||||||
|
|
||||||
add_definitions(-DLIBOBS_EXPORTS)
|
target_sources(libobs-winrt PRIVATE winrt-capture.cpp winrt-capture.h
|
||||||
|
winrt-dispatch.cpp winrt-dispatch.h)
|
||||||
|
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
target_precompile_headers(
|
||||||
|
libobs-winrt
|
||||||
|
PRIVATE
|
||||||
|
[["../libobs/util/windows/ComPtr.hpp"]]
|
||||||
|
<obs-module.h>
|
||||||
|
<d3d11.h>
|
||||||
|
<DispatcherQueue.h>
|
||||||
|
<dwmapi.h>
|
||||||
|
<Windows.Graphics.Capture.Interop.h>
|
||||||
|
<winrt/Windows.Foundation.Metadata.h>
|
||||||
|
<winrt/Windows.Graphics.Capture.h>
|
||||||
|
<winrt/Windows.System.h>)
|
||||||
|
|
||||||
set(libobs-winrt_SOURCES
|
target_link_libraries(libobs-winrt PRIVATE OBS::libobs Dwmapi windowsapp)
|
||||||
winrt-capture.cpp
|
|
||||||
winrt-dispatch.cpp)
|
|
||||||
|
|
||||||
set(libobs-winrt_HEADERS
|
target_compile_features(libobs-winrt PRIVATE cxx_std_17)
|
||||||
winrt-capture.h
|
|
||||||
winrt-dispatch.h)
|
|
||||||
|
|
||||||
add_library(libobs-winrt MODULE
|
set_target_properties(
|
||||||
${libobs-winrt_SOURCES}
|
libobs-winrt
|
||||||
${libobs-winrt_HEADERS})
|
PROPERTIES OUTPUT_NAME libobs-winrt
|
||||||
set_target_properties(libobs-winrt
|
FOLDER "core"
|
||||||
PROPERTIES
|
PREFIX "")
|
||||||
FOLDER "core"
|
|
||||||
OUTPUT_NAME libobs-winrt
|
|
||||||
PREFIX "")
|
|
||||||
target_precompile_headers(libobs-winrt
|
|
||||||
PRIVATE
|
|
||||||
[["../libobs/util/windows/ComPtr.hpp"]]
|
|
||||||
<obs-module.h>
|
|
||||||
<d3d11.h>
|
|
||||||
<DispatcherQueue.h>
|
|
||||||
<dwmapi.h>
|
|
||||||
<Windows.Graphics.Capture.Interop.h>
|
|
||||||
<winrt/Windows.Foundation.Metadata.h>
|
|
||||||
<winrt/Windows.Graphics.Capture.h>
|
|
||||||
<winrt/Windows.System.h>)
|
|
||||||
target_link_libraries(libobs-winrt
|
|
||||||
libobs
|
|
||||||
Dwmapi
|
|
||||||
windowsapp)
|
|
||||||
|
|
||||||
install_obs_core(libobs-winrt)
|
setup_binary_target(libobs-winrt)
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,15 @@
|
||||||
|
@PACKAGE_INIT@
|
||||||
|
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
||||||
|
check_required_components("@PROJECT_NAME@")
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
find_package(w32-pthreads REQUIRED)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
|
||||||
|
set(LIBOBS_PLUGIN_DESTINATION "@PACKAGE_OBS_PLUGIN_DESTINATION@")
|
||||||
|
set(LIBOBS_PLUGIN_DATA_DESTINATION "@PACKAGE_OBS_DATA_DESTINATION@/obs-plugins")
|
||||||
|
|
||||||
|
set(LIBOBS_LIBRARIES libobs)
|
|
@ -38,44 +38,30 @@ bool is_in_bundle()
|
||||||
|
|
||||||
const char *get_module_extension(void)
|
const char *get_module_extension(void)
|
||||||
{
|
{
|
||||||
return ".so";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *module_bin[] = {
|
|
||||||
"../obs-plugins",
|
|
||||||
OBS_INSTALL_PREFIX "obs-plugins",
|
|
||||||
};
|
|
||||||
|
|
||||||
static const char *module_data[] = {
|
|
||||||
"../data/obs-plugins/%module%",
|
|
||||||
OBS_INSTALL_DATA_PATH "obs-plugins/%module%",
|
|
||||||
};
|
|
||||||
|
|
||||||
static const int module_patterns_size =
|
|
||||||
sizeof(module_bin) / sizeof(module_bin[0]);
|
|
||||||
|
|
||||||
void add_default_module_paths(void)
|
void add_default_module_paths(void)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < module_patterns_size; i++)
|
struct dstr plugin_path;
|
||||||
obs_add_module_path(module_bin[i], module_data[i]);
|
|
||||||
|
|
||||||
if (is_in_bundle()) {
|
dstr_init_move_array(&plugin_path, os_get_executable_path_ptr(""));
|
||||||
NSRunningApplication *app =
|
dstr_cat(&plugin_path, "../PlugIns");
|
||||||
[NSRunningApplication currentApplication];
|
char *abs_plugin_path = os_get_abs_path_ptr(plugin_path.array);
|
||||||
NSURL *bundleURL = [app bundleURL];
|
|
||||||
NSURL *pluginsURL = [bundleURL
|
|
||||||
URLByAppendingPathComponent:@"Contents/PlugIns"];
|
|
||||||
NSURL *dataURL = [bundleURL
|
|
||||||
URLByAppendingPathComponent:
|
|
||||||
@"Contents/Resources/data/obs-plugins/%module%"];
|
|
||||||
|
|
||||||
const char *binPath = [[pluginsURL path]
|
if (abs_plugin_path != NULL) {
|
||||||
cStringUsingEncoding:NSUTF8StringEncoding];
|
dstr_move_array(&plugin_path, abs_plugin_path);
|
||||||
const char *dataPath = [[dataURL path]
|
struct dstr plugin_data;
|
||||||
cStringUsingEncoding:NSUTF8StringEncoding];
|
dstr_init_copy_dstr(&plugin_data, &plugin_path);
|
||||||
|
dstr_cat(&plugin_path, "/%module%.plugin/Contents/MacOS/");
|
||||||
|
dstr_cat(&plugin_data, "/%module%.plugin/Contents/Resources/");
|
||||||
|
|
||||||
obs_add_module_path(binPath, dataPath);
|
obs_add_module_path(plugin_path.array, plugin_data.array);
|
||||||
|
|
||||||
|
dstr_free(&plugin_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dstr_free(&plugin_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *find_libobs_data_file(const char *file)
|
char *find_libobs_data_file(const char *file)
|
||||||
|
@ -83,12 +69,11 @@ char *find_libobs_data_file(const char *file)
|
||||||
struct dstr path;
|
struct dstr path;
|
||||||
|
|
||||||
if (is_in_bundle()) {
|
if (is_in_bundle()) {
|
||||||
NSRunningApplication *app =
|
NSBundle *frameworkBundle = [NSBundle
|
||||||
[NSRunningApplication currentApplication];
|
bundleWithIdentifier:@"com.obsproject.libobs"];
|
||||||
NSURL *bundleURL = [app bundleURL];
|
NSURL *bundleURL = [frameworkBundle bundleURL];
|
||||||
NSURL *libobsDataURL =
|
NSURL *libobsDataURL =
|
||||||
[bundleURL URLByAppendingPathComponent:
|
[bundleURL URLByAppendingPathComponent:@"Resources/"];
|
||||||
@"Contents/Resources/data/libobs/"];
|
|
||||||
const char *libobsDataPath = [[libobsDataURL path]
|
const char *libobsDataPath = [[libobsDataURL path]
|
||||||
cStringUsingEncoding:NSUTF8StringEncoding];
|
cStringUsingEncoding:NSUTF8StringEncoding];
|
||||||
dstr_init_copy(&path, libobsDataPath);
|
dstr_init_copy(&path, libobsDataPath);
|
||||||
|
|
|
@ -358,9 +358,17 @@ static bool parse_binary_from_directory(struct dstr *parsed_bin_path,
|
||||||
|
|
||||||
dstr_copy_dstr(parsed_bin_path, &directory);
|
dstr_copy_dstr(parsed_bin_path, &directory);
|
||||||
dstr_cat(parsed_bin_path, file);
|
dstr_cat(parsed_bin_path, file);
|
||||||
|
#ifdef __APPLE__
|
||||||
|
if (!os_file_exists(parsed_bin_path->array)) {
|
||||||
|
dstr_cat(parsed_bin_path, ".so");
|
||||||
|
}
|
||||||
|
#else
|
||||||
dstr_cat(parsed_bin_path, get_module_extension());
|
dstr_cat(parsed_bin_path, get_module_extension());
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!os_file_exists(parsed_bin_path->array)) {
|
if (!os_file_exists(parsed_bin_path->array)) {
|
||||||
|
/* Legacy fallback: Check for plugin with .so suffix*/
|
||||||
|
dstr_cat(parsed_bin_path, ".so");
|
||||||
/* if the file doesn't exist, check with 'lib' prefix */
|
/* if the file doesn't exist, check with 'lib' prefix */
|
||||||
dstr_copy_dstr(parsed_bin_path, &directory);
|
dstr_copy_dstr(parsed_bin_path, &directory);
|
||||||
dstr_cat(parsed_bin_path, "lib");
|
dstr_cat(parsed_bin_path, "lib");
|
||||||
|
@ -397,15 +405,15 @@ static void process_found_module(struct obs_module_path *omp, const char *path,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
dstr_copy(&name, file);
|
dstr_copy(&name, file);
|
||||||
if (!directory) {
|
char *ext = strrchr(name.array, '.');
|
||||||
char *ext = strrchr(name.array, '.');
|
if (ext)
|
||||||
if (ext)
|
dstr_resize(&name, ext - name.array);
|
||||||
dstr_resize(&name, ext - name.array);
|
|
||||||
|
|
||||||
|
if (!directory) {
|
||||||
dstr_copy(&parsed_bin_path, path);
|
dstr_copy(&parsed_bin_path, path);
|
||||||
} else {
|
} else {
|
||||||
bin_found = parse_binary_from_directory(&parsed_bin_path,
|
bin_found = parse_binary_from_directory(&parsed_bin_path,
|
||||||
omp->bin, file);
|
omp->bin, name.array);
|
||||||
}
|
}
|
||||||
|
|
||||||
parsed_data_dir = make_data_directory(name.array, omp->data);
|
parsed_data_dir = make_data_directory(name.array, omp->data);
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include "obs-nix-x11.h"
|
#include "obs-nix-x11.h"
|
||||||
|
|
||||||
#include <xcb/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
#if USE_XINPUT
|
#if defined(XINPUT_FOUND)
|
||||||
#include <xcb/xinput.h>
|
#include <xcb/xinput.h>
|
||||||
#endif
|
#endif
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
|
@ -94,7 +94,7 @@ struct obs_hotkeys_platform {
|
||||||
int num_keysyms;
|
int num_keysyms;
|
||||||
int syms_per_code;
|
int syms_per_code;
|
||||||
|
|
||||||
#if USE_XINPUT
|
#if defined(XINPUT_FOUND)
|
||||||
bool pressed[XINPUT_MOUSE_LEN];
|
bool pressed[XINPUT_MOUSE_LEN];
|
||||||
bool update[XINPUT_MOUSE_LEN];
|
bool update[XINPUT_MOUSE_LEN];
|
||||||
bool button_pressed[XINPUT_MOUSE_LEN];
|
bool button_pressed[XINPUT_MOUSE_LEN];
|
||||||
|
@ -805,7 +805,7 @@ static inline xcb_window_t root_window(obs_hotkeys_platform_t *context,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USE_XINPUT
|
#if defined(XINPUT_FOUND)
|
||||||
static inline void registerMouseEvents(struct obs_core_hotkeys *hotkeys)
|
static inline void registerMouseEvents(struct obs_core_hotkeys *hotkeys)
|
||||||
{
|
{
|
||||||
obs_hotkeys_platform_t *context = hotkeys->platform_context;
|
obs_hotkeys_platform_t *context = hotkeys->platform_context;
|
||||||
|
@ -836,7 +836,7 @@ static bool obs_nix_x11_hotkeys_platform_init(struct obs_core_hotkeys *hotkeys)
|
||||||
hotkeys->platform_context = bzalloc(sizeof(obs_hotkeys_platform_t));
|
hotkeys->platform_context = bzalloc(sizeof(obs_hotkeys_platform_t));
|
||||||
hotkeys->platform_context->display = display;
|
hotkeys->platform_context->display = display;
|
||||||
|
|
||||||
#if USE_XINPUT
|
#if defined(XINPUT_FOUND)
|
||||||
registerMouseEvents(hotkeys);
|
registerMouseEvents(hotkeys);
|
||||||
#endif
|
#endif
|
||||||
fill_base_keysyms(hotkeys);
|
fill_base_keysyms(hotkeys);
|
||||||
|
@ -864,7 +864,7 @@ static bool mouse_button_pressed(xcb_connection_t *connection,
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
#if USE_XINPUT
|
#if defined(XINPUT_FOUND)
|
||||||
memset(context->pressed, 0, XINPUT_MOUSE_LEN);
|
memset(context->pressed, 0, XINPUT_MOUSE_LEN);
|
||||||
memset(context->update, 0, XINPUT_MOUSE_LEN);
|
memset(context->update, 0, XINPUT_MOUSE_LEN);
|
||||||
|
|
||||||
|
|
|
@ -54,16 +54,15 @@ const char *get_module_extension(void)
|
||||||
#define FLATPAK_PLUGIN_PATH "/app/plugins"
|
#define FLATPAK_PLUGIN_PATH "/app/plugins"
|
||||||
|
|
||||||
static const char *module_bin[] = {
|
static const char *module_bin[] = {
|
||||||
"../../obs-plugins/" BIT_STRING,
|
|
||||||
OBS_INSTALL_PREFIX "/" OBS_PLUGIN_DESTINATION,
|
OBS_INSTALL_PREFIX "/" OBS_PLUGIN_DESTINATION,
|
||||||
|
"../../obs-plugins/" BIT_STRING,
|
||||||
FLATPAK_PLUGIN_PATH "/" OBS_PLUGIN_DESTINATION,
|
FLATPAK_PLUGIN_PATH "/" OBS_PLUGIN_DESTINATION,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *module_data[] = {
|
static const char *module_data[] = {
|
||||||
OBS_DATA_PATH "/obs-plugins/%module%",
|
|
||||||
OBS_INSTALL_DATA_PATH "/obs-plugins/%module%",
|
OBS_INSTALL_DATA_PATH "/obs-plugins/%module%",
|
||||||
FLATPAK_PLUGIN_PATH "/share/obs/obs-plugins/%module%",
|
OBS_DATA_PATH "/obs-plugins/%module%",
|
||||||
};
|
FLATPAK_PLUGIN_PATH "/share/obs/obs-plugins/%module%"};
|
||||||
|
|
||||||
static const int module_patterns_size =
|
static const int module_patterns_size =
|
||||||
sizeof(module_bin) / sizeof(module_bin[0]);
|
sizeof(module_bin) / sizeof(module_bin[0]);
|
||||||
|
|
|
@ -10,18 +10,15 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define OBS_VERSION "@OBS_VERSION@"
|
#define OBS_VERSION "@OBS_VERSION@"
|
||||||
|
#define OBS_VERSION_CANONICAL "@OBS_VERSION_CANONICAL@"
|
||||||
#define OBS_DATA_PATH "@OBS_DATA_PATH@"
|
#define OBS_DATA_PATH "@OBS_DATA_PATH@"
|
||||||
#define OBS_INSTALL_PREFIX "@OBS_INSTALL_PREFIX@"
|
#define OBS_INSTALL_PREFIX "@OBS_INSTALL_PREFIX@"
|
||||||
#define OBS_PLUGIN_DESTINATION "@OBS_PLUGIN_DESTINATION@"
|
#define OBS_PLUGIN_DESTINATION "@OBS_PLUGIN_DESTINATION@"
|
||||||
#define OBS_RELATIVE_PREFIX "@OBS_RELATIVE_PREFIX@"
|
|
||||||
#define OBS_UNIX_STRUCTURE @OBS_UNIX_STRUCTURE@
|
|
||||||
#define HAVE_DBUS @HAVE_DBUS@
|
|
||||||
#define HAVE_PULSEAUDIO @HAVE_PULSEAUDIO@
|
|
||||||
#define USE_XINPUT @USE_XINPUT@
|
|
||||||
#define LIBOBS_IMAGEMAGICK_DIR_STYLE_6L 6
|
|
||||||
#define LIBOBS_IMAGEMAGICK_DIR_STYLE_7GE 7
|
|
||||||
#define LIBOBS_IMAGEMAGICK_DIR_STYLE @LIBOBS_IMAGEMAGICK_DIR_STYLE@
|
|
||||||
|
|
||||||
|
#define LINUX_PORTABLE "@LINUX_PORTABLE@"
|
||||||
|
#cmakedefine GIO_FOUND
|
||||||
|
#cmakedefine PULSEAUDIO_FOUND
|
||||||
|
#cmakedefine XCB_XINPUT_FOUND
|
||||||
#cmakedefine ENABLE_WAYLAND
|
#cmakedefine ENABLE_WAYLAND
|
||||||
|
|
||||||
/* NOTE: Release candidate version numbers internally are always the previous
|
/* NOTE: Release candidate version numbers internally are always the previous
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
prefix=@CMAKE_INSTALL_PREFIX@
|
||||||
|
exec_prefix=${prefix}
|
||||||
|
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
|
||||||
|
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@/obs
|
||||||
|
|
||||||
|
Name: libobs
|
||||||
|
Description: OBS Studio Library
|
||||||
|
Version: @OBS_VERSION_CANONICAL@
|
||||||
|
Cflags: -I${includedir} @_TARGET_DEFINITIONS@ @_TARGET_OPTIONS@ @_LINKED_DEFINITIONS@
|
||||||
|
Libs: -L${libdir} @_LINKED_LIBRARIES@
|
|
@ -24,16 +24,18 @@
|
||||||
#define UNUSED_PARAMETER(param) (void)param
|
#define UNUSED_PARAMETER(param) (void)param
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
#define OBS_UNUSED
|
||||||
#define OBS_DEPRECATED __declspec(deprecated)
|
#define OBS_DEPRECATED __declspec(deprecated)
|
||||||
#define OBS_NORETURN __declspec(noreturn)
|
#define OBS_NORETURN __declspec(noreturn)
|
||||||
#define FORCE_INLINE __forceinline
|
#define FORCE_INLINE __forceinline
|
||||||
#else
|
#else
|
||||||
|
#define OBS_UNUSED __attribute__((unused))
|
||||||
#define OBS_DEPRECATED __attribute__((deprecated))
|
#define OBS_DEPRECATED __attribute__((deprecated))
|
||||||
#define OBS_NORETURN __attribute__((noreturn))
|
#define OBS_NORETURN __attribute__((noreturn))
|
||||||
#define FORCE_INLINE inline __attribute__((always_inline))
|
#define FORCE_INLINE inline __attribute__((always_inline))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(IS_LIBOBS) || defined(SWIG)
|
#if defined(IS_LIBOBS) || defined(SWIG_TYPE_TABLE)
|
||||||
#define OBS_EXTERNAL_DEPRECATED
|
#define OBS_EXTERNAL_DEPRECATED
|
||||||
#else
|
#else
|
||||||
#define OBS_EXTERNAL_DEPRECATED OBS_DEPRECATED
|
#define OBS_EXTERNAL_DEPRECATED OBS_DEPRECATED
|
||||||
|
|
|
@ -64,7 +64,9 @@ void *os_dlopen(const char *path)
|
||||||
|
|
||||||
dstr_init_copy(&dylib_name, path);
|
dstr_init_copy(&dylib_name, path);
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
if (!dstr_find(&dylib_name, ".so") && !dstr_find(&dylib_name, ".dylib"))
|
if (!dstr_find(&dylib_name, ".framework") &&
|
||||||
|
!dstr_find(&dylib_name, ".plugin") &&
|
||||||
|
!dstr_find(&dylib_name, ".dylib") && !dstr_find(&dylib_name, ".so"))
|
||||||
#else
|
#else
|
||||||
if (!dstr_find(&dylib_name, ".so"))
|
if (!dstr_find(&dylib_name, ".so"))
|
||||||
#endif
|
#endif
|
||||||
|
@ -629,7 +631,7 @@ int os_chdir(const char *path)
|
||||||
|
|
||||||
#if !defined(__APPLE__)
|
#if !defined(__APPLE__)
|
||||||
|
|
||||||
#if HAVE_DBUS
|
#if defined(GIO_FOUND)
|
||||||
struct dbus_sleep_info;
|
struct dbus_sleep_info;
|
||||||
struct portal_inhibit_info;
|
struct portal_inhibit_info;
|
||||||
|
|
||||||
|
@ -645,7 +647,7 @@ extern void portal_inhibit_info_destroy(struct portal_inhibit_info *portal);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct os_inhibit_info {
|
struct os_inhibit_info {
|
||||||
#if HAVE_DBUS
|
#if defined(GIO_FOUND)
|
||||||
struct dbus_sleep_info *dbus;
|
struct dbus_sleep_info *dbus;
|
||||||
struct portal_inhibit_info *portal;
|
struct portal_inhibit_info *portal;
|
||||||
#endif
|
#endif
|
||||||
|
@ -661,7 +663,7 @@ os_inhibit_t *os_inhibit_sleep_create(const char *reason)
|
||||||
struct os_inhibit_info *info = bzalloc(sizeof(*info));
|
struct os_inhibit_info *info = bzalloc(sizeof(*info));
|
||||||
sigset_t set;
|
sigset_t set;
|
||||||
|
|
||||||
#if HAVE_DBUS
|
#if defined(GIO_FOUND)
|
||||||
info->portal = portal_inhibit_info_create();
|
info->portal = portal_inhibit_info_create();
|
||||||
if (!info->portal)
|
if (!info->portal)
|
||||||
info->dbus = dbus_sleep_info_create();
|
info->dbus = dbus_sleep_info_create();
|
||||||
|
@ -718,7 +720,7 @@ bool os_inhibit_sleep_set_active(os_inhibit_t *info, bool active)
|
||||||
if (info->active == active)
|
if (info->active == active)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#if HAVE_DBUS
|
#if defined(GIO_FOUND)
|
||||||
if (info->portal)
|
if (info->portal)
|
||||||
portal_inhibit(info->portal, info->reason, active);
|
portal_inhibit(info->portal, info->reason, active);
|
||||||
if (info->dbus)
|
if (info->dbus)
|
||||||
|
@ -749,7 +751,7 @@ void os_inhibit_sleep_destroy(os_inhibit_t *info)
|
||||||
{
|
{
|
||||||
if (info) {
|
if (info) {
|
||||||
os_inhibit_sleep_set_active(info, false);
|
os_inhibit_sleep_set_active(info, false);
|
||||||
#if HAVE_DBUS
|
#if defined(GIO_FOUND)
|
||||||
portal_inhibit_info_destroy(info->portal);
|
portal_inhibit_info_destroy(info->portal);
|
||||||
dbus_sleep_info_destroy(info->dbus);
|
dbus_sleep_info_destroy(info->dbus);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue