KDEAmbi/WaylandGrabber.cpp
Tobias J. Endres 18a8812d66 feat: Refactor to Wayland-only and add mock server
- Remove all X11-related code and dependencies.
- Create a mock Hyperion server for testing.
- Refactor the main application to be Wayland-only.
- Update the build system and documentation.
2025-08-14 20:31:00 +02:00

29 lines
617 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())
{
QImage image = frame.toImage();
if (!image.isNull())
{
emit frameReady(image);
}
}
}