GstCaps *to_try = gst_caps_copy_1 (trylist);
/* try each format */
- if (gst_pad_try_set_caps (dvdec->videosrcpad, to_try)) {
+ if (gst_pad_try_set_caps (dvdec->videosrcpad, to_try) > 0) {
guint32 fourcc;
/* it worked, try to find what it was again */
}
if (!GST_PAD_CAPS (pad)) {
/* set caps on src pad */
- if (!gst_pad_try_set_caps (esdmon->srcpad,
+ if (gst_pad_try_set_caps (esdmon->srcpad,
GST_CAPS_NEW (
"oss_src",
"audio/raw",
"depth", GST_PROPS_INT (esdmon->depth),
"rate", GST_PROPS_INT (esdmon->frequency),
"channels", GST_PROPS_INT (esdmon->channels)
- )))
+ )) <= 0)
{
gst_element_error (GST_ELEMENT (esdmon), "could not set caps");
return NULL;
not sure if this is correct. */
if (GST_CAPS_IS_FIXED (caps)) {
for (i=0;i<oclass->numsrcpads;i++) {
- if (! gst_pad_try_set_caps (ladspa->srcpads[i], caps))
+ if (gst_pad_try_set_caps (ladspa->srcpads[i], caps) <= 0)
return GST_PAD_CONNECT_REFUSED;
}
}
double sum = 0.0;
int len = 0;
double *kernel_lp, *kernel_hp;
+ GstPadConnectReturn set_retval;
GstBPWSinc *filter = GST_BPWSINC (gst_pad_get_parent (pad));
if (!GST_CAPS_IS_FIXED (caps))
return GST_PAD_CONNECT_DELAYED;
-
- if (gst_pad_try_set_caps (filter->srcpad, caps))
+
+ set_retval = gst_pad_try_set_caps (filter->srcpad, caps);
+
+ if (set_retval > 0)
{
len = filter->wing_size;
/* fill the lp kernel */
/* set up the residue memory space */
filter->residue = (gfloat *) g_malloc (sizeof (gfloat) * (len * 2 + 1));
for (i = 0; i <= len * 2; ++i) filter->residue[i] = 0.0;
-
- return GST_PAD_CONNECT_OK;
}
- return GST_PAD_CONNECT_REFUSED;
+ return set_retval;
}
static void
double sum = 0.0;
int len = 0;
GstLPWSinc *filter = GST_LPWSINC (gst_pad_get_parent (pad));
+ GstPadConnectReturn set_retval;
g_assert (GST_IS_PAD (pad));
g_assert (caps != NULL);
if (!GST_CAPS_IS_FIXED (caps))
return GST_PAD_CONNECT_DELAYED;
-
- if (gst_pad_try_set_caps (filter->srcpad, caps))
+
+ set_retval = gst_pad_try_set_caps(filter->srcpad, caps);
+
+ if (set_retval > 0)
{
/* connection works, so init the filter */
/* FIXME: remember to free it */
/* set up the residue memory space */
filter->residue = (gfloat *) g_malloc (sizeof (gfloat) * (len * 2 + 1));
for (i = 0; i <= len * 2; ++i) filter->residue[i] = 0.0;
-
- return GST_PAD_CONNECT_OK;
}
- return GST_PAD_CONNECT_REFUSED;
+ return set_retval;
}
static void
"width", GST_PROPS_INT (depth),
"signed", GST_PROPS_BOOLEAN (sign));
- if (!gst_pad_try_set_caps (auparse->srcpad, tempcaps)) {
+ if (gst_pad_try_set_caps (auparse->srcpad, tempcaps) <= 0) {
gst_buffer_unref (buf);
gst_element_error (GST_ELEMENT (auparse), "could not set audio caps");
return;
otherpad = (pad == filter->srcpad ? filter->sinkpad : filter->srcpad);
if (GST_CAPS_IS_FIXED (caps))
- {
- if (!gst_pad_try_set_caps (otherpad, caps))
- return GST_PAD_CONNECT_REFUSED;
-
- return GST_PAD_CONNECT_OK;
- }
+ return gst_pad_try_set_caps (otherpad, caps);
return GST_PAD_CONNECT_DELAYED;
}
filter->aging_mode = 0;
aging_mode_switch (filter);
- if (gst_pad_try_set_caps (filter->srcpad, caps)) {
- return GST_PAD_CONNECT_OK;
- }
-
- return GST_PAD_CONNECT_REFUSED;
+ return gst_pad_try_set_caps (filter->srcpad, caps);
}
static void
filter->dicemap = (gchar *) g_malloc (filter->height * filter->width * sizeof(char));
gst_dicetv_create_map (filter);
- if (gst_pad_try_set_caps (filter->srcpad, caps)) {
- return GST_PAD_CONNECT_OK;
- }
-
- return GST_PAD_CONNECT_REFUSED;
+ return gst_pad_try_set_caps (filter->srcpad, caps);
}
static void
filter->map = (guint32 *)g_malloc (filter->map_width * filter->map_height * sizeof(guint32) * 2);
bzero(filter->map, filter->map_width * filter->map_height * sizeof(guint32) * 2);
- if (gst_pad_try_set_caps (filter->srcpad, caps)) {
- return GST_PAD_CONNECT_OK;
- }
-
- return GST_PAD_CONNECT_REFUSED;
+ return gst_pad_try_set_caps (filter->srcpad, caps);
}
static void
filter->planetable[i] = NULL;
}
- if (gst_pad_try_set_caps (filter->srcpad, caps)) {
- return GST_PAD_CONNECT_OK;
- }
-
- return GST_PAD_CONNECT_REFUSED;
+ return gst_pad_try_set_caps (filter->srcpad, caps);
}
static void
gst_caps_get_int (caps, "width", &filter->width);
gst_caps_get_int (caps, "height", &filter->height);
- if (gst_pad_try_set_caps (filter->srcpad, caps)) {
- return GST_PAD_CONNECT_OK;
- }
-
- return GST_PAD_CONNECT_REFUSED;
+ return gst_pad_try_set_caps (filter->srcpad, caps);
}
static void
gst_shagadelic_initialize (filter);
- if (gst_pad_try_set_caps (filter->srcpad, caps)) {
- return GST_PAD_CONNECT_OK;
- }
-
- return GST_PAD_CONNECT_REFUSED;
+ return gst_pad_try_set_caps (filter->srcpad, caps);
}
static void
filter->alt_buffer = filter->buffer + area;
filter->phase = 0;
- if (gst_pad_try_set_caps (filter->srcpad, caps)) {
- return GST_PAD_CONNECT_OK;
- }
-
- return GST_PAD_CONNECT_REFUSED;
+ return gst_pad_try_set_caps (filter->srcpad, caps);
}
static void
gst_warptv_initialize (filter);
- if (gst_pad_try_set_caps (filter->srcpad, caps)) {
- return GST_PAD_CONNECT_OK;
- }
-
- return GST_PAD_CONNECT_REFUSED;
+ return gst_pad_try_set_caps (filter->srcpad, caps);
}
static void
"height", GST_PROPS_INT (goom->height)
);
- if (!gst_pad_try_set_caps (goom->srcpad, caps)) {
+ if (gst_pad_try_set_caps (goom->srcpad, caps) <= 0) {
gst_element_error (GST_ELEMENT (goom), "could not set caps");
return;
}
gst_caps_set(tempcaps,"width",GST_PROPS_INT(16));
gst_caps_set(tempcaps,"signed",GST_PROPS_BOOLEAN(TRUE));
- if (gst_pad_try_set_caps (alawdec->srcpad, tempcaps))
+ if (gst_pad_try_set_caps (alawdec->srcpad, tempcaps) > 0)
{
return GST_PAD_NEGOTIATE_AGREE;
}
gst_caps_set(tempcaps,"width",GST_PROPS_INT(8));
gst_caps_set(tempcaps,"signed",GST_PROPS_BOOLEAN(FALSE));
- if (gst_pad_try_set_caps (alawenc->srcpad, tempcaps))
+ if (gst_pad_try_set_caps (alawenc->srcpad, tempcaps) > 0)
{
return GST_PAD_NEGOTIATE_AGREE;
}
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;
- }
-
+ if (GST_CAPS_IS_FIXED (newcaps))
+ return gst_pad_try_set_caps (mulawdec->srcpad, newcaps);
return GST_PAD_CONNECT_DELAYED;
}
gst_caps_set(tempcaps,"width",GST_PROPS_INT(8));
gst_caps_set(tempcaps,"signed",GST_PROPS_BOOLEAN(FALSE));
- if (gst_pad_try_set_caps (mulawenc->srcpad, tempcaps))
+ if (gst_pad_try_set_caps (mulawenc->srcpad, tempcaps) > 0)
{
return GST_PAD_NEGOTIATE_AGREE;
}
if (GST_CAPS_IS_FIXED (caps))
{
- if (/* !volume_parse_caps (filter, caps) || */
- !gst_pad_try_set_caps (otherpad, caps))
- return GST_PAD_CONNECT_REFUSED;
-
- return GST_PAD_CONNECT_OK;
+ /*if ( !volume_parse_caps (filter, caps) || */
+ return gst_pad_try_set_caps (otherpad, caps);
}
return GST_PAD_CONNECT_DELAYED;
}
gst_caps_get_int (caps, "height", &filter->height);
/* forward to the next plugin */
- if (!gst_pad_try_set_caps(filter->srcpad, gst_caps_copy_1(caps)))
- return GST_PAD_CONNECT_REFUSED;
-
- return GST_PAD_CONNECT_OK;
+ return gst_pad_try_set_caps(filter->srcpad, gst_caps_copy_1(caps));
}
void gst_median_init (GstMedian *median)
"height", GST_PROPS_INT (monoscope->height)
);
- if (!gst_pad_try_set_caps (monoscope->srcpad, caps)) {
+ if (gst_pad_try_set_caps (monoscope->srcpad, caps) <= 0) {
gst_element_error (GST_ELEMENT (monoscope), "could not set caps");
return;
}
}
if (GST_PAD_CAPS (video_crop->srcpad) == NULL) {
- if (!gst_pad_try_set_caps (video_crop->srcpad,
+ if (gst_pad_try_set_caps (video_crop->srcpad,
GST_CAPS_NEW (
"video_crop_caps",
"video/raw",
"format", GST_PROPS_FOURCC (GST_STR_FOURCC ("I420")),
"width", GST_PROPS_INT (video_crop->crop_width),
"height", GST_PROPS_INT (video_crop->crop_height)
- )))
+ )) <= 0)
{
gst_element_error (GST_ELEMENT (video_crop), "could not negotiate pads");
return;
"channels", GST_PROPS_INT (format->wChannels)
);
- if (!gst_pad_try_set_caps (wavparse->srcpad, caps)) {
+ if (gst_pad_try_set_caps (wavparse->srcpad, caps) <= 0) {
gst_element_error (GST_ELEMENT (wavparse), "Could not set caps");
return;
}
}
if (!GST_PAD_CAPS (pad)) {
/* set caps on src pad */
- if (!gst_pad_try_set_caps (src->srcpad,
+ if (gst_pad_try_set_caps (src->srcpad,
GST_CAPS_NEW (
"oss_src",
"audio/raw",
"depth", GST_PROPS_INT (src->format),
"rate", GST_PROPS_INT (src->frequency),
"channels", GST_PROPS_INT (src->channels)
- )))
+ )) <= 0)
{
gst_element_error (GST_ELEMENT (src), "could not set caps");
return NULL;
GstCaps *onecaps;
for (;lastcaps != NULL; lastcaps = lastcaps->next) {
onecaps = gst_caps_copy_1(lastcaps);
- if (gst_pad_try_set_caps(v4l2src->srcpad, onecaps))
+ if (gst_pad_try_set_caps(v4l2src->srcpad, onecaps) > 0)
if (gst_v4l2src_capture_init(v4l2src))
return GST_PAD_CONNECT_OK;
}