diff options
author | hans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain> | 2009-04-14 15:03:07 +0200 |
---|---|---|
committer | hans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain> | 2009-04-14 15:03:07 +0200 |
commit | 58d3334b54c207b8e04e7035969e0c2acfa1ce73 (patch) | |
tree | 79bfcb91241d0468871696b189ac8ee344ea1ed0 /v4l2-apps/libv4l/libv4lconvert/control | |
parent | 10a09b9ec6e08fb95c36f26d7f69834b0387386b (diff) | |
download | mediapointer-dvb-s2-58d3334b54c207b8e04e7035969e0c2acfa1ce73.tar.gz mediapointer-dvb-s2-58d3334b54c207b8e04e7035969e0c2acfa1ce73.tar.bz2 |
libv4l: Only allow supported destination formats when doing processing
From: Hans de Goede <hdegoede@redhat.com>
Only report / allow supported destination formats in enum_fmt / try_fmt /
g_fmt / s_fmt when processing, rotating or flipping.
Priority: normal
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'v4l2-apps/libv4l/libv4lconvert/control')
-rw-r--r-- | v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c | 5 | ||||
-rw-r--r-- | v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.h | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c b/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c index de8b608f9..b09ffc582 100644 --- a/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c +++ b/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c @@ -339,3 +339,8 @@ int v4lcontrol_get_ctrl(struct v4lcontrol_data *data, int ctrl) return 0; } + +/* See the comment about this in libv4lconvert.h */ +int v4lcontrol_needs_conversion(struct v4lcontrol_data *data) { + return data->flags || data->controls; +} diff --git a/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.h b/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.h index 344e68055..28308bc55 100644 --- a/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.h +++ b/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.h @@ -39,6 +39,11 @@ void v4lcontrol_destroy(struct v4lcontrol_data *data); /* Functions used by v4lprocessing to get the control state */ int v4lcontrol_get_flags(struct v4lcontrol_data *data); int v4lcontrol_get_ctrl(struct v4lcontrol_data *data, int ctrl); +/* Check if we must go through the conversion path (and thus alloc conversion + buffers, etc. in libv4l2). Note this always return 1 if we *may* need + rotate90 / flipping / processing, as if we actually need this may change + on the fly while the stream is active. */ +int v4lcontrol_needs_conversion(struct v4lcontrol_data *data); /* Functions used by v4lconvert to pass vidioc calls from libv4l2 */ int v4lcontrol_vidioc_queryctrl(struct v4lcontrol_data *data, void *arg); |