Skip to contentSkip to conversation

libv4lconvert: clarify the behavior and resulting restrictions of v4lconvert_convert()

PATCH Superseded Frank Schäfer 2 participants 3 messages Oct 3, 2012 – Oct 7, 2012 Media (V4L/DVB)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libv4lconvert: clarify the behavior and resulting restrictions of v4lconvert_convert()

---
 lib/include/libv4lconvert.h |   20 ++++++++++++++++++--

1 Datei geändert, 18 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)

lib/include/libv4lconvert.h +18 -2
index 167b57d..509655e 100644
@@ -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 an -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 */
Signature · 1 line
1.7.10.4
#1 lore raw

Hi Frank,

Thanks for all your work on this. I'm afraid that atm I'm very busy with work, so I don't have time to review your patches. I hope to find some time for this next weekend...

Regards,

Hans

Quoted 37 lines · Frank Schäfer
---
  lib/include/libv4lconvert.h |   20 ++++++++++++++++++--

1 Datei geändert, 18 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)

lib/include/libv4lconvert.h +18 -2
index 167b57d..509655e 100644
@@ -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 an -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 */
#2 lore raw

Hi Hans,

Am 07.10.2012 15:05, schrieb Hans de Goede:

Quoted 5 lines

Hi Frank,

Thanks for all your work on this. I'm afraid that atm I'm very busy with work, so I don't have time to review your patches. I hope to find some time for this next weekend...

No problem, I will send you a reminder in 2 weeks. ;)
I didn't have much time yet to work on further libv4lconvert patches, too.

Regards,
Frank

Quoted 46 lines

Regards,

Hans

Quoted 39 lines · Frank Schäfer
---
  lib/include/libv4lconvert.h |   20 ++++++++++++++++++--

1 Datei geändert, 18 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)

lib/include/libv4lconvert.h +0 -1
index 167b57d..509655e 100644
@@ -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

lib/include/libv4lconvert.h +18 -1
-   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 an -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 */