Dmabuf wrapped to GstBuffer for appsrc

I am looking to transfer the camera nv12 data from v4l2 to the appsrc plugin. Currently, I am using the normal gst_buffer_new_allocate and gst_buffer_fill methods, which results in a copy of the data.
To achieve zero copy, it is more efficient to map dmabuf-fd to GstBuffer.
How can I accomplish this?

I found a way to implement it, but every time I have to create a new GstBuffer,
is there a better way to implement it?
The *gst_buffer_new_wrapped_full api function does not directly wrap fd into GstBuffer;
it would be nice to have a function that does.

GstBuffer *buffer = gst_buffer_new();
GstAllocator *allocator=gst_dmabuf_allocator_new();
GstMemory    *mem=gst_dmabuf_allocator_alloc_with_flags(allocator, nv12_fd, nv12_size, GST_FD_MEMORY_FLAG_DONT_CLOSE);
gst_buffer_insert_memory(buffer, -1, mem);
gst_app_src_push_buffer((GstAppSrc *)(appsrc), buffer);