MediaStreamImageDataImportInterface Class Reference

#include <mediasession_stream.h>

Inheritance diagram for MediaStreamImageDataImportInterface:

Detailed Description

Stream which represents full image data.

Public Types

using InitHandler = Delegate< Result< void >(const MediaStreamImageDataImportRef &stream, const MediaStreamProperties &props)>
 
using SetPixelHandler = Delegate< Result< SetPixelHandlerStruct >(const MediaStreamImageDataImportRef &stream, const MediaStreamProperties &props, const ChannelOffsets &srcChannelOffset, SETPIXELHANDLERFLAGS setPixelFlags)>
 
using FinishHandler = Delegate< Result< void >(const MediaStreamImageDataImportRef &stream, const MediaStreamProperties &props)>
 

Public Member Functions

MAXON_METHOD Result< void > SetCallbackHandler (const InitHandler &initHandler, const SetPixelHandler &setPixelHandler, const FinishHandler &finishHandler)
 
MAXON_METHOD Result< void > InitStream (const MediaStreamProperties &props)
 
MAXON_METHOD Result< SetPixelHandlerStructSetPixelStream (const MediaStreamProperties &props, const ChannelOffsets &srcChannelOffsets, SETPIXELHANDLERFLAGS setPixelFlags)
 
MAXON_METHOD Result< void > FinishStream (const MediaStreamProperties &props)
 

Private Member Functions

 MAXON_INTERFACE (MediaStreamImageDataImportInterface, MAXON_REFERENCE_NORMAL, "net.maxon.image.interface.mediastreamimagedataimport")
 

Member Typedef Documentation

◆ InitHandler

using InitHandler = Delegate<Result<void>(const MediaStreamImageDataImportRef& stream, const MediaStreamProperties& props)>

◆ SetPixelHandler

using SetPixelHandler = Delegate<Result<SetPixelHandlerStruct>(const MediaStreamImageDataImportRef& stream, const MediaStreamProperties& props, const ChannelOffsets& srcChannelOffset, SETPIXELHANDLERFLAGS setPixelFlags)>

◆ FinishHandler

using FinishHandler = Delegate<Result<void>(const MediaStreamImageDataImportRef& stream, const MediaStreamProperties& props)>

Member Function Documentation

◆ MAXON_INTERFACE()

MAXON_INTERFACE ( MediaStreamImageDataImportInterface  ,
MAXON_REFERENCE_NORMAL  ,
"net.maxon.image.interface.mediastreamimagedataimport"   
)
private

◆ SetCallbackHandler()

MAXON_METHOD Result<void> SetCallbackHandler ( const InitHandler initHandler,
const SetPixelHandler setPixelHandler,
const FinishHandler finishHandler 
)

Subscribes to the stream. So if the media converter loads the stream the setPixelHandler callback is triggered. this allows to read data directly to the place where it needs to by without additional memory copy.

Parameters
[in]initHandlerA handler which is called from the input media converter to signal that data is available for this frame of the stream.
[in]setPixelHandlerA handler which is called for each thread that needs a valid SetPixelHandlerStruct which will be used by the input converter to set the pixel data.
[in]finishHandlerA handler which is called from the input media converter to signal that data loading the data from this stream is finished for this frame of the stream.
Returns
OK on success.

◆ InitStream()

MAXON_METHOD Result<void> InitStream ( const MediaStreamProperties &  props)

called by the input media converter implementation before loading a stream.

Parameters
[in]propsProperties of the source image stream.
Returns
OK on success.

◆ SetPixelStream()

MAXON_METHOD Result<SetPixelHandlerStruct> SetPixelStream ( const MediaStreamProperties &  props,
const ChannelOffsets srcChannelOffsets,
SETPIXELHANDLERFLAGS  setPixelFlags 
)

called by the input media converter implementation before loading a stream.

Parameters
[in]propsProperties of the source image stream.
[in]srcChannelOffsetsSource channel offsets of the data that will be set using this set pixel handler.
[in]setPixelFlagsFlags which control the set pixel operation. See also SETPIXELHANDLERFLAGS.
Returns
OK on success.

◆ FinishStream()

MAXON_METHOD Result<void> FinishStream ( const MediaStreamProperties &  props)

called by the input media converter implementation when loading the stream is completed.

Parameters
[in]propsProperties of the source image stream.
Returns
OK on success.