caps = gst_alsa_caps(this);
l = this->pads;
while (l) {
- if (!gst_pad_try_set_caps (GST_ALSA_PAD(l)->pad, caps)) {
+ if (gst_pad_try_set_caps (GST_ALSA_PAD(l)->pad, caps) <= 0) {
g_print ("DANGER WILL ROBINSON!\n");
sleep(1);
return FALSE;
if (!gst_adder_parse_caps (adder, caps))
return GST_PAD_CONNECT_REFUSED;
- if (pad == adder->srcpad || gst_pad_try_set_caps (adder->srcpad, caps)) {
+ if (pad == adder->srcpad || gst_pad_try_set_caps (adder->srcpad, caps) > 0) {
sinkpads = gst_element_get_pad_list ((GstElement*) adder);
while (sinkpads) {
p = (GstPad*) sinkpads->data;
if (p != pad && p != adder->srcpad) {
- if (!gst_pad_try_set_caps (p, caps)) {
+ if (gst_pad_try_set_caps (p, caps) <= 0) {
GST_DEBUG (GST_CAT_PLUGIN_INFO,
"caps mismatch; disconnecting and removing pad %s:%s "
"(peer %s:%s)",
gst_caps_set (newcaps, "rate", GST_PROPS_INT_TYPE, audioscale->targetfrequency, NULL);
if (GST_CAPS_IS_FIXED (caps))
- if (gst_pad_try_set_caps (audioscale->srcpad, newcaps))
- return GST_PAD_CONNECT_OK;
- else
- return GST_PAD_CONNECT_REFUSED;
+ return gst_pad_try_set_caps (audioscale->srcpad, newcaps);
else
return GST_PAD_CONNECT_DELAYED;
}
videoscale->targetheight);
GST_DEBUG(0,"width %d",videoscale->targetwidth);
- gst_pad_try_set_caps (videoscale->srcpad,
+ return gst_pad_try_set_caps (videoscale->srcpad,
GST_CAPS_NEW (
"videoscale_src",
"video/raw",
"width", GST_PROPS_INT (videoscale->targetwidth),
"height", GST_PROPS_INT (videoscale->targetheight)
));
-
- return GST_PAD_CONNECT_OK;
}
static void
otherpad = (pad == filter->srcpad ? filter->sinkpad : filter->srcpad);
if (GST_CAPS_IS_FIXED (caps)) {
- if (!volume_parse_caps (filter, caps) || !gst_pad_try_set_caps (otherpad, caps))
+ GstPadConnectReturn set_retval;
+ if (!volume_parse_caps (filter, caps))
return GST_PAD_CONNECT_REFUSED;
-
- if (gst_caps_get_int (caps, "rate", &rate)){
- gst_dpman_set_rate(filter->dpman, rate);
- }
- return GST_PAD_CONNECT_OK;
+
+ if ((set_retval = gst_pad_try_set_caps(otherpad, caps)) > 0)
+ if (gst_caps_get_int (caps, "rate", &rate)){
+ gst_dpman_set_rate(filter->dpman, rate);
+ }
+ return set_retval;
}
return GST_PAD_CONNECT_DELAYED;
"width", GST_PROPS_INT(v4lmjpegsrc->end_width),
"height", GST_PROPS_INT(v4lmjpegsrc->end_height),
NULL ) );
- if (!gst_pad_try_set_caps(v4lmjpegsrc->srcpad, caps))
+ if (gst_pad_try_set_caps(v4lmjpegsrc->srcpad, caps) <= 0)
{
gst_element_error(GST_ELEMENT(v4lmjpegsrc),
"Failed to set new caps");
gst_caps_debug (newcaps, "new caps to set on v4lsrc's src pad");
- if (!gst_pad_try_set_caps(v4lsrc->srcpad, newcaps))
+ if (gst_pad_try_set_caps(v4lsrc->srcpad, newcaps) <= 0)
continue;
if (!gst_v4lsrc_capture_init(v4lsrc))