Ask Your Question

Revision history [back]

android native camera crash

Hi,

I know there are lots of posts regarding Android native camera access issues, but I think my case differ a little bit from other to post my own question... (hope i'm right :-) )

I'm trying to open a camera from a cpp code called from another library (libpd).

When I call : new cv::VideoCapture(CV_CAP_ANDROID + 0);

The app crashes, logcat *:E tells : E/SensorManager(21134): thread start E/OpenCV_for_Tegra(21134): Tegra Version detected: 0 E/AudioPolicyService( 1848): getOutput() tid 1848 ++ E/AudioPolicyService( 1848): getOutput() tid 1848 -- E/SpannableStringBuilder(21134): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length E/SpannableStringBuilder(21134): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length E/OpenCV::camera(21134): ||libnative_camera_r2.3.3.so E/OpenCV::camera(21134): ||libnative_camera_r4.3.0.so E/OpenCV::camera(21134): ||libnative_camera_r4.2.0.so E/OpenCV::camera(21134): ||libnative_camera_r2.2.0.so E/OpenCV::camera(21134): ||libnative_camera_r4.0.0.so E/OpenCV::camera(21134): ||libnative_camera_r4.0.3.so E/OpenCV::camera(21134): ||libnative_camera_r4.1.1.so E/OpenCV::camera(21134): ||libnative_camera_r3.0.1.so E/DivXPlugin( 1847): DivXPlugin::onOpenDecryptSession() Not a Divx File. E/OpenCV::camera(21134): calling (*pGetPropertyC)(0x4d9a96f0, 0) E/OpenCV::camera(21134): calling (*pGetPropertyC)(0x4d9a96f0, 1) E/OpenCV::camera(21134): calling (*pGetPropertyC)(0x4d9a96f0, 4) E/cv::error()(21134): OpenCV Error: One of arguments' values is out of range (Failed attempt to GET unsupported camera property.) in virtual double CvCapture_Android::getProperty(int), file /home/reports/ci/slave_desktop/50-SDK/opencv/modules/highgui/src/cap_android.cpp, line 293 F/libc (21134): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 22225 (AudioTrack) E/SecCameraHardware( 1848): Could not dequeue gralloc buffer! E/ISecCameraHardware( 1848): previewThread: error, nativeFlushSurface E/InputDispatcher( 2129): channel ~ Channel is unrecoverably broken and will be disposed! E/SecCameraHardware( 1848): Could not dequeue gralloc buffer! E/InputDispatcher( 2129): channel ~ Channel is unrecoverably broken and will be disposed! E/ISecCameraHardware( 1848): previewThread: error, nativeFlushSurface E/SecCameraHardware( 1848): Could not dequeue gralloc buffer! E/ISecCameraHardware( 1848): previewThread: error, nativeFlushSurface E/SecCameraHardware( 1848): Could not dequeue gralloc buffer! E/ISecCameraHardware( 1848): previewThread: error, nativeFlushSurface E/SecCameraHardware( 1848): Could not dequeue gralloc buffer! E/ISecCameraHardware( 1848): previewThread: error, nativeFlushSurface E/ISecCameraHardware( 1848): setPreviewWindow: NULL Surface! E/PowerManagerService( 2129): CurLock p:3 mPS:1

I'm surprised because the sample Native Activity works fine.

I'm using OpenCV4Android 2.4.6 r2 and targeting to Android 4.3 (also tried 4.1.2).

Could someone help me on this ?

Thanks ! a

android native camera crash

Hi,

I know there are lots of posts regarding Android native camera access issues, but I think my case differ a little bit from other to post my own question... (hope i'm right :-) )

I'm trying to open a camera from a cpp code called from another library (libpd).

When I call : new cv::VideoCapture(CV_CAP_ANDROID + 0);

The app crashes, logcat *:E tells : :

E/SensorManager(21134): thread start
E/OpenCV_for_Tegra(21134): Tegra Version detected: 0
E/AudioPolicyService( 1848): getOutput() tid 1848 ++
E/AudioPolicyService( 1848): getOutput() tid 1848 --
E/SpannableStringBuilder(21134): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
E/SpannableStringBuilder(21134): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
E/OpenCV::camera(21134): ||libnative_camera_r2.3.3.so
E/OpenCV::camera(21134): ||libnative_camera_r4.3.0.so
E/OpenCV::camera(21134): ||libnative_camera_r4.2.0.so
E/OpenCV::camera(21134): ||libnative_camera_r2.2.0.so
E/OpenCV::camera(21134): ||libnative_camera_r4.0.0.so
E/OpenCV::camera(21134): ||libnative_camera_r4.0.3.so
E/OpenCV::camera(21134): ||libnative_camera_r4.1.1.so
E/OpenCV::camera(21134): ||libnative_camera_r3.0.1.so
E/DivXPlugin( 1847): DivXPlugin::onOpenDecryptSession() Not a Divx File.
E/OpenCV::camera(21134): calling (*pGetPropertyC)(0x4d9a96f0, 0)
E/OpenCV::camera(21134): calling (*pGetPropertyC)(0x4d9a96f0, 1)
E/OpenCV::camera(21134): calling (*pGetPropertyC)(0x4d9a96f0, 4)
E/cv::error()(21134): OpenCV Error: One of arguments' values is out of range (Failed attempt to GET unsupported camera property.) in virtual double CvCapture_Android::getProperty(int), file /home/reports/ci/slave_desktop/50-SDK/opencv/modules/highgui/src/cap_android.cpp, line 293
F/libc    (21134): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 22225 (AudioTrack)
E/SecCameraHardware( 1848): Could not dequeue gralloc buffer!
E/ISecCameraHardware( 1848): previewThread: error, nativeFlushSurface
E/InputDispatcher( 2129): channel ~ Channel is unrecoverably broken and will be disposed!
E/SecCameraHardware( 1848): Could not dequeue gralloc buffer!
E/InputDispatcher( 2129): channel ~ Channel is unrecoverably broken and will be disposed!
E/ISecCameraHardware( 1848): previewThread: error, nativeFlushSurface
E/SecCameraHardware( 1848): Could not dequeue gralloc buffer!
E/ISecCameraHardware( 1848): previewThread: error, nativeFlushSurface
E/SecCameraHardware( 1848): Could not dequeue gralloc buffer!
E/ISecCameraHardware( 1848): previewThread: error, nativeFlushSurface
E/SecCameraHardware( 1848): Could not dequeue gralloc buffer!
E/ISecCameraHardware( 1848): previewThread: error, nativeFlushSurface
E/ISecCameraHardware( 1848): setPreviewWindow: NULL Surface!
E/PowerManagerService( 2129): CurLock p:3 mPS:1

I'm surprised because the sample Native Activity works fine.

I'm using OpenCV4Android 2.4.6 r2 and targeting to Android 4.3 (also tried 4.1.2).

Could someone help me on this ?

Thanks ! a