DJI-Mobile-SDK-Tutorials / Android-FPVDemo

This demo shows how to create a simple FPV view and how to take photo and record video using DJI Mobile SDK.
MIT License
62 stars 81 forks source link

Auto Focus #32

Closed il421 closed 5 years ago

il421 commented 5 years ago

Hey,

I need to implement autofocus fo my video app. I use this: camera.getCamera().setFocusMode(SettingsDefinitions.FocusMode.AUTO, null);

where exactly, or at what moment I need to include it.

I tried but my app is crashed after this...

Please help me

gduflo commented 5 years ago

I don't know if this the same case as mine, but for me, getCamera() returns null. So if it is the case for you as well, it is normal it crashes since setFocusMode(...) would be applied on a null object.

By the way, if you have solved this problem, I am interested by your solution.

gduflo commented 5 years ago

If your problem was that getCamera() returns null: https://github.com/DJI-Mobile-SDK-Tutorials/Android-FPVDemo/issues/34#issuecomment-436585696