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
structConfiguration
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.
boolconfigure(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.
boolsetInputFormatAndStart(const Configuration & configuration)
Set the input format of this MediaStreamer and start the streamer. The.
boolstopAndResetFormat()
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.
booloutputData(const std::shared_ptr< AlignedData::DataFrame > & frame)
Output data through this streamer.
std::stringgetVersion()
Get application version.
std::stringgetBuildInfo()
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