summaryrefslogtreecommitdiffstats
path: root/sys/v4l2/v4l2_calls.c
diff options
context:
space:
mode:
authorRob Clark <rob@ti.com>2009-08-04 09:14:20 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-08-04 09:16:56 +0200
commitf19cfbda96d098362cc2a2565197cef347878549 (patch)
tree598fdc98292aa14467da24fd6d711590588c1f68 /sys/v4l2/v4l2_calls.c
parent56850099a6a47b8c3f8606f8107d42cb86dfe601 (diff)
v4l2: Add v4l2sink element
This also does the following changes: (1) pull the bufferpool code out into gstv4l2bufferpool.c, and make a bit more generic so it can be used both for v4l2src and v4l2sink (2) move some of the device probing/configuration/caps stuff into gstv4l2object.c so it does not have to be duplicated between v4l2src and v4l2sink Fixes bug #590280.
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 4fb1fad8..5f6261ea 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)) {