Hi guys,
We have memory leakage when we want push a DMA buffer in to a Gstreamer pipeline
GstFlowReturn ret;
GstBuffer* buffer_to_send;
buffer_to_send = gst_buffer_new_wrapped(surfaceDst, sizeof(NvBufSurface));
g_signal_emit_by_name(GST_APP_SRC (AppSrc), "push-buffer", buffer_to_send, &ret);
but if this function is used memory leakage is decreased but not solved completely.
GstFlowReturn ret;
GstBuffer* buffer_to_send = gst_buffer_new_allocate(NULL, sizeof (NvBufSurface), NULL);
gst_buffer_fill(buffer_to_send, 0, surfaceSrc, sizeof (NvBufSurface));
GstSample * sample = gst_sample_new(buffer_to_send,nullptr,nullptr,nullptr);
g_signal_emit_by_name(GST_APP_SRC (AppSrc), "push-sample", sample, &ret);
gst_sample_unref(sample);
gst_buffer_unref(buffer_to_send);
Which function from Gstreamer must be used to not having memory leakage when a DMA buffer is pushed in to Gstreamer pipeline.
Thanks so much.