diff options
author | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2003-11-10 10:25:59 +0000 |
---|---|---|
committer | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2003-11-10 10:25:59 +0000 |
commit | 28a38344c68672ce2dc58a1e4cfe46f8be12e916 (patch) | |
tree | 001fdac5dbab4cc1d16d6e30af9d6dd5b67efb33 /sys/v4l2 | |
parent | 8f120cdf009a8a237690f49e133c44c703f706ce (diff) | |
download | gst-plugins-bad-28a38344c68672ce2dc58a1e4cfe46f8be12e916.tar.gz gst-plugins-bad-28a38344c68672ce2dc58a1e4cfe46f8be12e916.tar.bz2 gst-plugins-bad-28a38344c68672ce2dc58a1e4cfe46f8be12e916.zip |
Proper device-capabilities check when opening
Original commit message from CVS:
Proper device-capabilities check when opening
Diffstat (limited to 'sys/v4l2')
-rw-r--r-- | sys/v4l2/v4l2_calls.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/v4l2/v4l2_calls.c b/sys/v4l2/v4l2_calls.c index 8b65dc71..ee6e00dd 100644 --- a/sys/v4l2/v4l2_calls.c +++ b/sys/v4l2/v4l2_calls.c @@ -34,6 +34,8 @@ #include "gstv4l2xoverlay.h" #include "gstv4l2colorbalance.h" +#include "gstv4l2src.h" + #define DEBUG(format, args...) \ GST_DEBUG_OBJECT (\ GST_ELEMENT(v4l2element), \ @@ -372,6 +374,15 @@ gst_v4l2_open (GstV4l2Element *v4l2element) goto error; } + /* do we need to be a capture device? */ + if (GST_IS_V4L2SRC(v4l2element) && + !(v4l2element->vcap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) { + gst_element_error(GST_ELEMENT(v4l2element), + "Not a capture device (0x%x)", + v4l2element->vcap.capabilities); + goto error; + } + /* create enumerations */ if (!gst_v4l2_fill_lists(v4l2element)) goto error; |