summaryrefslogtreecommitdiffstats
path: root/ext/gsm/gstgsmdec.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2002-01-13 22:27:25 +0000
committerWim Taymans <wim.taymans@gmail.com>2002-01-13 22:27:25 +0000
commit93e9ac34a1058caab1ef680071874d620a10d132 (patch)
tree4c730c821178cc2ea708454dc276a1d36b5bfe1b /ext/gsm/gstgsmdec.c
parente92b7beff5470ec3f1662e2413622295b37f8710 (diff)
downloadgst-plugins-bad-93e9ac34a1058caab1ef680071874d620a10d132.tar.gz
gst-plugins-bad-93e9ac34a1058caab1ef680071874d620a10d132.tar.bz2
gst-plugins-bad-93e9ac34a1058caab1ef680071874d620a10d132.zip
Bring the plugins in sync with the new core capsnego system.
Original commit message from CVS: Bring the plugins in sync with the new core capsnego system. Added some features, enhancements...
Diffstat (limited to 'ext/gsm/gstgsmdec.c')
-rw-r--r--ext/gsm/gstgsmdec.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/ext/gsm/gstgsmdec.c b/ext/gsm/gstgsmdec.c
index 5ead519c..8a61453a 100644
--- a/ext/gsm/gstgsmdec.c
+++ b/ext/gsm/gstgsmdec.c
@@ -45,11 +45,11 @@ enum {
/* FILL ME */
};
-static void gst_gsmdec_class_init (GstGSMDec *klass);
-static void gst_gsmdec_init (GstGSMDec *gsmdec);
+static void gst_gsmdec_class_init (GstGSMDec *klass);
+static void gst_gsmdec_init (GstGSMDec *gsmdec);
-static void gst_gsmdec_chain (GstPad *pad, GstBuffer *buf);
-static void gst_gsmdec_newcaps (GstPad *pad, GstCaps *caps);
+static void gst_gsmdec_chain (GstPad *pad, GstBuffer *buf);
+static GstPadConnectReturn gst_gsmdec_sinkconnect (GstPad *pad, GstCaps *caps);
static GstElementClass *parent_class = NULL;
//static guint gst_gsmdec_signals[LAST_SIGNAL] = { 0 };
@@ -93,7 +93,7 @@ gst_gsmdec_init (GstGSMDec *gsmdec)
gsmdec->sinkpad = gst_pad_new_from_template (gsmdec_sink_template, "sink");
gst_element_add_pad (GST_ELEMENT (gsmdec), gsmdec->sinkpad);
gst_pad_set_chain_function (gsmdec->sinkpad, gst_gsmdec_chain);
- gst_pad_set_newcaps_function (gsmdec->sinkpad, gst_gsmdec_newcaps);
+ gst_pad_set_connect_function (gsmdec->sinkpad, gst_gsmdec_sinkconnect);
gsmdec->srcpad = gst_pad_new_from_template (gsmdec_src_template, "src");
gst_element_add_pad (GST_ELEMENT (gsmdec), gsmdec->srcpad);
@@ -102,13 +102,18 @@ gst_gsmdec_init (GstGSMDec *gsmdec)
gsmdec->bufsize = 0;
}
-static void
-gst_gsmdec_newcaps (GstPad *pad, GstCaps *caps)
+static GstPadConnectReturn
+gst_gsmdec_sinkconnect (GstPad *pad, GstCaps *caps)
{
GstGSMDec *gsmdec;
gsmdec = GST_GSMDEC (gst_pad_get_parent (pad));
- gst_pad_set_caps (gsmdec->srcpad, GST_CAPS_NEW (
+
+ if (!GST_CAPS_IS_FIXED (caps))
+ return GST_PAD_CONNECT_DELAYED;
+
+ if (gst_pad_try_set_caps (gsmdec->srcpad,
+ GST_CAPS_NEW (
"gsm_raw",
"audio/raw",
"format", GST_PROPS_STRING ("int"),
@@ -119,7 +124,11 @@ gst_gsmdec_newcaps (GstPad *pad, GstCaps *caps)
"depth", GST_PROPS_INT (16),
"rate", GST_PROPS_INT (gst_caps_get_int (caps, "rate")),
"channels", GST_PROPS_INT (1)
- ));
+ )))
+ {
+ return GST_PAD_CONNECT_OK;
+ }
+ return GST_PAD_CONNECT_REFUSED;
}
static void