#include <mediasession_converter.h>
MediaConverterInterface is a generic interface to access media conversions. It allows to connect streams and triggers the evaluation of the network.
Public Member Functions | |
MAXON_METHOD Bool | SupportImportStrategy () const |
MAXON_METHOD Bool | SupportExportStrategy () const |
MAXON_METHOD Result< BaseArray< MediaConverterRef > > | GetInputConverter () const |
MAXON_METHOD Result< void > | AddOutputStream (const MediaStreamRef &stream) |
MAXON_METHOD Result< void > | RemoveOutputStream (const MediaStreamRef &stream) |
MAXON_METHOD Result< BaseArray< MediaStreamRef > > | GetOutputStreams (Bool flattenChildren) const |
MAXON_METHOD Result< void > | Analyze (const Block< const MediaConverterRef > &inputs, const TimeValue &targetTime, MEDIASESSIONFLAGS flags) |
MAXON_METHOD Result< void > | PrepareExecute (const Block< const MediaConverterRef > &inputs, const TimeValue &targetTime, MEDIASESSIONFLAGS flags) |
MAXON_METHOD Result< void > | Execute (const Block< const MediaConverterRef > &inputs, const TimeValue &targetTime, MEDIASESSIONFLAGS flags) |
MAXON_METHOD Result< void > | Close (const Block< const MediaConverterRef > &inputs) |
Private Member Functions | |
MAXON_INTERFACE (MediaConverterInterface, MAXON_REFERENCE_NORMAL, "net.maxon.image.interface.mediaconverter", MAXON_IMPLEMENTATION_MODULE("net.maxon.image")) | |
|
private |
MAXON_METHOD Bool SupportImportStrategy | ( | ) | const |
Returns true for media importers: The converter supports the import strategy where the input pushes the read data to the output nodes. The media session can only connect converters which support the same strategies, e.g. MediaStreamImageDataImportInterface.
MAXON_METHOD Bool SupportExportStrategy | ( | ) | const |
Returns true for media exporters: The converter supports the export strategy where the output pulls the required data from the input nodes. The media session can only connect converters which support the same strategies, e.g. MediaStreamImageDataExportInterface.
MAXON_METHOD Result<BaseArray<MediaConverterRef> > GetInputConverter | ( | ) | const |
Get the connected MediaConvertRef used as input. An empty array if it's the source/root.
MAXON_METHOD Result<void> AddOutputStream | ( | const MediaStreamRef & | stream | ) |
Adds an output stream to the converter.
MAXON_METHOD Result<void> RemoveOutputStream | ( | const MediaStreamRef & | stream | ) |
Removes an output stream from the converter.
MAXON_METHOD Result<BaseArray<MediaStreamRef> > GetOutputStreams | ( | Bool | flattenChildren | ) | const |
Returns all output streams of this converter.
[in] | flattenChildren | Return also all children streams by running recursively through all streams. |
MAXON_METHOD Result<void> Analyze | ( | const Block< const MediaConverterRef > & | inputs, |
const TimeValue & | targetTime, | ||
MEDIASESSIONFLAGS | flags | ||
) |
Analyzes the streams. A converter needs to call the same function for all inputs followed by calling stream.SubscribeStream() to signal the interest for one or more streams.
[in] | inputs | Block of input streams to evaluate. |
[in] | targetTime | Target time to load. |
[in] | flags | See MEDIASESSIONFLAGS for details. |
MAXON_METHOD Result<void> PrepareExecute | ( | const Block< const MediaConverterRef > & | inputs, |
const TimeValue & | targetTime, | ||
MEDIASESSIONFLAGS | flags | ||
) |
Prepares to execute the streams. Called after Analyze() and before Execute(). At this moment all requested streams are already subscribed. This allows to setup progress hooks to setup correctly with the necessary data.
[in] | inputs | Block of input streams to evaluate. |
[in] | targetTime | Target time to load. |
[in] | flags | See MEDIASESSIONFLAGS for details. |
MAXON_METHOD Result<void> Execute | ( | const Block< const MediaConverterRef > & | inputs, |
const TimeValue & | targetTime, | ||
MEDIASESSIONFLAGS | flags | ||
) |
Executes the streams.
[in] | inputs | Block of input streams to evaluate. |
[in] | targetTime | Target time to load. |
[in] | flags | See MEDIASESSIONFLAGS for details. |
MAXON_METHOD Result<void> Close | ( | const Block< const MediaConverterRef > & | inputs | ) |
Closes the converter and closes all streams and operations.
[in] | inputs | Block of input streams to close. |