mirror of
https://invent.kde.org/network/krfb
synced 2024-07-01 07:24:29 +00:00
pw: Fix build with last released KPipeWire release
This commit is contained in:
parent
8ee8075f82
commit
0d3a38f39e
|
@ -38,6 +38,12 @@ add_library(krfb_framebuffer_pw
|
|||
MODULE
|
||||
${krfb_framebuffer_pw_SRCS}
|
||||
)
|
||||
|
||||
if (KPipeWire_VERSION VERSION_LESS "6.0.80")
|
||||
target_compile_definitions(krfb_framebuffer_pw PRIVATE -DKPIPEWIRE60=1)
|
||||
else()
|
||||
target_compile_definitions(krfb_framebuffer_pw PRIVATE -DKPIPEWIRE60=0)
|
||||
endif()
|
||||
set_property(TARGET krfb_framebuffer_pw PROPERTY C_STANDARD 99)
|
||||
|
||||
target_link_libraries(krfb_framebuffer_pw
|
||||
|
|
|
@ -340,17 +340,28 @@ void PWFrameBuffer::Private::handleFrame(const PipeWireFrame &frame)
|
|||
{
|
||||
cursor = frame.cursor;
|
||||
|
||||
#if KPIPEWIRE60
|
||||
if (!frame.dmabuf && !frame.image) {
|
||||
#else
|
||||
if (!frame.dmabuf && !frame.dataFrame) {
|
||||
#endif
|
||||
qCDebug(KRFB_FB_PIPEWIRE) << "Got empty buffer. The buffer possibly carried only "
|
||||
"information about the mouse cursor.";
|
||||
return;
|
||||
}
|
||||
|
||||
#if KPIPEWIRE60
|
||||
if (frame.image) {
|
||||
memcpy(q->fb, frame.image->constBits(), frame.image->sizeInBytes());
|
||||
setVideoSize(frame.image->size());
|
||||
}
|
||||
#else
|
||||
if (frame.dataFrame) {
|
||||
// FIXME: Assuming stride == width * 4, not sure to which extent this holds
|
||||
setVideoSize(frame.dataFrame->size);
|
||||
memcpy(q->fb, frame.dataFrame->data, frame.dataFrame->size.width() * frame.dataFrame->stride);
|
||||
}
|
||||
#endif
|
||||
else if (frame.dmabuf) {
|
||||
// FIXME: Assuming stride == width * 4, not sure to which extent this holds
|
||||
const QSize size = { frame.dmabuf->width, frame.dmabuf->height };
|
||||
|
|
Loading…
Reference in New Issue
Block a user