台湾一级a毛片在线播放,黄色精品偷拍视频大全,精品一区二区在线欧美日韩,日本特黄一级视频播三级片,日韩美女18岁美女视频,偷偷操不一样的99,国产午夜激无码av毛片久

智慧服務(wù),成就美好體驗 項目咨詢

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

入門使用

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

更新時間:2019-11-20

描述

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

音頻通話已建立,主被叫正在通話中。

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

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

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

  1. 請求發(fā)起方UI調(diào)用tsdk_add_video()發(fā)起音頻轉(zhuǎn)視頻呼叫請求。
    代碼示例:
    -(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. 請求發(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. 被請求方SDK收到請求后,向UI上報對方請求增加視頻事件TSDK_E_CALL_EVT_OPEN_VIDEO_REQ,UI應(yīng)刷新界面通知用戶遠(yuǎn)端請求轉(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. 被請求方UI調(diào)用tsdk_reply_add_video()接口來處理轉(zhuǎn)視頻請求,參數(shù)為呼叫標(biāo)識call_id和is_accept標(biāo)識。接收轉(zhuǎn)視頻請求時,is_accept標(biāo)識的值為TSDK_TRUE;拒絕轉(zhuǎn)視頻請求時,is_accept標(biāo)識的值為TSDK_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. 被請求用戶接受轉(zhuǎn)視頻請求,UI先完成本地窗口和遠(yuǎn)端窗口創(chuàng)建,再調(diào)用tsdk_set_video_window()接口設(shè)置視頻窗口與呼叫的綁定關(guān)系方。
    說明: 

    只有被請求方用戶接受時,才需要此步驟。

    若用戶長時間沒有響應(yīng),被請求端應(yīng)用程序應(yīng)該自動拒絕轉(zhuǎn)視頻的請求。建議時間為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)音頻信令和媒體交互處理;

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

    若被請求方拒絕視頻請求,請求方向UI上報遠(yuǎn)端拒絕請求打開視頻通知事件TSDK_E_CALL_EVT_REFUSE_OPEN_VIDEO_IND,UI銷毀遠(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;        
    }
     

注意事項

無。