add zoom control

This commit is contained in:
Maik Jurischka
2025-12-19 07:01:27 +01:00
parent 7313592993
commit 5fed3070de
2 changed files with 98 additions and 12 deletions

View File

@@ -7,6 +7,8 @@
#include <QLineEdit>
#include <QLabel>
#include <QImage>
#include <QSlider>
#include <QScrollArea>
#include <gst/gst.h>
#include <gst/app/gstappsink.h>
@@ -25,6 +27,7 @@ private slots:
void onStartViewer();
void onStopViewer();
void onSourceTypeChanged(int index);
void onZoomChanged(int value);
void displayFrame(const QImage& frame);
private:
@@ -39,6 +42,7 @@ private:
static GstFlowReturn newSampleCallback(GstAppSink* appsink, gpointer user_data);
// UI elements
QScrollArea* m_scrollArea;
QLabel* m_videoDisplay;
QPushButton* m_startBtn;
QPushButton* m_stopBtn;
@@ -46,11 +50,17 @@ private:
QLineEdit* m_hostEdit;
QLineEdit* m_portEdit;
QLabel* m_statusLabel;
QSlider* m_zoomSlider;
QLabel* m_zoomLabel;
// GStreamer elements
GstElement* m_pipeline;
GstElement* m_appSink;
guint m_busWatchId;
// Video state
QImage m_currentFrame;
double m_zoomFactor;
};
#endif // VIDEOVIEWERWIDGET_H