GStreamer Video Analytics (GVA) Plugin
Classes | Typedefs | Enumerations | Functions
gva_tensor_meta.h File Reference

This file contains helper functions to control _GstGVATensorMeta instances. More...

Go to the source code of this file.

Classes

struct  _GstGVATensorMeta
 This struct represents raw tensor metadata and contains instance of parent GstMeta and fields describing inference result tensor. This metadata instances is attached to buffer by gvainference elements. More...
 

Typedefs

typedef struct _GstGVATensorMeta GstGVATensorMeta
 

Enumerations

enum  GVAPrecision { GVA_PRECISION_UNSPECIFIED = 255, GVA_PRECISION_FP32 = 10, GVA_PRECISION_U8 = 40 }
 This enum describes model layer precision. More...
 
enum  GVALayout { GVA_LAYOUT_ANY = 0, GVA_LAYOUT_NCHW = 1, GVA_LAYOUT_NHWC = 2, GVA_LAYOUT_NC = 193 }
 This enum describes model layer layout. More...
 

Functions

const void * gva_get_tensor_data (GstStructure *s, gsize *nbytes)
 This function returns a pointer to the fixed array of tensor bytes. More...
 
const GstMetaInfo * gst_gva_tensor_meta_get_info (void)
 This function registers, if needed, and returns GstMetaInfo for _GstGVATensorMeta. More...
 
GType gst_gva_tensor_meta_api_get_type (void)
 This function registers, if needed, and returns a GType for api "GstGVATensorMetaAPI" and associate it with GVA_TENSOR_META_TAG tag. More...
 
GstGVATensorMetafind_tensor_meta (GstBuffer *buffer, const char *model_name, const char *output_layer)
 This function searches for first _GstGVATensorMeta instance that satisfies passed parameters. More...
 
GstGVATensorMetafind_tensor_meta_ext (GstBuffer *buffer, const char *model_name, const char *output_layer, const char *element_id)
 This function searches for first _GstGVATensorMeta instance that satisfies passed parameters. More...
 

Detailed Description

This file contains helper functions to control _GstGVATensorMeta instances.

Enumeration Type Documentation

◆ GVALayout

enum GVALayout

This enum describes model layer layout.

Enumerator
GVA_LAYOUT_ANY 

unspecified layout

GVA_LAYOUT_NCHW 

NCWH layout

GVA_LAYOUT_NHWC 

NHWC layout

GVA_LAYOUT_NC 

NC layout

◆ GVAPrecision

This enum describes model layer precision.

Enumerator
GVA_PRECISION_UNSPECIFIED 

default value

GVA_PRECISION_FP32 

32bit floating point value

GVA_PRECISION_U8 

unsignned 8bit integer value

Function Documentation

◆ find_tensor_meta()

GstGVATensorMeta* find_tensor_meta ( GstBuffer *  buffer,
const char *  model_name,
const char *  output_layer 
)

This function searches for first _GstGVATensorMeta instance that satisfies passed parameters.

Parameters
bufferGstBuffer* that is searched for metadata
model_namesubstring that should be in _GstGVATensorMeta instance's model_name
output_layersubstring that should be in _GstGVATensorMeta instance's layer_name
Returns
GstGVATensorMeta* for found instance or NULL if none are found

◆ find_tensor_meta_ext()

GstGVATensorMeta* find_tensor_meta_ext ( GstBuffer *  buffer,
const char *  model_name,
const char *  output_layer,
const char *  element_id 
)

This function searches for first _GstGVATensorMeta instance that satisfies passed parameters.

Parameters
bufferGstBuffer* that is searched for metadata
model_namesubstring that should be in _GstGVATensorMeta instance's model_name
output_layersubstring that should be in _GstGVATensorMeta instance's layer_name
element_idelement_id substring that should be in _GstGVATensorMeta instance's element_id
Returns
GstGVATensorMeta* for found instance or NULL if none are found

◆ gst_gva_tensor_meta_api_get_type()

GType gst_gva_tensor_meta_api_get_type ( void  )

This function registers, if needed, and returns a GType for api "GstGVATensorMetaAPI" and associate it with GVA_TENSOR_META_TAG tag.

Returns
GType type

◆ gst_gva_tensor_meta_get_info()

const GstMetaInfo* gst_gva_tensor_meta_get_info ( void  )

This function registers, if needed, and returns GstMetaInfo for _GstGVATensorMeta.

Returns
GstMetaInfo* for registered type

◆ gva_get_tensor_data()

const void* gva_get_tensor_data ( GstStructure *  s,
gsize *  nbytes 
)
inline

This function returns a pointer to the fixed array of tensor bytes.

Parameters
sGstStructure* to get tensor from. It's assumed that tensor data is stored in "data_buffer" field
[out]nbytespointer to the location to store the number of bytes in returned array
Returns
void* to tensor data as bytes, NULL if s has no "data_buffer" field