summaryrefslogtreecommitdiff
path: root/v4l2-apps/libv4l/libv4l1/libv4l1-priv.h
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2009-02-13 13:06:29 +0100
committerHans Verkuil <hverkuil@xs4all.nl>2009-02-13 13:06:29 +0100
commit4e061e403e8a5ab5f041a54a6852c69e6b00b368 (patch)
treed288a6a3edad467d22fc7cb7a022b327060a0733 /v4l2-apps/libv4l/libv4l1/libv4l1-priv.h
parentd9fcd7e5495fbd0fe020223823338d21ce31dcaf (diff)
downloadmediapointer-dvb-s2-4e061e403e8a5ab5f041a54a6852c69e6b00b368.tar.gz
mediapointer-dvb-s2-4e061e403e8a5ab5f041a54a6852c69e6b00b368.tar.bz2
v4l2-apps: move libraries around to make the directory tree flatter
From: Hans Verkuil <hverkuil@xs4all.nl> Instead of having libv4l2util in v4l2-apps/lib and libv4l in v4l2-apps/lib/libv4l, both are now moved to v4l2-apps/libv4l2util and v4l2-apps/libv4l. This is much cleaner and less confusing. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'v4l2-apps/libv4l/libv4l1/libv4l1-priv.h')
-rw-r--r--v4l2-apps/libv4l/libv4l1/libv4l1-priv.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/v4l2-apps/libv4l/libv4l1/libv4l1-priv.h b/v4l2-apps/libv4l/libv4l1/libv4l1-priv.h
new file mode 100644
index 000000000..651599255
--- /dev/null
+++ b/v4l2-apps/libv4l/libv4l1/libv4l1-priv.h
@@ -0,0 +1,83 @@
+/*
+# (C) 2008 Hans de Goede <j.w.r.degoede@hhs.nl>
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#ifndef __LIBV4L1_PRIV_H
+#define __LIBV4L1_PRIV_H
+
+#include <stdio.h>
+#include <pthread.h>
+
+/* On 32 bits archs we always use mmap2, on 64 bits archs there is no mmap2 */
+#ifdef __NR_mmap2
+#define SYS_mmap2 __NR_mmap2
+#define MMAP2_PAGE_SHIFT 12
+#else
+#define SYS_mmap2 SYS_mmap
+#define MMAP2_PAGE_SHIFT 0
+#endif
+
+#define V4L1_MAX_DEVICES 16
+#define V4L1_NO_FRAMES 4
+#define V4L1_FRAME_BUF_SIZE (4096 * 4096)
+
+extern FILE *v4l1_log_file;
+
+#define V4L1_LOG_ERR(...) \
+ do { \
+ if (v4l1_log_file) { \
+ fprintf(v4l1_log_file, "libv4l1: error " __VA_ARGS__); \
+ fflush(v4l1_log_file); \
+ } else \
+ fprintf(stderr, "libv4l1: error " __VA_ARGS__); \
+ } while(0)
+
+#define V4L1_LOG_WARN(...) \
+ do { \
+ if (v4l1_log_file) { \
+ fprintf(v4l1_log_file, "libv4l1: warning " __VA_ARGS__); \
+ fflush(v4l1_log_file); \
+ } else \
+ fprintf(stderr, "libv4l1: warning " __VA_ARGS__); \
+ } while(0)
+
+#define V4L1_LOG(...) \
+ do { \
+ if (v4l1_log_file) { \
+ fprintf(v4l1_log_file, "libv4l1: " __VA_ARGS__); \
+ fflush(v4l1_log_file); \
+ } \
+ } while(0)
+
+struct v4l1_dev_info {
+ int fd;
+ int flags;
+ int open_count;
+ int v4l1_frame_buf_map_count;
+ pthread_mutex_t stream_lock;
+ unsigned int depth;
+ unsigned int v4l1_pal; /* VIDEO_PALETTE */
+ unsigned int v4l2_pixfmt; /* V4L2_PIX_FMT */
+ unsigned int min_width, min_height, max_width, max_height;
+ unsigned int width, height;
+ unsigned char *v4l1_frame_pointer;
+};
+
+/* From log.c */
+void v4l1_log_ioctl(unsigned long int request, void *arg, int result);
+
+#endif