Is lens_wait_readytotakepic(64) necessary to change a prop value?

Started by Marsu42, April 08, 2013, 12:28:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Marsu42

I installed PROP_INT and PROP_HANDLER for drive, af, iso, metering and ae where they didn't exist - everything works fine (except af, see other question in thread). However in lens.c I saw that before changing the prop there is a lens_wait_readytotakepic() and afterwards a short msleep() - is this necessary or good practice for changing props in general like the ones I mentioned?

void lens_set_drivemode( int dm )
{
    lens_wait_readytotakepic(64);
    prop_request_change( PROP_DRIVE, &dm, 4 );
    msleep(10);
}


a1ex

Since properties are changed in another task (PropMgr), it's a good idea to wait in order to give that task a chance to run.

This won't guarantee that the change was operated; to be sure, one has to wait until the prop handler is fired.

Trying to change camera settings while taking a picture will not work in most cases - so you have to wait. The entire waiting thing is a heuristic (trial and error).

Marsu42

Quote from: a1ex on April 08, 2013, 12:52:58 PM
Since properties are changed in another task (PropMgr), it's a good idea to wait in order to give that task a chance to run.

Is the 64 value definitive or a rough guess? As far as I see it this is responsible for the perceived lag when using ml features like exposure lock? Would it be possible to try to shorten it a bit, or would this invite bugs?