Unref Elements?
killerrats
koreysjunkmail at gmail.com
Wed Sep 20 23:45:22 UTC 2017
*for example:*
*typedef struct* _CustomData {
GstElement* pipeline;
GstElement* rtspsrc;
GstElement* h264parse;
GstElement* decodebin;
} CustomData;
gboolean *bus_cb* (GstBus * bus, GstMessage * msg, CustomData* user_data)
{
GstElement* src = gst_bin_get_by_name(GST_BIN(data.pipeline),"source");
....
gst_object_unref(src);
}
int *main*()
{
CustomData data;
gst_init(NULL,NULL);
.....
gst_object_unref(data.pipeline);
// never seen this in tutorials
gst_object_unref(data.rtspsrc);
}
when you use the *gst_bin_get_by_name ()* you unref them in a method just
like in *bus_cb()*. I noticed in the tutorials you just unref the pipeline
not any of the elements that are add to the pipeline. they don't go
gst_object_unref(data.rtspsrc); or gst_object_unref(h264parse); or
gst_object_unref(decodebin);. is that something you don't have to do or
something I should be doing before I close?
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
More information about the gstreamer-devel
mailing list