first commit
This commit is contained in:
55
videoviewerwidget.h
Normal file
55
videoviewerwidget.h
Normal 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
|
||||
Reference in New Issue
Block a user