13#ifndef STREAMS_RTSP_PLAYER_H
14#define STREAMS_RTSP_PLAYER_H
17#include <QGraphicsPixmapItem>
18#include <QGraphicsScene>
19#include <QGraphicsView>
29#include "qt6/QtRtspDepayloader.h"
46 explicit RtspPlayer(QWidget *parent =
nullptr);
62 void play(
const QString name,
const QString url,
const QString user,
const QString password);
79 bool eventFilter(QObject *obj, QEvent *event)
override;
85 void sessionState(mediax::qt6::QtRtspDepayloader::State state);
void stop()
Stop the stream, close the window and destroy this object.
Definition rtsp_player.cpp:114
void setLabelColour(const QString &colour)
Set the colour of the stream label.
Definition rtsp_player.cpp:180
mediax::qt6::QtRtspDepayloader * m_receiver
The RTSP receiver.
Definition rtsp_player.h:112
void noFrame()
Blank the display when no frames are arriving.
Definition rtsp_player.cpp:174
bool eventFilter(QObject *obj, QEvent *event) override
Event filter to keep the image fitted to the dialog on resize.
Definition rtsp_player.cpp:185
quint64 m_frame_count
Frames received.
Definition rtsp_player.h:114
~RtspPlayer() final
Stop the stream and close the window.
Definition rtsp_player.cpp:92
void sessionState(mediax::qt6::QtRtspDepayloader::State state)
Update the status bar and report the new state.
Definition rtsp_player.cpp:139
QLabel * m_frame_label
Frame counter label.
Definition rtsp_player.h:108
QLabel * m_stream_label
Stream address label (without credentials).
Definition rtsp_player.h:104
QGraphicsPixmapItem * m_pixmap_item
The pixmap item, kept to avoid flicker.
Definition rtsp_player.h:100
void stateChanged(const QString &state)
The state of the stream changed.
QGraphicsScene * m_scene
The scene.
Definition rtsp_player.h:96
QGraphicsView * m_view
The view.
Definition rtsp_player.h:98
QTimer m_blank_timer
No-frame blanking timer.
Definition rtsp_player.h:110
QPixmap m_pixmap
The displayed image.
Definition rtsp_player.h:102
void showFrame(const QImage &image)
Show a received frame.
Definition rtsp_player.cpp:122
QLabel * m_format_label
Resolution label.
Definition rtsp_player.h:106
QPointer< QDialog > m_dialog
The player dialog.
Definition rtsp_player.h:94
RtspPlayer(QWidget *parent=nullptr)
Construct a new RTSP player and show the window.
Definition rtsp_player.cpp:42
void play(const QString name, const QString url, const QString user, const QString password)
Connect to the camera in the background and start playing.
Definition rtsp_player.cpp:101