From card buffer to GstBuffer

Sebastian Dröge sebastian at centricular.com
Thu Sep 1 06:30:58 UTC 2016


On Wed, 2016-08-31 at 04:50 -0700, BogdanS wrote:
> 
> I tried 
> buffrer= gst_buffer_new_wraped(outbuf,outsize);
> gst_app_src_push_buffer(appsrc,buffer);
> 
> But every time I have memory exception.

That function takes ownership of the memory you pass it and will call
g_free() on it after its no longer in use.

Your API looks like the outbuf is only valid in the scope of the
function, so you would have to copy it first before putting it into a
GstBuffer or GstMemory.


If you had API that has refcounting or otherwise allows you to notify
the caller about when the memory is not in use anymore, you could use
gst_buffer_new_wrapped_full() without copying but a custom function to
"free" the memory.

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 931 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160901/af5baf04/attachment.sig>


More information about the gstreamer-devel mailing list