ToolX 1.11.1 [e3f477f]
A GUI debug tool chain for diagnosing GVA systems
Loading...
Searching...
No Matches
SrtPlayer Class Reference

Receives an SRT stream and displays the video in a window. More...

#include <srt_player.h>

Inheritance diagram for SrtPlayer:
Inheritance graph
Collaboration diagram for SrtPlayer:
Collaboration graph

Public Slots

void play (const QString name, const QString url, const QString description)
 Start the SRT connection in the background and play.
void stop ()
 Stop the stream, close the window and destroy this object.

Signals

void stateChanged (const QString &state)
 The state of the stream changed.

Public Member Functions

 SrtPlayer (QWidget *parent=nullptr)
 Construct a new SRT player and show the window.
 ~SrtPlayer () final
 Stop the stream and close the window.

Static Public Member Functions

static int activeCount ()
 The number of players that are open.

Protected Member Functions

bool eventFilter (QObject *obj, QEvent *event) override
 Event filter to keep the image fitted to the dialog on resize.

Private Slots

void showFrame (const QImage &image)
 Show a received frame.
void linkState (mediax::qt6::QtSrtDepayloader::State state)
 Update the status bar and report the new state.
void linkError (const QString &message)
 Report a connection error.
void noFrame ()
 Blank the display when no frames are arriving.
void updateStatistics ()
 Show the link statistics.

Private Member Functions

void setLabelColour (const QString &colour)
 Set the colour of the stream label.

Private Attributes

QPointer< QDialog > m_dialog
 The player dialog.
QGraphicsScene * m_scene = nullptr
 The scene.
QGraphicsView * m_view = nullptr
 The view.
QGraphicsPixmapItem * m_pixmap_item = nullptr
 The pixmap item, kept to avoid flicker.
QPixmap m_pixmap
 The displayed image.
QLabel * m_stream_label = nullptr
 Stream description label.
QLabel * m_format_label = nullptr
 Resolution label.
QLabel * m_link_label = nullptr
 Link statistics label.
QLabel * m_frame_label = nullptr
 Frame counter label.
QTimer m_blank_timer
 No-frame blanking timer.
QTimer m_statistics_timer
 Statistics refresh timer.
mediax::qt6::QtSrtDepayloader * m_receiver = nullptr
 The SRT receiver.
quint64 m_frame_count = 0
 Frames received.

Detailed Description

Receives an SRT stream and displays the video in a window.

The stream stops and the object is destroyed when the window is closed or stop() is called.

Constructor & Destructor Documentation

◆ SrtPlayer()

SrtPlayer::SrtPlayer ( QWidget * parent = nullptr)
explicit

Construct a new SRT player and show the window.

Parameters
parentthe parent widget (the player closes when the parent closes)

Member Function Documentation

◆ activeCount()

int SrtPlayer::activeCount ( )
static

The number of players that are open.

Returns
int the number of open player windows

◆ play

void SrtPlayer::play ( const QString name,
const QString url,
const QString description )
slot

Start the SRT connection in the background and play.

Parameters
namethe stream name shown in the window title
urlthe srt:// URL (it may hold a passphrase and is never shown)
descriptionwhat to show in the status bar, e.g. "Listener :9000"

◆ stateChanged

void SrtPlayer::stateChanged ( const QString & state)
signal

The state of the stream changed.

Parameters
statea short description, e.g. "Connected" or "Error: Connection timed out"

The documentation for this class was generated from the following files: