暖暖视频免费观**,国产免费美女被艹视频,毛片一级毛片,不卡三级

智慧服務(wù),成就美好體驗(yàn) 項(xiàng)目咨詢(xún)

主頁(yè) > 服務(wù)與支持 > 開(kāi)發(fā)平臺(tái) > 客戶(hù)端SDK參考 > iOS Native SDK > 音視頻呼叫 音頻通話(huà)轉(zhuǎn)視頻通話(huà)

入門(mén)使用

音頻通話(huà)轉(zhuǎn)視頻通話(huà)

更新時(shí)間:2019-11-20

描述

音頻通話(huà)中,通話(huà)的一方發(fā)起音頻通話(huà)切換為視頻通話(huà)。

音頻通話(huà)已建立,主被叫正在通話(huà)中。

業(yè)務(wù)流程

圖1 音頻通話(huà)轉(zhuǎn)視頻通話(huà)流程 
說(shuō)明: 

通話(huà)中,主被叫雙方均可以發(fā)起音頻轉(zhuǎn)視頻操作。

  1. 請(qǐng)求發(fā)起方UI調(diào)用tsdk_add_video()發(fā)起音頻轉(zhuǎn)視頻呼叫請(qǐng)求。
    代碼示例:
    -(BOOL)upgradeAudioToVideoCallWithCallId:(unsigned int)callId
    {    
        TSDK_RESULT ret = tsdk_add_video((TSDK_UINT32)callId);    
        DDLogInfo(@"Call_Log: tsdk_add_video = %d",ret);    
        return ret == TSDK_SUCCESS ? YES : NO;
    }
     
  2. 請(qǐng)求發(fā)起方UI先完成本地窗口和遠(yuǎn)端窗口創(chuàng)建,再調(diào)用tsdk_set_video_window()接口設(shè)置視頻窗口與呼叫的綁定關(guān)系。
    代碼示例:
    - (BOOL)updateVideoWindowWithLocal:(id)localVideoView andRemote:(id)remoteVideoView andBFCP:(id)bfcpVideoView callId:(unsigned int)callId
    {    
        TSDK_S_VIDEO_WND_INFO videoInfo[3];    
        memset_s(videoInfo, sizeof(TSDK_S_VIDEO_WND_INFO) * 2, 0, sizeof(TSDK_S_VIDEO_WND_INFO) * 2);    
        videoInfo[0].video_wnd_type = TSDK_E_VIDEO_WND_LOCAL;    
        videoInfo[0].render = (TSDK_UPTR)localVideoView;    
        videoInfo[0].display_mode = TSDK_E_VIDEO_WND_DISPLAY_FULL;    
        videoInfo[1].video_wnd_type = TSDK_E_VIDEO_WND_REMOTE;    
        videoInfo[1].render = (TSDK_UPTR)remoteVideoView;   
        videoInfo[1].display_mode = TSDK_E_VIDEO_WND_DISPLAY_CUT;    
        videoInfo[2].video_wnd_type = TSDK_E_VIDEO_WND_AUX_DATA;    
        videoInfo[2].render = (TSDK_UPTR)bfcpVideoView;    
        TSDK_RESULT ret;    
        videoInfo[2].display_mode = TSDK_E_VIDEO_WND_DISPLAY_CUT;    
        ret = tsdk_set_video_window((TSDK_UINT32)callId, 3, videoInfo);    
        DDLogInfo(@"Call_Log: tsdk_set_video_window = %d",ret);        
        [self updateVideoRenderInfoWithVideoIndex:CameraIndexFront withRenderType:TSDK_E_VIDEO_WND_LOCAL andCallId:callId];    
        [self updateVideoRenderInfoWithVideoIndex:CameraIndexFront withRenderType:TSDK_E_VIDEO_WND_REMOTE andCallId:callId];    return (TSDK_SUCCESS == ret);
    }
     
  3. 被請(qǐng)求方SDK收到請(qǐng)求后,向UI上報(bào)對(duì)方請(qǐng)求增加視頻事件TSDK_E_CALL_EVT_OPEN_VIDEO_REQ,UI應(yīng)刷新界面通知用戶(hù)遠(yuǎn)端請(qǐng)求轉(zhuǎn)視頻。
    代碼示例:
    case TSDK_E_CALL_EVT_OPEN_VIDEO_REQ:        
    {            
        NSString *callId = [NSString stringWithFormat:@"%d",notify.param1];            
        NSDictionary *callUpgradePassiveInfo = [NSDictionary dictionaryWithObjectsAndKeys:callId,CALL_ID,nil];            
        [self respondsCallDelegateWithType:CALL_UPGRADE_VIDEO_PASSIVE result:callUpgradePassiveInfo];            
        DDLogInfo(@"Call_Log: call revice CALL_E_EVT_CALL_ADD_VIDEO");            
        break;        
    }
     
  4. 被請(qǐng)求方UI調(diào)用tsdk_reply_add_video()接口來(lái)處理轉(zhuǎn)視頻請(qǐng)求,參數(shù)為呼叫標(biāo)識(shí)call_id和is_accept標(biāo)識(shí)。接收轉(zhuǎn)視頻請(qǐng)求時(shí),is_accept標(biāo)識(shí)的值為T(mén)SDK_TRUE;拒絕轉(zhuǎn)視頻請(qǐng)求時(shí),is_accept標(biāo)識(shí)的值為T(mén)SDK_FALSE。
    代碼示例:
    -(BOOL)replyAddVideoCallIsAccept:(BOOL)accept callId:(unsigned int)callId
    {    
        TSDK_BOOL isAccept = accept;    
        TSDK_RESULT ret = tsdk_reply_add_video((TSDK_UINT32)callId , isAccept);    
        return ret == TSDK_SUCCESS ? YES : NO;
    }
     
  5. 被請(qǐng)求用戶(hù)接受轉(zhuǎn)視頻請(qǐng)求,UI先完成本地窗口和遠(yuǎn)端窗口創(chuàng)建,再調(diào)用tsdk_set_video_window()接口設(shè)置視頻窗口與呼叫的綁定關(guān)系方。
    說(shuō)明: 

    只有被請(qǐng)求方用戶(hù)接受時(shí),才需要此步驟。

    若用戶(hù)長(zhǎng)時(shí)間沒(méi)有響應(yīng),被請(qǐng)求端應(yīng)用程序應(yīng)該自動(dòng)拒絕轉(zhuǎn)視頻的請(qǐng)求。建議時(shí)間為45s。

    代碼示例:
    - (BOOL)updateVideoWindowWithLocal:(id)localVideoView andRemote:(id)remoteVideoView andBFCP:(id)bfcpVideoView callId:(unsigned int)callId
    {    
        TSDK_S_VIDEO_WND_INFO videoInfo[3];    
        memset_s(videoInfo, sizeof(TSDK_S_VIDEO_WND_INFO) * 2, 0, sizeof(TSDK_S_VIDEO_WND_INFO) * 2);    
        videoInfo[0].video_wnd_type = TSDK_E_VIDEO_WND_LOCAL;    
        videoInfo[0].render = (TSDK_UPTR)localVideoView;    
        videoInfo[0].display_mode = TSDK_E_VIDEO_WND_DISPLAY_FULL;    
        videoInfo[1].video_wnd_type = TSDK_E_VIDEO_WND_REMOTE;    
        videoInfo[1].render = (TSDK_UPTR)remoteVideoView;   
        videoInfo[1].display_mode = TSDK_E_VIDEO_WND_DISPLAY_CUT;    
        videoInfo[2].video_wnd_type = TSDK_E_VIDEO_WND_AUX_DATA;    
        videoInfo[2].render = (TSDK_UPTR)bfcpVideoView;    
        TSDK_RESULT ret;    
        videoInfo[2].display_mode = TSDK_E_VIDEO_WND_DISPLAY_CUT;    
        ret = tsdk_set_video_window((TSDK_UINT32)callId, 3, videoInfo);    
        DDLogInfo(@"Call_Log: tsdk_set_video_window = %d",ret);        
        [self updateVideoRenderInfoWithVideoIndex:CameraIndexFront withRenderType:TSDK_E_VIDEO_WND_LOCAL andCallId:callId];    
        [self updateVideoRenderInfoWithVideoIndex:CameraIndexFront withRenderType:TSDK_E_VIDEO_WND_REMOTE andCallId:callId];    return (TSDK_SUCCESS == ret);
    }
     
  6. 主、被叫SDK完成視頻轉(zhuǎn)音頻信令和媒體交互處理;

    若被請(qǐng)求方接受視頻請(qǐng)求,請(qǐng)求方向UI上報(bào)打開(kāi)視頻通知事件TSDK_E_CALL_EVT_OPEN_VIDEO_IND,UI根據(jù)事件顯示遠(yuǎn)端和近端視頻窗口;被請(qǐng)求方點(diǎn)擊接受后,UI顯示遠(yuǎn)端和近端視頻窗口。

    若被請(qǐng)求方拒絕視頻請(qǐng)求,請(qǐng)求方向UI上報(bào)遠(yuǎn)端拒絕請(qǐng)求打開(kāi)視頻通知事件TSDK_E_CALL_EVT_REFUSE_OPEN_VIDEO_IND,UI銷(xiāo)毀遠(yuǎn)端和近端視頻窗口。

    代碼示例:
    case TSDK_E_CALL_EVT_OPEN_VIDEO_IND:        
    {            
        NSString *callId = [NSString stringWithFormat:@"%d",notify.param1];            
        NSDictionary *callUpgradePassiveInfo = [NSDictionary dictionaryWithObjectsAndKeys:callId,CALL_ID,nil];            
        [self respondsCallDelegateWithType:CALL_REFUSE_OPEN_VIDEO result:callUpgradePassiveInfo];            
        DDLogInfo(@"Call_Log: call CALL_E_EVT_CALL_DEL_VIDEO");            
        break;        
    }
     

注意事項(xiàng)

無(wú)。