This is the multi-page printable view of this section. Click here to print.
C++ SDK
- 1: Classes
- 1.1: AlignedData::DataFrame
- 1.2: ControlDataCommon::ConnectionStatus
- 1.3: ControlDataCommon::Response
- 1.4: ControlDataCommon::StatusMessage
- 1.5: ControlDataReceiver
- 1.6: ControlDataReceiver::IncomingRequest
- 1.7: ControlDataReceiver::ReceiverResponse
- 1.8: ControlDataReceiver::Settings
- 1.9: ControlDataSender
- 1.10: ControlDataSender::Settings
- 1.11: IngestApplication
- 1.12: IngestApplication::Settings
- 1.13: ISystemControllerInterface
- 1.14: ISystemControllerInterface::Callbacks
- 1.15: ISystemControllerInterface::Response
- 1.16: MediaReceiver
- 1.17: MediaReceiver::NewStreamParameters
- 1.18: MediaReceiver::Settings
- 1.19: MediaStreamer
- 1.20: MediaStreamer::Configuration
- 1.21: SystemControllerConnection
- 1.22: SystemControllerConnection::Settings
- 1.23: TimeCommon::TAIStatus
- 1.24: TimeCommon::TimeStructure
- 2: Files
- 2.1: include/AclLog.h
- 2.2: include/AlignedData.h
- 2.3: include/Base64.h
- 2.4: include/ControlDataCommon.h
- 2.5: include/ControlDataReceiver.h
- 2.6: include/ControlDataSender.h
- 2.7: include/IngestApplication.h
- 2.8: include/IngestUtils.h
- 2.9: include/ISystemControllerInterface.h
- 2.10: include/MediaReceiver.h
- 2.11: include/MediaStreamer.h
- 2.12: include/SystemControllerConnection.h
- 2.13: include/TimeCommon.h
- 2.14: include/UUIDUtils.h
- 3: Namespaces
- 3.1: AclLog
- 3.2: AlignedData
- 3.3: ControlDataCommon
- 3.4: IngestUtils
- 3.5: TimeCommon
- 3.6: UUIDUtils
1 - Classes
Classes
- namespace AclLog
A namespace for logging utilities. - namespace AlignedData
- struct DataFrame
A frame of aligned data that is passed to the rendering engine from the MediaReceiver. A DataFrame contains a time stamped frame of media, which might be video, audio and auxiliary data such as subtitles. A single DataFrame can contain one or multiple types of media. Which media types are included can be probed by nullptr-checking/size checking the data members. The struct has ownership of all data pointers included. The struct includes all logic for freeing the resources held by this struct and the user should therefore just make sure the struct itself is deallocated to ensure all resources are freed.
- struct DataFrame
- namespace ControlDataCommon
- struct ConnectionStatus
Connection status struct containing information about a connection event. - struct Response
A response from a ControlDataReceiver to a request. The UUID tells which receiver the response is sent from. - struct StatusMessage
A status message from a ControlDataReceiver. The UUID tells which receiver the message is sent from.
- struct ConnectionStatus
- class ControlDataReceiver
A ControlDataReceiver can receive messages from a sender or another ControlDataReceiver using a network connection. It can also connect to and forward the incoming request messages to other receivers. The connections to the sender and the other receivers are controlled by an ISystemControllerInterface instance. The ControlDataReceiver has areceiving
orlistening
side, as well as asending
side. The listening side can listen to one single network port and have multiple ControlDataSenders and ControlDataReceivers connected to that port to receive requests from them. On the sending side of the ControlDataReceiver, it can be connected to the listening side of other ControlDataReceivers, used to forward all incoming messages to that receiver, as well as sending its own requests.- struct IncomingRequest
An incoming request to this ControlDataReceiver. - struct ReceiverResponse
A response message to a request. - struct Settings
Settings for a ControlDataReceiver.
- struct IncomingRequest
- class ControlDataSender
A ControlDataSender can send control signals to one or more receivers using a network connection. A single ControlDataSender can connect to multiple receivers, all identified by a UUID. The class is controlled using an ISystemControllerInterface; this interface is responsible for setting up connections to receivers. The ControlDataSender can send asynchronous requests to (all) the receivers and get a response back. Each response is identified with a request ID as well as the UUID of the responding receiver. The ControlDataSender can also receive status messages from the receivers.- struct Settings
Settings for a ControlDataSender.
- struct Settings
- class ISystemControllerInterface
An ISystemControllerInterface is the interface between a component and the System controller controlling the component. The interface allows for two-way communication between the component and the system controller by means of sending requests and getting responses. Classes deriving from the ISystemControllerInterface should provide the component side implementation of the communication with the system controller. This interface can be inherited and implemented by developers to connect to custom system controllers, or to directly control a component programmatically, without the need for connecting to a remote server. An ISystemControllerInterface can have a parent-child relationship with other interfaces, where the children are aware of which their parent interface is. This is useful for components that provides extra features for another component, but where the components are still to be considered as two separate entities with separate connections to the System controller. - class IngestApplication
- struct Settings
- namespace IngestUtils
- class MediaReceiver
A MediaReceiver contains the logic for receiving, decoding and aligning incoming media sources from the Ingests. The aligned data is then delivered to the Rendering Engine which is also responsible for setting up the MediaReceiver. The MediaReceiver has a builtin multi view generator, which can create output streams containing composited subsets of the incoming video sources. This class is controlled using an ISystemControllerInterface provided when starting it.- struct NewStreamParameters
A struct containing information on the format of an incoming stream. - struct Settings
Settings for a MediaReceiver.
- struct NewStreamParameters
- class MediaStreamer
MediaStreamer is a class that can take a single stream of uncompressed video and/or audio frames and encode and output it in some way to some interface. This interface can either be a stream to a network or writing down the data to a file on the hard drive. This class is configured from two interfaces. The input configuration (input video resolution, frame rate, pixel format, number of audio channels…) is made through this C++ API. The output stream is then started from the System Controller. Any of these configurations can be made first. The actual stream to output will start once the first call to.- struct Configuration
The input configuration of the frames that will be sent to this MediaStreamer. The output stream configuration is made from the System controller via the ISystemControllerInterface.
- struct Configuration
- class SystemControllerConnection
An implementation of the ISystemControllerInterface for a System controller residing in a remote server. The connection to the server uses a Websocket.- struct Settings
Settings for a SystemControllerConnection.
- struct Settings
- namespace TimeCommon
- struct TAIStatus
- struct TimeStructure
- namespace UUIDUtils
A namespace for UUID utility functions.
Updated on 2022-06-22 at 16:53:25 +0200
1.1 - AlignedData::DataFrame
AlignedData::DataFrame
A frame of aligned data that is passed to the rendering engine from the MediaReceiver. A DataFrame contains a time stamped frame of media, which might be video, audio and auxiliary data such as subtitles. A single DataFrame can contain one or multiple types of media. Which media types are included can be probed by nullptr-checking/size checking the data members. The struct has ownership of all data pointers included. The struct includes all logic for freeing the resources held by this struct and the user should therefore just make sure the struct itself is deallocated to ensure all resources are freed.
#include <AlignedData.h>
Public Functions
Name | |
---|---|
DataFrame() =default | |
~DataFrame() | |
DataFrame(DataFrame const & ) =delete | |
DataFrame & | operator=(DataFrame const & ) =delete |
Public Attributes
Name | |
---|---|
uint64_t | mPTS |
uint8_t * | mVideoDataCudaPtr |
PixelFormat | mPixelFormat |
uint32_t | mFrameRateN |
uint32_t | mFrameRateD |
uint32_t | mWidth |
uint32_t | mHeight |
std::vector< AudioSampleRow > | mAudioData |
uint32_t | mAudioChannels |
uint32_t | mAudioSamplingFrequency |
Public Functions Documentation
function DataFrame
DataFrame() =default
function ~DataFrame
inline ~DataFrame()
function DataFrame
DataFrame(
DataFrame const &
) =delete
function operator=
DataFrame & operator=(
DataFrame const &
) =delete
Public Attributes Documentation
variable mPTS
uint64_t mPTS;
variable mVideoDataCudaPtr
uint8_t * mVideoDataCudaPtr = nullptr;
variable mPixelFormat
PixelFormat mPixelFormat = PixelFormat::kUnknown;
variable mFrameRateN
uint32_t mFrameRateN = 0;
variable mFrameRateD
uint32_t mFrameRateD = 0;
variable mWidth
uint32_t mWidth = 0;
variable mHeight
uint32_t mHeight = 0;
variable mAudioData
std::vector< AudioSampleRow > mAudioData;
variable mAudioChannels
uint32_t mAudioChannels = 0;
variable mAudioSamplingFrequency
uint32_t mAudioSamplingFrequency = 0;
Updated on 2022-06-22 at 16:53:25 +0200
1.2 - ControlDataCommon::ConnectionStatus
ControlDataCommon::ConnectionStatus
Connection status struct containing information about a connection event.
#include <ControlDataCommon.h>
Public Functions
Name | |
---|---|
ConnectionStatus() =default | |
ConnectionStatus(ConnectionType mConnectionType, const std::string & mIp, uint16_t mPort) |
Public Attributes
Name | |
---|---|
ConnectionType | mConnectionType |
std::string | mIP |
uint16_t | mPort |
Public Functions Documentation
function ConnectionStatus
ConnectionStatus() =default
function ConnectionStatus
inline ConnectionStatus(
ConnectionType mConnectionType,
const std::string & mIp,
uint16_t mPort
)
Public Attributes Documentation
variable mConnectionType
ConnectionType mConnectionType;
variable mIP
std::string mIP;
variable mPort
uint16_t mPort = 0;
Updated on 2022-06-22 at 16:53:25 +0200
1.3 - ControlDataCommon::Response
ControlDataCommon::Response
A response from a ControlDataReceiver to a request. The UUID tells which receiver the response is sent from.
#include <ControlDataCommon.h>
Public Attributes
Name | |
---|---|
std::vector< uint8_t > | mMessage |
uint64_t | mRequestId The actual message. |
std::string | mFromUUID The ID of the request this is a response to. |
Public Attributes Documentation
variable mMessage
std::vector< uint8_t > mMessage;
variable mRequestId
uint64_t mRequestId = 0;
The actual message.
variable mFromUUID
std::string mFromUUID;
The ID of the request this is a response to.
Updated on 2022-06-22 at 16:53:25 +0200
1.4 - ControlDataCommon::StatusMessage
ControlDataCommon::StatusMessage
A status message from a ControlDataReceiver. The UUID tells which receiver the message is sent from.
#include <ControlDataCommon.h>
Public Attributes
Name | |
---|---|
std::vector< uint8_t > | mMessage |
std::string | mFromUUID The actual message. |
Public Attributes Documentation
variable mMessage
std::vector< uint8_t > mMessage;
variable mFromUUID
std::string mFromUUID;
The actual message.
Updated on 2022-06-22 at 16:53:25 +0200
1.5 - ControlDataReceiver
ControlDataReceiver
A ControlDataReceiver can receive messages from a sender or another ControlDataReceiver using a network connection. It can also connect to and forward the incoming request messages to other receivers. The connections to the sender and the other receivers are controlled by an ISystemControllerInterface instance. The ControlDataReceiver has a receiving
or listening
side, as well as a sending
side. The listening side can listen to one single network port and have multiple ControlDataSenders and ControlDataReceivers connected to that port to receive requests from them. On the sending side of the ControlDataReceiver, it can be connected to the listening side of other ControlDataReceivers, used to forward all incoming messages to that receiver, as well as sending its own requests. More…
#include <ControlDataReceiver.h>
Public Classes
Name | |
---|---|
struct | IncomingRequest An incoming request to this ControlDataReceiver. |
struct | ReceiverResponse A response message to a request. |
struct | Settings Settings for a ControlDataReceiver. |
Public Functions
Name | |
---|---|
ControlDataReceiver() Default constructor, creates an empty object. | |
~ControlDataReceiver() Destructor. Will disconnect from the connected receivers and close the System controller connection. | |
bool | configure(const std::shared_ptr< ISystemControllerInterface > & controllerInterface, const Settings & settings) Configure this ControlDataReceiver and connect it to the System Controller. This method will fail in case the ISystemControllerInterface has already been connected to the controller by another component, as such interface can only be used by one component. |
bool | sendStatusMessageToSender(const std::vector< uint8_t > & message) Send a status message to the (directly or indirectly) connected ControlDataSender. In case this ControlDataReceiver has another ControlDataReceiver as sender, that receiver will forward the status message to the sender. |
bool | sendRequestToReceivers(const std::vector< uint8_t > & request, uint64_t & requestId) Send a request to the connected ControlDataReceivers asynchronously. This request will only be sent to ControlDataReceivers on the receiving side of this receiver. In case a receiver is located between this ControlDataReceiver and the sender, neither of those will see this request. The response will be sent to the response callback asynchronously. |
ControlDataReceiver(ControlDataReceiver const & ) =delete | |
ControlDataReceiver & | operator=(ControlDataReceiver const & ) =delete |
std::string | getVersion() Get application version. |
std::string | getBuildInfo() Get application build information. |
Detailed Description
class ControlDataReceiver;
A ControlDataReceiver can receive messages from a sender or another ControlDataReceiver using a network connection. It can also connect to and forward the incoming request messages to other receivers. The connections to the sender and the other receivers are controlled by an ISystemControllerInterface instance. The ControlDataReceiver has a receiving
or listening
side, as well as a sending
side. The listening side can listen to one single network port and have multiple ControlDataSenders and ControlDataReceivers connected to that port to receive requests from them. On the sending side of the ControlDataReceiver, it can be connected to the listening side of other ControlDataReceivers, used to forward all incoming messages to that receiver, as well as sending its own requests.
Each ControlDataReceiver can be configured to have a certain message delay. This delay parameter is set when the System controller instructs the ControlDataReceiver to start listening for incoming connections from senders (or sending ControlDataReceiver). Each incoming request will then be delayed and delivered according to the parameter, compared to the send timestamp in the message. In case multiple receivers are chained, like sender->receiver1->receiver2, receiver1 will delay the incoming messages from the sender based on when they were sent from the sender. Furthermore, receiver2 will delay them compared to when they were sent from receiver1.
A ControlDataReceiver can send status messages back to the sender. In case of chained receivers, the message will be forwarded back to the sender. A user of the ControlDataReceiver can register callbacks to receive requests and status messages. There is also an optional “preview” callback that is useful in case the incoming messages are delayed (have a delay > 0). This callback will then be called as soon as the request message arrives, to allow the user to prepare for when the actual delayed request callback is called.
Public Functions Documentation
function ControlDataReceiver
ControlDataReceiver()
Default constructor, creates an empty object.
function ~ControlDataReceiver
~ControlDataReceiver()
Destructor. Will disconnect from the connected receivers and close the System controller connection.
function configure
bool configure(
const std::shared_ptr< ISystemControllerInterface > & controllerInterface,
const Settings & settings
)
Configure this ControlDataReceiver and connect it to the System Controller. This method will fail in case the ISystemControllerInterface has already been connected to the controller by another component, as such interface can only be used by one component.
Parameters:
- controllerInterface The interface to the System controller, used for communicating with this ControlDataReceiver
- settings The settings to use for this ControlDataReceiver
Return: True on success, false otherwise
function sendStatusMessageToSender
bool sendStatusMessageToSender(
const std::vector< uint8_t > & message
)
Send a status message to the (directly or indirectly) connected ControlDataSender. In case this ControlDataReceiver has another ControlDataReceiver as sender, that receiver will forward the status message to the sender.
Parameters:
- message The status message
Return: True in case the message was sent successfully, false otherwise.
function sendRequestToReceivers
bool sendRequestToReceivers(
const std::vector< uint8_t > & request,
uint64_t & requestId
)
Send a request to the connected ControlDataReceivers asynchronously. This request will only be sent to ControlDataReceivers on the receiving side of this receiver. In case a receiver is located between this ControlDataReceiver and the sender, neither of those will see this request. The response will be sent to the response callback asynchronously.
Parameters:
- request The request message
- requestId The unique identifier of this request. Used to identify the async response.
Return: True if the request was successfully sent, false otherwise
function ControlDataReceiver
ControlDataReceiver(
ControlDataReceiver const &
) =delete
function operator=
ControlDataReceiver & operator=(
ControlDataReceiver const &
) =delete
function getVersion
static std::string getVersion()
Get application version.
Return: a string with the current version, e.g. “1.0.0”
function getBuildInfo
static std::string getBuildInfo()
Get application build information.
Return: a string with the current build information such as git hashes of all direct dependencies
Updated on 2022-06-22 at 16:53:25 +0200
1.6 - ControlDataReceiver::IncomingRequest
ControlDataReceiver::IncomingRequest
An incoming request to this ControlDataReceiver.
#include <ControlDataReceiver.h>
Public Attributes
Name | |
---|---|
std::vector< uint8_t > | mMessage |
std::string | mSenderUUID The actual message. |
std::string | mRequesterUUID UUID of the sender/forwarder that sent the request to this ControlDataReceiver. |
uint64_t | mRequestID UUID of the requester (the original sender, creating the request) |
int64_t | mSenderTimestampUs The requester’s unique id of this request. |
int64_t | mDeliveryTimestampUs The TAI timestamp when this message was sent from the sender/forwarder in micro sec since TAI epoch. |
Public Attributes Documentation
variable mMessage
std::vector< uint8_t > mMessage;
variable mSenderUUID
std::string mSenderUUID;
The actual message.
variable mRequesterUUID
std::string mRequesterUUID;
UUID of the sender/forwarder that sent the request to this ControlDataReceiver.
variable mRequestID
uint64_t mRequestID = 0;
UUID of the requester (the original sender, creating the request)
variable mSenderTimestampUs
int64_t mSenderTimestampUs =
0;
The requester’s unique id of this request.
variable mDeliveryTimestampUs
int64_t mDeliveryTimestampUs =
0;
The TAI timestamp when this message was sent from the sender/forwarder in micro sec since TAI epoch.
Updated on 2022-06-22 at 16:53:25 +0200
1.7 - ControlDataReceiver::ReceiverResponse
ControlDataReceiver::ReceiverResponse
A response message to a request.
#include <ControlDataReceiver.h>
Public Attributes
Name | |
---|---|
std::vector< uint8_t > | mMessage |
Public Attributes Documentation
variable mMessage
std::vector< uint8_t > mMessage;
Updated on 2022-06-22 at 16:53:25 +0200
1.8 - ControlDataReceiver::Settings
ControlDataReceiver::Settings
Settings for a ControlDataReceiver.
#include <ControlDataReceiver.h>
Public Attributes
Name | |
---|---|
std::function< void(const IncomingRequest &)> | mPreviewIncomingRequestCallback |
std::function< ReceiverResponse(const IncomingRequest &)> | mIncomingRequestCallback |
std::function< void(const ControlDataCommon::ConnectionStatus &)> | mConnectionStatusCallback |
std::function< void(const ControlDataCommon::Response &)> | mResponseCallback Callback for connection events. |
Public Attributes Documentation
variable mPreviewIncomingRequestCallback
std::function< void(const IncomingRequest &)> mPreviewIncomingRequestCallback;
Callback called as soon as this ControlDataReceiver gets the request, as a “preview” of what requests will be delievered.
variable mIncomingRequestCallback
std::function< ReceiverResponse(const IncomingRequest &)> mIncomingRequestCallback;
The actual callback used when this ControlDataReceiver gets a request and wants a response back. This callback will delay and deliver the request according to this receiver’s configured delay.
variable mConnectionStatusCallback
std::function< void(const ControlDataCommon::ConnectionStatus &)> mConnectionStatusCallback;
variable mResponseCallback
std::function< void(const ControlDataCommon::Response &)> mResponseCallback;
Callback for connection events.
Updated on 2022-06-22 at 16:53:25 +0200
1.9 - ControlDataSender
ControlDataSender
A ControlDataSender can send control signals to one or more receivers using a network connection. A single ControlDataSender can connect to multiple receivers, all identified by a UUID. The class is controlled using an ISystemControllerInterface; this interface is responsible for setting up connections to receivers. The ControlDataSender can send asynchronous requests to (all) the receivers and get a response back. Each response is identified with a request ID as well as the UUID of the responding receiver. The ControlDataSender can also receive status messages from the receivers.
#include <ControlDataSender.h>
Public Classes
Name | |
---|---|
struct | Settings Settings for a ControlDataSender. |
Public Functions
Name | |
---|---|
ControlDataSender() Default constructor, creates an empty object. | |
~ControlDataSender() Destructor. Will disconnect from the connected receivers and close the System controller connection. | |
bool | configure(const std::shared_ptr< ISystemControllerInterface > & controllerInterface, const Settings & settings) Configure this ControlDataSender and connect it to the System Controller. This method will fail in case the ISystemControllerInterface has already been connected to the controller by another component, as such interface can only be used by one component. |
bool | sendRequestToReceivers(const std::vector< uint8_t > & request, uint64_t & requestId) Send a request to all the connected ControlDataReceivers asynchronously. The responses will be sent to the response callback. |
ControlDataSender(ControlDataSender const & ) =delete | |
ControlDataSender & | operator=(ControlDataSender const & ) =delete |
std::string | getVersion() Get application version. |
std::string | getBuildInfo() Get application build information. |
Public Functions Documentation
function ControlDataSender
ControlDataSender()
Default constructor, creates an empty object.
function ~ControlDataSender
~ControlDataSender()
Destructor. Will disconnect from the connected receivers and close the System controller connection.
function configure
bool configure(
const std::shared_ptr< ISystemControllerInterface > & controllerInterface,
const Settings & settings
)
Configure this ControlDataSender and connect it to the System Controller. This method will fail in case the ISystemControllerInterface has already been connected to the controller by another component, as such interface can only be used by one component.
Parameters:
- controllerInterface The interface to the System controller, used for communicating with this ControlDataSender
- settings The Settings to use for this ControlDataSender
Return: True on success, false otherwise
function sendRequestToReceivers
bool sendRequestToReceivers(
const std::vector< uint8_t > & request,
uint64_t & requestId
)
Send a request to all the connected ControlDataReceivers asynchronously. The responses will be sent to the response callback.
Parameters:
- request The request message
- requestId The unique identifier of this request. Used to identify the async responses.
Return: True if the request was successfully sent, false otherwise
function ControlDataSender
ControlDataSender(
ControlDataSender const &
) =delete
function operator=
ControlDataSender & operator=(
ControlDataSender const &
) =delete
function getVersion
static std::string getVersion()
Get application version.
Return: a string with the current version, e.g. “1.0.0”
function getBuildInfo
static std::string getBuildInfo()
Get application build information.
Return: a string with the current build information such as git hashes of all direct dependencies
Updated on 2022-06-22 at 16:53:25 +0200
1.10 - ControlDataSender::Settings
ControlDataSender::Settings
Settings for a ControlDataSender.
#include <ControlDataSender.h>
Public Attributes
Name | |
---|---|
std::function< void(const ControlDataCommon::ConnectionStatus &)> | mConnectionStatusCallback |
std::function< void(const ControlDataCommon::Response &)> | mResponseCallback |
std::function< void(const ControlDataCommon::StatusMessage &)> | mStatusMessageCallback |
Public Attributes Documentation
variable mConnectionStatusCallback
std::function< void(const ControlDataCommon::ConnectionStatus &)> mConnectionStatusCallback;
variable mResponseCallback
std::function< void(const ControlDataCommon::Response &)> mResponseCallback;
variable mStatusMessageCallback
std::function< void(const ControlDataCommon::StatusMessage &)> mStatusMessageCallback;
Updated on 2022-06-22 at 16:53:25 +0200
1.11 - IngestApplication
IngestApplication
Public Classes
Name | |
---|---|
struct | Settings |
Public Functions
Name | |
---|---|
IngestApplication() Constructor, creates an empty IngestApplication without starting it. | |
~IngestApplication() Destructor. | |
bool | start(const std::shared_ptr< ISystemControllerInterface > & controllerInterface, const Settings & settings) Start this IngestApplication given an interface to the System Controller and an UUID. |
bool | stop() Stop this IngestApplication. |
std::string | getVersion() Get application version. |
std::string | getBuildInfo() Get application build information. |
Public Functions Documentation
function IngestApplication
IngestApplication()
Constructor, creates an empty IngestApplication without starting it.
function ~IngestApplication
~IngestApplication()
Destructor.
function start
bool start(
const std::shared_ptr< ISystemControllerInterface > & controllerInterface,
const Settings & settings
)
Start this IngestApplication given an interface to the System Controller and an UUID.
Parameters:
- controllerInterface The interface for communication with the System Controller
- settings The settings for the IngestApplication
Return: True if the IngestApplication was successfully started, false otherwise
function stop
bool stop()
Stop this IngestApplication.
Return: True if the IngestApplication was successfully stopped, false otherwise
function getVersion
static std::string getVersion()
Get application version.
Return: a string with the current version, e.g. “1.0.0”
function getBuildInfo
static std::string getBuildInfo()
Get application build information.
Return: a string with the current build information such as git hashes of all direct dependencies
Updated on 2022-06-22 at 16:53:25 +0200
1.12 - IngestApplication::Settings
IngestApplication::Settings
Public Attributes
Name | |
---|---|
bool | mDebugAudio |
bool | mDebugVideo |
Public Attributes Documentation
variable mDebugAudio
bool mDebugAudio = false;
variable mDebugVideo
bool mDebugVideo = false;
Updated on 2022-06-22 at 16:53:25 +0200
1.13 - ISystemControllerInterface
ISystemControllerInterface
An ISystemControllerInterface is the interface between a component and the System controller controlling the component. The interface allows for two-way communication between the component and the system controller by means of sending requests and getting responses. Classes deriving from the ISystemControllerInterface should provide the component side implementation of the communication with the system controller. This interface can be inherited and implemented by developers to connect to custom system controllers, or to directly control a component programmatically, without the need for connecting to a remote server. An ISystemControllerInterface can have a parent-child relationship with other interfaces, where the children are aware of which their parent interface is. This is useful for components that provides extra features for another component, but where the components are still to be considered as two separate entities with separate connections to the System controller.
#include <ISystemControllerInterface.h>
Inherited by SystemControllerConnection
Public Classes
Name | |
---|---|
struct | Callbacks A struct containing the callbacks that needs to be registered by the component using this interface. |
struct | Response A response to a request, consists of a status code and an (optional) parameters JSON object. |
Public Types
Name | |
---|---|
enum class uint32_t | StatusCode { SUCCESS = 3001, TOO_MANY_REQUESTS = 3101, UUID_ALREADY_REGISTERED = 3201, FORMAT_ERROR = 3202, ALREADY_CONFIGURED = 3203, OUT_OF_RESOURCES = 3204, NOT_FOUND = 3205, INTERNAL_ERROR = 3206, CONNECTION_FAILED = 3207, TIMEOUT_EXCEEDED = 3208, KEY_MISMATCH = 3209, UNKNOWN_REQUEST = 3210, MALFORMED_REQUEST = 3211, ALREADY_IN_USE = 3212} Status codes used in JSON response messages for Websockets. These are starting at 3000 since the 1000 - 2000 range is taken up by the Spec: https://datatracker.ietf.org/doc/html/rfc6455#section-7.4.1. |
Public Functions
Name | |
---|---|
virtual | ~ISystemControllerInterface() =default Virtual destructor. |
virtual Response | sendRequest(const std::string & request, const nlohmann::json & parameters) =0 Send a request with some JSON parameters to the controller and await the response. |
virtual bool | registerRequestCallback(const Callbacks & callbacks) =0 Register the callbacks to call for events in this class. |
virtual bool | connect() =0 Connect to the System controller. |
virtual bool | disconnect() =0 Disconnect from the System controller. |
virtual bool | isConnected() const =0 |
virtual std::string | getUUID() const =0 |
virtual bool | hasParent() const =0 |
virtual std::shared_ptr< ISystemControllerInterface > | getParentInterface() const =0 |
Public Types Documentation
enum StatusCode
Enumerator | Value | Description |
---|---|---|
SUCCESS | 3001 | 3000-3099 Info/Notifications |
TOO_MANY_REQUESTS | 3101 | 3100-3199 Warnings |
UUID_ALREADY_REGISTERED | 3201 | 3200-3299 Error |
FORMAT_ERROR | 3202 | |
ALREADY_CONFIGURED | 3203 | |
OUT_OF_RESOURCES | 3204 | |
NOT_FOUND | 3205 | |
INTERNAL_ERROR | 3206 | |
CONNECTION_FAILED | 3207 | |
TIMEOUT_EXCEEDED | 3208 | |
KEY_MISMATCH | 3209 | |
UNKNOWN_REQUEST | 3210 | |
MALFORMED_REQUEST | 3211 | |
ALREADY_IN_USE | 3212 |
Status codes used in JSON response messages for Websockets. These are starting at 3000 since the 1000 - 2000 range is taken up by the Spec: https://datatracker.ietf.org/doc/html/rfc6455#section-7.4.1.
Public Functions Documentation
function ~ISystemControllerInterface
virtual ~ISystemControllerInterface() =default
Virtual destructor.
function sendRequest
virtual Response sendRequest(
const std::string & request,
const nlohmann::json & parameters
) =0
Send a request with some JSON parameters to the controller and await the response.
Parameters:
- request The name of the request command
- parameters The parameters part of the JSON message
Return: The response from the controller.
Reimplemented by: SystemControllerConnection::sendRequest
function registerRequestCallback
virtual bool registerRequestCallback(
const Callbacks & callbacks
) =0
Register the callbacks to call for events in this class.
Parameters:
- callbacks The callbacks to use when events in this class happen
Return: True on successful registration, false if some callback is not set or if already connected
Reimplemented by: SystemControllerConnection::registerRequestCallback
function connect
virtual bool connect() =0
Connect to the System controller.
Return: True on successful connection, false on error or if already connected
Reimplemented by: SystemControllerConnection::connect
function disconnect
virtual bool disconnect() =0
Disconnect from the System controller.
Return: True on successful disconnection, false on error or if not connected
Reimplemented by: SystemControllerConnection::disconnect
function isConnected
virtual bool isConnected() const =0
Return: True if connected to the System controller, false otherwise
Reimplemented by: SystemControllerConnection::isConnected
function getUUID
virtual std::string getUUID() const =0
Return: The UUID of this interface to the System controller
Reimplemented by: SystemControllerConnection::getUUID
function hasParent
virtual bool hasParent() const =0
Return: True if this component has a parent ISystemControllerInterface, false otherwise
Reimplemented by: SystemControllerConnection::hasParent
function getParentInterface
virtual std::shared_ptr< ISystemControllerInterface > getParentInterface() const =0
Return: A pointer to parent’s ISystemControllerInterface, if any. Returns nullptr in case there is no parent
Reimplemented by: SystemControllerConnection::getParentInterface
Updated on 2022-06-22 at 16:53:25 +0200
1.14 - ISystemControllerInterface::Callbacks
ISystemControllerInterface::Callbacks
A struct containing the callbacks that needs to be registered by the component using this interface.
#include <ISystemControllerInterface.h>
Public Attributes
Name | |
---|---|
std::function< Response(const std::string &, const nlohmann::json &)> | mRequestCallback |
std::function< void(uint32_t, const std::string &, const std::error_code &)> | mConnectionClosedCallback |
Public Attributes Documentation
variable mRequestCallback
std::function< Response(const std::string &, const nlohmann::json &)> mRequestCallback;
variable mConnectionClosedCallback
std::function< void(uint32_t, const std::string &, const std::error_code &)> mConnectionClosedCallback;
Updated on 2022-06-22 at 16:53:25 +0200
1.15 - ISystemControllerInterface::Response
ISystemControllerInterface::Response
A response to a request, consists of a status code and an (optional) parameters JSON object.
#include <ISystemControllerInterface.h>
Public Attributes
Name | |
---|---|
StatusCode | mCode |
nlohmann::json | mParameters |
Public Attributes Documentation
variable mCode
StatusCode mCode;
variable mParameters
nlohmann::json mParameters;
Updated on 2022-06-22 at 16:53:25 +0200
1.16 - MediaReceiver
MediaReceiver
A MediaReceiver contains the logic for receiving, decoding and aligning incoming media sources from the Ingests. The aligned data is then delivered to the Rendering Engine which is also responsible for setting up the MediaReceiver. The MediaReceiver has a builtin multi view generator, which can create output streams containing composited subsets of the incoming video sources. This class is controlled using an ISystemControllerInterface provided when starting it.
#include <MediaReceiver.h>
Public Classes
Name | |
---|---|
struct | NewStreamParameters A struct containing information on the format of an incoming stream. |
struct | Settings Settings for a MediaReceiver. |
Public Functions
Name | |
---|---|
MediaReceiver() Default constructor. | |
~MediaReceiver() Default destructor. | |
bool | start(const std::shared_ptr< ISystemControllerInterface > & controllerInterface, const Settings & settings) Start the MediaReceiver. This method will call connect on the System controller interface and set up the callbacks from the interface to call internal methods. |
void | stop() Stop the MediaReceiver. |
std::function< void(const std::shared_ptr< AlignedData::DataFrame > &)> | getCustomMultiViewSourceInput(uint32_t inputSlot, const std::string & name ="") This method allows the Rendering Engine to provide custom input sources to the Multi-view generator to send video streams that can be added to the multi-views. This could for instance be used for adding a “preview” of the video stream the rendering engine is about to cut to. |
MediaReceiver(MediaReceiver const & ) =delete MediaReceiver is neither copyable nor movable. | |
MediaReceiver(MediaReceiver && ) =delete | |
MediaReceiver & | operator=(MediaReceiver const & ) =delete |
MediaReceiver & | operator=(MediaReceiver && ) =delete |
std::string | getVersion() Get application version. |
std::string | getBuildInfo() Get application build information. |
Public Functions Documentation
function MediaReceiver
MediaReceiver()
Default constructor.
function ~MediaReceiver
~MediaReceiver()
Default destructor.
function start
bool start(
const std::shared_ptr< ISystemControllerInterface > & controllerInterface,
const Settings & settings
)
Start the MediaReceiver. This method will call connect on the System controller interface and set up the callbacks from the interface to call internal methods.
Parameters:
- controllerInterface The ISystemControllerInterface to use for this MediaReceiver. The interface should be configured (Such as setting the IP address and port of the System Controller if a server based System Controller is used) but not connected before passed to this method. This method will internally set the callbacks before connecting to the controller. If the controller is already connected or if the controller is not configured, this method will return false. This class will take ownership of the smart pointer.
- settings The settings to use for the MediaReceiver.
Return: True if the MediaReceiver was started successfully, false otherwise.
function stop
void stop()
Stop the MediaReceiver.
function getCustomMultiViewSourceInput
std::function< void(const std::shared_ptr< AlignedData::DataFrame > &)> getCustomMultiViewSourceInput(
uint32_t inputSlot,
const std::string & name =""
)
This method allows the Rendering Engine to provide custom input sources to the Multi-view generator to send video streams that can be added to the multi-views. This could for instance be used for adding a “preview” of the video stream the rendering engine is about to cut to.
Parameters:
- inputSlot The input slot this source will be “plugged in” to. The custom input sources share the input slots with the streams connected from Ingests. This means that it is probably a good idea to use higher numbered slots for these custom inputs, such as numbers from 1000, so that the lower numbers, 1 and up, can be used by the connected video cameras, as the input slot number will also be used when cutting.
- name Optional human readable name of this stream, to be presented to the System Controller.
See: MediaReceiver::Settings::mDecodedFormat.
Return: A function to where the Rendering Engine should send the frames. In case the requested inputSlot is already used by another custom input source, or a stream from an ingest, the returned function will be nullptr.
Precondition: The DataFrames sent to this function must have the same pixel format as this MediaReceiver is configured to deliver to the Rendering Engine,
function MediaReceiver
MediaReceiver(
MediaReceiver const &
) =delete
MediaReceiver is neither copyable nor movable.
function MediaReceiver
MediaReceiver(
MediaReceiver &&
) =delete
function operator=
MediaReceiver & operator=(
MediaReceiver const &
) =delete
function operator=
MediaReceiver & operator=(
MediaReceiver &&
) =delete
function getVersion
static std::string getVersion()
Get application version.
Return: a string with the current version, e.g. “1.0.0”
function getBuildInfo
static std::string getBuildInfo()
Get application build information.
Return: a string with the current build information such as git hashes of all direct dependencies
Updated on 2022-06-22 at 16:53:25 +0200
1.17 - MediaReceiver::NewStreamParameters
MediaReceiver::NewStreamParameters
A struct containing information on the format of an incoming stream.
#include <MediaReceiver.h>
Public Attributes
Name | |
---|---|
uint32_t | mVideoHeight |
uint32_t | mVideoWidth |
uint32_t | mFrameRateN |
uint32_t | mFrameRateD |
uint32_t | mAudioSampleRate |
Public Attributes Documentation
variable mVideoHeight
uint32_t mVideoHeight = 0;
variable mVideoWidth
uint32_t mVideoWidth = 0;
variable mFrameRateN
uint32_t mFrameRateN = 0;
variable mFrameRateD
uint32_t mFrameRateD = 1;
variable mAudioSampleRate
uint32_t mAudioSampleRate = 0;
Updated on 2022-06-22 at 16:53:25 +0200
1.18 - MediaReceiver::Settings
MediaReceiver::Settings
Settings for a MediaReceiver.
#include <MediaReceiver.h>
Public Attributes
Name | |
---|---|
AlignedData::PixelFormat | mDecodedFormat The pixel format delivered to the rendering engine. |
std::function< std::function< void(const std::shared_ptr< AlignedData::DataFrame > &)> uint32_t inputSlot, const std::string &streamID, const NewStreamParameters &newStreamParameters)> | mNewConnectionCallback |
std::function< void(uint32_t inputSlot)> | mClosedConnectionCallback |
bool | mUseMultiViewer |
bool | mDebugAudio Set to true if this MediaReceiver should have a multi-view generator. |
bool | mDebugVideo Insert a 1500 Hz sound at every other turn to a new second according to TAI. |
bool | mDeliverOld Print the timestamp in the picture. |
Public Attributes Documentation
variable mDecodedFormat
AlignedData::PixelFormat mDecodedFormat = AlignedData::PixelFormat::kRgba64Le;
The pixel format delivered to the rendering engine.
variable mNewConnectionCallback
std::function< std::function< void(const std::shared_ptr< AlignedData::DataFrame > &)> uint32_t inputSlot, const std::string &streamID, const NewStreamParameters &newStreamParameters)> mNewConnectionCallback;
Parameters:
- inputSlot can be seen as a virtual SDI input on a hardware mixer and should be used by the Rendering engine to identify sources. For example, if a source is connected to input slot 5, the button “Cut to camera 5” on the control panel ought to cut to this stream. The MediaReceiver is responsible for making sure only one stream can be connected to an input slot at a time. This callback might be called multiple times with the same input slot, however, in case the stream has been disconnected and the mClosedConnectionCallback has been called for that input slot earlier.
- streamID is the identification string of the video/audio source on the Ingest. A Rendering engine might have the same StreamID connected multiple times (for instance if two different alignments are used for the same source) so this should not be used as an unique identifier for the stream.
- newStreamParameters contains information on the pending incoming stream to allow the Rendering engine to decide if it can receive it or not.
A callback called by the MediaReceiver whenever a new connection from an Ingest is set up. The callback should return a function to which the data will be delivered. In case the Rendering engine does not want to accept the pending incoming stream (due to a format not supported, etc) the Rendering engine can return nullptr.
variable mClosedConnectionCallback
std::function< void(uint32_t inputSlot)> mClosedConnectionCallback;
Parameters:
- inputSlot The input slot that was disconnected
A callback called whenever a connection from an Ingest has been stopped. When receiving this callback, the callback function returned by the mNewConnectionCallback will not be called anymore and can be discarded if required by the application. After this function has been called, the input slot might be reused by another incoming stream after a call to the mNewConnectionCallback.
variable mUseMultiViewer
bool mUseMultiViewer = false;
variable mDebugAudio
bool mDebugAudio = false;
Set to true if this MediaReceiver should have a multi-view generator.
variable mDebugVideo
bool mDebugVideo = false;
Insert a 1500 Hz sound at every other turn to a new second according to TAI.
variable mDeliverOld
bool mDeliverOld = false;
Print the timestamp in the picture.
Updated on 2022-06-22 at 16:53:25 +0200
1.19 - MediaStreamer
MediaStreamer
MediaStreamer is a class that can take a single stream of uncompressed video and/or audio frames and encode and output it in some way to some interface. This interface can either be a stream to a network or writing down the data to a file on the hard drive. This class is configured from two interfaces. The input configuration (input video resolution, frame rate, pixel format, number of audio channels…) is made through this C++ API. The output stream is then started from the System Controller. Any of these configurations can be made first. The actual stream to output will start once the first call to. More…
#include <MediaStreamer.h>
Public Classes
Name | |
---|---|
struct | Configuration The input configuration of the frames that will be sent to this MediaStreamer. The output stream configuration is made from the System controller via the ISystemControllerInterface. |
Public Functions
Name | |
---|---|
MediaStreamer() Default constructor. | |
~MediaStreamer() Destructor. This will stop the output stream if not already done by calling. | |
bool | configure(const std::shared_ptr< ISystemControllerInterface > & controllerInterface) Configure this MediaStreamer and connect it to the System controller. This must be called before any call to the. |
bool | setInputFormatAndStart(const Configuration & configuration) Set the input format of this MediaStreamer and start the streamer. The. |
bool | stopAndResetFormat() Stop streaming and reset the format. A call to this method will stop any output streams set up by the ISystemControllerInterface and reset the input format set by the. |
bool | outputData(const std::shared_ptr< AlignedData::DataFrame > & frame) Output data through this streamer. |
std::string | getVersion() Get application version. |
std::string | getBuildInfo() Get application build information. |
Detailed Description
class MediaStreamer;
MediaStreamer is a class that can take a single stream of uncompressed video and/or audio frames and encode and output it in some way to some interface. This interface can either be a stream to a network or writing down the data to a file on the hard drive. This class is configured from two interfaces. The input configuration (input video resolution, frame rate, pixel format, number of audio channels…) is made through this C++ API. The output stream is then started from the System Controller. Any of these configurations can be made first. The actual stream to output will start once the first call to.
See: outputData is made.
Public Functions Documentation
function MediaStreamer
MediaStreamer()
Default constructor.
function ~MediaStreamer
~MediaStreamer()
Destructor. This will stop the output stream if not already done by calling.
See: stop.
function configure
bool configure(
const std::shared_ptr< ISystemControllerInterface > & controllerInterface
)
Configure this MediaStreamer and connect it to the System controller. This must be called before any call to the.
Parameters:
- controllerInterface The interface to the System controller, used for communicating with this MediaStreamer
See:
Return: True if the streamer was successfully connected to the System controller
function setInputFormatAndStart
bool setInputFormatAndStart(
const Configuration & configuration
)
Set the input format of this MediaStreamer and start the streamer. The.
Parameters:
- configuration The configuration with the format of the frames that will be sent to this MediaReceiver
See:
- configure method must be called before this method is called. This method must be called before any call to
- outputData. If the format should be reset, the
- stopAndResetFormat method should be called first and then this method can be called again to reset the format.
Return: True if the streamer was successfully started, false otherwise
function stopAndResetFormat
bool stopAndResetFormat()
Stop streaming and reset the format. A call to this method will stop any output streams set up by the ISystemControllerInterface and reset the input format set by the.
See: setInputFormatAndStart method. The connection to the ISystemControllerInterface will be kept.
Return: True if the stream was successfully stopped and the the format reset, or if the format was not set before this method was called, false on error.
function outputData
bool outputData(
const std::shared_ptr< AlignedData::DataFrame > & frame
)
Output data through this streamer.
Parameters:
- frame The data frame to output, with video data in CUDA memory
See: setInputFormatAndStart method, or if the format has not been set by a call to that method.
Return: True if the frame was accepted (but not necessarily streamed, in case the output stream has not been set up by the ISystemControllerInterface), false in case the frame did not match the configuration made in the
function getVersion
static std::string getVersion()
Get application version.
Return: a string with the current version, e.g. “1.0.0”
function getBuildInfo
static std::string getBuildInfo()
Get application build information.
Return: a string with the current build information such as git hashes of all direct dependencies
Updated on 2022-06-22 at 16:53:25 +0200
1.20 - MediaStreamer::Configuration
MediaStreamer::Configuration
The input configuration of the frames that will be sent to this MediaStreamer. The output stream configuration is made from the System controller via the ISystemControllerInterface.
#include <MediaStreamer.h>
Public Attributes
Name | |
---|---|
AlignedData::PixelFormat | mIncomingPixelFormat |
uint32_t | mWidth |
uint32_t | mHeight |
uint32_t | mFrameRateN |
uint32_t | mFrameRateD |
uint32_t | mAudioSampleRate |
uint32_t | mNumAudioChannels |
Public Attributes Documentation
variable mIncomingPixelFormat
AlignedData::PixelFormat mIncomingPixelFormat = AlignedData::PixelFormat::kUnknown;
variable mWidth
uint32_t mWidth = 0;
variable mHeight
uint32_t mHeight = 0;
variable mFrameRateN
uint32_t mFrameRateN = 0;
variable mFrameRateD
uint32_t mFrameRateD = 0;
variable mAudioSampleRate
uint32_t mAudioSampleRate = 0;
variable mNumAudioChannels
uint32_t mNumAudioChannels = 0;
Updated on 2022-06-22 at 16:53:25 +0200
1.21 - SystemControllerConnection
SystemControllerConnection
An implementation of the ISystemControllerInterface for a System controller residing in a remote server. The connection to the server uses a Websocket.
#include <SystemControllerConnection.h>
Inherits from ISystemControllerInterface
Public Classes
Name | |
---|---|
struct | Settings Settings for a SystemControllerConnection. |
Public Types
Name | |
---|---|
enum class uint32_t | ComponentType { kIngest, kMediaReceiver, kMediaStreamer, kControlDataReceiver, kControlDataSender} Enumeration of component types the component using this SystemControllerConnection can tell the System Controller to be seen as. |
Public Functions
Name | |
---|---|
SystemControllerConnection() | |
~SystemControllerConnection() override | |
bool | configure(const Settings & settings, const std::shared_ptr< ISystemControllerInterface > & parentInterface =nullptr) Configure this connection. This method should be called before calling. |
virtual bool | connect() override Connect to the server using the settings set with the. |
virtual bool | isConnected() const override |
virtual std::string | getUUID() const override |
virtual Response | sendRequest(const std::string & request, const nlohmann::json & parameters) override Send a JSON object to the system controller server and awaits the response. |
virtual bool | disconnect() override Disconnect from the server. |
virtual bool | registerRequestCallback(const Callbacks & callbacks) override Register callbacks to call when getting requests from the server or the server connection is lost. |
virtual bool | hasParent() const override |
virtual std::shared_ptr< ISystemControllerInterface > | getParentInterface() const override |
SystemControllerConnection(SystemControllerConnection const & ) =delete | |
SystemControllerConnection(SystemControllerConnection && ) =delete | |
SystemControllerConnection & | operator=(SystemControllerConnection const & ) =delete |
SystemControllerConnection & | operator=(SystemControllerConnection && ) =delete |
Additional inherited members
Public Classes inherited from ISystemControllerInterface
Name | |
---|---|
struct | Callbacks A struct containing the callbacks that needs to be registered by the component using this interface. |
struct | Response A response to a request, consists of a status code and an (optional) parameters JSON object. |
Public Types inherited from ISystemControllerInterface
Name | |
---|---|
enum class uint32_t | StatusCode { SUCCESS, TOO_MANY_REQUESTS, UUID_ALREADY_REGISTERED, FORMAT_ERROR, ALREADY_CONFIGURED, OUT_OF_RESOURCES, NOT_FOUND, INTERNAL_ERROR, CONNECTION_FAILED, TIMEOUT_EXCEEDED, KEY_MISMATCH, UNKNOWN_REQUEST, MALFORMED_REQUEST, ALREADY_IN_USE} Status codes used in JSON response messages for Websockets. These are starting at 3000 since the 1000 - 2000 range is taken up by the Spec: https://datatracker.ietf.org/doc/html/rfc6455#section-7.4.1. |
Public Functions inherited from ISystemControllerInterface
Name | |
---|---|
virtual | ~ISystemControllerInterface() =default Virtual destructor. |
Public Types Documentation
enum ComponentType
Enumerator | Value | Description |
---|---|---|
kIngest | ||
kMediaReceiver | ||
kMediaStreamer | ||
kControlDataReceiver | ||
kControlDataSender |
Enumeration of component types the component using this SystemControllerConnection can tell the System Controller to be seen as.
Public Functions Documentation
function SystemControllerConnection
SystemControllerConnection()
function ~SystemControllerConnection
~SystemControllerConnection() override
function configure
bool configure(
const Settings & settings,
const std::shared_ptr< ISystemControllerInterface > & parentInterface =nullptr
)
Configure this connection. This method should be called before calling.
Parameters:
- settings The settings to use when connecting to the server
- parentInterface Optional parent interface that this interface is a child of. Setting this to nullptr means that this interface does not have a parent interface
See: connect.
Return: True if successfully configured, false otherwise
function connect
virtual bool connect() override
Connect to the server using the settings set with the.
See: configure method.
Return: True if connection was successful, false otherwise
Reimplements: ISystemControllerInterface::connect
function isConnected
virtual bool isConnected() const override
Return: True if this class is connected to the server, false otherwise
Reimplements: ISystemControllerInterface::isConnected
function getUUID
virtual std::string getUUID() const override
Return: The UUID of this interface to the System controller
Reimplements: ISystemControllerInterface::getUUID
function sendRequest
virtual Response sendRequest(
const std::string & request,
const nlohmann::json & parameters
) override
Send a JSON object to the system controller server and awaits the response.
Parameters:
- request The name of the request command
- parameters The parameters part of the JSON message
Return: The response from the controller
Note: The status code might be TIMEOUT in case no response was received within the timeframe
Reimplements: ISystemControllerInterface::sendRequest
function disconnect
virtual bool disconnect() override
Disconnect from the server.
Return: True if successfully disconnected, false on internal error
Reimplements: ISystemControllerInterface::disconnect
function registerRequestCallback
virtual bool registerRequestCallback(
const Callbacks & callbacks
) override
Register callbacks to call when getting requests from the server or the server connection is lost.
Parameters:
- callbacks The callbacks to set
Return: True if successfully registered, false if a callback is not set, or if already connected to the server
Reimplements: ISystemControllerInterface::registerRequestCallback
function hasParent
virtual bool hasParent() const override
Return: True if this component has a parent ISystemControllerInterface, false otherwise
Reimplements: ISystemControllerInterface::hasParent
function getParentInterface
virtual std::shared_ptr< ISystemControllerInterface > getParentInterface() const override
Return: A pointer to parent’s ISystemControllerInterface, if any. Returns nullptr in case there is no parent
Reimplements: ISystemControllerInterface::getParentInterface
function SystemControllerConnection
SystemControllerConnection(
SystemControllerConnection const &
) =delete
function SystemControllerConnection
SystemControllerConnection(
SystemControllerConnection &&
) =delete
function operator=
SystemControllerConnection & operator=(
SystemControllerConnection const &
) =delete
function operator=
SystemControllerConnection & operator=(
SystemControllerConnection &&
) =delete
Updated on 2022-06-22 at 16:53:25 +0200
1.22 - SystemControllerConnection::Settings
SystemControllerConnection::Settings
Settings for a SystemControllerConnection.
#include <SystemControllerConnection.h>
Public Attributes
Name | |
---|---|
std::string | mSystemControllerIP |
uint16_t | mSystemControllerPort |
std::string | mSystemControllerPostfix |
std::string | mPSK |
std::string | mUUID |
ComponentType | mType |
std::string | mName |
std::string | mMyIP |
std::chrono::milliseconds | mConnectTimeout |
Public Attributes Documentation
variable mSystemControllerIP
std::string mSystemControllerIP;
variable mSystemControllerPort
uint16_t mSystemControllerPort;
variable mSystemControllerPostfix
std::string mSystemControllerPostfix;
variable mPSK
std::string mPSK;
variable mUUID
std::string mUUID;
variable mType
ComponentType mType;
variable mName
std::string mName;
variable mMyIP
std::string mMyIP;
variable mConnectTimeout
std::chrono::milliseconds mConnectTimeout {
3000};
Updated on 2022-06-22 at 16:53:25 +0200
1.23 - TimeCommon::TAIStatus
TimeCommon::TAIStatus
Public Attributes
Name | |
---|---|
StratumLevel | mStratum |
bool | mHasLock |
Public Attributes Documentation
variable mStratum
StratumLevel mStratum = StratumLevel::UnknownStratum;
variable mHasLock
bool mHasLock = false;
Updated on 2022-06-22 at 16:53:25 +0200
1.24 - TimeCommon::TimeStructure
TimeCommon::TimeStructure
Public Attributes
Name | |
---|---|
uint64_t | t1 |
uint64_t | t2 |
uint64_t | t3 |
uint64_t | t4 |
uint64_t | token |
uint64_t | dummy1 |
uint64_t | dummy2 |
uint64_t | dummy3 |
Public Attributes Documentation
variable t1
uint64_t t1 = 0;
variable t2
uint64_t t2 = 0;
variable t3
uint64_t t3 = 0;
variable t4
uint64_t t4 = 0;
variable token
uint64_t token = 0;
variable dummy1
uint64_t dummy1 = 0;
variable dummy2
uint64_t dummy2 = 0;
variable dummy3
uint64_t dummy3 = 0;
Updated on 2022-06-22 at 16:53:25 +0200
2 - Files
Files
- dir build
- dir install
- dir include
- file include/AclLog.h
- file include/AlignedData.h
- file include/Base64.h
- file include/ControlDataCommon.h
- file include/ControlDataReceiver.h
- file include/ControlDataSender.h
- file include/ISystemControllerInterface.h
- file include/IngestApplication.h
- file include/IngestUtils.h
- file include/MediaReceiver.h
- file include/MediaStreamer.h
- file include/SystemControllerConnection.h
- file include/TimeCommon.h
- file include/UUIDUtils.h
- dir include
- dir install
Updated on 2022-06-22 at 16:53:25 +0200
2.1 - include/AclLog.h
include/AclLog.h
Namespaces
Name |
---|
AclLog A namespace for logging utilities. |
Source code
// Copyright (c) 2022, Edgeware AB. All rights reserved.
#pragma once
#include <string>
namespace AclLog {
enum class Level {
kTrace, // Detailed diagnostics (for development only)
kDebug, // Messages intended for debugging only
kInfo, // Messages about normal behavior (default log level)
kWarning, // Warnings (functionality intact)
kError, // Recoverable errors (functionality impaired)
kCritical, // Unrecoverable errors (application must stop)
kOff // Turns off all logging
};
void init(const std::string& name);
void setLevel(Level level);
} // namespace AclLog
Updated on 2022-06-22 at 16:53:25 +0200
2.2 - include/AlignedData.h
include/AlignedData.h
Namespaces
Name |
---|
AlignedData |
Classes
Name | |
---|---|
struct | AlignedData::DataFrame A frame of aligned data that is passed to the rendering engine from the MediaReceiver. A DataFrame contains a time stamped frame of media, which might be video, audio and auxiliary data such as subtitles. A single DataFrame can contain one or multiple types of media. Which media types are included can be probed by nullptr-checking/size checking the data members. The struct has ownership of all data pointers included. The struct includes all logic for freeing the resources held by this struct and the user should therefore just make sure the struct itself is deallocated to ensure all resources are freed. |
Source code
// Copyright (c) 2022, Edgeware AB. All rights reserved.
#pragma once
#include <array>
#include <iostream>
#include <vector>
#include <cuda_runtime_api.h>
namespace AlignedData {
typedef std::array<float, 16> AudioSampleRow;
enum class CompressedVideoFormat {
kAvc, // H264
kHevc // H265
};
enum class PixelFormat {
kUnknown,
kNv12, // 8 bit per component 4:2:0 YUV format. Y plane followed by interleaved UV plane.
kP016, // 16 bit per component 4:2:0 YUV format. Y plane followed by interleaved UV plane.
kUyvy, // 8 bit per component 4:2:2 YUV format. U-Y-V-Y bytes interleaved.
kRgba, // 8 bit per component RGBA, ordered as R-G-B-A-R-G.. in memory.
kRgba64Le // 16 bit per component RGBA, ordered as R-G-B-A-R-G.. in memory with little endian words.
};
struct DataFrame {
DataFrame() = default;
~DataFrame() {
if (mVideoDataCudaPtr) {
cudaError_t cudaStatus = cudaFree(mVideoDataCudaPtr);
mVideoDataCudaPtr = nullptr;
if (cudaStatus != cudaSuccess) {
std::cout << "AlignedData::~DataFrame: Failed to release cuda memory: " << cudaStatus << std::endl;
}
}
}
DataFrame(DataFrame const&) = delete; // Copy construct
DataFrame& operator=(DataFrame const&) = delete; // Copy assign
uint64_t mPTS;
// Video
uint8_t* mVideoDataCudaPtr = nullptr;
PixelFormat mPixelFormat = PixelFormat::kUnknown;
uint32_t mFrameRateN = 0;
uint32_t mFrameRateD = 0;
uint32_t mWidth = 0;
uint32_t mHeight = 0;
// Audio
std::vector<AudioSampleRow> mAudioData;
uint32_t mAudioChannels = 0;
uint32_t mAudioSamplingFrequency = 0;
};
} // namespace AlignedData
Updated on 2022-06-22 at 16:53:25 +0200
2.3 - include/Base64.h
include/Base64.h
Functions
Name | |
---|---|
std::string | encodeBase64(const uint8_t * data, size_t size) Base64 encode some data. |
std::string | encodeBase64(const std::vector< uint8_t > & data) Base64 encode some data. |
std::vector< uint8_t > | decodeBase64(const std::string & data) Decode some Base64 encoded data. |
Functions Documentation
function encodeBase64
std::string encodeBase64(
const uint8_t * data,
size_t size
)
Base64 encode some data.
Parameters:
- data Pointer to the data to encode with Base64
- size The length of the data to encode with Base64
Return: The resulting Base64 encoded string
function encodeBase64
std::string encodeBase64(
const std::vector< uint8_t > & data
)
Base64 encode some data.
Parameters:
- data The data to encode with Base64
Return: The resulting Base64 encoded string
function decodeBase64
std::vector< uint8_t > decodeBase64(
const std::string & data
)
Decode some Base64 encoded data.
Parameters:
- data The Base64 encoded string to decode
Return: The resulting decoded data
Source code
// Copyright (c) 2022, Edgeware AB. All rights reserved.
#pragma once
#include <string>
#include <vector>
std::string encodeBase64(const uint8_t* data, size_t size);
std::string encodeBase64(const std::vector<uint8_t>& data);
std::vector<uint8_t> decodeBase64(const std::string& data);
Updated on 2022-06-22 at 16:53:25 +0200
2.4 - include/ControlDataCommon.h
include/ControlDataCommon.h
Namespaces
Name |
---|
ControlDataCommon |
Classes
Name | |
---|---|
struct | ControlDataCommon::ConnectionStatus Connection status struct containing information about a connection event. |
struct | ControlDataCommon::Response A response from a ControlDataReceiver to a request. The UUID tells which receiver the response is sent from. |
struct | ControlDataCommon::StatusMessage A status message from a ControlDataReceiver. The UUID tells which receiver the message is sent from. |
Source code
// Copyright (c) 2022, Edgeware AB. All rights reserved.
#pragma once
namespace ControlDataCommon {
enum class ConnectionType { CONNECTED, DISCONNECTED };
struct ConnectionStatus {
ConnectionStatus() = default;
ConnectionStatus(ConnectionType mConnectionType, const std::string& mIp, uint16_t mPort)
: mConnectionType(mConnectionType)
, mIP(mIp)
, mPort(mPort) {
}
ConnectionType mConnectionType;
std::string mIP;
uint16_t mPort = 0;
};
struct Response {
std::vector<uint8_t> mMessage;
uint64_t mRequestId = 0;
std::string mFromUUID;
};
struct StatusMessage {
std::vector<uint8_t> mMessage;
std::string mFromUUID;
};
} // namespace ControlDataCommon
Updated on 2022-06-22 at 16:53:25 +0200
2.5 - include/ControlDataReceiver.h
include/ControlDataReceiver.h
Classes
Name | |
---|---|
class | ControlDataReceiver A ControlDataReceiver can receive messages from a sender or another ControlDataReceiver using a network connection. It can also connect to and forward the incoming request messages to other receivers. The connections to the sender and the other receivers are controlled by an ISystemControllerInterface instance. The ControlDataReceiver has a receiving or listening side, as well as a sending side. The listening side can listen to one single network port and have multiple ControlDataSenders and ControlDataReceivers connected to that port to receive requests from them. On the sending side of the ControlDataReceiver, it can be connected to the listening side of other ControlDataReceivers, used to forward all incoming messages to that receiver, as well as sending its own requests. |
struct | ControlDataReceiver::IncomingRequest An incoming request to this ControlDataReceiver. |
struct | ControlDataReceiver::ReceiverResponse A response message to a request. |
struct | ControlDataReceiver::Settings Settings for a ControlDataReceiver. |
Source code
// Copyright (c) 2022, Edgeware AB. All rights reserved.
#pragma once
#include <memory>
#include <ISystemControllerInterface.h>
#include "ControlDataCommon.h"
class ControlDataReceiver final {
public:
struct IncomingRequest {
std::vector<uint8_t> mMessage;
std::string mSenderUUID;
std::string mRequesterUUID;
uint64_t mRequestID = 0;
int64_t mSenderTimestampUs =
0;
int64_t mDeliveryTimestampUs =
0;
};
struct ReceiverResponse {
std::vector<uint8_t> mMessage;
};
struct Settings {
std::function<void(const IncomingRequest&)> mPreviewIncomingRequestCallback;
std::function<ReceiverResponse(const IncomingRequest&)> mIncomingRequestCallback;
std::function<void(const ControlDataCommon::ConnectionStatus&)>
mConnectionStatusCallback;
std::function<void(const ControlDataCommon::Response&)>
mResponseCallback;
};
ControlDataReceiver();
~ControlDataReceiver();
bool configure(const std::shared_ptr<ISystemControllerInterface>& controllerInterface, const Settings& settings);
bool sendStatusMessageToSender(const std::vector<uint8_t>& message);
bool sendRequestToReceivers(const std::vector<uint8_t>& request, uint64_t& requestId);
static std::string getVersion();
static std::string getBuildInfo();
// ControlDataReceiver is not copyable
ControlDataReceiver(ControlDataReceiver const&) = delete; // Copy construct
ControlDataReceiver& operator=(ControlDataReceiver const&) = delete; // Copy assign
private:
class Impl;
std::unique_ptr<Impl> pImpl;
};
Updated on 2022-06-22 at 16:53:25 +0200
2.6 - include/ControlDataSender.h
include/ControlDataSender.h
Classes
Name | |
---|---|
class | ControlDataSender A ControlDataSender can send control signals to one or more receivers using a network connection. A single ControlDataSender can connect to multiple receivers, all identified by a UUID. The class is controlled using an ISystemControllerInterface; this interface is responsible for setting up connections to receivers. The ControlDataSender can send asynchronous requests to (all) the receivers and get a response back. Each response is identified with a request ID as well as the UUID of the responding receiver. The ControlDataSender can also receive status messages from the receivers. |
struct | ControlDataSender::Settings Settings for a ControlDataSender. |
Source code
// Copyright (c) 2022, Edgeware AB. All rights reserved.
#pragma once
#include <functional>
#include <memory>
#include <vector>
#include <ISystemControllerInterface.h>
#include "ControlDataCommon.h"
class ControlDataSender final {
public:
struct Settings {
std::function<void(const ControlDataCommon::ConnectionStatus&)>
mConnectionStatusCallback; // Callback for receiver connection/disconnection events
std::function<void(const ControlDataCommon::Response&)>
mResponseCallback; // Callback for response messages from receivers
std::function<void(const ControlDataCommon::StatusMessage&)>
mStatusMessageCallback; // Callback for status messages from receivers
};
ControlDataSender();
~ControlDataSender();
bool configure(const std::shared_ptr<ISystemControllerInterface>& controllerInterface, const Settings& settings);
bool sendRequestToReceivers(const std::vector<uint8_t>& request, uint64_t& requestId);
static std::string getVersion();
static std::string getBuildInfo();
// ControlDataSender is not copyable
ControlDataSender(ControlDataSender const&) = delete; // Copy construct
ControlDataSender& operator=(ControlDataSender const&) = delete; // Copy assign
private:
class Impl;
std::unique_ptr<Impl> pImpl;
};
Updated on 2022-06-22 at 16:53:25 +0200
2.7 - include/IngestApplication.h
include/IngestApplication.h
Classes
Name | |
---|---|
class | IngestApplication |
struct | IngestApplication::Settings |
Source code
// Copyright (c) 2022, Edgeware AB. All rights reserved.
#pragma once
#include <memory>
#include "ISystemControllerInterface.h"
class IngestApplication {
public:
struct Settings {
bool mDebugAudio = false; // Insert a 800 Hz sound at every turn to a new second according to TAI
bool mDebugVideo = false; // Print the timestamp in the picture
};
IngestApplication();
~IngestApplication();
bool start(const std::shared_ptr<ISystemControllerInterface>& controllerInterface, const Settings& settings);
bool stop();
static std::string getVersion();
static std::string getBuildInfo();
private:
class Impl;
std::unique_ptr<Impl> pImpl;
};
Updated on 2022-06-22 at 16:53:25 +0200
2.8 - include/IngestUtils.h
include/IngestUtils.h
Namespaces
Name |
---|
IngestUtils |
Source code
// Copyright (c) 2022, Edgeware AB. All rights reserved.
#pragma once
namespace IngestUtils {
bool isRunningWithRootPrivileges();
} // namespace IngestUtils
Updated on 2022-06-22 at 16:53:25 +0200
2.9 - include/ISystemControllerInterface.h
include/ISystemControllerInterface.h
Classes
Name | |
---|---|
class | ISystemControllerInterface An ISystemControllerInterface is the interface between a component and the System controller controlling the component. The interface allows for two-way communication between the component and the system controller by means of sending requests and getting responses. Classes deriving from the ISystemControllerInterface should provide the component side implementation of the communication with the system controller. This interface can be inherited and implemented by developers to connect to custom system controllers, or to directly control a component programmatically, without the need for connecting to a remote server. An ISystemControllerInterface can have a parent-child relationship with other interfaces, where the children are aware of which their parent interface is. This is useful for components that provides extra features for another component, but where the components are still to be considered as two separate entities with separate connections to the System controller. |
struct | ISystemControllerInterface::Response A response to a request, consists of a status code and an (optional) parameters JSON object. |
struct | ISystemControllerInterface::Callbacks A struct containing the callbacks that needs to be registered by the component using this interface. |
Source code
// Copyright (c) 2022, Edgeware AB. All rights reserved.
#pragma once
#include <functional>
#include <json.hpp>
#include <string>
class ISystemControllerInterface {
public:
enum class StatusCode : uint32_t {
SUCCESS = 3001, // Accept / Success
TOO_MANY_REQUESTS = 3101, // Too many requests, try again later
UUID_ALREADY_REGISTERED = 3201, // UUID is already registered
FORMAT_ERROR = 3202, // Message formatting error
ALREADY_CONFIGURED = 3203, // The requested thing to configure is already configured
OUT_OF_RESOURCES = 3204, // Out of resources (CPU/GPU close to max utilization, all available slots used, etc.)
NOT_FOUND = 3205, // The requested thing was not found
INTERNAL_ERROR = 3206, // Internal error when trying to serve the request
CONNECTION_FAILED = 3207, // Connection failure
TIMEOUT_EXCEEDED = 3208, // Timeout exceeded
KEY_MISMATCH = 3209, // Key mismatch (might be a timeout, 3007 in the future)
UNKNOWN_REQUEST = 3210, // The name of the request was not known
MALFORMED_REQUEST = 3211, // The request is not correctly formatted
ALREADY_IN_USE = 3212, // The requested resource is already in use
// None, yet
};
struct Response {
StatusCode mCode;
nlohmann::json mParameters; // Can be empty
};
struct Callbacks {
std::function<Response(const std::string&, const nlohmann::json&)>
mRequestCallback; // Callback called when then controller has sent a request
std::function<void(uint32_t, const std::string&, const std::error_code&)>
mConnectionClosedCallback; // Callback called when the connection to the controller is closed
};
virtual ~ISystemControllerInterface() = default;
virtual Response sendRequest(const std::string& request, const nlohmann::json& parameters) = 0;
virtual bool registerRequestCallback(const Callbacks& callbacks) = 0;
virtual bool connect() = 0;
virtual bool disconnect() = 0;
virtual bool isConnected() const = 0;
virtual std::string getUUID() const = 0;
virtual bool hasParent() const = 0;
virtual std::shared_ptr<ISystemControllerInterface> getParentInterface() const = 0;
};
Updated on 2022-06-22 at 16:53:25 +0200
2.10 - include/MediaReceiver.h
include/MediaReceiver.h
Classes
Name | |
---|---|
class | MediaReceiver A MediaReceiver contains the logic for receiving, decoding and aligning incoming media sources from the Ingests. The aligned data is then delivered to the Rendering Engine which is also responsible for setting up the MediaReceiver. The MediaReceiver has a builtin multi view generator, which can create output streams containing composited subsets of the incoming video sources. This class is controlled using an ISystemControllerInterface provided when starting it. |
struct | MediaReceiver::NewStreamParameters A struct containing information on the format of an incoming stream. |
struct | MediaReceiver::Settings Settings for a MediaReceiver. |
Source code
// Copyright (c) 2022, Edgeware AB. All rights reserved.
#pragma once
#include <memory>
#include <utility>
#include "AlignedData.h"
#include "ISystemControllerInterface.h"
class MediaReceiver {
public:
struct NewStreamParameters {
uint32_t mVideoHeight = 0; // Height of the video in pixels. 0 if the stream does not contain any video
uint32_t mVideoWidth = 0; // Width of the video in pixels. 0 if the stream does not contain any video
uint32_t mFrameRateN = 0; // Frame rate numerator
uint32_t mFrameRateD = 1; // Frame rate denominator
uint32_t mAudioSampleRate = 0; // Sample rate of the audio in Hz. 0 if the stream does not contain any audio
};
struct Settings {
AlignedData::PixelFormat mDecodedFormat = AlignedData::PixelFormat::kRgba64Le;
std::function<std::function<void(const std::shared_ptr<AlignedData::DataFrame>&)>(
uint32_t inputSlot,
const std::string& streamID,
const NewStreamParameters& newStreamParameters)>
mNewConnectionCallback;
std::function<void(uint32_t inputSlot)> mClosedConnectionCallback;
bool mUseMultiViewer = false;
bool mDebugAudio = false;
bool mDebugVideo = false;
bool mDeliverOld = false;
};
MediaReceiver();
~MediaReceiver();
bool start(const std::shared_ptr<ISystemControllerInterface>& controllerInterface, const Settings& settings);
void stop();
std::function<void(const std::shared_ptr<AlignedData::DataFrame>&)>
getCustomMultiViewSourceInput(uint32_t inputSlot, const std::string& name = "");
MediaReceiver(MediaReceiver const&) = delete; // Copy construct
MediaReceiver(MediaReceiver&&) = delete; // Move construct
MediaReceiver& operator=(MediaReceiver const&) = delete; // Copy assign
MediaReceiver& operator=(MediaReceiver&&) = delete; // Move assign
static std::string getVersion();
static std::string getBuildInfo();
private:
class Impl;
std::unique_ptr<Impl> pImpl;
};
Updated on 2022-06-22 at 16:53:25 +0200
2.11 - include/MediaStreamer.h
include/MediaStreamer.h
Classes
Name | |
---|---|
class | MediaStreamer MediaStreamer is a class that can take a single stream of uncompressed video and/or audio frames and encode and output it in some way to some interface. This interface can either be a stream to a network or writing down the data to a file on the hard drive. This class is configured from two interfaces. The input configuration (input video resolution, frame rate, pixel format, number of audio channels…) is made through this C++ API. The output stream is then started from the System Controller. Any of these configurations can be made first. The actual stream to output will start once the first call to. |
struct | MediaStreamer::Configuration The input configuration of the frames that will be sent to this MediaStreamer. The output stream configuration is made from the System controller via the ISystemControllerInterface. |
Source code
// Copyright (c) 2022, Edgeware AB. All rights reserved.
#pragma once
#include <memory>
#include <ISystemControllerInterface.h>
#include "AlignedData.h"
class MediaStreamer final {
public:
struct Configuration {
// Video
AlignedData::PixelFormat mIncomingPixelFormat = AlignedData::PixelFormat::kUnknown;
uint32_t mWidth = 0; // Width of the incoming video frames in pixels
uint32_t mHeight = 0; // Height of the incoming video frames in pixels
uint32_t mFrameRateN = 0; // Frame rate numerator of the incoming video frames
uint32_t mFrameRateD = 0; // Frame rate denominator of the incoming video frames
// Audio
uint32_t mAudioSampleRate = 0; // Audio sample rate of the incoming frames in Hz
uint32_t mNumAudioChannels = 0; // Number of audio channels in the incoming frames
};
MediaStreamer();
~MediaStreamer();
bool configure(const std::shared_ptr<ISystemControllerInterface>& controllerInterface);
bool setInputFormatAndStart(const Configuration& configuration);
bool stopAndResetFormat();
bool outputData(const std::shared_ptr<AlignedData::DataFrame>& frame);
static std::string getVersion();
static std::string getBuildInfo();
private:
class Impl;
std::unique_ptr<Impl> pImpl;
};
Updated on 2022-06-22 at 16:53:25 +0200
2.12 - include/SystemControllerConnection.h
include/SystemControllerConnection.h
Classes
Name | |
---|---|
class | SystemControllerConnection An implementation of the ISystemControllerInterface for a System controller residing in a remote server. The connection to the server uses a Websocket. |
struct | SystemControllerConnection::Settings Settings for a SystemControllerConnection. |
Source code
// Copyright (c) 2022, Edgeware AB. All rights reserved.
#pragma once
#include <chrono>
#include "ISystemControllerInterface.h"
#include "json.hpp"
class SystemControllerConnection final : public ISystemControllerInterface {
public:
enum class ComponentType : uint32_t {
kIngest,
kMediaReceiver,
kMediaStreamer,
kControlDataReceiver,
kControlDataSender,
};
struct Settings {
std::string mSystemControllerIP; // IP of the server
uint16_t mSystemControllerPort; // Port of the server
std::string mSystemControllerPostfix; // Postfix of the address that the backend uses if any
std::string mPSK; // The pre shared key used for authorization with the system controller server
std::string mUUID; // The UUID of the device using this library
ComponentType mType; // The component type of the component using this SystemControllerConnection
std::string mName; // The component name (optional)
std::string mMyIP; // The external IP of the system the component is running on. Will be sent to the system
// controller server in the announce message (optional)
std::chrono::milliseconds mConnectTimeout{
3000}; // Max time to wait on an announcement response from the server during connection
};
SystemControllerConnection();
~SystemControllerConnection() override;
bool configure(const Settings& settings,
const std::shared_ptr<ISystemControllerInterface>& parentInterface = nullptr);
bool connect() override;
bool isConnected() const override;
std::string getUUID() const override;
Response sendRequest(const std::string& request, const nlohmann::json& parameters) override;
bool disconnect() override;
bool registerRequestCallback(const Callbacks& callbacks) override;
bool hasParent() const override;
std::shared_ptr<ISystemControllerInterface> getParentInterface() const override;
SystemControllerConnection(SystemControllerConnection const&) = delete; // Copy construct
SystemControllerConnection(SystemControllerConnection&&) = delete; // Move construct
SystemControllerConnection& operator=(SystemControllerConnection const&) = delete; // Copy assign
SystemControllerConnection& operator=(SystemControllerConnection&&) = delete; // Move assign
private:
class Impl;
std::unique_ptr<Impl> pImpl;
};
Updated on 2022-06-22 at 16:53:25 +0200
2.13 - include/TimeCommon.h
include/TimeCommon.h
Namespaces
Name |
---|
TimeCommon |
Classes
Name | |
---|---|
struct | TimeCommon::TAIStatus |
struct | TimeCommon::TimeStructure |
Source code
// Copyright (c) 2022, Edgeware AB. All rights reserved.
#pragma once
#include <chrono>
#include <cstdint>
#include <fstream>
#include <sstream>
namespace TimeCommon {
enum class StratumLevel {
UnknownStratum,
stratum0,
stratum1,
stratum2,
stratum3,
stratum4,
};
struct TAIStatus {
StratumLevel mStratum = StratumLevel::UnknownStratum;
bool mHasLock = false;
};
// Little endian
// Minimum size packet is 64 - bytes
struct TimeStructure {
uint64_t t1 = 0; // 8-bytes / Total 8-bytes == Client time T1
uint64_t t2 = 0; // 8-bytes / Total 16-bytes == Server
uint64_t t3 = 0; // 8-bytes / Total 24-bytes
uint64_t t4 = 0; // 8-bytes / Total 32-bytes
uint64_t token = 0; // 8-bytes / Total 40-bytes == t1 ^ key
uint64_t dummy1 = 0; // 8-bytes / Total 48-bytes == for future use
uint64_t dummy2 = 0; // 8-bytes / Total 56-bytes == for future use
uint64_t dummy3 = 0; // 8-bytes / Total 64-bytes == for future use
};
uint64_t getMonotonicClockMicro();
TimeCommon::TAIStatus getStatus();
int64_t getTAIMicro();
} // namespace TimeCommon
Updated on 2022-06-22 at 16:53:25 +0200
2.14 - include/UUIDUtils.h
include/UUIDUtils.h
Namespaces
Name |
---|
UUIDUtils A namespace for UUID utility functions. |
Source code
// Copyright (c) 2022, Edgeware AB. All rights reserved.
#pragma once
#include <string>
namespace UUIDUtils {
std::string generateRandomUUID();
bool isValidUUIDString(const std::string& uuid);
} // namespace UUIDUtils
Updated on 2022-06-22 at 16:53:25 +0200
3 - Namespaces
Namespaces
- namespace AclLog
A namespace for logging utilities. - namespace AlignedData
- namespace ControlDataCommon
- namespace IngestUtils
- namespace TimeCommon
- namespace UUIDUtils
A namespace for UUID utility functions.
Updated on 2022-06-22 at 16:53:25 +0200
3.1 - AclLog
AclLog
A namespace for logging utilities.
Types
Name | |
---|---|
enum class | Level { kTrace, kDebug, kInfo, kWarning, kError, kCritical, kOff} Log levels. |
Functions
Name | |
---|---|
void | init(const std::string & name) Initialize logging. |
void | setLevel(Level level) Set global logging level. |
Types Documentation
enum Level
Enumerator | Value | Description |
---|---|---|
kTrace | ||
kDebug | ||
kInfo | ||
kWarning | ||
kError | ||
kCritical | ||
kOff |
Log levels.
Functions Documentation
function init
void init(
const std::string & name
)
Initialize logging.
Parameters:
- name The name of the component (used for log prefix and filename)
By default two sinks are created. The first sink writes messages to the console. The second sink attempts to create a log file in the path set by the environment variable ACL_LOG_PATH (’/tmp’ if unset). The name of the log file is ’name.log’. The default logging level is ‘info’ (‘debug’ for debug builds) and can be changed by setting the ACL_LOG_LEVEL environment variable.
function setLevel
void setLevel(
Level level
)
Set global logging level.
Parameters:
- level Logging level to set
Updated on 2022-06-22 at 16:53:25 +0200
3.2 - AlignedData
AlignedData
Classes
Name | |
---|---|
struct | AlignedData::DataFrame A frame of aligned data that is passed to the rendering engine from the MediaReceiver. A DataFrame contains a time stamped frame of media, which might be video, audio and auxiliary data such as subtitles. A single DataFrame can contain one or multiple types of media. Which media types are included can be probed by nullptr-checking/size checking the data members. The struct has ownership of all data pointers included. The struct includes all logic for freeing the resources held by this struct and the user should therefore just make sure the struct itself is deallocated to ensure all resources are freed. |
Types
Name | |
---|---|
enum class | CompressedVideoFormat { kAvc, kHevc} |
enum class | PixelFormat { kUnknown, kNv12, kP016, kUyvy, kRgba, kRgba64Le} |
typedef std::array< float, 16 > | AudioSampleRow One audio sample in 16 channels. |
Types Documentation
enum CompressedVideoFormat
Enumerator | Value | Description |
---|---|---|
kAvc | ||
kHevc |
enum PixelFormat
Enumerator | Value | Description |
---|---|---|
kUnknown | ||
kNv12 | ||
kP016 | ||
kUyvy | ||
kRgba | ||
kRgba64Le |
typedef AudioSampleRow
typedef std::array<float, 16> AlignedData::AudioSampleRow;
One audio sample in 16 channels.
Updated on 2022-06-22 at 16:53:25 +0200
3.3 - ControlDataCommon
ControlDataCommon
Classes
Name | |
---|---|
struct | ControlDataCommon::ConnectionStatus Connection status struct containing information about a connection event. |
struct | ControlDataCommon::Response A response from a ControlDataReceiver to a request. The UUID tells which receiver the response is sent from. |
struct | ControlDataCommon::StatusMessage A status message from a ControlDataReceiver. The UUID tells which receiver the message is sent from. |
Types
Name | |
---|---|
enum class | ConnectionType { CONNECTED, DISCONNECTED} The connection types. |
Types Documentation
enum ConnectionType
Enumerator | Value | Description |
---|---|---|
CONNECTED | ||
DISCONNECTED |
The connection types.
Updated on 2022-06-22 at 16:53:25 +0200
3.4 - IngestUtils
IngestUtils
Functions
Name | |
---|---|
bool | isRunningWithRootPrivileges() |
Functions Documentation
function isRunningWithRootPrivileges
bool isRunningWithRootPrivileges()
Return: true if this application is executing with root privileges, false otherwise
Updated on 2022-06-22 at 16:53:25 +0200
3.5 - TimeCommon
TimeCommon
Classes
Name | |
---|---|
struct | TimeCommon::TAIStatus |
struct | TimeCommon::TimeStructure |
Types
Name | |
---|---|
enum class | StratumLevel { UnknownStratum, stratum0, stratum1, stratum2, stratum3, stratum4} |
Functions
Name | |
---|---|
uint64_t | getMonotonicClockMicro() Get current time since epoch. |
TimeCommon::TAIStatus | getStatus() Get TAI status. |
int64_t | getTAIMicro() Get current TAI time. |
Types Documentation
enum StratumLevel
Enumerator | Value | Description |
---|---|---|
UnknownStratum | ||
stratum0 | ||
stratum1 | ||
stratum2 | ||
stratum3 | ||
stratum4 |
Functions Documentation
function getMonotonicClockMicro
uint64_t getMonotonicClockMicro()
Get current time since epoch.
Return: Return current time since epoch in microseconds
function getStatus
TimeCommon::TAIStatus getStatus()
Get TAI status.
Return: Return the TAI status
function getTAIMicro
int64_t getTAIMicro()
Get current TAI time.
Return: Return current TAI time in microseconds
Updated on 2022-06-22 at 16:53:25 +0200
3.6 - UUIDUtils
UUIDUtils
A namespace for UUID utility functions.
Functions
Name | |
---|---|
std::string | generateRandomUUID() Generates a completely randomized UUID string. |
bool | isValidUUIDString(const std::string & uuid) Checks if a string is a valid UUID string. |
Functions Documentation
function generateRandomUUID
std::string generateRandomUUID()
Generates a completely randomized UUID string.
Return: A random generated UUID string
function isValidUUIDString
bool isValidUUIDString(
const std::string & uuid
)
Checks if a string is a valid UUID string.
Parameters:
- uuid The string to check
Return: True if uuid is a valid UUID string, otherwise false
Updated on 2022-06-22 at 16:53:25 +0200