VoiSmart / pjsip-android

SIP Service for Android based on PJSIP
http://www.pjsip.org/
Apache License 2.0
290 stars 140 forks source link

Crash when outgoing video call #179

Open SmartSystemElectronics opened 1 year ago

SmartSystemElectronics commented 1 year ago

In my codes, when I create call and after previewing video start, it will be crash.

Crash is happening in this line -->> currentCall.vidPrev.start(vidPrevParam);

    if (currentCall != null && currentCall.vidWin != null && currentCall.vidPrev != null) {
            try {
                epGlobal.libRegisterThread("videocall");
            } catch (Exception e) {
                e.printStackTrace();
            }

            VideoWindowHandle vidWH = new VideoWindowHandle();
            vidWH.getHandle().setWindow(holder.getSurface());
            VideoPreviewOpParam vidPrevParam = new VideoPreviewOpParam();
            vidPrevParam.setWindow(vidWH);

            try {
                currentCall.vidPrev.start(vidPrevParam);
            } catch (Exception e) {
                e.printStackTrace();
                Log.e(TAG,"error in starting video: " + e.getLocalizedMessage());
            }
    } 

The error logs are here;

1 2 3

I can create voice call successfully, but in the other hand I cannot with video. Can you anyone help me?

aenonGit commented 1 year ago

Have you set the camera manager? Which version of the lib are you using? Have you tried not registering a dedicated thread for videocall? Have you tried just doing things like in the startPreviewVideoFeed method ?

SmartSystemElectronics commented 1 year ago

1 - I didn't set and I dont know how to and when set camera manager 2 - 4.0.2 3 - I registered my video call with libregisterthread(); 4 - Yeah, as you can see, the method I use is same with yours startPreviewVideoFeed.

SmartSystemElectronics commented 1 year ago

On the other hand, callMediaInfo.getVideoIncomingWindowId() returns -1, why?

aenonGit commented 1 year ago
  1. SipServiceCommand.setCameraManager(getSystemService(Context.CAMERA_SERVICE) as CameraManager)
  2. what? pjsip-android latest version is 2.9.3
  3. yeah I see that, you sould try NOT to register a dedicated thread
  4. if it was the same you wouldn't have registered a dedicated thread
SmartSystemElectronics commented 1 year ago

1- I did it, but same result 2- How can I get the version of pjsip-android? 3- Ok, i edited it but my app crashes when I delete that

aenonGit commented 1 year ago
  1. how do u integrate the lib in your app? Either you have set the version in the github dependency version string, or if you cloned the repo in yuour project, you can read the app/build.gradle file to check the version