diff options
author | Thomas Vander Stichele <thomas@apestaart.org> | 2003-06-09 18:52:24 +0000 |
---|---|---|
committer | Thomas Vander Stichele <thomas@apestaart.org> | 2003-06-09 18:52:24 +0000 |
commit | 0b107fc6d8aee32de4f11249eb5d3d2fe5cc3f70 (patch) | |
tree | 9fb67b12293bc317d02a9ab535f41c1e4205d79b | |
parent | 26ad049ddd2adb358f3c4a1ccff68f7421d3dcef (diff) | |
download | gstreamer-plugins-base-0b107fc6d8aee32de4f11249eb5d3d2fe5cc3f70.tar.gz |
fixes #109069
Original commit message from CVS:
fixes #109069
-rw-r--r-- | gst/videotestsrc/gstvideotestsrc.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/gst/videotestsrc/gstvideotestsrc.c b/gst/videotestsrc/gstvideotestsrc.c index 2f49db741..177a62f44 100644 --- a/gst/videotestsrc/gstvideotestsrc.c +++ b/gst/videotestsrc/gstvideotestsrc.c @@ -198,26 +198,33 @@ gst_videotestsrc_srcconnect (GstPad * pad, GstCaps * caps) return GST_PAD_LINK_DELAYED; } - if(GST_CAPS_IS_CHAINED(caps)){ + for ( ; caps != NULL; caps = caps->next) { GstCaps *caps1 = gst_caps_copy_1(caps); GstPadLinkReturn ret; - GST_DEBUG (0, "caps chained\n"); - ret = gst_pad_try_set_caps(pad, caps1); - GST_DEBUG (0, "try_set_caps returned %d\n", ret); - if(ret!=GST_PAD_LINK_OK){ + if (ret != GST_PAD_LINK_OK && + ret != GST_PAD_LINK_DONE) { gst_caps_unref(caps1); - return ret; + continue; } - caps = caps1; + 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; } - videotestsrc->fourcc = paintinfo_find_by_caps(caps); - if(!videotestsrc->fourcc){ - return GST_PAD_LINK_DELAYED; + 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", @@ -230,7 +237,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 |