14#ifndef STREAMS_SAP_PLAYER_H
15#define STREAMS_SAP_PLAYER_H
17#include "../ui_player.h"
23#include <QElapsedTimer>
26#include <QGraphicsPixmapItem>
27#include <QGraphicsView>
30#include "rtp/mkv_recorder.h"
33# include "qt6/QtRtpVaapiH264Depayloader.h"
34# include "qt6/QtRtpVaapiH265Depayloader.h"
37#include "qt6/QtRtpOpenH264Depayloader.h"
38#include "qt6/QtRtpUncompressedDepayloader.h"
39#include "qt6/QtRtpJpegDepayloader.h"
41# include "qt6/QtRtpAv1Depayloader.h"
77 void play(
const QString name, const ::mediax::sap::SdpMessage sap);
114 bool eventFilter(QObject *obj, QEvent *event)
override;
129#ifdef VAAPI_SUPPORTED
131 mediax::qt6::QtRtpVaapiH264Depayloader m_rtpVaapiH264Depayloader;
133 mediax::qt6::QtRtpH265Depayloader m_rtpH265Depayloader;
135 toolx::streams::QtRtpVaapiAv1Depayloader m_rtpVaapiAv1Depayloader;
139#if defined(BUILD_RUST) && !defined(VAAPI_SUPPORTED)
141 mediax::qt6::QtRtpAv1Depayloader m_rtpAv1Depayloader;
QGraphicsView * m_graphicsView
Pointer to the graphics view (cached to avoid findChild per frame).
Definition sap_player.h:162
QDialog * m_player_dialog
The player dialog.
Definition sap_player.h:120
void stopRecording()
Stop/pause recording (finalise MKV file).
Definition sap_player.cpp:439
mediax::qt6::QtRtpUncompressedDepayloader m_rtpUncompressedDepayloader
The RTP depayloader (uncompressed).
Definition sap_player.h:146
mediax::qt6::QtRtpDepayloader * m_depayloader
The RTP depayloader.
Definition sap_player.h:148
StreamGenerator::EncoderType m_decoder
The Decoder type.
Definition sap_player.h:178
void newFrame(Frame frame)
Receive a new video frame.
Definition sap_player.cpp:288
QLabel * m_recordingLabel
The recording status label.
Definition sap_player.h:184
QLabel * label_width
The frame width.
Definition sap_player.h:174
void startRecording()
Start recording to MKV file.
Definition sap_player.cpp:394
mediax::qt6::QtRtpOpenH264Depayloader m_rtpOpenH264Depayloader
The RTP depayloader (compressed H.264).
Definition sap_player.h:138
QTimer m_timer
Timer for blanking video (fires after prolonged silence).
Definition sap_player.h:150
QTimer m_renderTimer
Fixed-rate display timer for smooth rendering.
Definition sap_player.h:152
QLabel * label_framerate
The frame rate.
Definition sap_player.h:176
QGraphicsPixmapItem * m_pixmapItem
The persistent pixmap item (avoids clear/add flicker).
Definition sap_player.h:124
QLabel * m_stream_label
The stream details.
Definition sap_player.h:170
mediax::qt6::QtRtpJpegDepayloader m_rtpJpegDepayloader
The RTP depayloader (compressed JPEG, RFC 2435).
Definition sap_player.h:144
void updateRecordButtonIcon()
Update the record button icon based on recording state.
Definition sap_player.cpp:462
void renderFrame()
Render the latest buffered frame at display rate.
Definition sap_player.cpp:305
QLabel * label_height
The frame height.
Definition sap_player.h:172
QStatusBar * m_status_bar
The status bar.
Definition sap_player.h:164
static int activeCount()
The number of open RTP player windows.
Definition sap_player.cpp:129
uint32_t m_frame_count
The frame count.
Definition sap_player.h:166
uint32_t m_actualHeight
Actual decoded frame height (from latest received frame).
Definition sap_player.h:190
QGraphicsScene * m_scene
The scene for the player.
Definition sap_player.h:122
~SapPlayer() final
Destroy the Sap Player object.
Definition sap_player.cpp:119
void play(const QString name, const ::mediax::sap::SdpMessage sap)
New frame signal.
Definition sap_player.cpp:134
bool m_framePending
Whether a new frame is pending render.
Definition sap_player.h:160
::mediax::sap::SdpMessage m_sap
The SAP message.
Definition sap_player.h:128
Frame m_pendingFrame
The latest raw frame waiting to be rendered (stored cheaply, converted at render time).
Definition sap_player.h:156
Ui::Player * m_player_ui
The UI for the player.
Definition sap_player.h:118
void noFrame()
Timer to blank frame.
Definition sap_player.cpp:385
QPushButton * m_recordButton
The record button.
Definition sap_player.h:186
QPixmap m_pixmap
The pixmap for the player.
Definition sap_player.h:126
QByteArray m_convertBuffer
Reusable buffer for colorspace conversion (avoids per-frame heap allocation).
Definition sap_player.h:158
mediax::rtp::MkvRecorder m_mkvRecorder
The MKV recorder.
Definition sap_player.h:180
QLabel * m_frame_count_label
The frame count label.
Definition sap_player.h:168
bool eventFilter(QObject *obj, QEvent *event) override
Event filter to handle dialog resize events.
Definition sap_player.cpp:109
bool m_recording
Whether recording is active.
Definition sap_player.h:182
SapPlayer(StreamGenerator::EncoderType decoder, QWidget *parent=nullptr)
Construct a new Sap Player object.
Definition sap_player.cpp:38
std::mutex m_frameMutex
Mutex protecting the pending frame buffer.
Definition sap_player.h:154
uint32_t m_actualWidth
Actual decoded frame width (from latest received frame).
Definition sap_player.h:188
void toggleRecording()
Toggle recording on/off.
Definition sap_player.cpp:453
EncoderType
The encoder type.
Definition stream_generator.h:36
Qt wrapper for the MediaX VAAPI AV1 depayloader.
Session Announcement Protocol (SDP) implementation for listening to announcements of stream data....