Hello All,
I've discovered a slight bug in the Capture_SetAttribute function. It
seems to check the range of new_value as being between 0 and 65535.
This is wrong as v4l2 controls are defined as being signed 32bit
integers. It should really be checking that the range is between the
attributes min and max values, This is an issue with the webcam I use
and help develop as its hue is implemented with a range of -180 to
180, with 0 being the default normal hue.
The attached patch should fix this issue allowing controls to use
negative values.
Brian Johnson
diff -Naur amsn.orig/utils/linux/capture/capture.c amsn/utils/linux/capture/capture.c
--- amsn.orig/utils/linux/capture/capture.c 2009-03-20 05:19:07.000000000 -0400
+++ amsn/utils/linux/capture/capture.c 2009-03-20 05:20:20.000000000 -0400
@@ -867,15 +867,13 @@
return TCL_OK;
}
- if (new_value > 65535 || new_value < 0) {
-// Tcl_SetResult(interp, "Invalid value. It should be between 0 and 65535" , TCL_STATIC);
-// return TCL_ERROR;
- return TCL_OK;
- }
-
// Get the ng_attribute struct from the attribute id
attr = ng_attr_byid(&(capItem->dev), attribute);
+ if (new_value > attr->max || new_value < attr->min) {
+ return TCL_OK;
+ }
+
// Set attribute value using attribute->write proc...
if (attr != NULL) {
if (new_value != -1)
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel