diff --git a/CMakeLists.txt b/CMakeLists.txt index 5859ca0f..0b4e3854 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,12 +74,11 @@ find_package(LibVNCServer REQUIRED) option(DISABLE_PIPEWIRE "Disable PipeWire support." OFF) if(NOT DISABLE_PIPEWIRE) find_package(KPipeWire REQUIRED) - pkg_check_modules(PipeWire IMPORTED_TARGET libpipewire-0.3) endif() -add_feature_info(PipeWire PipeWire_FOUND "Required for pipewire screencast plugin") +add_feature_info(PipeWire KPipeWire_FOUND "Required for pipewire screencast plugin") find_package(PlasmaWaylandProtocols 1.5.0) -if(PipeWire_FOUND AND PlasmaWaylandProtocols_FOUND) +if(KPipeWire_FOUND AND PlasmaWaylandProtocols_FOUND) find_package(KF5Wayland ${KF5_MIN_VERSION}) find_package(QtWaylandScanner REQUIRED) find_package(Qt5WaylandClient) @@ -87,31 +86,6 @@ if(PipeWire_FOUND AND PlasmaWaylandProtocols_FOUND) find_package(Wayland REQUIRED COMPONENTS Client) endif() -find_package(gbm) -set_package_properties(gbm PROPERTIES - TYPE OPTIONAL - PURPOSE "Required for dma-buf support in pipewire screencast plugin." -) - -find_package(EGL) -set_package_properties(EGL PROPERTIES - TYPE OPTIONAL - PURPOSE "Required for dma-buf support in pipewire screencast plugin." -) - -find_package(epoxy) -set_package_properties(epoxy PROPERTIES DESCRIPTION "libepoxy" - URL "https://github.com/anholt/libepoxy" - TYPE OPTIONAL - PURPOSE "Required for dma-buf support in pipewire screencast plugin." -) - -if(EGL_FOUND AND gbm_FOUND AND epoxy_FOUND) - set (HAVE_DMA_BUF TRUE) -else() - set (HAVE_DMA_BUF FALSE) -endif() - ecm_setup_version(PROJECT VARIABLE_PREFIX KRFB VERSION_HEADER "krfb_version.h") diff --git a/events/CMakeLists.txt b/events/CMakeLists.txt index b9d2502f..ed85201c 100644 --- a/events/CMakeLists.txt +++ b/events/CMakeLists.txt @@ -1,6 +1,6 @@ add_subdirectory(x11) # Makes sense to use only when PW framebuffer is used -if (${PipeWire_FOUND}) +if (TARGET K::KPipeWire) add_subdirectory(xdp) endif() diff --git a/framebuffers/CMakeLists.txt b/framebuffers/CMakeLists.txt index 51a751db..c86208f4 100644 --- a/framebuffers/CMakeLists.txt +++ b/framebuffers/CMakeLists.txt @@ -4,6 +4,6 @@ if (${XCB_DAMAGE_FOUND} AND ${XCB_SHM_FOUND} AND ${XCB_IMAGE_FOUND}) add_subdirectory (xcb) endif() -if (${PipeWire_FOUND}) +if (TARGET K::KPipeWire) add_subdirectory(pipewire) endif() diff --git a/framebuffers/pipewire/CMakeLists.txt b/framebuffers/pipewire/CMakeLists.txt index 5c53e670..a51edf50 100644 --- a/framebuffers/pipewire/CMakeLists.txt +++ b/framebuffers/pipewire/CMakeLists.txt @@ -48,18 +48,10 @@ target_link_libraries(krfb_framebuffer_pw KF5::WaylandClient Wayland::Client krfbprivate - PkgConfig::PipeWire K::KPipeWire K::KPipeWireDmaBuf ) -if (HAVE_DMA_BUF) - target_link_libraries(krfb_framebuffer_pw - ${epoxy_LIBRARIES} - gbm::gbm - ) -endif() - set_target_properties(krfb_framebuffer_pw PROPERTIES OUTPUT_NAME pw) install (TARGETS krfb_framebuffer_pw DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/framebuffer diff --git a/framebuffers/pipewire/pw_framebuffer.cpp b/framebuffers/pipewire/pw_framebuffer.cpp index 354334ac..1fd0dd58 100644 --- a/framebuffers/pipewire/pw_framebuffer.cpp +++ b/framebuffers/pipewire/pw_framebuffer.cpp @@ -26,15 +26,6 @@ #include // pipewire -#include - -#include -#include -#include -#include - -#include - #include #include "pw_framebuffer.h" @@ -45,14 +36,6 @@ #include #include -#if HAVE_DMA_BUF -#include - -#include -#include -#include -#endif /* HAVE_DMA_BUF */ - static const int BYTES_PER_PIXEL = 4; static const uint MIN_SUPPORTED_XDP_KDE_SC_VERSION = 1; @@ -79,30 +62,6 @@ const QDBusArgument &operator >> (const QDBusArgument &arg, PWFrameBuffer::Strea return arg; } -#if HAVE_DMA_BUF -const char * formatGLError(GLenum err) -{ - switch(err) { - case GL_NO_ERROR: - return "GL_NO_ERROR"; - case GL_INVALID_ENUM: - return "GL_INVALID_ENUM"; - case GL_INVALID_VALUE: - return "GL_INVALID_VALUE"; - case GL_INVALID_OPERATION: - return "GL_INVALID_OPERATION"; - case GL_STACK_OVERFLOW: - return "GL_STACK_OVERFLOW"; - case GL_STACK_UNDERFLOW: - return "GL_STACK_UNDERFLOW"; - case GL_OUT_OF_MEMORY: - return "GL_OUT_OF_MEMORY"; - default: - return (QLatin1String("0x") + QString::number(err, 16)).toLocal8Bit().constData(); - } -} -#endif /* HAVE_DMA_BUF */ - /** * @brief The PWFrameBuffer::Private class - private counterpart of PWFramebuffer class. This is the entity where * whole logic resides, for more info search for "d-pointer pattern" information. @@ -392,7 +351,6 @@ void PWFrameBuffer::Private::handleFrame(const PipeWireFrame &frame) memcpy(q->fb, frame.image->constBits(), frame.image->sizeInBytes()); setVideoSize(frame.image->size()); } -#if HAVE_DMA_BUF else if (frame.dmabuf) { QImage src((uchar*) q->fb, videoSize.width(), videoSize.height(), QImage::Format_RGB32); if (!m_dmabufHandler.downloadFrame(src, frame)) { @@ -401,9 +359,7 @@ void PWFrameBuffer::Private::handleFrame(const PipeWireFrame &frame) return; } setVideoSize(src.size()); - } -#endif /* HAVE_DMA_BUF */ - else { + } else { qCDebug(KRFB_FB_PIPEWIRE) << "Unknown kind of frame"; } diff --git a/framebuffers/pipewire/pw_framebufferplugin.h b/framebuffers/pipewire/pw_framebufferplugin.h index 21fad4f1..66e1c32f 100644 --- a/framebuffers/pipewire/pw_framebufferplugin.h +++ b/framebuffers/pipewire/pw_framebufferplugin.h @@ -22,8 +22,6 @@ #include "framebufferplugin.h" -#include - class FrameBuffer; diff --git a/krfb/config-krfb.h.cmake b/krfb/config-krfb.h.cmake index 22fe007d..38d479c6 100644 --- a/krfb/config-krfb.h.cmake +++ b/krfb/config-krfb.h.cmake @@ -9,6 +9,3 @@ /* Define if XShm is available */ #cmakedefine HAVE_XSHM 1 - -/* Define if DMA-BUF support is available */ -#cmakedefine01 HAVE_DMA_BUF