summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2002-09-18 10:57:56 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2002-09-18 10:57:56 +0000
commit6413f023bce7ed25f29f9feb2ba9d64912df8017 (patch)
tree7ab1d06312075f541d55c2decc4d3e91ffced11b
parent79adbf346ea2950bd222aad182bb980b308624ee (diff)
some enhancements for capsnego
Original commit message from CVS: some enhancements for capsnego
-rw-r--r--sys/v4l2/gstv4l2src.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c
index 3c1e6c9f3..d5ca7106f 100644
--- a/sys/v4l2/gstv4l2src.c
+++ b/sys/v4l2/gstv4l2src.c
@@ -563,8 +563,14 @@ gst_v4l2src_srcconnect (GstPad *pad,
/* clean up if we still haven't cleaned up our previous
* capture session */
if (GST_V4L2_IS_ACTIVE(GST_V4L2ELEMENT(v4l2src)))
+ {
if (!gst_v4l2src_capture_deinit(v4l2src))
return GST_PAD_CONNECT_REFUSED;
+ }
+ else if (!GST_V4L2_IS_OPEN(GST_V4L2ELEMENT(v4l2src)))
+ {
+ return GST_PAD_CONNECT_DELAYED;
+ }
/* build our own capslist */
if (v4l2src->palette) {
@@ -610,10 +616,17 @@ gst_v4l2src_srcconnect (GstPad *pad,
format->flags & V4L2_FMT_FLAG_COMPRESSED);
GstCaps *onecaps;
for (;lastcaps != NULL; lastcaps = lastcaps->next) {
+ GstPadConnectReturn ret_val;
onecaps = gst_caps_copy_1(lastcaps);
- if (gst_pad_try_set_caps(v4l2src->srcpad, onecaps) > 0)
+ if ((ret_val = gst_pad_try_set_caps(v4l2src->srcpad, onecaps)) > 0)
+ {
if (gst_v4l2src_capture_init(v4l2src))
- return GST_PAD_CONNECT_OK;
+ return GST_PAD_CONNECT_DONE;
+ }
+ else if (ret_val == GST_PAD_CONNECT_DELAYED)
+ {
+ return GST_PAD_CONNECT_DELAYED;
+ }
}
}
}