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>
Name | |
---|---|
struct | NewStreamParameters A struct containing information on the format of an incoming stream. |
struct | Settings Settings for a MediaReceiver. |
Name | |
---|---|
enum class uint32_t | TallyBorderColor { kNone, kRed, kGreen, kYellow} Available colors for tally border in multi view. |
Name | |
---|---|
MediaReceiver() Default constructor. | |
~MediaReceiver() Default destructor. | |
bool | start(const std::shared_ptr< ISystemControllerInterface > & controllerInterface, CUcontext cudaContext, 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 AlignedFramePtr &)> | 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. |
bool | removeCustomMultiViewSourceInput(uint32_t inputSlot) Remove a custom multi-view generator source input earlier registered using the getCustomMultiViewSourceInput method. |
void | setTallyBorder(uint32_t inputSlot, TallyBorderColor color) Set tally border color in the multi-views for a specific input slot. |
void | clearTallyBorder(uint32_t inputSlot) Remove tally border in the multi-views for a specific input slot. |
void | clearAllTallyBorders() Remove all tally borders. |
MediaReceiver::TallyBorderColor | getTallyBorder(uint32_t inputSlot) const get tally border color for an input slot |
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. |
std::string | getLibraryVersions() Get versions of the libraries available at runtime, among others, CUDA runtime and driver versions. |
Enumerator | Value | Description |
---|---|---|
kNone | ||
kRed | ||
kGreen | ||
kYellow |
Available colors for tally border in multi view.
MediaReceiver()
Default constructor.
~MediaReceiver()
Default destructor.
bool start(
const std::shared_ptr< ISystemControllerInterface > & controllerInterface,
CUcontext cudaContext,
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:
Return: True if the MediaReceiver was started successfully, false otherwise.
void stop()
Stop the MediaReceiver.
std::function< void(const AlignedFramePtr &)> 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:
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.
Note: Make sure no CUDA stream will write to the DeviceMemory in the AlignedFrame passed to the function. Failing to do so will lead to undefined behavior. In case another CUDA stream has written to the DeviceMemory, make sure to synchronize with the stream before passing the AlignedFrame.
Precondition: The AlignedFrame sent to this function must have the same pixel format as this MediaReceiver is configured to deliver to the Rendering Engine,
bool removeCustomMultiViewSourceInput(
uint32_t inputSlot
)
Remove a custom multi-view generator source input earlier registered using the getCustomMultiViewSourceInput
method.
Parameters:
Return: True if the custom multi-view source input was successfully removed, false in case there was no custom input registered for the given input slot, or in case of an internal error.
void setTallyBorder(
uint32_t inputSlot,
TallyBorderColor color
)
Set tally border color in the multi-views for a specific input slot.
Parameters:
void clearTallyBorder(
uint32_t inputSlot
)
Remove tally border in the multi-views for a specific input slot.
Parameters:
void clearAllTallyBorders()
Remove all tally borders.
MediaReceiver::TallyBorderColor getTallyBorder(
uint32_t inputSlot
) const
get tally border color for an input slot
Parameters:
Return: the tally border color for the given input slot
MediaReceiver(
MediaReceiver const &
) =delete
MediaReceiver is neither copyable nor movable.
MediaReceiver(
MediaReceiver &&
) =delete
MediaReceiver & operator=(
MediaReceiver const &
) =delete
MediaReceiver & operator=(
MediaReceiver &&
) =delete
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
static std::string getLibraryVersions()
Get versions of the libraries available at runtime, among others, CUDA runtime and driver versions.
Return: a string with the currently found versions of the libraries used by this application
Updated on 2024-01-25 at 12:02:05 +0100