How to Modify NvBufSurface in a DeepStream Pad Probe?

Question:

In a DeepStream 7.1 pipeline on Jetson, I want to modify the contents of the GPU buffer associated with a GstBuffer inside a pad probe function.

I am currently using a pad probe function to access the buffer within the DeepStream pipeline, as shown below:

static GstPadProbeReturn pgie_pad_buffer_probe_network_type100 (GstPad * pad, GstPadProbeInfo * info, gpointer u_data)

Reference:

Since GstBuffer is just a handle to NvBufSurface, what is the correct and safe way to access and modify the NvBufSurface data directly within this function?

Platform Details:

  • Hardware Platform (Jetson / GPU): Jetson Orin Nano / Jetson AGX Orin
  • DeepStream Version: 7.1
  • JetPack Version (for Jetson): 6.2
  • TensorRT Version: 10.3.0.30
  • NVIDIA GPU Driver Version (for dGPU): 540.4.0

You can refer to our source deepstream\sources\gst-plugins\gst-dsexample\gstdsexample_optimized.cpp to learn how to modify that.

static gboolean
convert_batch_and_push_to_process_thread (GstDsExample * dsexample,
    GstDsExampleBatch * batch)
{

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks