1
votes

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)

1
Make sure you release the camera resources when finishing a call. In my case i do videoSource.stop(). - Samuel Méndez
Thanks @SamuelMéndez it worked perfect... The video is now showing on second call, but now the below error is coming and the app crashed java.lang.AssertionError: Expected condition to be true - Akshay Bissa
I suggest opening a new question because is another error probably from another part of your code. And i will post my comment as an answer in case you want to mark it as the correct one. - Samuel Méndez

1 Answers

1
votes

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