~ubuntu-branches/ubuntu/precise/v4l-utils/precise

« back to all changes in this revision

Viewing changes to lib/include/libv4l1.h

  • Committer: Bazaar Package Importer
  • Author(s): Gregor Jasny
  • Date: 2010-02-28 19:44:15 UTC
  • Revision ID: james.westby@ubuntu.com-20100228194415-067hdj8rvawj91zw
Tags: upstream-0.7.90
ImportĀ upstreamĀ versionĀ 0.7.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
#             (C) 2008 Hans de Goede <hdegoede@redhat.com>
 
3
 
 
4
# This program is free software; you can redistribute it and/or modify
 
5
# it under the terms of the GNU Lesser General Public License as published by
 
6
# the Free Software Foundation; either version 2.1 of the License, or
 
7
# (at your option) any later version.
 
8
#
 
9
# This program is distributed in the hope that it will be useful,
 
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
# GNU Lesser General Public License for more details.
 
13
#
 
14
# You should have received a copy of the GNU Lesser General Public License
 
15
# along with this program; if not, write to the Free Software
 
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
17
*/
 
18
 
 
19
#ifndef __LIBV4L1_H
 
20
#define __LIBV4L1_H
 
21
 
 
22
#ifdef __cplusplus
 
23
extern "C" {
 
24
#endif /* __cplusplus */
 
25
 
 
26
#include <stdio.h>
 
27
#include <stdint.h>
 
28
#include <unistd.h>
 
29
 
 
30
#if __GNUC__ >= 4
 
31
#define LIBV4L_PUBLIC __attribute__ ((visibility("default")))
 
32
#else
 
33
#define LIBV4L_PUBLIC
 
34
#endif
 
35
 
 
36
/* Point this to a FILE opened for writing when you want to log error and
 
37
   status messages to a file, when NULL errors will get send to stderr */
 
38
LIBV4L_PUBLIC extern FILE *v4l1_log_file;
 
39
 
 
40
/* Just like your regular open/close/etc, except that when opening a v4l2
 
41
   capture only device, full v4l1 emulation is done including emulating the
 
42
   often not implemented in v4l2 drivers CGMBUF ioctl and v4l1 style mmap call
 
43
   in userspace.
 
44
 
 
45
   Format conversion is done if necessary when capturing. That is if you
 
46
   (try to) set a capture format which is not supported by the cam, but is
 
47
   supported by libv4lconvert then SPICT will succeed and on SYNC / read the
 
48
   data will be converted for you and returned in the request format.
 
49
 
 
50
   Note that currently libv4l1 depends on the kernel v4l1 compatibility layer
 
51
   for: 1) Devices which are not capture only, 2) Emulation of many basic
 
52
   v4l1 ioctl's which require no driver specific handling.
 
53
 
 
54
   Note that no functionality is added to v4l1 devices, so if for example an
 
55
   obscure v4l1 device is opened which only supports some weird capture format
 
56
   then libv4l1 will not be of any help (in this case it would be best to get
 
57
   the driver converted to v4l2, as v4l2 has been designed to include weird
 
58
   capture formats, like hw specific bayer compression methods).
 
59
*/
 
60
 
 
61
LIBV4L_PUBLIC int v4l1_open (const char *file, int oflag, ...);
 
62
LIBV4L_PUBLIC int v4l1_close(int fd);
 
63
LIBV4L_PUBLIC int v4l1_dup(int fd);
 
64
LIBV4L_PUBLIC int v4l1_ioctl (int fd, unsigned long int request, ...);
 
65
LIBV4L_PUBLIC ssize_t v4l1_read (int fd, void* buffer, size_t n);
 
66
LIBV4L_PUBLIC void *v4l1_mmap(void *start, size_t length, int prot, int flags, int fd,
 
67
  int64_t offset);
 
68
LIBV4L_PUBLIC int v4l1_munmap(void *_start, size_t length);
 
69
 
 
70
#ifdef __cplusplus
 
71
}
 
72
#endif /* __cplusplus */
 
73
 
 
74
#endif