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