gst_unref_object GstElement*

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

gst_unref_object GstElement*

killerrats
Administrator
I created some GstElements but when I go to unref them in the end it says
"GStreamer-CRITICAL **: gst_object_unref: assertion '((GObject *) object)->ref_count > 0' failed"

I checked to see if its null and it isn't but don't understand why it says this. It's only saying about:

GstElement* RecBin,* source,* q1,* rtpdepay,* parse,* vtee,* q2,* audioRtpDepay
                                 ,* audioParse,* audioDec,* atee;
                GstElement* q3,* q4,* mux,* appsink;

that are in the class.

what I do is this steps:

1. setup gstelements
2. link them up
3. start to play
when I stop the pipeline
1. null pipeline, unlink them, remove pads
2. unref the gstelements (This is where it errors out)
3. unref pipeline.

videoRecClass.h

i just gave you the create and unlink and delete for the gstreamer pipeline.

VideoRecClass::Create_Pipeline();
void VideoRecClass::delete_pipeline();
bool VideoRecClass::LinkRtspRecPipeline();
bool VideoRecClass::LinkRtspSrcPipeline();
void VideoRecClass::UnlinkRecPipeline();
void VideoRecClass::UnlinkRtspSourcePipeline();
void VideoRecClass::UnreferenceRtspRecVideoData();
------------------------------
Gstreamer 1.16.2
------------------------------
Windows
Reply | Threaded
Open this post in threaded view
|

Re: gst_unref_object GstElement*

Yi-Lung Tsai
According to 2nd paragraph of description from https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPipeline.html, all added elements are freed when pipeline is freed.
This is a good point to check first.

--
Yi-Lung (Bruce) Tsai





On Jan 18, 2017, at 5:45 AM, killerrats <[hidden email]> wrote:

I created some GstElements but when I go to unref them in the end it says
*"GStreamer-CRITICAL **: gst_object_unref: assertion '((GObject *)
object)->ref_count > 0' failed"*

I checked to see if its null and it isn't but don't understand why it says
this. It's only saying about:

*GstElement* RecBin*,** source*,** q1*,** rtpdepay*,** parse*,** vtee*,**
q2*,** audioRtpDepay*
,** audioParse*,** audioDec*,** atee*;
*GstElement* q3*,** q4*,** mux*,** appsink*;

that are in the class.

what I do is this steps:

1. setup gstelements
2. link them up
3. start to play
when I stop the pipeline
1. null pipeline, unlink them, remove pads
2. unref the gstelements *(This is where it errors out)*
3. unref pipeline.

videoRecClass.h <http://www.planetkorey.com/tmp/videoRecClass.h>  

i just gave you the create and unlink and delete for the gstreamer pipeline.

VideoRecClass::Create_Pipeline();
void VideoRecClass::delete_pipeline();
bool VideoRecClass::LinkRtspRecPipeline();
bool VideoRecClass::LinkRtspSrcPipeline();
void VideoRecClass::UnlinkRecPipeline();
void VideoRecClass::UnlinkRtspSourcePipeline();
void VideoRecClass::UnreferenceRtspRecVideoData();




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/gst-unref-object-GstElement-tp4681515.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gst_unref_object GstElement*

Nicolas Dufresne-5
In reply to this post by killerrats


Le 17 janv. 2017 4:53 PM, "killerrats" <[hidden email]> a écrit :
I created some GstElements but when I go to unref them in the end it says
*"GStreamer-CRITICAL **: gst_object_unref: assertion '((GObject *)
object)->ref_count > 0' failed"*

I checked to see if its null and it isn't but don't understand why it says
this. It's only saying about:

*GstElement* RecBin*,** source*,** q1*,** rtpdepay*,** parse*,** vtee*,**
q2*,** audioRtpDepay*
                                 ,** audioParse*,** audioDec*,** atee*;
                *GstElement* q3*,** q4*,** mux*,** appsink*;

that are in the class.

what I do is this steps:

1. setup gstelements
2. link them up
3. start to play
when I stop the pipeline
1. null pipeline, unlink them, remove pads
2. unref the gstelements *(This is where it errors out)*
3. unref pipeline.

When you add an element to a pipeline, you give the pipeline ownership. No need to unref these elements, the pipeline will do that for you.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel