13#ifndef STREAMS_SRT_PLAYER_H
14#define STREAMS_SRT_PLAYER_H
17#include <QGraphicsPixmapItem>
18#include <QGraphicsScene>
19#include <QGraphicsView>
29#include "qt6/QtSrtDepayloader.h"
46 explicit SrtPlayer(QWidget *parent =
nullptr);
68 void play(
const QString name,
const QString url,
const QString description);
85 bool eventFilter(QObject *obj, QEvent *event)
override;
91 void linkState(mediax::qt6::QtSrtDepayloader::State state);
QPointer< QDialog > m_dialog
The player dialog.
Definition srt_player.h:104
QLabel * m_format_label
Resolution label.
Definition srt_player.h:116
void stateChanged(const QString &state)
The state of the stream changed.
QLabel * m_link_label
Link statistics label.
Definition srt_player.h:118
mediax::qt6::QtSrtDepayloader * m_receiver
The SRT receiver.
Definition srt_player.h:126
QTimer m_statistics_timer
Statistics refresh timer.
Definition srt_player.h:124
QPixmap m_pixmap
The displayed image.
Definition srt_player.h:112
QGraphicsView * m_view
The view.
Definition srt_player.h:108
void setLabelColour(const QString &colour)
Set the colour of the stream label.
Definition srt_player.cpp:193
void updateStatistics()
Show the link statistics.
Definition srt_player.cpp:173
QLabel * m_frame_label
Frame counter label.
Definition srt_player.h:120
void play(const QString name, const QString url, const QString description)
Start the SRT connection in the background and play.
Definition srt_player.cpp:110
void linkState(mediax::qt6::QtSrtDepayloader::State state)
Update the status bar and report the new state.
Definition srt_player.cpp:145
QGraphicsPixmapItem * m_pixmap_item
The pixmap item, kept to avoid flicker.
Definition srt_player.h:110
void showFrame(const QImage &image)
Show a received frame.
Definition srt_player.cpp:128
void noFrame()
Blank the display when no frames are arriving.
Definition srt_player.cpp:187
QLabel * m_stream_label
Stream description label.
Definition srt_player.h:114
SrtPlayer(QWidget *parent=nullptr)
Construct a new SRT player and show the window.
Definition srt_player.cpp:39
~SrtPlayer() final
Stop the stream and close the window.
Definition srt_player.cpp:94
void stop()
Stop the stream, close the window and destroy this object.
Definition srt_player.cpp:120
void linkError(const QString &message)
Report a connection error.
Definition srt_player.cpp:166
quint64 m_frame_count
Frames received.
Definition srt_player.h:128
static int activeCount()
The number of players that are open.
Definition srt_player.cpp:105
QGraphicsScene * m_scene
The scene.
Definition srt_player.h:106
QTimer m_blank_timer
No-frame blanking timer.
Definition srt_player.h:122
bool eventFilter(QObject *obj, QEvent *event) override
Event filter to keep the image fitted to the dialog on resize.
Definition srt_player.cpp:198