Включить приглашение видеозвонка для другого пользователя Использование Linphone в Swift? - PullRequest
0 голосов
/ 10 июня 2019

Я приглашаю видео Вызов прямого пользователя 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 Code:

удаленный хочет добавить видео

  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) {
}

Swift: проблемы с конверсией

Невозможно быстро преобразовать код Swift.

  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 () } else if value2.toBool () &&! remoteValue.toBool () {

     }

после обновления метода вызова Вызов:

case LinphoneCallUpdating: / <Мы инициировали обновление вызова * / print ("callStateChanged: LinphoneCallUpdating") в этом случае сбой приложения: ** При столкновении не удается показать приглашение / отклонить видео. Звоните </strong>

...