diff options
author | Rob Clark <rob@ti.com> | 2009-08-04 09:14:20 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-08-04 09:16:56 +0200 |
commit | f19cfbda96d098362cc2a2565197cef347878549 (patch) | |
tree | 598fdc98292aa14467da24fd6d711590588c1f68 /sys/v4l2/v4l2_calls.h | |
parent | 56850099a6a47b8c3f8606f8107d42cb86dfe601 (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.h')
-rw-r--r-- | sys/v4l2/v4l2_calls.h | 59 |
1 files changed, 50 insertions, 9 deletions
diff --git a/sys/v4l2/v4l2_calls.h b/sys/v4l2/v4l2_calls.h index 8bf7bcea..1f24c1f4 100644 --- a/sys/v4l2/v4l2_calls.h +++ b/sys/v4l2/v4l2_calls.h @@ -25,18 +25,20 @@ #define __V4L2_CALLS_H__ #include "gstv4l2object.h" -#include "gst/gst-i18n-plugin.h" #ifdef HAVE_LIBV4L2 -#include <libv4l2.h> +# include <libv4l2.h> #else -#define v4l2_fd_open(fd, flags) (fd) -#define v4l2_close close -#define v4l2_dup dup -#define v4l2_ioctl ioctl -#define v4l2_read read -#define v4l2_mmap mmap -#define v4l2_munmap munmap +# include <sys/ioctl.h> +# include <linux/videodev.h> +# include <linux/videodev2.h> +# define v4l2_fd_open(fd, flags) (fd) +# define v4l2_close close +# define v4l2_dup dup +# define v4l2_ioctl ioctl +# define v4l2_read read +# define v4l2_mmap mmap +# define v4l2_munmap munmap #endif /* simple check whether the device is open */ @@ -137,4 +139,43 @@ gboolean gst_v4l2_set_attribute (GstV4l2Object *v4l2object, gboolean gst_v4l2_get_capabilities (GstV4l2Object * v4l2object); + +/* note: in case this is a build with TTIF logging, we can optimize slightly + * and avoid the gst_caps_to_string() in case logging isn't enabled by using + * the TTIF_TRACE_ARG_PROCESSOR feature of ttif_trace_fprintf(): + */ +#ifdef GST_LOG_OVER_TTIF +# define LOG_CAPS(obj, caps) G_STMT_START { \ + if (caps) { \ + static TTIF_TRACE_ARG_PROCESSOR proc = { \ + .convert = (char (*)(void *))gst_caps_to_string, \ + .free = (void (*)(char *))g_free \ + }; \ + GST_DEBUG_OBJECT (obj, "%s: %qs", #caps, &proc, (caps)); \ + } else { \ + GST_DEBUG_OBJECT (obj, "null"); \ + } \ + } G_STMT_END +#else +# define LOG_CAPS(obj, caps) G_STMT_START { \ + if (caps) { \ + gchar *capstr = gst_caps_to_string (caps); \ + GST_DEBUG_OBJECT (obj, "%s: %s", #caps, capstr); \ + g_free (capstr); \ + } else { \ + GST_DEBUG_OBJECT (obj, "null"); \ + } \ + } G_STMT_END +#endif + +/* note: the omapzoom kernel v4l2 display driver deviates from the v4l2 API + * spec in a few areas. For example, we must always have one buffer with + * the driver before STREAMON until after STREAMOFF. And some interfaces, + * such as rotation (and mirroring?) are different. + * + * this is only a temporary hack, as we should switch to the new driver soon + */ +#define OMAPZOOM + + #endif /* __V4L2_CALLS_H__ */ |