plugins: fix pad template ref leaks.

This commit is contained in:
Gwenole Beauchesne 2012-02-05 18:24:08 +01:00
parent fc596d1ea9
commit f64bafea59
4 changed files with 25 additions and 28 deletions

View file

@ -408,20 +408,19 @@ static void
gst_vaapidecode_base_init(gpointer klass)
{
GstElementClass * const element_class = GST_ELEMENT_CLASS(klass);
GstPadTemplate *pad_template;
gst_element_class_set_details(element_class, &gst_vaapidecode_details);
/* sink pad */
gst_element_class_add_pad_template(
element_class,
gst_static_pad_template_get(&gst_vaapidecode_sink_factory)
);
pad_template = gst_static_pad_template_get(&gst_vaapidecode_sink_factory);
gst_element_class_add_pad_template(element_class, pad_template);
gst_object_unref(pad_template);
/* src pad */
gst_element_class_add_pad_template(
element_class,
gst_static_pad_template_get(&gst_vaapidecode_src_factory)
);
pad_template = gst_static_pad_template_get(&gst_vaapidecode_src_factory);
gst_element_class_add_pad_template(element_class, pad_template);
gst_object_unref(pad_template);
}
static void

View file

@ -220,20 +220,19 @@ static void
gst_vaapidownload_base_init(gpointer klass)
{
GstElementClass * const element_class = GST_ELEMENT_CLASS(klass);
GstPadTemplate *pad_template;
gst_element_class_set_details(element_class, &gst_vaapidownload_details);
/* sink pad */
gst_element_class_add_pad_template(
element_class,
gst_static_pad_template_get(&gst_vaapidownload_sink_factory)
);
pad_template = gst_static_pad_template_get(&gst_vaapidownload_sink_factory);
gst_element_class_add_pad_template(element_class, pad_template);
gst_object_unref(pad_template);
/* src pad */
gst_element_class_add_pad_template(
element_class,
gst_static_pad_template_get(&gst_vaapidownload_src_factory)
);
pad_template = gst_static_pad_template_get(&gst_vaapidownload_src_factory);
gst_element_class_add_pad_template(element_class, pad_template);
gst_object_unref(pad_template);
}
static void

View file

@ -784,13 +784,13 @@ static void
gst_vaapisink_base_init(gpointer klass)
{
GstElementClass * const element_class = GST_ELEMENT_CLASS(klass);
GstPadTemplate *pad_template;
gst_element_class_set_details(element_class, &gst_vaapisink_details);
gst_element_class_add_pad_template(
element_class,
gst_static_pad_template_get(&gst_vaapisink_sink_factory)
);
pad_template = gst_static_pad_template_get(&gst_vaapisink_sink_factory);
gst_element_class_add_pad_template(element_class, pad_template);
gst_object_unref(pad_template);
}
static void

View file

@ -211,20 +211,19 @@ static void
gst_vaapiupload_base_init(gpointer klass)
{
GstElementClass * const element_class = GST_ELEMENT_CLASS(klass);
GstPadTemplate *pad_template;
gst_element_class_set_details(element_class, &gst_vaapiupload_details);
/* sink pad */
gst_element_class_add_pad_template(
element_class,
gst_static_pad_template_get(&gst_vaapiupload_sink_factory)
);
pad_template = gst_static_pad_template_get(&gst_vaapiupload_sink_factory);
gst_element_class_add_pad_template(element_class, pad_template);
gst_object_unref(pad_template);
/* src pad */
gst_element_class_add_pad_template(
element_class,
gst_static_pad_template_get(&gst_vaapiupload_src_factory)
);
pad_template = gst_static_pad_template_get(&gst_vaapiupload_src_factory);
gst_element_class_add_pad_template(element_class, pad_template);
gst_object_unref(pad_template);
}
static void