From 548fb8aa23fe31401ba3dae823d31f9a73cc101f Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期二, 16 七月 2024 10:01:54 +0800
Subject: [PATCH] backup

---
 HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/activity/HDLLinphoneReverseCallActivity.java |   30 +++++++++++++++++++++++++++---
 1 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/activity/HDLLinphoneReverseCallActivity.java b/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/activity/HDLLinphoneReverseCallActivity.java
index 9420018..362b933 100644
--- a/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/activity/HDLLinphoneReverseCallActivity.java
+++ b/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/activity/HDLLinphoneReverseCallActivity.java
@@ -32,6 +32,7 @@
 import com.hdl.hdllinphonesdk.utils.HDLLog;
 
 import org.linphone.core.Call;
+import org.linphone.core.CallParams;
 import org.linphone.core.Core;
 import org.linphone.core.CoreListenerStub;
 
@@ -74,6 +75,7 @@
     private CoreListenerStub mCoreListener;
 
     private String deviceSipAccount;//璁惧SIP璐﹀彿
+    private boolean enableVideo = false;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -265,7 +267,7 @@
      */
     private void onClickUnlock() {
         try {
-            AlertDialog.Builder builder = new AlertDialog.Builder(this,R.style.CustomAlertDialog);
+            AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.CustomAlertDialog);
             builder.setTitle(R.string.lp_tipStr);
             builder.setMessage(R.string.tip_confirm_unlock);
 
@@ -291,8 +293,8 @@
 
             AlertDialog dialog = builder.create();
             dialog.show();
-        }catch (Exception exception){
-            Log.e(TAG,  exception.getMessage());
+        } catch (Exception exception) {
+            Log.e(TAG, exception.getMessage());
         }
 
     }
@@ -419,6 +421,13 @@
                     // we missed the first one
                     showToast(getString(R.string.lp_endOfCallStr));
                     finish();
+                } else if (state == Call.State.StreamsRunning) {
+                    if (HDLLinphoneKit.getInstance().getIntercomeType().equals(HDLLinphoneKit.INTER_PHONE_TYPE_HDL)) {
+                        if (!enableVideo) {
+                            enableVideo(core, call);
+                            enableVideo = true;
+                        }
+                    }
                 }
             }
         };
@@ -435,6 +444,21 @@
 
     }
 
+
+    void enableVideo(Core core, Call call) {
+//        Call currentCall = HDLLinphoneService.getCore().getCurrentCall();
+
+        CallParams params = call.getCurrentParams();
+        if (params == null) {
+            params = core.createCallParams(call);
+        }
+        params.enableVideo(true);
+        params.enableLowBandwidth(false);
+        params.setAudioBandwidthLimit(0); // disable limitation
+
+        call.update(params);
+    }
+
     /**
      * onDestroyLinphone
      */

--
Gitblit v1.8.0