How to deep-copy the emory in nvsurface

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) Jetson tx2-4G
• DeepStream Versionv5.0
**• JetPack Version (valid for Jetson only)**4.4
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
• question
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

Hi,

we are trying to display two nvoverlaysink on dual monitors, each displaying a Picture-In-Picture window. There is only one video source, we Tee it into four pads connecting to two nvstreamtile, then to the nvoverlaysinks.

It turns out that nvstreamTile has a thread-safety bug in supporting this. In short, the 4 inputs of the 2 nvstreamtiles are working on the same frame memory. When the 2 nvstreamtiles are on two gstreamer queues, the display became scambled due to multi-thread access. So we decided to develop a plugin to deep-copy the video frame. However, we cannot find an API to deep-copy the data in nvsurface, in the header file.

could you help me to solve this? or is there any existing plugin that we can use to deep-copy the data?

Best regards.

Hi,
Can you use below to generate your pipeline graph?
and for deep copy nvbufsurface, you need to first create buffer for it, for this you can refer to dsexample plugin function gst_dsexample_start for how to create nvbufsurface buffer, for deep copy, you need to get access to the buffer you want to copy from, which encapsulated into GstBuffer, you can refer to sample deepstream-image-meta-test, function pgie_src_pad_buffer_probe

1 For commane line
$ sudo apt-get install graphviz

$ export GST_DEBUG_DUMP_DOT_DIR=/tmp/

nvgstiva-app -c {HOME}/configs/PGIE-FP16-CarType-CarMake-CarColor.txt // or other GStreamer command line

… after the run ends.

$ cd /tmp/

$ dot -Tpng 0.00.03.918991257-iva-app-playing.dot >DeepStreamV1.5-app-playing.png // convert the doc file to png file.

  1. For application

2.1 add “g_setenv(“GST_DEBUG_DUMP_DOT_DIR”, “/tmp”, TRUE);” before gst_init()

2.2 add “GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(gst_objs.pipeline), GST_DEBUG_GRAPH_SHOW_ALL, “demo-app-pipeline”);” at the point where want to export the dot file, e.g. when switching to PLAYING

BTW, need to include header file - #include <gio/gio.h>

never mind. I found that NvSurfaceTransform() can be used to deep-copy data. Thanks for the response.