From: Ronald S. Bultje Date: Tue, 10 Jun 2003 16:22:41 +0000 (+0000) Subject: Backport of #109069 X-Git-Tag: 1.19.3~511^2~15377 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c64c58bd118a6341bfeabf5ee28de2359574ce9b;p=platform%2Fupstream%2Fgstreamer.git Backport of #109069 Original commit message from CVS: Backport of #109069 --- diff --git a/gst/videotestsrc/gstvideotestsrc.c b/gst/videotestsrc/gstvideotestsrc.c index 6dd7908..a9f71b5 100644 --- a/gst/videotestsrc/gstvideotestsrc.c +++ b/gst/videotestsrc/gstvideotestsrc.c @@ -193,9 +193,33 @@ gst_videotestsrc_srcconnect (GstPad * pad, GstCaps * caps) GST_DEBUG (0, "gst_videotestsrc_srcconnect"); videotestsrc = GST_VIDEOTESTSRC (gst_pad_get_parent (pad)); - videotestsrc->fourcc = paintinfo_find_by_caps(caps); - if(!videotestsrc->fourcc){ - return GST_PAD_LINK_DELAYED; + for ( ; caps != NULL; caps = caps->next) { + GstCaps *caps1 = gst_caps_copy_1(caps); + GstPadLinkReturn ret; + + ret = gst_pad_try_set_caps(pad, caps1); + + if (ret != GST_PAD_LINK_OK && + ret != GST_PAD_LINK_DONE) { + gst_caps_unref(caps1); + continue; + } + + videotestsrc->fourcc = paintinfo_find_by_caps(caps1); + if (!videotestsrc->fourcc) { + gst_caps_unref(caps1); + continue; + } + + /* if we get here, it's allright */ + gst_caps_unref(caps1); + break; + } + + if (caps == NULL) { + GST_DEBUG (GST_CAT_PLUGIN_ERRORS, + "videotestsrc: no suitable opposite-side caps found"); + return GST_PAD_LINK_REFUSED; } GST_DEBUG (0,"videotestsrc: using fourcc element %p %s\n", @@ -208,7 +232,7 @@ gst_videotestsrc_srcconnect (GstPad * pad, GstCaps * caps) GST_DEBUG (0, "size %d x %d", videotestsrc->width, videotestsrc->height); - return GST_PAD_LINK_OK; + return GST_PAD_LINK_DONE; } static GstElementStateReturn