IMediaStreamer is an interface class for MediaStreamers, that can take a single stream of uncompressed video and/or audio frames and encode and output it in some way. This output 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 <IMediaStreamer.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. |
struct | Settings Settings used when creating a new MediaStreamer. |
Name | |
---|---|
virtual | ~IMediaStreamer() =default Destructor. |
virtual bool | configure(const std::string & uuid, const Settings & settings, CUcontext cudaContext) =0 Configure this MediaStreamer. This must be called before any call to the. |
virtual bool | setInputFormatAndStart(const Configuration & configuration) =0 Set the input format of this MediaStreamer and start the streamer. The. |
virtual bool | stopAndResetFormat() =0 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. |
virtual bool | hasFormatAndIsRunning() const =0 |
virtual bool | hasOpenOutputStream() const =0 |
virtual bool | outputData(const AlignedFramePtr & frame) =0 Output data through this streamer. The AlignedFrame::mRenderingTimestamp of the frame will be used as PTS when encoding the uncompressed frame. |
class IMediaStreamer;
IMediaStreamer is an interface class for MediaStreamers, that can take a single stream of uncompressed video and/or audio frames and encode and output it in some way. This output 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.
virtual ~IMediaStreamer() =default
Destructor.
virtual bool configure(
const std::string & uuid,
const Settings & settings,
CUcontext cudaContext
) =0
Configure this MediaStreamer. This must be called before any call to the.
Parameters:
See:
Return: True if the streamer was successfully configured
virtual bool setInputFormatAndStart(
const Configuration & configuration
) =0
Set the input format of this MediaStreamer and start the streamer. The.
Parameters:
See:
Return: True if the streamer was successfully started, false otherwise
virtual bool stopAndResetFormat() =0
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.
virtual bool hasFormatAndIsRunning() const =0
Return: True if the input format is set and the OutputStreamer is running, false otherwise
virtual bool hasOpenOutputStream() const =0
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
virtual bool outputData(
const AlignedFramePtr & frame
) =0
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.
Updated on 2024-04-08 at 15:15:27 +0200