Akshay Bissa
Akshay Bissa

Reputation: 109

java.lang.RuntimeException: Fail to connect to camera service in webrtc in android

I am using libjingle for implementing webrtc in Android Application. In that, during one application life cycle, the first call is successfully established without any errors, but after that the second call is established only video doesn't start because of this error.

The library version I am using is ver-9127. The complete logcat error is below:

CameraBase: An error occurred while connecting to camera: 0 08-23 21:10:05.695 29223-32486/com.justtotaltech.tagove.app E/VideoCapturerAndroid: startCapture failed java.lang.RuntimeException: Fail to connect to camera service at android.hardware.Camera.native_setup(Native Method) at android.hardware.Camera.(Camera.java:379) at android.hardware.Camera.open(Camera.java:329) at org.webrtc.VideoCapturerAndroid.startCaptureOnCameraThread(VideoCapturerAndroid.java:414) at org.webrtc.VideoCapturerAndroid.access$300(VideoCapturerAndroid.java:74) at org.webrtc.VideoCapturerAndroid$2.run(VideoCapturerAndroid.java:401) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at org.webrtc.VideoCapturerAndroid$CameraThread.run(VideoCapturerAndroid.java:368)

Upvotes: 1

Views: 1138

Answers (1)

Samuel Méndez
Samuel Méndez

Reputation: 611

Make sure you release the camera resources when finishing a call. In my case I do videoSource.stop()

Upvotes: 1

Related Questions