In my DeepStream application, I add custom user metas to both frames and objects in a very similar fashion to nvinfer_src_pad_buffer_probe in deepstream-user-metadata-test. I’ve created a probe called src_pad_buffer_probe that gets added to my primary GIE bin.
I’ve also written some custom plugins that are placed after my primary GIE bin. I want to be able to edit the metadata created by my src_pad_buffer_probe in my plugin’s gst_dsexample_transform_ip function, but I am running into issues. In particular, I am doing something like this in gst_dsexample_transform_ip:
This code runs and gives me no errors, but when I look at the metadata for these same objects further down the pipeline, my changes weren’t propagated. What am I missing? Is it not possible to update user metas once they’ve been set?
Then I add this probe to my primary GIE source pad with:
GstPad *infer_src_pad = gst_element_get_static_pad(bin->primary_gie, "src");
if (!infer_src_pad) {
NVGSTDS_ERR_MSG_V("Failed to get source pad");
} else {
gst_pad_add_probe(infer_src_pad, GST_PAD_PROBE_TYPE_BUFFER, src_pad_buffer_probe, NULL, NULL);
}
gst_object_unref(infer_src_pad);
I’ve tried reproducing deepstream-user-metadata-test, but the issue is updating existing metadata, not setting it once, then only reading it later, so it hasn’t been very useful.
I’m not sure I understand your comment about meta type-I’m pretty sure what I am adding is a NvDsUserMeta. I think the code I’ve included in this reply does exactly that.
It is the same with deepstream-user-metadata-test, if the meta can be available in probe function, it can also be read and changed by plugin. We can not know what is wrong just with the pieces of codes you post here.