Setting camera flash mode causes a segfault (Bug #1989)
Description
In OpenCV for Android 2.4, there is an option to set the flash mode for the native camera.
I tried to do this with the following code:
mCamera.set(Highgui.CV_CAP_PROP_ANDROID_FLASH_MODE, Highgui.CV_CAP_ANDROID_FLASH_MODE_ON);
However, this causes a segfault on my Asus Transformer TF101 running ICS:
Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)
At the beginning one of the log messages says:
[OpenCV_NativeCamera] Supported Flash Modes: null
- Have a way to query flash modes programmatically.
- Address the SIGSEGV case in native code when no flash mode is supported.
- Detect flash modes correctly on Asus TF101.
In this patch:
http://code.opencv.org/attachments/663/android-native-cam-properties.patch
I can see that there is already a check whether a flash mode is supported in line 644, but it doesn't handle the case when supported_modes is null.
Associated revisions
Bug #1989 fixed. NULL pointer check added.
Native camera libs rebuilt for bug #1989 fix.
History
Updated by Andrey Pavlenko almost 13 years ago
- Target version set to 2.4.1
- Assignee changed from Andrey Pavlenko to Alexander Smorkalov
Updated by Alexander Smorkalov almost 13 years ago
Problem was not reproduced on available devices. Fixed at revision #8499. NULL pointers check added.
OpenCV native camera uses video capture mode on Android. It means, that you cannot use flash for single image.
Updated by Alexander Smorkalov almost 13 years ago
- Status changed from Open to Done