first commit

This commit is contained in:
Maik Jurischka
2025-12-18 16:10:55 +01:00
commit 69e2f3ae1d
19 changed files with 2707 additions and 0 deletions

55
videoviewerwidget.h Normal file
View File

@@ -0,0 +1,55 @@
#ifndef VIDEOVIEWERWIDGET_H
#define VIDEOVIEWERWIDGET_H
#include <QWidget>
#include <QPushButton>
#include <QComboBox>
#include <QLineEdit>
#include <QLabel>
#include <gst/gst.h>
class VideoViewerWidget : public QWidget
{
Q_OBJECT
public:
explicit VideoViewerWidget(QWidget *parent = nullptr);
~VideoViewerWidget();
protected:
void showEvent(QShowEvent* event) override;
private slots:
void onStartViewer();
void onStopViewer();
void onSourceTypeChanged(int index);
private:
void setupUI();
void initGStreamer();
void cleanupGStreamer();
void startPipeline();
void stopPipeline();
QString buildPipelineString();
void setupVideoOverlay();
static gboolean busCallback(GstBus* bus, GstMessage* msg, gpointer data);
static void onPrepareWindowHandle(GstBus* bus, GstMessage* msg, gpointer data);
// UI elements
QWidget* m_videoContainer;
QPushButton* m_startBtn;
QPushButton* m_stopBtn;
QComboBox* m_sourceType;
QLineEdit* m_hostEdit;
QLineEdit* m_portEdit;
QLabel* m_statusLabel;
// GStreamer elements
GstElement* m_pipeline;
GstElement* m_videoSink;
guint m_busWatchId;
WId m_windowId;
};
#endif // VIDEOVIEWERWIDGET_H