mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-17 22:06:41 +00:00
This updates all plugins to the new API for gst_pad_try_set_caps
Original commit message from CVS: This updates all plugins to the new API for gst_pad_try_set_caps
This commit is contained in:
parent
2ddfd11493
commit
95281dfe33
7 changed files with 15 additions and 18 deletions
|
@ -907,7 +907,7 @@ gst_alsa_src_process (GstAlsa *this, snd_pcm_uframes_t frames)
|
|||
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;
|
||||
|
|
|
@ -273,12 +273,12 @@ gst_adder_connect (GstPad *pad, GstCaps *caps)
|
|||
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)",
|
||||
|
|
|
@ -183,10 +183,7 @@ gst_audioscale_sinkconnect (GstPad * pad, GstCaps * caps)
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -201,7 +201,7 @@ gst_videoscale_sinkconnect (GstPad *pad, GstCaps *caps)
|
|||
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",
|
||||
|
@ -209,8 +209,6 @@ gst_videoscale_sinkconnect (GstPad *pad, GstCaps *caps)
|
|||
"width", GST_PROPS_INT (videoscale->targetwidth),
|
||||
"height", GST_PROPS_INT (videoscale->targetheight)
|
||||
));
|
||||
|
||||
return GST_PAD_CONNECT_OK;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -144,13 +144,15 @@ volume_connect (GstPad *pad, GstCaps *caps)
|
|||
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;
|
||||
|
|
|
@ -258,7 +258,7 @@ gst_v4lmjpegsrc_srcconnect (GstPad *pad,
|
|||
"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");
|
||||
|
|
|
@ -350,7 +350,7 @@ gst_v4lsrc_srcconnect (GstPad *pad,
|
|||
|
||||
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))
|
||||
|
|
Loading…
Reference in a new issue