KDEAmbi/hyperiongrabber.h
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

45 lines
1.0 KiB
C++

#include <QObject>
#include <QTimer>
#include <QImage>
#include "hyperionclient.h"
#include "WaylandGrabber.h"
#include <QOpenGLContext>
#include <QOpenGLFramebufferObject>
#include <QOpenGLFunctions>
#include <QOpenGLTexture>
#include <QOpenGLShader>
#include <QOpenGLShaderProgram>
#include <QVideoFrame>
#include <QOffscreenSurface>
class HyperionGrabber : public QObject
{
Q_OBJECT
public:
HyperionGrabber(QHash<QString, QString> opts);
~HyperionGrabber();
private:
HyperionClient *_hclient_p;
QTimer *_timer_p;
WaylandGrabber *_waylandGrabber_p;
int _inactiveTime_m = 0;
QString _hyperionPriority_m;
unsigned short _scale_m = 8;
QOpenGLContext *_context;
QOpenGLFramebufferObject *_fbo;
QOpenGLShaderProgram *_shaderProgram;
QOpenGLTexture *_texture;
QOpenGLFunctions *_functions;
QOffscreenSurface *_offscreenSurface;
QString _parseColorArr(QString, bool);
private slots:
void _inActivity();
void _processFrame(const QVideoFrame &frame);
void _setImgSize(int width, int height);
};