1604400e48
Generally moves all the plugin code into xcomposite-input.cpp and removes all C++ dependencies. Migrate as much as possible to xcb from Xlib to enable us to handle errors and attribute them to the correct callers. This caused many other knock on issues such as wrongly attributed errors and cleanup code working incorrectly. That allows us to use the xcursor-xcb implementation and delete the pure Xlib implementation. We also add the missing functionality from the Xlib implementation to the xcb implementation. Capture glXCreatePixmap errors which occur most commonly on nvidia+gnome due to nvidia's driver being unable to allocate more than 1 pixmap per window and gnome being the only compositor to read window data via glx pixmaps. Fix cleanup after failed glXCreatePixmap that might have leaked pixmaps and prevented later captures on nvidia drivers for the same reason.
38 lines
867 B
CMake
38 lines
867 B
CMake
project(linux-capture)
|
|
|
|
find_package(X11 REQUIRED)
|
|
find_package(XCB COMPONENTS XCB XFIXES RANDR SHM XINERAMA COMPOSITE)
|
|
if(NOT TARGET XCB::COMPOSITE)
|
|
obs_status(FATAL_ERROR "xcb composite library not found")
|
|
endif()
|
|
|
|
add_library(linux-capture MODULE)
|
|
add_library(OBS::capture ALIAS linux-capture)
|
|
|
|
target_sources(
|
|
linux-capture
|
|
PRIVATE linux-capture.c
|
|
xcursor-xcb.c
|
|
xcursor-xcb.h
|
|
xhelpers.c
|
|
xhelpers.h
|
|
xshm-input.c
|
|
xcomposite-input.c
|
|
xcomposite-input.h)
|
|
|
|
target_link_libraries(
|
|
linux-capture
|
|
PRIVATE OBS::libobs
|
|
OBS::obsglad
|
|
X11::X11
|
|
XCB::XCB
|
|
XCB::XFIXES
|
|
XCB::RANDR
|
|
XCB::SHM
|
|
XCB::XINERAMA
|
|
XCB::COMPOSITE)
|
|
|
|
set_target_properties(linux-capture PROPERTIES FOLDER "plugins")
|
|
|
|
setup_plugin_target(linux-capture)
|