Connects to an RTSP camera and displays the video in a window.
More...
#include <rtsp_player.h>
|
| void | play (const QString name, const QString url, const QString user, const QString password) |
| | Connect to the camera in the background and start playing.
|
|
void | stop () |
| | Stop the stream, close the window and destroy this object.
|
|
| void | stateChanged (const QString &state) |
| | The state of the stream changed.
|
|
| | RtspPlayer (QWidget *parent=nullptr) |
| | Construct a new RTSP player and show the window.
|
|
| ~RtspPlayer () final |
| | Stop the stream and close the window.
|
|
|
bool | eventFilter (QObject *obj, QEvent *event) override |
| | Event filter to keep the image fitted to the dialog on resize.
|
|
|
void | showFrame (const QImage &image) |
| | Show a received frame.
|
|
void | sessionState (mediax::qt6::QtRtspDepayloader::State state) |
| | Update the status bar and report the new state.
|
|
void | noFrame () |
| | Blank the display when no frames are arriving.
|
|
|
void | setLabelColour (const QString &colour) |
| | Set the colour of the stream label.
|
|
|
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 address label (without credentials).
|
|
QLabel * | m_format_label = nullptr |
| | Resolution label.
|
|
QLabel * | m_frame_label = nullptr |
| | Frame counter label.
|
|
QTimer | m_blank_timer |
| | No-frame blanking timer.
|
|
mediax::qt6::QtRtspDepayloader * | m_receiver = nullptr |
| | The RTSP receiver.
|
|
quint64 | m_frame_count = 0 |
| | Frames received.
|
Connects to an RTSP camera and displays the video in a window.
The stream stops and the object is destroyed when the window is closed or stop() is called.
◆ RtspPlayer()
| RtspPlayer::RtspPlayer |
( |
QWidget * | parent = nullptr | ) |
|
|
explicit |
Construct a new RTSP player and show the window.
- Parameters
-
| parent | the parent widget (the player closes when the parent closes) |
◆ play
| void RtspPlayer::play |
( |
const QString | name, |
|
|
const QString | url, |
|
|
const QString | user, |
|
|
const QString | password ) |
|
slot |
Connect to the camera in the background and start playing.
- Parameters
-
| name | the camera name shown in the window title |
| url | the stream URL, rtsp://[user[:password]@]host[:port]/path |
| user | the user name, empty to use any credentials in the URL |
| password | the password |
◆ stateChanged
| void RtspPlayer::stateChanged |
( |
const QString & | state | ) |
|
|
signal |
The state of the stream changed.
- Parameters
-
| state | a short description, e.g. "Playing" or "Failed: Connection refused" |
The documentation for this class was generated from the following files: