2
# (C) 2008-2009 Elmar Kleijn <elmar_kleijn@hotmail.com>
3
# (C) 2008-2009 Sjoerd Piepenbrink <need4weed@gmail.com>
4
# (C) 2008-2009 Radjnies Bhansingh <radjnies@gmail.com>
5
# (C) 2008-2009 Hans de Goede <hdegoede@redhat.com>
7
# This program is free software; you can redistribute it and/or modify
8
# it under the terms of the GNU Lesser General Public License as published by
9
# the Free Software Foundation; either version 2.1 of the License, or
10
# (at your option) any later version.
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU Lesser General Public License for more details.
17
# You should have received a copy of the GNU Lesser General Public License
18
# along with this program; if not, write to the Free Software
19
# Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
22
#ifndef __LIBV4LCONTROL_H
23
#define __LIBV4LCONTROL_H
26
#define V4LCONTROL_HFLIPPED 0x01
27
#define V4LCONTROL_VFLIPPED 0x02
28
#define V4LCONTROL_ROTATED_90_JPEG 0x04
29
#define V4LCONTROL_WANTS_WB 0x08
30
#define V4LCONTROL_WANTS_AUTOGAIN 0x10
33
#define V4LCONTROL_WANTS_WB_AUTOGAIN (V4LCONTROL_WANTS_WB | V4LCONTROL_WANTS_AUTOGAIN)
37
V4LCONTROL_WHITEBALANCE,
41
/* All fake controls above here are auto enabled when not present in hw */
42
V4LCONTROL_AUTO_ENABLE_COUNT,
44
V4LCONTROL_AUTOGAIN_TARGET,
48
struct v4lcontrol_data;
50
struct v4lcontrol_data *v4lcontrol_create(int fd, int always_needs_conversion);
51
void v4lcontrol_destroy(struct v4lcontrol_data *data);
53
int v4lcontrol_get_bandwidth(struct v4lcontrol_data *data);
55
/* Functions used by v4lprocessing to get the control state */
56
int v4lcontrol_get_flags(struct v4lcontrol_data *data);
57
int v4lcontrol_get_ctrl(struct v4lcontrol_data *data, int ctrl);
58
/* Check if the controls have changed since the last time this function
60
int v4lcontrol_controls_changed(struct v4lcontrol_data *data);
61
/* Check if we must go through the conversion path (and thus alloc conversion
62
buffers, etc. in libv4l2). Note this always return 1 if we *may* need
63
rotate90 / flipping / processing, as if we actually need this may change
64
on the fly while the stream is active. */
65
int v4lcontrol_needs_conversion(struct v4lcontrol_data *data);
67
/* Functions used by v4lconvert to pass vidioc calls from libv4l2 */
68
int v4lcontrol_vidioc_queryctrl(struct v4lcontrol_data *data, void *arg);
69
int v4lcontrol_vidioc_g_ctrl(struct v4lcontrol_data *data, void *arg);
70
int v4lcontrol_vidioc_s_ctrl(struct v4lcontrol_data *data, void *arg);