mirror of
https://github.com/KDE/krfb
synced 2026-07-01 07:31:16 -07:00
pipewire: Drop dependencies that remained after the port to KPipeWire
This commit is contained in:
@@ -74,12 +74,11 @@ find_package(LibVNCServer REQUIRED)
|
|||||||
option(DISABLE_PIPEWIRE "Disable PipeWire support." OFF)
|
option(DISABLE_PIPEWIRE "Disable PipeWire support." OFF)
|
||||||
if(NOT DISABLE_PIPEWIRE)
|
if(NOT DISABLE_PIPEWIRE)
|
||||||
find_package(KPipeWire REQUIRED)
|
find_package(KPipeWire REQUIRED)
|
||||||
pkg_check_modules(PipeWire IMPORTED_TARGET libpipewire-0.3)
|
|
||||||
endif()
|
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)
|
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(KF5Wayland ${KF5_MIN_VERSION})
|
||||||
find_package(QtWaylandScanner REQUIRED)
|
find_package(QtWaylandScanner REQUIRED)
|
||||||
find_package(Qt5WaylandClient)
|
find_package(Qt5WaylandClient)
|
||||||
@@ -87,31 +86,6 @@ if(PipeWire_FOUND AND PlasmaWaylandProtocols_FOUND)
|
|||||||
find_package(Wayland REQUIRED COMPONENTS Client)
|
find_package(Wayland REQUIRED COMPONENTS Client)
|
||||||
endif()
|
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
|
ecm_setup_version(PROJECT
|
||||||
VARIABLE_PREFIX KRFB
|
VARIABLE_PREFIX KRFB
|
||||||
VERSION_HEADER "krfb_version.h")
|
VERSION_HEADER "krfb_version.h")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
add_subdirectory(x11)
|
add_subdirectory(x11)
|
||||||
|
|
||||||
# Makes sense to use only when PW framebuffer is used
|
# Makes sense to use only when PW framebuffer is used
|
||||||
if (${PipeWire_FOUND})
|
if (TARGET K::KPipeWire)
|
||||||
add_subdirectory(xdp)
|
add_subdirectory(xdp)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -4,6 +4,6 @@ if (${XCB_DAMAGE_FOUND} AND ${XCB_SHM_FOUND} AND ${XCB_IMAGE_FOUND})
|
|||||||
add_subdirectory (xcb)
|
add_subdirectory (xcb)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (${PipeWire_FOUND})
|
if (TARGET K::KPipeWire)
|
||||||
add_subdirectory(pipewire)
|
add_subdirectory(pipewire)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -48,18 +48,10 @@ target_link_libraries(krfb_framebuffer_pw
|
|||||||
KF5::WaylandClient
|
KF5::WaylandClient
|
||||||
Wayland::Client
|
Wayland::Client
|
||||||
krfbprivate
|
krfbprivate
|
||||||
PkgConfig::PipeWire
|
|
||||||
K::KPipeWire
|
K::KPipeWire
|
||||||
K::KPipeWireDmaBuf
|
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)
|
set_target_properties(krfb_framebuffer_pw PROPERTIES OUTPUT_NAME pw)
|
||||||
install (TARGETS krfb_framebuffer_pw
|
install (TARGETS krfb_framebuffer_pw
|
||||||
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/framebuffer
|
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/framebuffer
|
||||||
|
|||||||
@@ -26,15 +26,6 @@
|
|||||||
#include <KWayland/Client/registry.h>
|
#include <KWayland/Client/registry.h>
|
||||||
|
|
||||||
// pipewire
|
// pipewire
|
||||||
#include <sys/ioctl.h>
|
|
||||||
|
|
||||||
#include <spa/param/format-utils.h>
|
|
||||||
#include <spa/param/video/format-utils.h>
|
|
||||||
#include <spa/param/props.h>
|
|
||||||
#include <spa/utils/result.h>
|
|
||||||
|
|
||||||
#include <pipewire/pipewire.h>
|
|
||||||
|
|
||||||
#include <climits>
|
#include <climits>
|
||||||
|
|
||||||
#include "pw_framebuffer.h"
|
#include "pw_framebuffer.h"
|
||||||
@@ -45,14 +36,6 @@
|
|||||||
#include <KPipeWire/PipeWireSourceStream>
|
#include <KPipeWire/PipeWireSourceStream>
|
||||||
#include <KPipeWire/DmaBufHandler>
|
#include <KPipeWire/DmaBufHandler>
|
||||||
|
|
||||||
#if HAVE_DMA_BUF
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include <gbm.h>
|
|
||||||
#include <epoxy/egl.h>
|
|
||||||
#include <epoxy/gl.h>
|
|
||||||
#endif /* HAVE_DMA_BUF */
|
|
||||||
|
|
||||||
static const int BYTES_PER_PIXEL = 4;
|
static const int BYTES_PER_PIXEL = 4;
|
||||||
static const uint MIN_SUPPORTED_XDP_KDE_SC_VERSION = 1;
|
static const uint MIN_SUPPORTED_XDP_KDE_SC_VERSION = 1;
|
||||||
|
|
||||||
@@ -79,30 +62,6 @@ const QDBusArgument &operator >> (const QDBusArgument &arg, PWFrameBuffer::Strea
|
|||||||
return arg;
|
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
|
* @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.
|
* 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());
|
memcpy(q->fb, frame.image->constBits(), frame.image->sizeInBytes());
|
||||||
setVideoSize(frame.image->size());
|
setVideoSize(frame.image->size());
|
||||||
}
|
}
|
||||||
#if HAVE_DMA_BUF
|
|
||||||
else if (frame.dmabuf) {
|
else if (frame.dmabuf) {
|
||||||
QImage src((uchar*) q->fb, videoSize.width(), videoSize.height(), QImage::Format_RGB32);
|
QImage src((uchar*) q->fb, videoSize.width(), videoSize.height(), QImage::Format_RGB32);
|
||||||
if (!m_dmabufHandler.downloadFrame(src, frame)) {
|
if (!m_dmabufHandler.downloadFrame(src, frame)) {
|
||||||
@@ -401,9 +359,7 @@ void PWFrameBuffer::Private::handleFrame(const PipeWireFrame &frame)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setVideoSize(src.size());
|
setVideoSize(src.size());
|
||||||
}
|
} else {
|
||||||
#endif /* HAVE_DMA_BUF */
|
|
||||||
else {
|
|
||||||
qCDebug(KRFB_FB_PIPEWIRE) << "Unknown kind of frame";
|
qCDebug(KRFB_FB_PIPEWIRE) << "Unknown kind of frame";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,8 +22,6 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "framebufferplugin.h"
|
#include "framebufferplugin.h"
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
|
|
||||||
class FrameBuffer;
|
class FrameBuffer;
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,3 @@
|
|||||||
|
|
||||||
/* Define if XShm is available */
|
/* Define if XShm is available */
|
||||||
#cmakedefine HAVE_XSHM 1
|
#cmakedefine HAVE_XSHM 1
|
||||||
|
|
||||||
/* Define if DMA-BUF support is available */
|
|
||||||
#cmakedefine01 HAVE_DMA_BUF
|
|
||||||
|
|||||||
Reference in New Issue
Block a user