NVIDIA DeepStream SDK API Reference

4.0.2 Release

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
DeepStream Metadata Extension

Detailed Description

Defines an API for managing GStreamer DeepStream metadata.

DeepStream Metadata is attached to a buffer with gst_buffer_add_nvds_meta(). It's metadata type is set to NVDS_BATCH_GST_META

Multiple metadatas may be attached by different elements. gst_buffer_get_nvds_meta() gets the last added NvDsMeta. To iterate through each NvDsMeta, following snippet can be used.

gpointer state = NULL;
GstMeta *gst_meta;
NvDsMeta *nvdsmeta;
static GQuark _nvdsmeta_quark = 0;
if (!_nvdsmeta_quark)
_nvdsmeta_quark = g_quark_from_static_string(NVDS_META_STRING);
while ((gst_meta = gst_buffer_iterate_meta (buf, &state))) {
if (gst_meta_api_type_has_tag(gst_meta->info->api, _nvdsmeta_quark)) {
nvdsmeta = (NvDsMeta *) gst_meta;
// Do something with this nvdsmeta
}
}

The meta_data member of the NvDsMeta structure must be cast to a meaningful structure pointer based on the meta_type. For example, for meta_type = NVDS_BATCH_GST_META, meta_data must be cast as (NvDsBatchMeta *).

Data Structures

struct  _NvDsMeta
 Specifies the type of function to copy meta data. More...
 

Macros

#define NVDS_META_API_TYPE   (nvds_meta_api_get_type())
 
#define NVDS_META_INFO   (nvds_meta_get_info())
 
#define NVDS_META_STRING   "nvdsmeta"
 

Typedefs

typedef struct _NvDsMeta NvDsMeta
 Specifies the type of function to copy meta data. More...
 

Enumerations

enum  GstNvDsMetaType {
  NVDS_GST_INVALID_META =-1,
  NVDS_BATCH_GST_META = NVDS_GST_CUSTOM_META + 1,
  NVDS_DECODER_GST_META,
  NVDS_DEWARPER_GST_META,
  NVDS_RESERVED_GST_META = NVDS_GST_CUSTOM_META + 4096,
  NVDS_GST_META_FORCE32 = 0x7FFFFFFF
}
 Specifies the type of meta data. More...
 

Functions

GType nvds_meta_api_get_type (void)
 
const GstMetaInfo * nvds_meta_get_info (void)
 
NvDsMetagst_buffer_add_nvds_meta (GstBuffer *buffer, gpointer meta_data, gpointer user_data, NvDsMetaCopyFunc copy_func, NvDsMetaReleaseFunc release_func)
 Adds GstMeta of type NvDsMeta to the GstBuffer and sets the meta_data member of NvDsMeta. More...
 
NvDsMetagst_buffer_get_nvds_meta (GstBuffer *buffer)
 Gets the NvDsMeta last added to the GstBuffer. More...
 
NvDsBatchMetagst_buffer_get_nvds_batch_meta (GstBuffer *buffer)
 Gets the NvDsBatchMeta added to the GstBuffer. More...
 

Macro Definition Documentation

#define NVDS_META_API_TYPE   (nvds_meta_api_get_type())

Definition at line 71 of file gstnvdsmeta.h.

#define NVDS_META_INFO   (nvds_meta_get_info())

Definition at line 75 of file gstnvdsmeta.h.

#define NVDS_META_STRING   "nvdsmeta"

Definition at line 77 of file gstnvdsmeta.h.

Typedef Documentation

typedef struct _NvDsMeta NvDsMeta

Specifies the type of function to copy meta data.

It is passed the pointer to meta data and user specific data. It allocates the required memory, copy the content and returns the pointer to newly allocated memory. Holds DeepSteam meta data.

Enumeration Type Documentation

Specifies the type of meta data.

NVIDIA defined GstNvDsMetaType will be present in the range from NVDS_BATCH_GST_META to NVDS_START_USER_META (refer nvdsmeta.h) User can add it's own metadata type NVDS_RESERVED_GST_META onwards.

Enumerator
NVDS_GST_INVALID_META 
NVDS_BATCH_GST_META 
NVDS_DECODER_GST_META 
NVDS_DEWARPER_GST_META 
NVDS_RESERVED_GST_META 
NVDS_GST_META_FORCE32 

Definition at line 85 of file gstnvdsmeta.h.

Function Documentation

NvDsMeta* gst_buffer_add_nvds_meta ( GstBuffer *  buffer,
gpointer  meta_data,
gpointer  user_data,
NvDsMetaCopyFunc  copy_func,
NvDsMetaReleaseFunc  release_func 
)

Adds GstMeta of type NvDsMeta to the GstBuffer and sets the meta_data member of NvDsMeta.

Parameters
[in]bufferGstBuffer to which the function adds metadata.
[in]meta_dataThe pointer to which the function sets the meta_data member of NvDsMeta.
[in]user_dataA pointer to the user specific data
[in]copy_funcThe NvDsMetaCopyFunc function to be called when NvDsMeta is to be copied. The function is called with meta_data and user_data as parameters.
[in]release_funcThe NvDsMetaReleaseFunc function to be called when NvDsMeta is to be destroyed. The function is called with meta_data and user_data as parameters.
Returns
A pointer to the attached NvDsMeta structure; or NULL in case of failure.
NvDsBatchMeta* gst_buffer_get_nvds_batch_meta ( GstBuffer *  buffer)

Gets the NvDsBatchMeta added to the GstBuffer.

Parameters
[in]bufferGstBuffer
Returns
A pointer to the NvDsBatchMeta structure; or NULL if no NvDsMeta was attached.
NvDsMeta* gst_buffer_get_nvds_meta ( GstBuffer *  buffer)

Gets the NvDsMeta last added to the GstBuffer.

Parameters
[in]bufferGstBuffer
Returns
A pointer to the last added NvDsMeta structure; or NULL if no NvDsMeta was attached.
GType nvds_meta_api_get_type ( void  )
const GstMetaInfo* nvds_meta_get_info ( void  )