diff mbox

[v2,RESEND] libv4lconvert: clarify the behavior and resulting restrictions of v4lconvert_convert()

Message ID 1350838722-15074-1-git-send-email-fschaefer.oss@googlemail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Frank Schäfer Oct. 21, 2012, 4:58 p.m. UTC
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
---
 lib/include/libv4lconvert.h |   20 ++++++++++++++++++--
 1 Datei geändert, 18 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)

Comments

Frank Schäfer Oct. 28, 2012, 1:02 p.m. UTC | #1
Am 21.10.2012 19:58, schrieb Frank Schäfer:
> Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
> ---
>  lib/include/libv4lconvert.h |   20 ++++++++++++++++++--
>  1 Datei geändert, 18 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)
>
> diff --git a/lib/include/libv4lconvert.h b/lib/include/libv4lconvert.h
> index 167b57d..509655e 100644
> --- a/lib/include/libv4lconvert.h
> +++ b/lib/include/libv4lconvert.h
> @@ -89,8 +89,24 @@ LIBV4L_PUBLIC int v4lconvert_needs_conversion(struct v4lconvert_data *data,
>  		const struct v4l2_format *src_fmt,   /* in */
>  		const struct v4l2_format *dest_fmt); /* in */
>  
> -/* return value of -1 on error, otherwise the amount of bytes written to
> -   dest */
> +/* This function does the following conversions:
> +    - format conversion
> +    - cropping
> +   if enabled:
> +    - processing (auto whitebalance, auto gain, gamma correction)
> +    - horizontal/vertical flipping
> +    - 90 degree (clockwise) rotation
> +   
> +   NOTE: the last 3 steps are enabled/disabled depending on
> +    - the internal device list
> +    - the state of the (software emulated) image controls 
> +  
> +   Therefore this function should
> +    - not be used when getting the frames from libv4l
> +    - be called only once per frame
> +   Otherwise this may result in unintended double conversions !
> +  
> +   Returns the amount of bytes written to dest and -1 on error */
>  LIBV4L_PUBLIC int v4lconvert_convert(struct v4lconvert_data *data,
>  		const struct v4l2_format *src_fmt,  /* in */
>  		const struct v4l2_format *dest_fmt, /* in */
Ping !

Hans, what's wrong with this patch ? You asked for it !
Btw, I prefer clear answers. So if you changed your mind and don't want
it anymore, please tell me.

Regards,
Frank

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hans de Goede Nov. 1, 2012, 9 p.m. UTC | #2
Hi,

Thanks, Looks good, added to git-master (with some trailing whitespace cleanups)

Regards,

Hans


On 10/21/2012 06:58 PM, Frank Schäfer wrote:
> Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
> ---
>   lib/include/libv4lconvert.h |   20 ++++++++++++++++++--
>   1 Datei geändert, 18 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)
>
> diff --git a/lib/include/libv4lconvert.h b/lib/include/libv4lconvert.h
> index 167b57d..509655e 100644
> --- a/lib/include/libv4lconvert.h
> +++ b/lib/include/libv4lconvert.h
> @@ -89,8 +89,24 @@ LIBV4L_PUBLIC int v4lconvert_needs_conversion(struct v4lconvert_data *data,
>   		const struct v4l2_format *src_fmt,   /* in */
>   		const struct v4l2_format *dest_fmt); /* in */
>
> -/* return value of -1 on error, otherwise the amount of bytes written to
> -   dest */
> +/* This function does the following conversions:
> +    - format conversion
> +    - cropping
> +   if enabled:
> +    - processing (auto whitebalance, auto gain, gamma correction)
> +    - horizontal/vertical flipping
> +    - 90 degree (clockwise) rotation
> +
> +   NOTE: the last 3 steps are enabled/disabled depending on
> +    - the internal device list
> +    - the state of the (software emulated) image controls
> +
> +   Therefore this function should
> +    - not be used when getting the frames from libv4l
> +    - be called only once per frame
> +   Otherwise this may result in unintended double conversions !
> +
> +   Returns the amount of bytes written to dest and -1 on error */
>   LIBV4L_PUBLIC int v4lconvert_convert(struct v4lconvert_data *data,
>   		const struct v4l2_format *src_fmt,  /* in */
>   		const struct v4l2_format *dest_fmt, /* in */
>
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/lib/include/libv4lconvert.h b/lib/include/libv4lconvert.h
index 167b57d..509655e 100644
--- a/lib/include/libv4lconvert.h
+++ b/lib/include/libv4lconvert.h
@@ -89,8 +89,24 @@  LIBV4L_PUBLIC int v4lconvert_needs_conversion(struct v4lconvert_data *data,
 		const struct v4l2_format *src_fmt,   /* in */
 		const struct v4l2_format *dest_fmt); /* in */
 
-/* return value of -1 on error, otherwise the amount of bytes written to
-   dest */
+/* This function does the following conversions:
+    - format conversion
+    - cropping
+   if enabled:
+    - processing (auto whitebalance, auto gain, gamma correction)
+    - horizontal/vertical flipping
+    - 90 degree (clockwise) rotation
+   
+   NOTE: the last 3 steps are enabled/disabled depending on
+    - the internal device list
+    - the state of the (software emulated) image controls 
+  
+   Therefore this function should
+    - not be used when getting the frames from libv4l
+    - be called only once per frame
+   Otherwise this may result in unintended double conversions !
+  
+   Returns the amount of bytes written to dest and -1 on error */
 LIBV4L_PUBLIC int v4lconvert_convert(struct v4lconvert_data *data,
 		const struct v4l2_format *src_fmt,  /* in */
 		const struct v4l2_format *dest_fmt, /* in */