MediaStreamImageDataExportInterface Class Reference

#include <mediasession_stream.h>

Inheritance diagram for MediaStreamImageDataExportInterface:

Detailed Description

Stream which represents full image data.

Public Types

using InitHandler = Delegate< Result< void >(const MediaStreamImageDataExportRef &stream, MediaStreamProperties &props)>
 
using GetPixelHandler = Delegate< Result< GetPixelHandlerStruct >(const MediaStreamImageDataExportRef &stream, const MediaStreamProperties &props, const PixelFormat &dstFormat, const ChannelOffsets &channelOffsets, const ColorProfile &dstColorProfile, GETPIXELHANDLERFLAGS flags, const LayerSetInterface *layerSet)>
 
using FinishHandler = Delegate< Result< void >(const MediaStreamImageDataExportRef &stream, const MediaStreamProperties &props)>
 

Public Member Functions

MAXON_METHOD Result< void > SetCallbackHandler (const InitHandler &initHandler, const GetPixelHandler &getPixelHandler, const FinishHandler &finishHandler)
 
MAXON_METHOD Result< void > InitStream (MediaStreamProperties &props)
 
MAXON_METHOD Result< GetPixelHandlerStructGetPixelStream (const MediaStreamProperties &props, const PixelFormat &dstFormat, const ChannelOffsets &channelOffsets, const ColorProfile &dstColorProfile, GETPIXELHANDLERFLAGS flags)
 
MAXON_METHOD Result< void > FinishStream (const MediaStreamProperties &props)
 

Private Member Functions

 MAXON_INTERFACE (MediaStreamImageDataExportInterface, MAXON_REFERENCE_NORMAL, "net.maxon.image.interface.mediastreamimagedataexport")
 

Member Typedef Documentation

◆ InitHandler

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

◆ GetPixelHandler

using GetPixelHandler = Delegate<Result<GetPixelHandlerStruct>(const MediaStreamImageDataExportRef& stream, const MediaStreamProperties& props, const PixelFormat& dstFormat, const ChannelOffsets& channelOffsets, const ColorProfile& dstColorProfile, GETPIXELHANDLERFLAGS flags, const LayerSetInterface* layerSet)>

◆ FinishHandler

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

Member Function Documentation

◆ MAXON_INTERFACE()

MAXON_INTERFACE ( MediaStreamImageDataExportInterface  ,
MAXON_REFERENCE_NORMAL  ,
"net.maxon.image.interface.mediastreamimagedataexport"   
)
private

◆ SetCallbackHandler()

MAXON_METHOD Result<void> SetCallbackHandler ( const InitHandler initHandler,
const GetPixelHandler getPixelHandler,
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 output media converter to signal that data is required for this frame of the stream.
[in]getPixelHandlerA handler which is called for each thread that needs a valid GetPixelHandlerStruct which will be used by the output converter to get the pixel data.
[in]finishHandlerA handler which is called from the output media converter to signal that data writing the data from this stream is finished for this frame of the stream.
Returns
OK on success.

◆ InitStream()

MAXON_METHOD Result<void> InitStream ( MediaStreamProperties &  props)

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

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

◆ GetPixelStream()

MAXON_METHOD Result<GetPixelHandlerStruct> GetPixelStream ( const MediaStreamProperties &  props,
const PixelFormat &  dstFormat,
const ChannelOffsets channelOffsets,
const ColorProfile dstColorProfile,
GETPIXELHANDLERFLAGS  flags 
)

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

Parameters
[in]propsProperties of the image stream.
[in]dstFormatDestination pixel format.
[in]channelOffsetsChannel offset that is needed in the destination.
[in]dstColorProfileDestination color profile.
[in]flagsSee GETPIXELHANDLERFLAGS flags.
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 image stream.
Returns
OK on success.