KDEAmbi/WaylandGrabber.cpp
Tobias J. Endres 3dda269c4b Fix: Correct image orientation in Wayland grabber
Resolved the issue where captured images were appearing upside down or flipped.
Implemented a final vertical flip on the QImage after reading from the OpenGL
Framebuffer Object (FBO) to ensure correct orientation before sending to Hyperion.
This completes the basic hardware-accelerated scaling pipeline.
2025-08-14 22:19:15 +02:00

25 lines
524 B
C++

#include "WaylandGrabber.h"
#include <QVideoFrame>
WaylandGrabber::WaylandGrabber(QObject *parent)
: QObject(parent)
{
m_captureSession.setScreenCapture(&m_screenCapture);
m_captureSession.setVideoSink(&m_videoSink);
connect(&m_videoSink, &QVideoSink::videoFrameChanged, this, &WaylandGrabber::handleFrame);
}
void WaylandGrabber::start()
{
m_screenCapture.start();
}
void WaylandGrabber::handleFrame(const QVideoFrame &frame)
{
if (frame.isValid())
{
emit frameReady(frame);
}
}