GNOME Bugzilla – Bug 734384
playbin: "convert-sample" returns a sample with an initial refCount of 2
Last modified: 2016-02-21 23:41:59 UTC
Created attachment 282745 [details] Sample code showing refCount issue Given the following pipeline: playbin uri=http://media.w3.org/2010/05/sintel/trailer.webm I'm calling g_signal_emit_by_name() to obtain a sample converted to a defined format using "convert-sample". The sample returned has an initial refCount of 2, rather than the expected value of 1. This has been confirmed by checking the GST_OBJECT_REFCOUNT_VALUE as soon as the sample is returned. The code in the attached file (sorry for the hack!) demonstrates the problem.
Thanks for the bug report and the test case to reproduce it. I can't reproduce this myself with your test code, however. I've tried the tip of the 1.2 branch (after 1.2.4) and git master. I've added a if ( GST_STATE_CHANGE_FAILURE == gst_element_get_state ( pipeline, NULL, NULL, -1 ) ) { throw "Failed to preroll!"; } to your code after the gst_element_set_state ( pipeline, GST_STATE_PLAYING ) to make it wait until prerolled. There's one bug in your test program: GstSample is not a GstObject, it's a GstMiniObject, hence the refcount should be queried using GST_MINI_OBJECT_REFCOUNT_VALUE(frame) and not GST_OBJECT_REFCOUNT_VALUE(frame).
Thanks, I've updated to use GST_MINI_OBJECT_REFCOUNT_VALUE, but I'm still getting the same ref counts reported. My system is Ubuntu 12.04 and the ppa only goes up to 1.2.1 - I'll have a go at getting a later version built and installed.
Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment. Thanks!