Generic DMABUF to vaapi h264 encoding
Nicolas Dufresne
nicolas.dufresne at collabora.com
Mon Jul 27 14:08:27 PDT 2015
Le lundi 27 juillet 2015 à 19:56 +0200, Volker Vogelhuber a écrit :
> I tried adding a gst_mini_object_weak_ref, but it seems like I cannot
> stop releasing the buffer within the callback. So for me it's to late
> if
> I don't want to reallocate the whole GstBuffer and GstMemory object.
> How expensive is it to do
>
> GstMemory mem = gst_dmabuf_allocator_alloc(
> m_dmaAllocator, fd, h * stride );
> GstBuffer* buffer = gst_buffer_new();
> gst_buffer_append_memory(buffer, mem );
> gsize offset[GST_VIDEO_MAX_PLANES] = {0, 0, 0, 0};
> gint stride[GST_VIDEO_MAX_PLANES] = {w * 4, 0, 0, 0};
> gst_buffer_add_video_meta_full( buffer, GST_VIDEO_FRAME_FLAG_NONE,
> GST_VIDEO_FORMAT_BGRx, w,h, 1, offset, stride);
>
> all the time? Is it negligible, so I should do it that way?
>
> If don't unref the GstBuffer in the need-data callback, everything is
> Ok, but I don't know when I'm allowed to reuse the buffer for GPU
> rendering. Or is there any other callback or signal I can use when
> vaapipostproc is done with converting the input buffer.
It's not going to be that bad to be fair. To reuse the buffer, you
would have to implement sub-class of GstBufferPool.
Nicolas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150727/8be174de/attachment.sig>
More information about the gstreamer-devel
mailing list