How to get frame with c++

• Jetson Nano
• DeepStream 5.0
• JetPack 4.4

I trying to get frame from GstBuffer with C++. I found Api and sample code for Python. Can anyone help me?

DeepStream SDK can be downloaded here
The C/C++ sample codes are in the SDK package.

I can’t find analog of function for C++ get_nvds_buf_surface in Python.

File: /opt/nvidia/deepstream/deepstream-5.0/sources/gst-plugins/gst-dsexample/gstdsexample.cpp

static GstFlowReturn
gst_dsexample_transform_ip (GstBaseTransform * btrans, GstBuffer * inbuf)
     NvBufSurface *surface = NULL;
     memset (&in_map_info, 0, sizeof (in_map_info));
     if (!gst_buffer_map (inbuf, &in_map_info, GST_MAP_READ)) {
         g_print ("Error: Failed to map gst buffer\n");
         goto error;
     surface = (NvBufSurface *);
     // refer to   [NvBufSurface Struct Reference](  to operate NvBufSurface