ToolX 1.11.1 [e3f477f]
A GUI debug tool chain for diagnosing GVA systems
Loading...
Searching...
No Matches
toolx::streams::StreamManager Class Reference
Inheritance diagram for toolx::streams::StreamManager:
Inheritance graph
Collaboration diagram for toolx::streams::StreamManager:
Collaboration graph

Public Slots

void enableStream (QTableWidgetItem *item)
 Qt slot for when the user clicks the add stream button.
void addRow (int row, VideoStreamInfo stream)
 add a row to the table
void createNewRow ()
 Qt slot for when the user clicks the remove stream button.
void removeRow ()
 Remove the selected row.
void enableAll ()
 Enable all the RTP streams.
void sapEnable (int state)
 Enable SAP/SDP announcements.
void refreshCodecAvailability ()
 Grey out the encodings that this build can not generate.

Public Member Functions

 StreamManager (Ui::Dialog &ui, Config *config, QString deviceName, QLabel *rtp_streams, QLabel *sap_enabled, QWidget *parent=nullptr)
 The StreamManager class.
void addStreams ()
 Add the streams in config to the table.
QJsonObject toJson () const
 The RTP table as a JSON object for the configuration file.
void fromJson (const QJsonObject &rtp)
 Replace the RTP table with the streams of a JSON object.
int activeCount () const
 Count the RTP streams that are transmitting.
std::optional< StreamGenerator::EncoderType > encoderForStream (const QString &ip_address, int port) const
 The H.264 encoder of the transmit stream sent to an address.

Private Member Functions

void SetStreamDropdown (QComboBox *stream, int index=0) const
 Set the Pattern Stream Dropdown object.
void SetPatternDropDown (QComboBox *item, int index=0)
 Set the Pattern Drop Down object.
mediax::rtp::StreamInformation getStream (int row)
 Get the Stream object.

Private Attributes

std::map< int, std::shared_ptr< StreamGenerator > > m_streams
 The video streams.
mediax::qt6::QtSapAnnouncer m_announcer
 The SAP/SDP announcer.
Ui::Dialog & m_ui
 The Qt6 user interface.
Config * m_config
 The Qt6 configuration manager.
QString m_deviceName
 Ethernet device name.
int m_streamCounter = 0
 RTP stream counter.
QLabel * m_rtp_streams
 The RTP stream label.
QLabel * m_sap_enabled
 The SAP enabled label.

Constructor & Destructor Documentation

◆ StreamManager()

toolx::streams::StreamManager::StreamManager ( Ui::Dialog & ui,
Config * config,
QString deviceName,
QLabel * rtp_streams,
QLabel * sap_enabled,
QWidget * parent = nullptr )
explicit

The StreamManager class.

The StreamManager class is a Qt dialog that allows the user to manage the streams that are being received. The user can select which streams to display, and which streams to record.

Start the SAP/SDP announcer

Member Function Documentation

◆ activeCount()

int toolx::streams::StreamManager::activeCount ( ) const

Count the RTP streams that are transmitting.

Returns
the number of started streams

◆ enableStream

void toolx::streams::StreamManager::enableStream ( QTableWidgetItem * item)
slot

Qt slot for when the user clicks the add stream button.

Parameters
item

◆ encoderForStream()

std::optional< StreamGenerator::EncoderType > toolx::streams::StreamManager::encoderForStream ( const QString & ip_address,
int port ) const

The H.264 encoder of the transmit stream sent to an address.

Used to play a stream sent by this tool with the matching decoder.

Parameters
ip_addressthe multicast address of the stream
portthe UDP port of the stream
Returns
the encoder if a H.264 row has this address and port, nothing otherwise

◆ fromJson()

void toolx::streams::StreamManager::fromJson ( const QJsonObject & rtp)

Replace the RTP table with the streams of a JSON object.

Running streams are stopped and the table is cleared. The new streams are added stopped. Missing or out of range values take defaults, an unknown encoding or test card name selects the first test card or H.264 (OpenH264).

Parameters
rtpthe object made by toJson()

◆ getStream()

mediax::rtp::StreamInformation toolx::streams::StreamManager::getStream ( int row)
private

Get the Stream object.

Parameters
rowthe row of the stream
Returns
mediax::rtp::StreamInformation

◆ refreshCodecAvailability

void toolx::streams::StreamManager::refreshCodecAvailability ( )
slot

Grey out the encodings that this build can not generate.

Greys out the H.264 (VAAPI) and AV1 encoding choices, and any stream already set to one of them, when VAAPI support was not built in.

◆ sapEnable

void toolx::streams::StreamManager::sapEnable ( int state)
slot

Enable SAP/SDP announcements.

Parameters
state

◆ SetPatternDropDown()

void toolx::streams::StreamManager::SetPatternDropDown ( QComboBox * item,
int index = 0 )
private

Set the Pattern Drop Down object.

Parameters
item

◆ SetStreamDropdown()

void toolx::streams::StreamManager::SetStreamDropdown ( QComboBox * stream,
int index = 0 ) const
private

Set the Pattern Stream Dropdown object.

Parameters
stream
index

◆ toJson()

QJsonObject toolx::streams::StreamManager::toJson ( ) const

The RTP table as a JSON object for the configuration file.

Holds the state of the SAP announcements check box and one entry per row with the session name, address, port, size, frame rate, encoding and test card. The encoding and the test card are stored by name. Whether a stream is running is not stored.

Returns
QJsonObject { "sapAnnouncements": bool, "streams": [ ... ] }

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