summaryrefslogtreecommitdiff
path: root/v4l2-apps/libv4l/include
diff options
context:
space:
mode:
authorhans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain>2009-04-14 15:03:07 +0200
committerhans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain>2009-04-14 15:03:07 +0200
commit58d3334b54c207b8e04e7035969e0c2acfa1ce73 (patch)
tree79bfcb91241d0468871696b189ac8ee344ea1ed0 /v4l2-apps/libv4l/include
parent10a09b9ec6e08fb95c36f26d7f69834b0387386b (diff)
downloadmediapointer-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/include')
-rw-r--r--v4l2-apps/libv4l/include/libv4lconvert.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/v4l2-apps/libv4l/include/libv4lconvert.h b/v4l2-apps/libv4l/include/libv4lconvert.h
index fcc31dace..7901b35dc 100644
--- a/v4l2-apps/libv4l/include/libv4lconvert.h
+++ b/v4l2-apps/libv4l/include/libv4lconvert.h
@@ -42,18 +42,30 @@ struct v4lconvert_data;
LIBV4L_PUBLIC struct v4lconvert_data *v4lconvert_create(int fd);
LIBV4L_PUBLIC void v4lconvert_destroy(struct v4lconvert_data *data);
+/* When doing flipping / rotating / video-processing, only supported
+ destination formats can be used (as flipping / rotating / video-processing
+ is not supported on other formats). This function can be used to query
+ if that is the case. */
+LIBV4L_PUBLIC int v4lconvert_supported_dst_fmt_only(
+ struct v4lconvert_data *data);
+
/* With regards to dest_fmt just like VIDIOC_TRY_FMT, except that the try
format will succeed and return the requested V4L2_PIX_FMT_foo in dest_fmt if
the cam has a format from which v4lconvert can convert to dest_fmt.
The real format to which the cam should be set is returned through src_fmt
- when not NULL. */
+ when not NULL.
+ Note that just like the real VIDIOC_TRY_FMT this function will change the
+ dest_fmt when not supported. This includes changing it to a supported
+ destination format when trying a native format of the camera and
+ v4lconvert_supported_dst_fmt_only() returns true. */
LIBV4L_PUBLIC int v4lconvert_try_format(struct v4lconvert_data *data,
struct v4l2_format *dest_fmt, /* in / out */
struct v4l2_format *src_fmt /* out */
);
-/* Just like VIDIOC_ENUM_FMT, except that the emulated formats are added at
- the end of the list */
+/* Like VIDIOC_ENUM_FMT, but the emulated formats are added at the end of the
+ list, except if flipping / processing is active for the device, then only
+ supported destination formats are listed */
LIBV4L_PUBLIC int v4lconvert_enum_fmt(struct v4lconvert_data *data, struct v4l2_fmtdesc *fmt);
/* Is conversion necessary or can the app use the data directly? */
@@ -89,6 +101,9 @@ LIBV4L_PUBLIC int v4lconvert_vidioc_g_ctrl(struct v4lconvert_data *data,
LIBV4L_PUBLIC int v4lconvert_vidioc_s_ctrl(struct v4lconvert_data *data,
void *arg);
+/* Is the passed in pixelformat supported as destination format ? */
+LIBV4L_PUBLIC int v4lconvert_supported_dst_format(unsigned int pixelformat);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */