mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 04:22:27 +00:00
gst/: Free pad templates, fixes a couple of leaks.
Original commit message from CVS: * gst/base/gstbasesrc.c: (gst_base_src_init): * gst/elements/gsttypefindelement.c: (gst_type_find_element_init): * gst/gstqueue.c: (gst_queue_init): Free pad templates, fixes a couple of leaks.
This commit is contained in:
parent
57f0a5b232
commit
ba68a823c9
7 changed files with 51 additions and 24 deletions
|
@ -1,3 +1,10 @@
|
|||
2005-11-15 Johan Dahlin <johan@gnome.org>
|
||||
|
||||
* gst/base/gstbasesrc.c: (gst_base_src_init):
|
||||
* gst/elements/gsttypefindelement.c: (gst_type_find_element_init):
|
||||
* gst/gstqueue.c: (gst_queue_init):
|
||||
Free pad templates, fixes a couple of leaks.
|
||||
|
||||
2005-11-15 Daniel Fischer <dan at f3c dot com>
|
||||
|
||||
Reviewed by: Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
|
|
@ -195,6 +195,7 @@ gst_base_src_init (GstBaseSrc * basesrc, gpointer g_class)
|
|||
|
||||
GST_DEBUG_OBJECT (basesrc, "creating src pad");
|
||||
pad = gst_pad_new_from_template (pad_template, "src");
|
||||
g_object_unref (pad_template);
|
||||
|
||||
GST_DEBUG_OBJECT (basesrc, "setting functions on src pad");
|
||||
gst_pad_set_activatepush_function (pad,
|
||||
|
|
|
@ -204,10 +204,13 @@ static void
|
|||
gst_type_find_element_init (GstTypeFindElement * typefind,
|
||||
GstTypeFindElementClass * g_class)
|
||||
{
|
||||
GstPadTemplate *sink_template, *src_template;
|
||||
|
||||
/* sinkpad */
|
||||
typefind->sink =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get
|
||||
(&type_find_element_sink_template), "sink");
|
||||
src_template = gst_static_pad_template_get (&type_find_element_sink_template);
|
||||
typefind->sink = gst_pad_new_from_template (src_template, "sink");
|
||||
g_object_unref (src_template);
|
||||
|
||||
gst_pad_set_activate_function (typefind->sink,
|
||||
GST_DEBUG_FUNCPTR (gst_type_find_element_activate));
|
||||
gst_pad_set_chain_function (typefind->sink,
|
||||
|
@ -215,10 +218,12 @@ gst_type_find_element_init (GstTypeFindElement * typefind,
|
|||
gst_pad_set_event_function (typefind->sink,
|
||||
GST_DEBUG_FUNCPTR (gst_type_find_element_handle_event));
|
||||
gst_element_add_pad (GST_ELEMENT (typefind), typefind->sink);
|
||||
|
||||
/* srcpad */
|
||||
typefind->src =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get
|
||||
(&type_find_element_src_template), "src");
|
||||
sink_template = gst_static_pad_template_get (&type_find_element_src_template);
|
||||
typefind->src = gst_pad_new_from_template (sink_template, "src");
|
||||
g_object_unref (sink_template);
|
||||
|
||||
gst_pad_set_activatepull_function (typefind->src,
|
||||
GST_DEBUG_FUNCPTR (gst_type_find_element_activate_src_pull));
|
||||
gst_pad_set_checkgetrange_function (typefind->src,
|
||||
|
|
|
@ -331,9 +331,12 @@ gst_queue_class_init (GstQueueClass * klass)
|
|||
static void
|
||||
gst_queue_init (GstQueue * queue)
|
||||
{
|
||||
queue->sinkpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
|
||||
"sink");
|
||||
GstPadTemplate *sink_template, *src_template;
|
||||
|
||||
sink_template = gst_static_pad_template_get (&sinktemplate);
|
||||
queue->sinkpad = gst_pad_new_from_template (sink_template, "sink");
|
||||
g_object_unref (sink_template);
|
||||
|
||||
gst_pad_set_chain_function (queue->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_queue_chain));
|
||||
gst_pad_set_activatepush_function (queue->sinkpad,
|
||||
|
@ -348,9 +351,10 @@ gst_queue_init (GstQueue * queue)
|
|||
GST_DEBUG_FUNCPTR (gst_queue_bufferalloc));
|
||||
gst_element_add_pad (GST_ELEMENT (queue), queue->sinkpad);
|
||||
|
||||
queue->srcpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
|
||||
"src");
|
||||
src_template = gst_static_pad_template_get (&srctemplate);
|
||||
queue->srcpad = gst_pad_new_from_template (src_template, "src");
|
||||
g_object_unref (src_template);
|
||||
|
||||
gst_pad_set_activatepush_function (queue->srcpad,
|
||||
GST_DEBUG_FUNCPTR (gst_queue_src_activate_push));
|
||||
gst_pad_set_link_function (queue->srcpad,
|
||||
|
|
|
@ -195,6 +195,7 @@ gst_base_src_init (GstBaseSrc * basesrc, gpointer g_class)
|
|||
|
||||
GST_DEBUG_OBJECT (basesrc, "creating src pad");
|
||||
pad = gst_pad_new_from_template (pad_template, "src");
|
||||
g_object_unref (pad_template);
|
||||
|
||||
GST_DEBUG_OBJECT (basesrc, "setting functions on src pad");
|
||||
gst_pad_set_activatepush_function (pad,
|
||||
|
|
|
@ -331,9 +331,12 @@ gst_queue_class_init (GstQueueClass * klass)
|
|||
static void
|
||||
gst_queue_init (GstQueue * queue)
|
||||
{
|
||||
queue->sinkpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
|
||||
"sink");
|
||||
GstPadTemplate *sink_template, *src_template;
|
||||
|
||||
sink_template = gst_static_pad_template_get (&sinktemplate);
|
||||
queue->sinkpad = gst_pad_new_from_template (sink_template, "sink");
|
||||
g_object_unref (sink_template);
|
||||
|
||||
gst_pad_set_chain_function (queue->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_queue_chain));
|
||||
gst_pad_set_activatepush_function (queue->sinkpad,
|
||||
|
@ -348,9 +351,10 @@ gst_queue_init (GstQueue * queue)
|
|||
GST_DEBUG_FUNCPTR (gst_queue_bufferalloc));
|
||||
gst_element_add_pad (GST_ELEMENT (queue), queue->sinkpad);
|
||||
|
||||
queue->srcpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
|
||||
"src");
|
||||
src_template = gst_static_pad_template_get (&srctemplate);
|
||||
queue->srcpad = gst_pad_new_from_template (src_template, "src");
|
||||
g_object_unref (src_template);
|
||||
|
||||
gst_pad_set_activatepush_function (queue->srcpad,
|
||||
GST_DEBUG_FUNCPTR (gst_queue_src_activate_push));
|
||||
gst_pad_set_link_function (queue->srcpad,
|
||||
|
|
|
@ -204,10 +204,13 @@ static void
|
|||
gst_type_find_element_init (GstTypeFindElement * typefind,
|
||||
GstTypeFindElementClass * g_class)
|
||||
{
|
||||
GstPadTemplate *sink_template, *src_template;
|
||||
|
||||
/* sinkpad */
|
||||
typefind->sink =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get
|
||||
(&type_find_element_sink_template), "sink");
|
||||
src_template = gst_static_pad_template_get (&type_find_element_sink_template);
|
||||
typefind->sink = gst_pad_new_from_template (src_template, "sink");
|
||||
g_object_unref (src_template);
|
||||
|
||||
gst_pad_set_activate_function (typefind->sink,
|
||||
GST_DEBUG_FUNCPTR (gst_type_find_element_activate));
|
||||
gst_pad_set_chain_function (typefind->sink,
|
||||
|
@ -215,10 +218,12 @@ gst_type_find_element_init (GstTypeFindElement * typefind,
|
|||
gst_pad_set_event_function (typefind->sink,
|
||||
GST_DEBUG_FUNCPTR (gst_type_find_element_handle_event));
|
||||
gst_element_add_pad (GST_ELEMENT (typefind), typefind->sink);
|
||||
|
||||
/* srcpad */
|
||||
typefind->src =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get
|
||||
(&type_find_element_src_template), "src");
|
||||
sink_template = gst_static_pad_template_get (&type_find_element_src_template);
|
||||
typefind->src = gst_pad_new_from_template (sink_template, "src");
|
||||
g_object_unref (sink_template);
|
||||
|
||||
gst_pad_set_activatepull_function (typefind->src,
|
||||
GST_DEBUG_FUNCPTR (gst_type_find_element_activate_src_pull));
|
||||
gst_pad_set_checkgetrange_function (typefind->src,
|
||||
|
|
Loading…
Reference in a new issue