JLChen
2021-11-25 5dc625a64cf58d798929f22c3073cd06b837f87a
HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/core/service/HDLLinphoneService.java
@@ -175,12 +175,18 @@
    public void onDestroy() {
        removeAllCallback();
        logout();
        mCore.removeListener(mCoreListener);
        mTimer.cancel();
        mCore.stop();
        // A stopped Core can be started again
        // To ensure resources are freed, we must ensure it will be garbage collected
        mCore = null;
        if(mTimer != null) {
            mTimer.cancel();
        }
        if(mCore != null){
            mCore.removeListener(mCoreListener);
            mCore.stop();
            // A stopped Core can be started again
            // To ensure resources are freed, we must ensure it will be garbage collected
            mCore = null;
        }
        // Don't forget to free the singleton as well
        sInstance = null;
@@ -326,12 +332,12 @@
//        mCore.setNetworkReachable(true);
        //5.回声消除
        mCore.enableEchoCancellation(true);
        mCore.enableEchoLimiter(true);
//        mCore.enableEchoLimiter(false);
        mCore.enableMic(true);//启用麦克风
        //6.自适应码率控制
        mCore.enableAdaptiveRateControl(true);
        //7.audio 码率设置
//        mCore.getConfig().setInt("audio", "codec_bitrate_limit", 36);
        mCore.getConfig().setInt("audio", "codec_bitrate_limit", 36);
        //8.视频相关设置
        mCore.setVideoPreset("custom");//视频预设为custom
        mCore.setPreferredFramerate(5);//FPS优先设置为5
@@ -454,6 +460,9 @@
//            mPauseSoundFile = basePath + "/toy_mono.wav";
//            copyIfNotExist(R.raw.toy_mono, basePath + "/toy_mono.wav");
            String mLPConfigXsd = basePath + "/lpconfig.xsd";
            copyIfNotExist(R.raw.lpconfig, mLPConfigXsd);
        } catch (IOException ioe) {
            Log.e(ioe);
        }