diff options
author | Andy Wingo <wingo@pobox.com> | 2002-02-17 02:06:04 +0000 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2002-02-17 02:06:04 +0000 |
commit | 6f2a22eb93ce68abf25a6c5845d6ac5322a09557 (patch) | |
tree | 134f8f1d01786d668dd17be3b60358a7428e6b94 /gst/law | |
parent | f194a20c0ba29568abbe1bfc53780e612de46338 (diff) |
better capsnego in osssink s/parseau/auparse/ update volume, mulawdecode, auparse to new capsnego
Original commit message from CVS:
* better capsnego in osssink
* s/parseau/auparse/
* update volume, mulawdecode, auparse to new capsnego
Diffstat (limited to 'gst/law')
-rw-r--r-- | gst/law/mulaw-decode.c | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/gst/law/mulaw-decode.c b/gst/law/mulaw-decode.c index 5e485a33..2f95f056 100644 --- a/gst/law/mulaw-decode.c +++ b/gst/law/mulaw-decode.c @@ -46,35 +46,33 @@ static void gst_mulawdec_chain (GstPad *pad, GstBuffer *buf); static GstElementClass *parent_class = NULL; /*static guint gst_stereo_signals[LAST_SIGNAL] = { 0 };*/ -/* -static GstPadNegotiateReturn -mulawdec_negotiate_sink (GstPad *pad, GstCaps **caps, gint counter) + +static GstPadConnectReturn +mulawdec_connect_sink (GstPad *pad, GstCaps *caps) { - GstCaps* tempcaps; - + GstCaps *newcaps; GstMuLawDec* mulawdec=GST_MULAWDEC (GST_OBJECT_PARENT (pad)); - if (*caps==NULL) - return GST_PAD_NEGOTIATE_FAIL; - - tempcaps = gst_caps_copy(*caps); - - gst_caps_set(tempcaps,"format",GST_PROPS_STRING("int")); - gst_caps_set(tempcaps,"law",GST_PROPS_INT(0)); - gst_caps_set(tempcaps,"depth",GST_PROPS_INT(16)); - gst_caps_set(tempcaps,"width",GST_PROPS_INT(16)); - gst_caps_set(tempcaps,"signed",GST_PROPS_BOOLEAN(TRUE)); - - if (gst_pad_try_set_caps (mulawdec->srcpad, tempcaps)) - { - return GST_PAD_NEGOTIATE_AGREE; - } - else { - gst_caps_unref (tempcaps); - return GST_PAD_NEGOTIATE_FAIL; + if (caps==NULL) + return GST_PAD_CONNECT_REFUSED; + + newcaps = gst_caps_copy(caps); + + gst_caps_set(newcaps,"format",GST_PROPS_STRING("int")); + gst_caps_set(newcaps,"law",GST_PROPS_INT(0)); + gst_caps_set(newcaps,"depth",GST_PROPS_INT(16)); + gst_caps_set(newcaps,"width",GST_PROPS_INT(16)); + gst_caps_set(newcaps,"signed",GST_PROPS_BOOLEAN(TRUE)); + + if (GST_CAPS_IS_FIXED (newcaps)) { + if (gst_pad_try_set_caps (mulawdec->srcpad, newcaps)) + return GST_PAD_CONNECT_OK; + else + return GST_PAD_CONNECT_REFUSED; } + + return GST_PAD_CONNECT_DELAYED; } -*/ GType gst_mulawdec_get_type(void) { @@ -116,7 +114,7 @@ gst_mulawdec_init (GstMuLawDec *mulawdec) { mulawdec->sinkpad = gst_pad_new_from_template(mulawdec_sink_template,"sink"); mulawdec->srcpad = gst_pad_new_from_template(mulawdec_src_template,"src"); - /*gst_pad_set_negotiate_function(mulawdec->sinkpad, mulawdec_negotiate_sink);*/ + gst_pad_set_connect_function(mulawdec->sinkpad, mulawdec_connect_sink); gst_element_add_pad(GST_ELEMENT(mulawdec),mulawdec->sinkpad); gst_pad_set_chain_function(mulawdec->sinkpad,gst_mulawdec_chain); |