更新时间:2019-11-20
音频通话中,通话的一方发起音频通话切换为视频通话。
音频通话已建立,主被叫正在通话中。
通话中,主被叫双方均可以发起音频转视频操作。
//c code TSDK_RESULT ret; ret = tsdk_add_video(callid); if (TSDK_SUCCESS != ret) { LOG_D_CALL_ERROR("add video failed. result=%#x", ret); return -1; } return TSDK_SUCCESS; |
//c code TSDK_RESULT ret; TSDK_S_VIDEO_WND_INFO video_window_info[SERVICE_CALL_D_VIDEO_WINDOW_NUM] = { TSDK_E_VIDEO_WND_REMOTE }; video_window_info[TSDK_E_VIDEO_WND_LOCAL].render = (TSDK_UINT32)local_video_wnd; video_window_info[TSDK_E_VIDEO_WND_LOCAL].video_wnd_type = TSDK_E_VIDEO_WND_LOCAL; video_window_info[TSDK_E_VIDEO_WND_LOCAL].index = 1; video_window_info[TSDK_E_VIDEO_WND_LOCAL].display_mode = TSDK_E_VIDEO_WND_DISPLAY_FULL; video_window_info[TSDK_E_VIDEO_WND_REMOTE].render = (TSDK_UINT32)remote_video_wnd; video_window_info[TSDK_E_VIDEO_WND_REMOTE].video_wnd_type = TSDK_E_VIDEO_WND_REMOTE; video_window_info[TSDK_E_VIDEO_WND_REMOTE].index = 0; video_window_info[TSDK_E_VIDEO_WND_REMOTE].display_mode = TSDK_E_VIDEO_WND_DISPLAY_FULL; ret = tsdk_set_video_window(callid, SERVICE_CALL_D_VIDEO_WINDOW_NUM,video_window_info); if(TSDK_SUCCESS != ret) { LOG_D_CALL_ERROR("set video window info failed. result=%#x", ret); return -1; } return TSDK_SUCCESS; |
//c code unsigned int callID = (unsigned int)wParam; CDemoCallCtrlDlg* pCallDlg = CallDlgManager::GetInstance().GetCallDlgByCallID(callID); CHECK_POINTER_RETURN(pCallDlg, -1L); CDemoPromptDlg dlg; dlg.SetTextOfContent(L"The peer party request add video,do you agree?"); INT_PTR nResponse = dlg.DoModal(); pCallDlg->PostMessage(WM_CALL_ADD_VIDEO, (WPARAM)nResponse, NULL); return 0L; |
//c code TSDK_RESULT ret; ret = tsdk_reply_add_video(callid,isAccept); if (TSDK_SUCCESS != ret) { LOG_D_CALL_ERROR("reply add video failed. result=%#x", ret); return -1; } return TSDK_SUCCESS; |
只有被请求方用户接受时,才需要此步骤。
若用户长时间没有响应,被请求端应用程序应该自动拒绝转视频的请求。建议时间为45s。
//c code TSDK_RESULT ret; TSDK_S_VIDEO_WND_INFO video_window_info[SERVICE_CALL_D_VIDEO_WINDOW_NUM] = { TSDK_E_VIDEO_WND_REMOTE }; video_window_info[TSDK_E_VIDEO_WND_LOCAL].render = (TSDK_UINT32)local_video_wnd; video_window_info[TSDK_E_VIDEO_WND_LOCAL].video_wnd_type = TSDK_E_VIDEO_WND_LOCAL; video_window_info[TSDK_E_VIDEO_WND_LOCAL].index = 1; video_window_info[TSDK_E_VIDEO_WND_LOCAL].display_mode = TSDK_E_VIDEO_WND_DISPLAY_FULL; video_window_info[TSDK_E_VIDEO_WND_REMOTE].render = (TSDK_UINT32)remote_video_wnd; video_window_info[TSDK_E_VIDEO_WND_REMOTE].video_wnd_type = TSDK_E_VIDEO_WND_REMOTE; video_window_info[TSDK_E_VIDEO_WND_REMOTE].index = 0; video_window_info[TSDK_E_VIDEO_WND_REMOTE].display_mode = TSDK_E_VIDEO_WND_DISPLAY_FULL; ret = tsdk_set_video_window(callid, SERVICE_CALL_D_VIDEO_WINDOW_NUM,video_window_info); if(TSDK_SUCCESS != ret) { LOG_D_CALL_ERROR("set video window info failed. result=%#x", ret); return -1; } return TSDK_SUCCESS; |
若被请求方接受视频请求,请求方向UI上报打开视频通知事件TSDK_E_CALL_EVT_OPEN_VIDEO_IND,UI根据事件显示远端和近端视频窗口;被请求方点击接受后,UI显示远端和近端视频窗口。
若被请求方拒绝视频请求,请求方向UI上报远端拒绝请求打开视频通知事件TSDK_E_CALL_EVT_REFUSE_OPEN_VIDEO_IND,UI销毁远端和近端视频窗口。
//c code /* 被请求方接受视频请求 */ unsigned int callID = (unsigned int)wParam; CDemoCallCtrlDlg* pCallDlg; pCallDlg = CallDlgManager::GetInstance().GetCallDlgByCallID(callID); CHECK_POINTER_RETURN(pCallDlg, -1L); DLG_TYPE type; type = SIP_SIGNLE_VIDEO; pCallDlg->SendMessage(WM_CALL_MODIFY_VIDEO, WPARAM(type), NULL); return 0L; /* 被请求方拒绝视频请求 */ unsigned int callID = (unsigned int)wParam; CDemoCallCtrlDlg* pCallDlg; pCallDlg = CallDlgManager::GetInstance().GetCallDlgByCallID(callID); CHECK_POINTER_RETURN(pCallDlg, -1L); DLG_TYPE type; type = SIP_SIGNLE_CALL; pCallDlg->SendMessage(WM_CALL_MODIFY_VIDEO, WPARAM(type), NULL); return 0L; |
无。