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>
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. |
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, CUcontext cudaContext) 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 | hasFormatAndIsRunning() const |
bool | hasOpenOutputStream() const |
bool | outputData(const AlignedFramePtr & frame) Output data through this streamer. The AlignedFrame::mRenderingTimestamp of the frame will be used as PTS when encoding the uncompressed frame. |
std::string | getVersion() Get application version. |
std::string | getBuildInfo() Get application build information. |
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.
MediaStreamer()
Default constructor.
~MediaStreamer()
Destructor. This will stop the output stream if not already done by calling.
See: stop.
bool configure(
const std::shared_ptr< ISystemControllerInterface > & controllerInterface,
CUcontext cudaContext
)
Configure this MediaStreamer and connect it to the System controller. This must be called before any call to the.
Parameters:
See:
Return: True if the streamer was successfully connected to the System controller
bool setInputFormatAndStart(
const Configuration & configuration
)
Set the input format of this MediaStreamer and start the streamer. The.
Parameters:
See:
Return: True if the streamer was successfully started, false otherwise
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 format reset, or if the format was not set before this method was called, false on error.
bool hasFormatAndIsRunning() const
Return: True if the input format is set and the OutputStreamer is running, false otherwise
bool hasOpenOutputStream() const
See:
Return: True if the output stream of the MediaStreamer is currently open and outputting the data, false otherwise. In case this returns false all frames passed to
bool outputData(
const AlignedFramePtr & frame
)
Output data through this streamer. The AlignedFrame::mRenderingTimestamp of the frame will be used as PTS when encoding the uncompressed frame.
Parameters:
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
Note: The DeviceMemory in the AlignedFrame passed to this method must not be in use by any CUDA stream. In case the memory has been used in kernels in another CUDA stream, make sure to first synchronize with the stream, before passing it over to the MediaStreamer.
static std::string getVersion()
Get application version.
Return: a string with the current version, e.g. “1.0.0”
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 2024-01-25 at 12:02:05 +0100