mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
ffmpeg: fix pad template ref leaks
https://bugzilla.gnome.org/show_bug.cgi?id=662664
This commit is contained in:
parent
28142d9549
commit
dcd387b313
6 changed files with 15 additions and 20 deletions
|
@ -103,10 +103,8 @@ gst_ffmpegaudioresample_base_init (gpointer g_class)
|
||||||
{
|
{
|
||||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_static_pad_template (element_class, &src_factory);
|
||||||
gst_static_pad_template_get (&src_factory));
|
gst_element_class_add_static_pad_template (element_class, &sink_factory);
|
||||||
gst_element_class_add_pad_template (element_class,
|
|
||||||
gst_static_pad_template_get (&sink_factory));
|
|
||||||
gst_element_class_set_details_simple (element_class,
|
gst_element_class_set_details_simple (element_class,
|
||||||
"FFMPEG Audio resampling element", "Filter/Converter/Audio",
|
"FFMPEG Audio resampling element", "Filter/Converter/Audio",
|
||||||
"Converts audio from one samplerate to another",
|
"Converts audio from one samplerate to another",
|
||||||
|
|
|
@ -145,10 +145,8 @@ gst_ffmpegdeinterlace_base_init (gpointer g_class)
|
||||||
{
|
{
|
||||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_static_pad_template (element_class, &src_factory);
|
||||||
gst_static_pad_template_get (&src_factory));
|
gst_element_class_add_static_pad_template (element_class, &sink_factory);
|
||||||
gst_element_class_add_pad_template (element_class,
|
|
||||||
gst_static_pad_template_get (&sink_factory));
|
|
||||||
gst_element_class_set_details_simple (element_class,
|
gst_element_class_set_details_simple (element_class,
|
||||||
"FFMPEG Deinterlace element", "Filter/Effect/Video/Deinterlace",
|
"FFMPEG Deinterlace element", "Filter/Effect/Video/Deinterlace",
|
||||||
"Deinterlace video", "Luca Ognibene <luogni@tin.it>");
|
"Deinterlace video", "Luca Ognibene <luogni@tin.it>");
|
||||||
|
|
|
@ -272,17 +272,20 @@ gst_ffmpegmux_base_init (gpointer g_class)
|
||||||
/* pad templates */
|
/* pad templates */
|
||||||
srctempl = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, srccaps);
|
srctempl = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, srccaps);
|
||||||
gst_element_class_add_pad_template (element_class, srctempl);
|
gst_element_class_add_pad_template (element_class, srctempl);
|
||||||
|
gst_object_unref (srctempl);
|
||||||
|
|
||||||
if (audiosinkcaps) {
|
if (audiosinkcaps) {
|
||||||
audiosinktempl = gst_pad_template_new ("audio_%d",
|
audiosinktempl = gst_pad_template_new ("audio_%d",
|
||||||
GST_PAD_SINK, GST_PAD_REQUEST, audiosinkcaps);
|
GST_PAD_SINK, GST_PAD_REQUEST, audiosinkcaps);
|
||||||
gst_element_class_add_pad_template (element_class, audiosinktempl);
|
gst_element_class_add_pad_template (element_class, audiosinktempl);
|
||||||
|
gst_object_unref (audiosinktempl);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (videosinkcaps) {
|
if (videosinkcaps) {
|
||||||
videosinktempl = gst_pad_template_new ("video_%d",
|
videosinktempl = gst_pad_template_new ("video_%d",
|
||||||
GST_PAD_SINK, GST_PAD_REQUEST, videosinkcaps);
|
GST_PAD_SINK, GST_PAD_REQUEST, videosinkcaps);
|
||||||
gst_element_class_add_pad_template (element_class, videosinktempl);
|
gst_element_class_add_pad_template (element_class, videosinktempl);
|
||||||
|
gst_object_unref (videosinktempl);
|
||||||
}
|
}
|
||||||
|
|
||||||
beach:
|
beach:
|
||||||
|
|
|
@ -103,10 +103,8 @@ gst_ffmpegscale_base_init (gpointer g_class)
|
||||||
{
|
{
|
||||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_static_pad_template (element_class, &src_factory);
|
||||||
gst_static_pad_template_get (&src_factory));
|
gst_element_class_add_static_pad_template (element_class, &sink_factory);
|
||||||
gst_element_class_add_pad_template (element_class,
|
|
||||||
gst_static_pad_template_get (&sink_factory));
|
|
||||||
gst_element_class_set_details_simple (element_class, "FFMPEG Scale element",
|
gst_element_class_set_details_simple (element_class, "FFMPEG Scale element",
|
||||||
"Filter/Converter/Video/Scaler",
|
"Filter/Converter/Video/Scaler",
|
||||||
"Converts video from one resolution to another",
|
"Converts video from one resolution to another",
|
||||||
|
|
|
@ -381,10 +381,10 @@ gst_post_proc_base_init (GstPostProcClass * klass)
|
||||||
g_free (longname);
|
g_free (longname);
|
||||||
g_free (description);
|
g_free (description);
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_static_pad_template (element_class,
|
||||||
gst_static_pad_template_get (&gst_post_proc_src_template));
|
&gst_post_proc_src_template);
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_static_pad_template (element_class,
|
||||||
gst_static_pad_template_get (&gst_post_proc_sink_template));
|
&gst_post_proc_sink_template);
|
||||||
|
|
||||||
klass->filterid = ppidx;
|
klass->filterid = ppidx;
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,10 +190,8 @@ gst_ffmpegscale_base_init (gpointer g_class)
|
||||||
{
|
{
|
||||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_static_pad_template (element_class, &src_factory);
|
||||||
gst_static_pad_template_get (&src_factory));
|
gst_element_class_add_static_pad_template (element_class, &sink_factory);
|
||||||
gst_element_class_add_pad_template (element_class,
|
|
||||||
gst_static_pad_template_get (&sink_factory));
|
|
||||||
gst_element_class_set_details_simple (element_class, "FFMPEG Scale element",
|
gst_element_class_set_details_simple (element_class, "FFMPEG Scale element",
|
||||||
"Filter/Converter/Video",
|
"Filter/Converter/Video",
|
||||||
"Converts video from one resolution to another",
|
"Converts video from one resolution to another",
|
||||||
|
|
Loading…
Reference in a new issue