ToolX 1.11.1 [e3f477f]
A GUI debug tool chain for diagnosing GVA systems
Loading...
Searching...
No Matches
stream_manager.h
Go to the documentation of this file.
1//
2// Copyright (c) 2026, Astute Systems PTY LTD
3//
4// This file is part of the VivoeX project developed by Astute Systems.
5//
6// License. See the LICENSE file in the project root for full license details.
7//
13
14#ifndef STREAMS_STREAM_MANAGER_H
15#define STREAMS_STREAM_MANAGER_H
16
17// for Q_OBJECT
18#include <QApplication>
19#include <QDialog>
20#include <QJsonObject>
21#include <QObject>
22#include <QComboBox>
23#include <memory>
24
25#include "rtp/rtp.h"
26#include "config.h"
27#include "../ui_toolx.h"
28#include "stream_generator.h"
29
30#include <optional>
31
32namespace toolx::streams {
33
34// Qt Stream Manager class
35class StreamManager : public QObject
36{
37 Q_OBJECT
38public:
45 explicit StreamManager(Ui::Dialog &ui, Config *config, QString deviceName, QLabel *rtp_streams,
46 QLabel *sap_enabled, QWidget *parent = nullptr);
47
48 ~StreamManager() final;
49
54 void addStreams();
55
65 QJsonObject toJson() const;
66
76 void fromJson(const QJsonObject &rtp);
77
83 int activeCount() const;
84
94 std::optional<StreamGenerator::EncoderType> encoderForStream(const QString &ip_address,
95 int port) const;
96public slots:
102 void enableStream(QTableWidgetItem *item);
103
108 void addRow(int row, VideoStreamInfo stream);
109
114 void createNewRow();
115
120 void removeRow();
121
126 void enableAll();
127
133 void sapEnable(int state);
134
142
143private:
150 void SetStreamDropdown(QComboBox *stream, int index = 0) const;
151
157 void SetPatternDropDown(QComboBox *item, int index = 0);
158
165 mediax::rtp::StreamInformation getStream(int row);
166
168 std::map<int, std::shared_ptr<StreamGenerator>> m_streams;
170 mediax::qt6::QtSapAnnouncer m_announcer;
172 Ui::Dialog &m_ui;
183};
184
185} // namespace toolx::streams
186
187#endif // STREAMS_STREAM_MANAGER_H
Definition config.h:33
Config * m_config
The Qt6 configuration manager.
Definition stream_manager.h:174
void enableStream(QTableWidgetItem *item)
Qt slot for when the user clicks the add stream button.
Definition stream_manager.cpp:496
mediax::rtp::StreamInformation getStream(int row)
Get the Stream object.
Definition stream_manager.cpp:794
void addStreams()
Add the streams in config to the table.
Definition stream_manager.cpp:207
int activeCount() const
Count the RTP streams that are transmitting.
Definition stream_manager.cpp:411
QJsonObject toJson() const
The RTP table as a JSON object for the configuration file.
Definition stream_manager.cpp:312
QLabel * m_sap_enabled
The SAP enabled label.
Definition stream_manager.h:182
void createNewRow()
Qt slot for when the user clicks the remove stream button.
Definition stream_manager.cpp:550
void SetStreamDropdown(QComboBox *stream, int index=0) const
Set the Pattern Stream Dropdown object.
Definition stream_manager.cpp:749
QLabel * m_rtp_streams
The RTP stream label.
Definition stream_manager.h:180
QString m_deviceName
Ethernet device name.
Definition stream_manager.h:176
void fromJson(const QJsonObject &rtp)
Replace the RTP table with the streams of a JSON object.
Definition stream_manager.cpp:347
std::map< int, std::shared_ptr< StreamGenerator > > m_streams
The video streams.
Definition stream_manager.h:168
void addRow(int row, VideoStreamInfo stream)
add a row to the table
Definition stream_manager.cpp:181
int m_streamCounter
RTP stream counter.
Definition stream_manager.h:178
void removeRow()
Remove the selected row.
Definition stream_manager.cpp:613
void refreshCodecAvailability()
Grey out the encodings that this build can not generate.
Definition stream_manager.cpp:445
void sapEnable(int state)
Enable SAP/SDP announcements.
Definition stream_manager.cpp:662
Ui::Dialog & m_ui
The Qt6 user interface.
Definition stream_manager.h:172
void enableAll()
Enable all the RTP streams.
Definition stream_manager.cpp:636
mediax::qt6::QtSapAnnouncer m_announcer
The SAP/SDP announcer.
Definition stream_manager.h:170
void SetPatternDropDown(QComboBox *item, int index=0)
Set the Pattern Drop Down object.
Definition stream_manager.cpp:762
StreamManager(Ui::Dialog &ui, Config *config, QString deviceName, QLabel *rtp_streams, QLabel *sap_enabled, QWidget *parent=nullptr)
The StreamManager class.
Definition stream_manager.cpp:67
std::optional< StreamGenerator::EncoderType > encoderForStream(const QString &ip_address, int port) const
The H.264 encoder of the transmit stream sent to an address.
Definition stream_manager.cpp:423
Session Announcement Protocol (SDP) implementation for listening to announcements of stream data....
Definition config.h:14