diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2006-07-27 10:50:39 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2006-07-27 10:50:39 +0000 |
commit | 3ca2e121ec1af161a564e0de32c70ef0cb337f4e (patch) | |
tree | 799c8afb1bbfb37f58d6123fc3b85ad25fb8cb05 /ext/gsm/gstgsmenc.c | |
parent | b093995aa90655418907fa204243ae6d7d591feb (diff) | |
download | gst-plugins-bad-3ca2e121ec1af161a564e0de32c70ef0cb337f4e.tar.gz gst-plugins-bad-3ca2e121ec1af161a564e0de32c70ef0cb337f4e.tar.bz2 gst-plugins-bad-3ca2e121ec1af161a564e0de32c70ef0cb337f4e.zip |
ext/gsm/: Fix negotiation.
Original commit message from CVS:
* ext/gsm/gstgsmdec.c: (gst_gsmdec_init),
(gst_gsmdec_sink_setcaps), (gst_gsmdec_sink_event):
* ext/gsm/gstgsmenc.c: (gst_gsmenc_init), (gst_gsmenc_setcaps):
Fix negotiation.
Diffstat (limited to 'ext/gsm/gstgsmenc.c')
-rw-r--r-- | ext/gsm/gstgsmenc.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/ext/gsm/gstgsmenc.c b/ext/gsm/gstgsmenc.c index 209e5c58..a791b884 100644 --- a/ext/gsm/gstgsmenc.c +++ b/ext/gsm/gstgsmenc.c @@ -55,6 +55,7 @@ static void gst_gsmenc_class_init (GstGSMEnc * klass); static void gst_gsmenc_init (GstGSMEnc * gsmenc); static void gst_gsmenc_finalize (GObject * object); +static gboolean gst_gsmenc_setcaps (GstPad * pad, GstCaps * caps); static GstFlowReturn gst_gsmenc_chain (GstPad * pad, GstBuffer * buf); static GstElementClass *parent_class = NULL; @@ -138,8 +139,9 @@ gst_gsmenc_init (GstGSMEnc * gsmenc) gsmenc->sinkpad = gst_pad_new_from_template (gst_static_pad_template_get (&gsmenc_sink_template), "sink"); - gst_element_add_pad (GST_ELEMENT (gsmenc), gsmenc->sinkpad); gst_pad_set_chain_function (gsmenc->sinkpad, gst_gsmenc_chain); + gst_pad_set_setcaps_function (gsmenc->sinkpad, gst_gsmenc_setcaps); + gst_element_add_pad (GST_ELEMENT (gsmenc), gsmenc->sinkpad); gsmenc->srcpad = gst_pad_new_from_template (gst_static_pad_template_get @@ -169,6 +171,24 @@ gst_gsmenc_finalize (GObject * object) G_OBJECT_CLASS (parent_class)->finalize (object); } +static gboolean +gst_gsmenc_setcaps (GstPad * pad, GstCaps * caps) +{ + GstGSMEnc *gsmenc; + GstCaps *srccaps; + + gsmenc = GST_GSMENC (gst_pad_get_parent (pad)); + + srccaps = gst_static_pad_template_get_caps (&gsmenc_src_template); + + gst_pad_set_caps (gsmenc->srcpad, srccaps); + + gst_object_unref (gsmenc); + + return TRUE; +} + + static GstFlowReturn gst_gsmenc_chain (GstPad * pad, GstBuffer * buf) { |