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.
25 lines
524 B
C++
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);
|
|
}
|
|
}
|