mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-28 18:18:38 +00:00
ext/speex/: Create the pad template correctly (from the static pad template, not a NULL pointer.)
Original commit message from CVS: * ext/speex/gstspeexdec.c: (gst_speexdec_base_init), (gst_speexdec_init): * ext/speex/gstspeexenc.c: (gst_speexenc_base_init), (gst_speexenc_init): Create the pad template correctly (from the static pad template, not a NULL pointer.)
This commit is contained in:
parent
af8ae1e043
commit
bcb6556758
3 changed files with 28 additions and 16 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2004-03-24 David Schleef <ds@schleef.org>
|
||||||
|
|
||||||
|
* ext/speex/gstspeexdec.c: (gst_speexdec_base_init),
|
||||||
|
(gst_speexdec_init):
|
||||||
|
* ext/speex/gstspeexenc.c: (gst_speexenc_base_init),
|
||||||
|
(gst_speexenc_init): Create the pad template correctly (from
|
||||||
|
the static pad template, not a NULL pointer.)
|
||||||
|
|
||||||
2004-03-25 Benjamin Otte <otte@gnome.org>
|
2004-03-25 Benjamin Otte <otte@gnome.org>
|
||||||
|
|
||||||
* gst/debug/Makefile.am:
|
* gst/debug/Makefile.am:
|
||||||
|
|
|
@ -25,8 +25,6 @@
|
||||||
|
|
||||||
#include "gstspeexdec.h"
|
#include "gstspeexdec.h"
|
||||||
|
|
||||||
static GstPadTemplate *speexdec_src_template, *speexdec_sink_template;
|
|
||||||
|
|
||||||
/* elementfactory information */
|
/* elementfactory information */
|
||||||
GstElementDetails gst_speexdec_details = {
|
GstElementDetails gst_speexdec_details = {
|
||||||
"speex audio decoder",
|
"speex audio decoder",
|
||||||
|
@ -85,7 +83,7 @@ gst_speexdec_get_type (void)
|
||||||
return speexdec_type;
|
return speexdec_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstStaticPadTemplate speex_sink_template =
|
static GstStaticPadTemplate speexdec_sink_template =
|
||||||
GST_STATIC_PAD_TEMPLATE ("sink",
|
GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
GST_PAD_SINK,
|
GST_PAD_SINK,
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
|
@ -93,7 +91,8 @@ GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
"rate = (int) [ 1000, 48000 ], " "channels = (int) 1")
|
"rate = (int) [ 1000, 48000 ], " "channels = (int) 1")
|
||||||
);
|
);
|
||||||
|
|
||||||
static GstStaticPadTemplate speex_src_template = GST_STATIC_PAD_TEMPLATE ("src",
|
static GstStaticPadTemplate speexdec_src_template =
|
||||||
|
GST_STATIC_PAD_TEMPLATE ("src",
|
||||||
GST_PAD_SRC,
|
GST_PAD_SRC,
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
GST_STATIC_CAPS ("audio/x-raw-int, "
|
GST_STATIC_CAPS ("audio/x-raw-int, "
|
||||||
|
@ -110,9 +109,9 @@ gst_speexdec_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_pad_template (element_class,
|
||||||
gst_static_pad_template_get (&speex_src_template));
|
gst_static_pad_template_get (&speexdec_src_template));
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_pad_template (element_class,
|
||||||
gst_static_pad_template_get (&speex_sink_template));
|
gst_static_pad_template_get (&speexdec_sink_template));
|
||||||
|
|
||||||
gst_element_class_set_details (element_class, &gst_speexdec_details);
|
gst_element_class_set_details (element_class, &gst_speexdec_details);
|
||||||
}
|
}
|
||||||
|
@ -134,12 +133,15 @@ gst_speexdec_init (GstSpeexDec * speexdec)
|
||||||
|
|
||||||
/* create the sink and src pads */
|
/* create the sink and src pads */
|
||||||
speexdec->sinkpad =
|
speexdec->sinkpad =
|
||||||
gst_pad_new_from_template (speexdec_sink_template, "sink");
|
gst_pad_new_from_template (gst_static_pad_template_get
|
||||||
|
(&speexdec_sink_template), "sink");
|
||||||
gst_element_add_pad (GST_ELEMENT (speexdec), speexdec->sinkpad);
|
gst_element_add_pad (GST_ELEMENT (speexdec), speexdec->sinkpad);
|
||||||
gst_pad_set_chain_function (speexdec->sinkpad, gst_speexdec_chain);
|
gst_pad_set_chain_function (speexdec->sinkpad, gst_speexdec_chain);
|
||||||
gst_pad_set_link_function (speexdec->sinkpad, gst_speexdec_sinkconnect);
|
gst_pad_set_link_function (speexdec->sinkpad, gst_speexdec_sinkconnect);
|
||||||
|
|
||||||
speexdec->srcpad = gst_pad_new_from_template (speexdec_src_template, "src");
|
speexdec->srcpad =
|
||||||
|
gst_pad_new_from_template (gst_static_pad_template_get
|
||||||
|
(&speexdec_src_template), "src");
|
||||||
gst_pad_use_explicit_caps (speexdec->srcpad);
|
gst_pad_use_explicit_caps (speexdec->srcpad);
|
||||||
gst_element_add_pad (GST_ELEMENT (speexdec), speexdec->srcpad);
|
gst_element_add_pad (GST_ELEMENT (speexdec), speexdec->srcpad);
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,6 @@
|
||||||
|
|
||||||
#include "gstspeexenc.h"
|
#include "gstspeexenc.h"
|
||||||
|
|
||||||
static GstPadTemplate *speexenc_src_template, *speexenc_sink_template;
|
|
||||||
|
|
||||||
/* elementfactory information */
|
/* elementfactory information */
|
||||||
GstElementDetails gst_speexenc_details = {
|
GstElementDetails gst_speexenc_details = {
|
||||||
"speex audio encoder",
|
"speex audio encoder",
|
||||||
|
@ -85,7 +83,7 @@ gst_speexenc_get_type (void)
|
||||||
return speexenc_type;
|
return speexenc_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstStaticPadTemplate speex_sink_template =
|
static GstStaticPadTemplate speexenc_sink_template =
|
||||||
GST_STATIC_PAD_TEMPLATE ("sink",
|
GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
GST_PAD_SINK,
|
GST_PAD_SINK,
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
|
@ -97,7 +95,8 @@ GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
"rate = (int) [ 1000, 48000 ], " "channels = (int) 1")
|
"rate = (int) [ 1000, 48000 ], " "channels = (int) 1")
|
||||||
);
|
);
|
||||||
|
|
||||||
static GstStaticPadTemplate speex_src_template = GST_STATIC_PAD_TEMPLATE ("src",
|
static GstStaticPadTemplate speexenc_src_template =
|
||||||
|
GST_STATIC_PAD_TEMPLATE ("src",
|
||||||
GST_PAD_SRC,
|
GST_PAD_SRC,
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
GST_STATIC_CAPS ("audio/x-speex, "
|
GST_STATIC_CAPS ("audio/x-speex, "
|
||||||
|
@ -110,9 +109,9 @@ gst_speexenc_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_pad_template (element_class,
|
||||||
gst_static_pad_template_get (&speex_sink_template));
|
gst_static_pad_template_get (&speexenc_sink_template));
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_pad_template (element_class,
|
||||||
gst_static_pad_template_get (&speex_src_template));
|
gst_static_pad_template_get (&speexenc_src_template));
|
||||||
|
|
||||||
gst_element_class_set_details (element_class, &gst_speexenc_details);
|
gst_element_class_set_details (element_class, &gst_speexenc_details);
|
||||||
}
|
}
|
||||||
|
@ -140,12 +139,15 @@ gst_speexenc_init (GstSpeexEnc * speexenc)
|
||||||
{
|
{
|
||||||
/* create the sink and src pads */
|
/* create the sink and src pads */
|
||||||
speexenc->sinkpad =
|
speexenc->sinkpad =
|
||||||
gst_pad_new_from_template (speexenc_sink_template, "sink");
|
gst_pad_new_from_template (gst_static_pad_template_get
|
||||||
|
(&speexenc_sink_template), "sink");
|
||||||
gst_element_add_pad (GST_ELEMENT (speexenc), speexenc->sinkpad);
|
gst_element_add_pad (GST_ELEMENT (speexenc), speexenc->sinkpad);
|
||||||
gst_pad_set_chain_function (speexenc->sinkpad, gst_speexenc_chain);
|
gst_pad_set_chain_function (speexenc->sinkpad, gst_speexenc_chain);
|
||||||
gst_pad_set_link_function (speexenc->sinkpad, gst_speexenc_sinkconnect);
|
gst_pad_set_link_function (speexenc->sinkpad, gst_speexenc_sinkconnect);
|
||||||
|
|
||||||
speexenc->srcpad = gst_pad_new_from_template (speexenc_src_template, "src");
|
speexenc->srcpad =
|
||||||
|
gst_pad_new_from_template (gst_static_pad_template_get
|
||||||
|
(&speexenc_src_template), "src");
|
||||||
gst_element_add_pad (GST_ELEMENT (speexenc), speexenc->srcpad);
|
gst_element_add_pad (GST_ELEMENT (speexenc), speexenc->srcpad);
|
||||||
|
|
||||||
speex_bits_init (&speexenc->bits);
|
speex_bits_init (&speexenc->bits);
|
||||||
|
|
Loading…
Reference in a new issue