NVIDIA DeepStream SDK API Reference

6.4 Release
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(). Its metadata type is set to NVDS_BATCH_GST_META.

Multiple groups of metadata may be attached by different elements. gst_buffer_get_nvds_meta() gets the last added NvDsMeta.

The NvDsMeta::meta_data structure member 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
 Holds DeepSteam metadata. 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
 Holds DeepSteam metadata. 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_BUFFER_GST_AS_FRAME_USER_META,
  NVDS_RESERVED_GST_META = NVDS_GST_CUSTOM_META + 4096,
  NVDS_GST_META_FORCE32 = 0x7FFFFFFF
}
 Defines the type of metadata. 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 a GstBuffer. More...
 
NvDsBatchMetagst_buffer_get_nvds_batch_meta (GstBuffer *buffer)
 Gets the NvDsBatchMeta added to a GstBuffer. More...
 
void nvds_copy_gst_meta_to_frame_meta (GstBuffer *src_gst_buffer, NvDsBatchMeta *batch_meta, NvDsFrameMeta *frame_meta)
 Copies all GstMeta objects on src_gst_buffer to the batched buffer's NvDsBatchMeta The GstMeta objects are copied into the user_meta_list within NvDsFrameMeta. More...
 
void nvds_copy_gst_meta_to_audio_frame_meta (GstBuffer *src_gst_buffer, NvDsBatchMeta *batch_meta, NvDsAudioFrameMeta *frame_meta)
 Copies all GstMeta objects on src_gst_buffer to the batched buffer's NvDsBatchMeta The GstMeta objects are copied into the user_meta_list within NvDsAudioFrameMeta. More...
 

Macro Definition Documentation

◆ NVDS_META_API_TYPE

#define NVDS_META_API_TYPE   (nvds_meta_api_get_type())

Definition at line 55 of file gstnvdsmeta.h.

◆ NVDS_META_INFO

#define NVDS_META_INFO   (nvds_meta_get_info())

Definition at line 59 of file gstnvdsmeta.h.

◆ NVDS_META_STRING

#define NVDS_META_STRING   "nvdsmeta"

Definition at line 61 of file gstnvdsmeta.h.

Typedef Documentation

◆ NvDsMeta

typedef struct _NvDsMeta NvDsMeta

Holds DeepSteam metadata.

Enumeration Type Documentation

◆ GstNvDsMetaType

Defines the type of metadata.

NVIDIA-defined GstNvDsMetaType values are in the range from NVDS_BATCH_GST_META to NVDS_START_USER_META.

Enumerator
NVDS_GST_INVALID_META 
NVDS_BATCH_GST_META 
NVDS_DECODER_GST_META 
NVDS_DEWARPER_GST_META 
NVDS_BUFFER_GST_AS_FRAME_USER_META 
NVDS_RESERVED_GST_META 
NVDS_GST_META_FORCE32 

Definition at line 67 of file gstnvdsmeta.h.

Function Documentation

◆ gst_buffer_add_nvds_meta()

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]bufferA pointer to a GstBuffer to which the function adds metadata.
[in]meta_dataA pointer at which the function sets the meta_data member of NvDsMeta.
[in]user_dataA pointer to the user-specific data.
[in]copy_funcThe callback to be called when NvDsMeta is to be copied. The function is called with meta_data and user_data as parameters.
[in]release_funcThe callback 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 if successful, or NULL otherwise.

◆ gst_buffer_get_nvds_batch_meta()

NvDsBatchMeta* gst_buffer_get_nvds_batch_meta ( GstBuffer buffer)

Gets the NvDsBatchMeta added to a GstBuffer.

Parameters
[in]bufferA pointer to the GstBuffer.
Returns
A pointer to the NvDsBatchMeta structure, or NULL if no NvDsMeta was attached.

◆ gst_buffer_get_nvds_meta()

NvDsMeta* gst_buffer_get_nvds_meta ( GstBuffer buffer)

Gets the NvDsMeta last added to a GstBuffer.

Parameters
[in]bufferA pointer to the GstBuffer.
Returns
A pointer to the last added NvDsMeta structure, or NULL if no NvDsMeta was attached.

◆ nvds_copy_gst_meta_to_audio_frame_meta()

void nvds_copy_gst_meta_to_audio_frame_meta ( GstBuffer src_gst_buffer,
NvDsBatchMeta batch_meta,
NvDsAudioFrameMeta frame_meta 
)

Copies all GstMeta objects on src_gst_buffer to the batched buffer's NvDsBatchMeta The GstMeta objects are copied into the user_meta_list within NvDsAudioFrameMeta.

Note: the list of plain GstMeta from @src_gst_buffer are copied into @frame_meta as a single frame_meta->user_meta with NvDsUserMeta->base_meta.meta_type == NVDS_USER_FRAME_META_GST_META. The list of N X NvDsMeta from @src_gst_buffer are copied into @frame_meta as N X frame_meta->user_meta with each NvDsUserMeta->base_meta.meta_type == NvDsMeta->meta_type.

Parameters
[in]src_gst_bufferA pointer to the GstBuffer. GstMeta objects in this GstBuffer will be copied.
[in]batch_metaA pointer to the NvDsBatchMeta obtained from nvstreammux plugin. (Note: Works only for nvstreammux2 (Beta))
[in]frame_metaA pointer to the NvDsAudioFrameMeta NvDsAudioFrameMeta (metadata) for the batched input frame to which GstMeta objects will be copied as frame NvDsUserMeta.

◆ nvds_copy_gst_meta_to_frame_meta()

void nvds_copy_gst_meta_to_frame_meta ( GstBuffer src_gst_buffer,
NvDsBatchMeta batch_meta,
NvDsFrameMeta frame_meta 
)

Copies all GstMeta objects on src_gst_buffer to the batched buffer's NvDsBatchMeta The GstMeta objects are copied into the user_meta_list within NvDsFrameMeta.

Note: the list of plain GstMeta from @src_gst_buffer are copied into @frame_meta as a single frame_meta->user_meta with NvDsUserMeta->base_meta.meta_type == NVDS_USER_FRAME_META_GST_META. The list of N X NvDsMeta from @src_gst_buffer are copied into @frame_meta as N X frame_meta->user_meta with each NvDsUserMeta->base_meta.meta_type == NvDsMeta->meta_type.

Parameters
[in]src_gst_bufferA pointer to the GstBuffer. GstMeta objects in this GstBuffer will be copied.
[in]batch_metaA pointer to the NvDsBatchMeta obtained from nvstreammux plugin. (Note: Works only for nvstreammux2 (Beta))
[in]frame_metaA pointer to the NvDsFrameMeta NvDsFrameMeta (metadata) for the batched input frame to which GstMeta objects will be copied as frame NvDsUserMeta.

◆ nvds_meta_api_get_type()

GType nvds_meta_api_get_type ( void  )

◆ nvds_meta_get_info()

const GstMetaInfo* nvds_meta_get_info ( void  )