justinjoy / gst-android-camera

GNU Lesser General Public License v2.1
32 stars 9 forks source link

Continuous video focus mode #4

Closed the-information-guy closed 6 years ago

the-information-guy commented 6 years ago

Hey,

I am trying to set the continuous video focus mode (autofocus) on ahcsrc

So far, can't get it working with each of the following :

g_object_set (ahc->ahcsrc, GST_PHOTOGRAPHY_PROP_FOCUS_MODE, 7, NULL);
g_object_set (ahc->ahcsrc, GST_PHOTOGRAPHY_PROP_FOCUS_MODE, GST_PHOTOGRAPHY_FOCUS_MODE_CONTINUOUS_EXTENDED, NULL);

Any idea ? :)

Thanks

justinjoy commented 6 years ago

The feature is mapped to FOCUS_MODE_CONTINUOUS_VIDEO. According to the API doc, if autofocus is enabled, the focus is locked.

Did you check whether it works if auto focus is cancelled before calling it? You might need to call gst_photography_set_autofocus with FALSE to cancel autofocus.

justinjoy commented 6 years ago

If it doesn't work even after cancelling auto focus, please file a bug on bugzilla.

the-information-guy commented 6 years ago

Assuming ahc->ahcsrc is the GstPhotography* element used as param in the set_autofocusmethod :

gst_photography_set_autofocus(ahc->ahcsrc, FALSE);
g_object_set(ahc->ahcsrc, GST_PHOTOGRAPHY_PROP_FOCUS_MODE, GST_PHOTOGRAPHY_FOCUS_MODE_CONTINUOUS_EXTENDED, NULL);

That is still not auto focusing by itself

justinjoy commented 6 years ago

@the-information-guy Please, check 56df844c09a5f1495cfc670f7b96cc3f701f1245 :)

the-information-guy commented 6 years ago

Thanks 👍