<html>
<head>
<meta content="text/html; charset=iso-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Il 21/10/2014 00:25, Chris Tapp ha
scritto:<br>
</div>
<blockquote
cite="mid:A467CBE1-0EF4-4983-AEB8-35533CC99610@keylevel.com"
type="cite">
<pre wrap="">
On 20 Oct 2014, at 22:06, Sebastian Dröge <a class="moz-txt-link-rfc2396E" href="mailto:sebastian@centricular.com"><sebastian@centricular.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">On Mo, 2014-10-20 at 21:51 +0100, Chris Tapp wrote:
</pre>
<blockquote type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">This is correct in this particular context.
</pre>
</blockquote>
</blockquote>
<pre wrap="">
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?
</pre>
</blockquote>
<pre wrap="">
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.
</pre>
</blockquote>
<pre wrap="">
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 ) );</pre>
</blockquote>
<br>
I think this should be:<br>
<br>
<pre wrap="">gst_app_src_push_buffer( myAppSrc, <b>gst_buffer_ref</b>( buffer ) );</pre>
<br>
Nicola<br>
<br>
<br>
<blockquote
cite="mid:A467CBE1-0EF4-4983-AEB8-35533CC99610@keylevel.com"
type="cite">
<pre wrap="">
gst_sample_unref( aSample );
But this leaks memory if I don't remove the gst_sample_ref() call.
--
Chris Tapp
<a class="moz-txt-link-abbreviated" href="mailto:opensource@keylevel.com">opensource@keylevel.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.keylevel.com">www.keylevel.com</a>
----
You can tell you're getting older when your car insurance gets real cheap!
_______________________________________________
gstreamer-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
</pre>
</blockquote>
<br>
</body>
</html>