gst_buffer_unref and pad push

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

gst_buffer_unref and pad push

arnabsamanta
gst_buffer_unref and pad push

 Hello Developers,

 When a plugin does the gst_pad_push() of a buffer, the next plugin in the
 pipeline does the gst_buffer_unref() of that buffer in its chain().

 What if gst_pad_push() fails .... in that case is the plugin sending the
 buffer has to unreference the buffer or is is done internally by Gstreamer ?

 My understanding is it should be done by the plugin doing the pad_push() as
 it can be seen in many plugin codes.

 But when I am doing as its mentioned above,
 I am getting the Gstreamer Warning: 

(<unknown>:1295): GStreamer-CRITICAL **:

gst_mini_object_unref: assertion `mini_object->refcount > 0' failed
which means , the reference count of the buffer is already 0.

I am unable to understand the reason for above.

Please help me to understand why am I getting the warning as such .

Thanks in advance

Ragards,

Arnab


 


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gst_buffer_unref and pad push

Tim-Philipp Müller-2
On Fri, 2009-06-05 at 16:12 +0530, Arnab Samanta wrote:

>  When a plugin does the gst_pad_push() of a buffer, the next plugin in
> the pipeline does the gst_buffer_unref() of that buffer in its
> chain().

Correct. You give away your ownership/ref of the buffer with
_pad_push().


>  What if gst_pad_push() fails .... in that case is the plugin sending
> the buffer has to unreference the buffer

No. You gave away ownership of the buffer.


>  My understanding is it should be done by the plugin doing the
> pad_push() as it can be seen in many plugin codes.

No, that would be a bug. If you see any gstreamer plugin unrefing the
buffer it pushed depending on the flow return from gst_pad_push(),
please file a bug or tell us otherwise.

When you look for example code, you should primarily look at
core/gst-plugins-base/gst-plugins-good, not -bad (fwiw).


>  But when I am doing as its mentioned above,
>  I am getting the Gstreamer Warning:
>
> (<unknown>:1295): GStreamer-CRITICAL **:
>
> gst_mini_object_unref: assertion `mini_object->refcount > 0' failed
> which means , the reference count of the buffer is already 0.

That's because you shouldn't be unrefing that most likely.

Cheers
 -Tim



------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel