Reclaim control of camera at runtime?

All your problems with Audio, Video and Images.

Reclaim control of camera at runtime?

Postby underminedsk » Tue Apr 20, 2010 3:31 pm

Hey,

Sometimes, (especially when debugging) I get the following exception when trying to start up the camera:

W/System.err( 791): java.lang.RuntimeException: Fail to connect to camera service
W/System.err( 791): at android.hardware.Camera.native_setup(Native Method)
W/System.err( 791): at android.hardware.Camera.<init>(Camera.java:110)
W/System.err( 791): at android.hardware.Camera.open(Camera.java:90)
W/System.err( 791): at com.Alice.utilities.CustomCameraController$3.surfaceCreated(CustomCameraController.java:90)
W/System.err( 791): at android.view.SurfaceView.updateWindow(SurfaceView.java:454)
W/System.err( 791): at android.view.SurfaceView.dispatchDraw(SurfaceView.java:287)
W/System.err( 791): at android.view.ViewGroup.drawChild(ViewGroup.java:1529)
...

presumably this is because an old instance of my application crashed and didn't properly release the camera. The only solution I've found is to restart my phone (annoying!).

Does anyone know of a way to deal with this at runtime? It would be nice to do something like call Camera.release() and then try again, but the camera API does not support such a static method call.
underminedsk
Developer
Developer
 
Posts: 26
Joined: Tue Mar 02, 2010 3:36 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 8 guests