MediaConverterInterface Class Reference

#include <mediasession_converter.h>

Inheritance diagram for MediaConverterInterface:

Detailed Description

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"))
 

Member Function Documentation

◆ MAXON_INTERFACE()

MAXON_INTERFACE ( MediaConverterInterface  ,
MAXON_REFERENCE_NORMAL  ,
"net.maxon.image.interface.mediaconverter"  ,
MAXON_IMPLEMENTATION_MODULE("net.maxon.image")   
)
private

◆ SupportImportStrategy()

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.

Returns
True for supported imported strategy, false otherwise.

◆ SupportExportStrategy()

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.

Returns
True for supported export strategy, false otherwise.

◆ GetInputConverter()

MAXON_METHOD Result<BaseArray<MediaConverterRef> > GetInputConverter ( ) const

Get the connected MediaConvertRef used as input. An empty array if it's the source/root.

Returns
Array of inputs.

◆ AddOutputStream()

MAXON_METHOD Result<void> AddOutputStream ( const MediaStreamRef &  stream)

Adds an output stream to the converter.

Returns
OK on success.

◆ RemoveOutputStream()

MAXON_METHOD Result<void> RemoveOutputStream ( const MediaStreamRef &  stream)

Removes an output stream from the converter.

Returns
OK on success.

◆ GetOutputStreams()

MAXON_METHOD Result<BaseArray<MediaStreamRef> > GetOutputStreams ( Bool  flattenChildren) const

Returns all output streams of this converter.

Parameters
[in]flattenChildrenReturn also all children streams by running recursively through all streams.
Returns
Array of output streams.

◆ Analyze()

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.

Parameters
[in]inputsBlock of input streams to evaluate.
[in]targetTimeTarget time to load.
[in]flagsSee MEDIASESSIONFLAGS for details.
Returns
OK on success.

◆ PrepareExecute()

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.

Parameters
[in]inputsBlock of input streams to evaluate.
[in]targetTimeTarget time to load.
[in]flagsSee MEDIASESSIONFLAGS for details.
Returns
OK on success.

◆ Execute()

MAXON_METHOD Result<void> Execute ( const Block< const MediaConverterRef > &  inputs,
const TimeValue targetTime,
MEDIASESSIONFLAGS  flags 
)

Executes the streams.

Parameters
[in]inputsBlock of input streams to evaluate.
[in]targetTimeTarget time to load.
[in]flagsSee MEDIASESSIONFLAGS for details.
Returns
OK on success.

◆ Close()

MAXON_METHOD Result<void> Close ( const Block< const MediaConverterRef > &  inputs)

Closes the converter and closes all streams and operations.

Parameters
[in]inputsBlock of input streams to close.
Returns
OK on success.