summaryrefslogtreecommitdiff
path: root/sys/v4l2/v4l2_calls.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/v4l2/v4l2_calls.c')
-rw-r--r--sys/v4l2/v4l2_calls.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/v4l2/v4l2_calls.c b/sys/v4l2/v4l2_calls.c
index 4fb1fad86..5f6261ea8 100644
--- a/sys/v4l2/v4l2_calls.c
+++ b/sys/v4l2/v4l2_calls.c
@@ -46,6 +46,9 @@
#include "gstv4l2colorbalance.h"
#include "gstv4l2src.h"
+#include "gstv4l2sink.h"
+
+#include "gst/gst-i18n-plugin.h"
/* Those are ioctl calls */
#ifndef V4L2_CID_HCENTER
@@ -449,10 +452,14 @@ gst_v4l2_open (GstV4l2Object * v4l2object)
goto error;
/* do we need to be a capture device? */
- if (GST_IS_V4L2SRC (v4l2object) &&
+ if (GST_IS_V4L2SRC (v4l2object->element) &&
!(v4l2object->vcap.capabilities & V4L2_CAP_VIDEO_CAPTURE))
goto not_capture;
+ if (GST_IS_V4L2SINK (v4l2object->element) &&
+ !(v4l2object->vcap.capabilities & V4L2_CAP_VIDEO_OUTPUT))
+ goto not_output;
+
/* create enumerations, posts errors. */
if (!gst_v4l2_fill_lists (v4l2object))
goto error;
@@ -497,6 +504,14 @@ not_capture:
("Capabilities: 0x%x", v4l2object->vcap.capabilities));
goto error;
}
+not_output:
+ {
+ GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, NOT_FOUND,
+ (_("Device '%s' is not a output device."),
+ v4l2object->videodev),
+ ("Capabilities: 0x%x", v4l2object->vcap.capabilities));
+ goto error;
+ }
error:
{
if (GST_V4L2_IS_OPEN (v4l2object)) {