[sugar] controlling AGC of camera on the XO

Arjun Sarwal arjun at laptop.org
Thu Feb 21 19:59:39 EST 2008


I need to turn OFF the AGC of the camera on the XO within my Activity.


I have found some pieces of code which I think might be relevant

(A)
in
olpc-2.6/drivers/media/video/pwc/pwc-ctrl.c

int pwc_set_agc(struct pwc_device *pdev, int mode, int value)
{
        char buf;
        int ret;

        if (mode)
                buf = 0x0; /* auto */
        else
                buf = 0xff; /* fixed */

        ret = SendControlMsg(SET_LUM_CTL, AGC_MODE_FORMATTER, 1);

        if (!mode && ret >= 0) {
                if (value < 0)
                        value = 0;
                if (value > 0xffff)
                        value = 0xffff;
                buf = (value >> 10) & 0x3F;
                ret = SendControlMsg(SET_LUM_CTL, PRESET_AGC_FORMATTER, 1);
        }
        if (ret < 0)
                return ret;
        return 0;
}

and

(B)
in
olpc-2.6/drivers/media/video/pwc/pwc-v4l.c

 case V4L2_CID_AUTOGAIN:
                                        ret = pwc_get_agc(pdev, &c->value);
                                        if (ret<0)
                                                return -EINVAL;
                                        c->value = (c->value < 0)?1:0;





My questions are  :

(1) Am I poking in the right place ?
(2) How do I go about developing a python wrapper? for this ?


many thanks in advance.
Arjun


More information about the Sugar mailing list