Doxygen Book
_GstTensorDecoderDef Struct Reference

Decoder definitions for different semantics of tensors This allows developers to create their own decoders. More...

#include <nnstreamer_plugin_api_decoder.h>

Public Attributes

char * modename
 
int(* init )(void **private_data)
 
void(* exit )(void **private_data)
 
int(* setOption )(void **private_data, int opNum, const char *param)
 
GstCaps *(* getOutCaps )(void **private_data, const GstTensorsConfig *config)
 
GstFlowReturn(* decode )(void **private_data, const GstTensorsConfig *config, const GstTensorMemory *input, GstBuffer *outbuf)
 
size_t(* getTransformSize )(void **private_data, const GstTensorsConfig *config, GstCaps *caps, size_t size, GstCaps *othercaps, GstPadDirection direction)
 

Detailed Description

Decoder definitions for different semantics of tensors This allows developers to create their own decoders.

Definition at line 38 of file nnstreamer_plugin_api_decoder.h.

Member Data Documentation

◆ decode

GstFlowReturn(* _GstTensorDecoderDef::decode) (void **private_data, const GstTensorsConfig *config, const GstTensorMemory *input, GstBuffer *outbuf)

The function to be called when the input tensor incomes into tensor_decoder. The sub-plugin should update the output buffer. outbuf must be allocated but empty (gst_buffer_get_size (outbuf) == 0).

Parameters
[in/out]private_data A sub-plugin may save its internal private data here. The sub-plugin is responsible for alloc/free of this pointer.
[in]configThe structure of input tensor info.
[in]inputThe array of input tensor data. The maximum array size of input data is NNS_TENSOR_SIZE_LIMIT.
[out]outbufA sub-plugin should update or append proper memory for the negotiated media type.
Returns
GST_FLOW_OK if OK.

Definition at line 71 of file nnstreamer_plugin_api_decoder.h.

◆ exit

void(* _GstTensorDecoderDef::exit) (void **private_data)

Object destruction for the decoder.

Parameters
[in/out]private_data A sub-plugin may save its internal private data here. The sub-plugin is responsible for alloc/free of this pointer. Normally, the sub-plugin may free the private_data with this function.

Definition at line 48 of file nnstreamer_plugin_api_decoder.h.

◆ getOutCaps

GstCaps*(* _GstTensorDecoderDef::getOutCaps) (void **private_data, const GstTensorsConfig *config)

The caller should unref the returned GstCaps using gst_caps_unref(). The sub-plugin should validate the information of input tensor and return proper media type. Note that the information of input tensor is not a fixed value and the pipeline may try different values during the cap negotiations. Do NOT allocate or fix internal data structure until decode is called.

Parameters
[in/out]private_data A sub-plugin may save its internal private data here. The sub-plugin is responsible for alloc/free of this pointer.
[in]configThe structure of input tensor info.
Returns
GstCaps object describing media type.

Definition at line 61 of file nnstreamer_plugin_api_decoder.h.

◆ getTransformSize

size_t(* _GstTensorDecoderDef::getTransformSize) (void **private_data, const GstTensorsConfig *config, GstCaps *caps, size_t size, GstCaps *othercaps, GstPadDirection direction)

Optional. The sub-plugin may calculate the size in bytes of a buffer. If this is NULL, tensor_decoder will pass the empty buffer and the sub-plugin should append the memory block when called decode. See GstBaseTransformClass::transform_size for the details.

Parameters
[in/out]private_data A sub-plugin may save its internal private data here. The sub-plugin is responsible for alloc/free of this pointer.
[in]configThe structure of input tensor info.
[in]capsGstCaps object for the given direction.
[in]sizeThe size of a buffer for the given direction.
[in]othercapsGstCaps object on the other pad for the given direction.
[in]directionThe direction of a pad. Normally this is GST_PAD_SINK.
Returns
The size of a buffer.

Definition at line 82 of file nnstreamer_plugin_api_decoder.h.

◆ init

int(* _GstTensorDecoderDef::init) (void **private_data)

Object initialization for the decoder.

Parameters
[in/out]private_data A sub-plugin may save its internal private data here. The sub-plugin is responsible for alloc/free of this pointer. Normally, the sub-plugin may allocate the private_data with this function.
Returns
TRUE if OK. FALSE if error.

Definition at line 42 of file nnstreamer_plugin_api_decoder.h.

◆ modename

char* _GstTensorDecoderDef::modename

Unique decoder name. GST users choose decoders with mode="modename".

Definition at line 40 of file nnstreamer_plugin_api_decoder.h.

◆ setOption

int(* _GstTensorDecoderDef::setOption) (void **private_data, int opNum, const char *param)

Process with the given options. It can be called repeatedly.

Parameters
[in/out]private_data A sub-plugin may save its internal private data here. The sub-plugin is responsible for alloc/free of this pointer.
[in]opNumThe index of the given options.
[in]paramThe option string. A sub-plugin should parse the string to get the proper value.
Returns
TRUE if OK. FALSE if error.

Definition at line 53 of file nnstreamer_plugin_api_decoder.h.


The documentation for this struct was generated from the following file: