Hi,
I’m developing an Android WebRTC application based on AppRTCDemo but I have a problem which I don’t know how to solve it. I have a MainActivity with settings, if a button is pressed it goes to RTCActivity which has a WebRtcClient object. The problem is, after the videoconference is done, RTCActivity finishes and it does an Intent to return to MainActivity. The app goes well so far until here, now if I try to restart the conference going again to RTCActivity the app crashes showing this error:
07-09 13:37:45.536 3817-6834/
com.app.android E/WEBRTC-JC﹕ startCapture failed
java.lang.RuntimeException: Fail to connect to camera service
at android.hardware.Camera.native_setup(Native Method)
at android.hardware.Camera.<init>(Camera.java:353)
at android.hardware.Camera.open(Camera.java:312)
at org.webrtc.videoengine.VideoCaptureAndroid.startCaptureOnCameraThread(VideoCaptureAndroid.java:145)
at org.webrtc.videoengine.VideoCaptureAndroid.access$400(VideoCaptureAndroid.java:40)
at org.webrtc.videoengine.VideoCaptureAndroid$2.run(VideoCaptureAndroid.java:132)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at org.webrtc.videoengine.VideoCaptureAndroid$CameraThread.run(VideoCaptureAndroid.java:107)
07-09 13:37:45.536 3817-6829/
com.app.android D/SensorManager﹕ registerListener :: handle = 0 name= LSM330DLC 3-axis Accelerometer delay= 200000 Listener= android.view.OrientationEventListener$SensorEventListenerImpl@41b08d48
07-09 13:37:45.536 3817-6829/
com.app.android E/libjingle﹕ Error(webrtcvideocapturer.cc:274): Camera 'Camera 1, Facing front, Orientation 0' failed to start
07-09 13:37:45.541 3817-6830/
com.app.android E/libjingle﹕ Error(common.cc:76): ../../talk/app/webrtc/videosource.cc(458): ASSERT FAILED: state_ != new_state @ SetState
07-09 13:46:20.596 7361-7363/
com.app.android D/dalvikvm﹕ GC_CONCURRENT freed 391K, 15% free 7330K/8583K, paused 12ms+2ms, total 32ms
It seems that the app can’t catch the VideoCapturer again eventhough I disposed the VideoCapture before the activity finishes. Does anyone know how to solve it?