libgstapp ownership

Mailing List SVR lists at svrinformatica.it
Tue Oct 21 08:50:00 PDT 2014


Il 21/10/2014 00:25, Chris Tapp ha scritto:
> On 20 Oct 2014, at 22:06, Sebastian Dröge <sebastian at centricular.com> wrote:
>
>> On Mo, 2014-10-20 at 21:51 +0100, Chris Tapp wrote:
>>>>> This is correct in this particular context.
>>> Except this is causing a memory leak where as the above doesn't. Does it make a difference that the samples are taken using "last-sample" from one pipeline and the appsrc is in another?
>> You have to unref the sample after usage as the last-sample property
>> will give you a new reference. If you unref the buffer as in your first
>> example, the buffer will be freed but the sample will still be leaked.
> Sure, and I am doing that just after I pass the gst_sample_ref() of it's buffer to push_buffer(). So what I have is:
>
>     aSample = get last-sample from sink
>
>     GstBuffer * buffer = gst_sample_get_buffer( aSample );
>
>     gst_app_src_push_buffer( myAppSrc, gst_sample_ref( buffer ) );

I think this should be:

gst_app_src_push_buffer( myAppSrc,*gst_buffer_ref*( buffer ) );


Nicola


>
>     gst_sample_unref( aSample );
>
> But this leaks memory if I don't remove the gst_sample_ref() call.
>
> --
>
> Chris Tapp
> opensource at keylevel.com
> www.keylevel.com
>
> ----
> You can tell you're getting older when your car insurance gets real cheap!
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20141021/646bded8/attachment.html>


More information about the gstreamer-devel mailing list