Nvarguscamerasrc on Xavier NX and deep stream 5.0 giving error due to NVBUF_MEM_CUDA_PINNED


I am following the example from the Deepstream 5.0 sdk on jetpack 4.4,
and the NvBufSurfTransform returns an error because of the surface being of type NVBUF_MEM_CUDA_PINNED.

how can it be? does the nvvidconv not converting the surface mem to Jetson default(NVBUF_MEM_SURFACE_ARRAY) ?? if not how can I make sure it will be in the correct mem-type?

my gstream pipline is :

gst-launch-1.0 nvarguscamerasrc   ! nvvidconv ! "video/x-raw(memory:NVMM),width=1280,height=720,format=NV12" ! **myplugin**  ! omxh264enc control-rate=2 bitrate=4000000 ! video/x-h264, stream-format=byte-stream ! rtph264pay mtu=1400 ! udpsink host= port=5000 sync=false async=false

We are deprecating omx plugins. Please replace omxh264enc with nvv4l2h264enc and try again.
The whole pipeline is in NVMM buffer and ot sure if you implement myplugin correctly. you may simply use dsexample plugin.

Thanks for your reply. I am using the code from dsexample the get the surface from the input map

however. as I said i am using Xavier Nx and receive a transform error due to the incoming mem-type is NVBUF_MEM_CUDA_PINNED and not NVBUF_MEM_SURFACE_ARRAY or NVBUF_MEM_DEFAULT the following code snippet is used:

 if (!gst_buffer_map(inbuf, &in_map_info, GST_MAP_READ)) {
       goto done;

  surface = (NvBufSurface *) in_map_info.data;
  NvBufSurface ip_surf;
  ip_surf = *surface;
  std::cout << "ip_surfmemType --> " << ip_surf.memType << "\n";

  ip_surf.numFilled = ip_surf.batchSize = 1;
  ip_surf.surfaceList = &(surface->surfaceList[0]);

  NvBufSurfTransformParams transform_params;
  cv::Size2d src= cv::Size2d(gputransPlugin->video_info.width, gputransPlugin->video_info.height)
  cv::Size2d crop= cv::Size2d(0, 0);
  cv::Size2d dst= cv::Size2d(gputransPlugin->processing_width, gputransPlugin->processing_height));

  memset(&transform_params, 0, sizeof(transform_params));
  NvBufSurfTransformRect src_rect;
  NvBufSurfTransformRect dst_rect;
  src_rect = {(guint)crop.width, (guint)crop.height, (guint) src.width, (guint)src.height};
  dst_rect = {0, 0, (guint)dst.width, (guint)dst.height};
  /* Set the transform parameters */
  transform_params.src_rect = &src_rect;
  transform_params.dst_rect = &dst_rect;
  transform_params.transform_flag =
  transform_params.transform_filter = NvBufSurfTransformInter_Default;

  transform_config_params.compute_mode = NvBufSurfTransformCompute_Default;
  transform_config_params.gpu_id = 0;
  transform_config_params.cuda_stream = NULL;

  /* Set the transform session parameters for the conversions executed in this
   * thread. */
  err = NvBufSurfTransformSetSessionParams (&transform_config_params);
  if (err != NvBufSurfTransformError_Success) {
goto done;
  err = NvBufSurfTransform (&ip_surf, gputransPlugin->surfconv_buf, &transform_params);
  if (err != NvBufSurfTransformError_Success) {
goto done;

the line std::cout << "ip_surfmemType --> " << ip_surf.memType << "\n"; result is NVBUF_MEM_CUDA_PINNED

Also i have compiled the dsexample without any changes to the plugin and the memtype is still PINNED.

am i missing a conversion?