Replaced the complex, low-level OpenGL pipeline in HyperionGrabber with a simple, high-level `QImage::scaled()` call. This change significantly reduces code complexity and improves maintainability without sacrificing performance, as `QImage::scaled()` is highly optimized and often hardware-accelerated. The new implementation is more robust and easier to understand. This resolves the following issues: - Removes fragile, hard-to-debug OpenGL code. - Eliminates potential bugs related to FBOs, shaders, and texture handling. - Corrects the image data pipeline to ensure raw pixel data is processed consistently.
33 lines
725 B
C++
33 lines
725 B
C++
#include <QObject>
|
|
#include <QTimer>
|
|
#include <QImage>
|
|
#include <QVideoFrame>
|
|
|
|
#include "hyperionclient.h"
|
|
#include "WaylandGrabber.h"
|
|
|
|
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;
|
|
unsigned short _frameskip_m = 0;
|
|
long long _frameCounter_m = 0;
|
|
|
|
QString _parseColorArr(QString, bool);
|
|
|
|
private slots:
|
|
void _inActivity();
|
|
void _processFrame(const QVideoFrame &frame);
|
|
void _setImgSize(int width, int height);
|
|
}; |