在Swift中使用Linphone为其他用户启用视频通话邀请吗?

时间:2019-06-10 06:26:18

标签: objective-c swift linphone

我邀请视频呼叫直接用户A到用户B。但是我得到了

的回复
linphone this method : 
case LinphoneCallUpdatedByRemote:
        print("callStateChanged: LinphoneCallUpdatedByRemote")

但无法使用此方法 我已经阅读了目标C代码,但是当我不得不将代码快速语言转换为面临类型转换问题时。

 case LinphoneCallUpdatedByRemote:
        print("callStateChanged: LinphoneCallUpdatedByRemote")

        let current = linphone_call_get_current_params(call)
        let remote = linphone_call_get_remote_params(call)

        // remote wants to add video
        linphone_core_video_display_enabled(theLinphone.lc)
        linphone_call_params_video_enabled(remote)
        linphone_core_get_video_policy(theLinphone.lc)
        linphone_core_defer_call_update(theLinphone.lc, call)

我很累。

我正在寻找解决方案,但这是客观的C代码:

远程想添加视频

  if (linphone_core_video_display_enabled(theLinphone.lc) && !linphone_call_params_video_enabled(current) && linphone_call_params_video_enabled(remote)) && (!linphone_core_get_video_policy(LC).automatically_accept || ((UIApplication.shared.applicationState != .active) && floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_9_x_Max)) {
         linphone_core_defer_call_update(theLinphone.lc, call)
         //displayAsk(toEnableVideoCall: call)
         } else if linphone_call_params_video_enabled(current) && !linphone_call_params_video_enabled(remote) {
}

迅速:转换问题

无法快速转换转换快速代码。

  let current = linphone_call_get_current_params(call)
    let remote = linphone_call_get_remote_params(call)
    let displayVideo : bool_t = linphone_core_video_display_enabled(theLinphone.lc)
    let value2 : bool_t = linphone_call_params_video_enabled(current)
    let remoteValue : bool_t = linphone_call_params_video_enabled(remote)
    let policyValue : UnsafePointer<LinphoneVideoPolicy> = linphone_core_get_video_policy(theLinphone.lc)

   let lenOfpolicy =  policyValue.withMemoryRebound(to: Int8.self, capacity: 8){
        return strlen($0)
    }

//远程要添加视频         if(displayVideo.toBool()&&!value2.toBool()&& remoteValue.toBool())&&((policyValue!= nil)||((UIApplication.shared.applicationState!= .active)&& Int32(floor(NSFoundationVersionNumber) )> NSFoundationVersionNumber_iOS_9_x_Max)){              linphone_core_defer_call_update(theLinphone.lc,通话)              theLinphone.manager!.videoEnableLinphone()              theLinphone.dalegateOut?.VideoInvite()              theLinphone.dalegateIn?.VideoInvite()              theLinphone.dalegateVideoOut?.VideoInvite()              theLinphone.dalegateVideoIn?.VideoInvite()          }否则,如果value2.toBool()&&!remoteValue.toBool(){

     }

调用方法更新后调用:

案例LinphoneCallUpdating:/ <我们已发起呼叫更新* /         print(“ callStateChanged:LinphoneCallUpdating”) 这种情况下应用崩溃: **面对崩溃无法显示邀请/拒绝视频通话

0 个答案:

没有答案