How To Push DMA nvbuffer In To Gstreamer Pipeline?

Hi guys
I want to push NVMM nvbufer(DMA) in to gstreamer appsrc pipeline? How To do it ? this is my sample code that doesn’t work ?

  int dmabuf_fd;
   NvBufferCreate(&dmabuf_fd, 1920, 1080, NvBufferLayout_Pitch, NvBufferColorFormat_YVU420);
   NvBufferParamsEx params = { 0, };
   
   if (NvBufferGetParamsEx (dmabuf_fd, &params)) {
       
   }
   GstMemory *mem;
   //    /* make empty buffer */
   buffer = gst_buffer_new();
   GstAllocator * aloc = gst_dmabuf_allocator_new();
   mem = gst_dmabuf_allocator_alloc(aloc, dmabuf_fd, params.params.psize[0]);
   /* add the buffer */
   gst_buffer_append_memory(buffer, mem);
   gst_app_src_push_buffer(GST_APP_SRC (source) ,buffer);

Thanks

Hi,
Please check this sample:
Creating a GStreamer source that publishes to NVMM - #7 by DaneLLL

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.