I would like to free meta, from primary detector and dsexample, from a buffer. I tried to use nvds_free_frame_meta function but I got segmentation fault.
// the primary detector
GstMeta *gst_meta;
NvDsMeta *dsmeta = NULL;
// NOTE: Initializing state to NULL is essential
gpointer state = NULL;
NvDsFrameMeta *bbparams;
// Standard way of iterating through buffer metadata
while ((gst_meta = gst_buffer_iterate_meta (inbuf, &state)) != NULL)
{
//Check if this metadata is of NvDsMeta type
if (!gst_meta_api_type_has_tag (gst_meta->info->api, _dsmeta_quark))
continue;
dsmeta = (NvDsMeta *) gst_meta;
// Check if the metadata of NvDsMeta contains object bounding boxes
if (dsmeta->meta_type != NVDS_META_FRAME_INFO)
continue;
bbparams = (NvDsFrameMeta *) dsmeta->meta_data;
// Check if these parameters have been set by the primary detector /
// tracker
if (bbparams->gie_type != 3 || bbparams->gie_type != 1) {
continue;
}
nvds_free_frame_meta(bbparams);
}
What is the right way to solve this problem? I only see an nvds_free_frame_meta function from gstnvdsmeta.h for freeing meta.
you do not need call the free function here manually
// Attach the NvDsFrameMeta structure as NvDsMeta to the buffer. Pass the
// function to be called when freeing the meta_data
dsmeta = gst_buffer_add_nvds_meta (inbuf, bbparams, free_ds_meta);
the callback will be called when free the meta_data
I want to create my own meta and attach to buffer in a plugin, called Filtering-plugin. Then, in the next plugin, I will get the filtered frame_meta again and add on text, called Text-plugin. However, I can only extract the unfiltered frame_meta from the Text-plugin. May I know how to overcome this problem.