|
@@ -806,10 +806,6 @@ static void negotiate_sdp(endpoint_call_t *call, const sdp_session_t *local_sdp,
|
|
|
unsigned int hash_code = hash_media_desc(&audio_desc);
|
|
|
if (hash_code != call->last_media_desc_hash)
|
|
|
{
|
|
|
- char str_local[RVC_MAX_IP_LEN] = {0};
|
|
|
- char str_remote[RVC_MAX_IP_LEN] = {0};
|
|
|
- translate_ipaddr_from_int(str_local, RVC_MAX_IP_LEN, audio_desc.local_ip);
|
|
|
- translate_ipaddr_from_int(str_remote, RVC_MAX_IP_LEN, audio_desc.remote_ip);
|
|
|
endpoint_media_update_audio(call, &audio_desc, call->ep->curr_audio_dev_type);
|
|
|
call->last_media_desc_hash = hash_code;
|
|
|
//char strmsg[MAX_PATH] = {0};
|
|
@@ -823,11 +819,6 @@ static void negotiate_sdp(endpoint_call_t *call, const sdp_session_t *local_sdp,
|
|
|
unsigned int hash_code = hash_media_desc(&video_desc);
|
|
|
if (hash_code != call->last_media_desc_hash)
|
|
|
{
|
|
|
- char str_local[128] = {0};
|
|
|
- char str_remote[128] = {0};
|
|
|
- translate_ipaddr_from_int(str_local, 128, video_desc.local_ip);
|
|
|
- translate_ipaddr_from_int(str_remote, 128, video_desc.remote_ip);
|
|
|
-
|
|
|
call->sdpvieo_desc.local_pt = video_desc.local_pt;
|
|
|
call->sdpvieo_desc.local_rtp_ip = video_desc.local_ip;
|
|
|
call->sdpvieo_desc.local_rtp_port = video_desc.local_port;
|
|
@@ -1472,13 +1463,7 @@ int endpoint_call_start_video(endpoint_call_t *call, unsigned long remote_ip, in
|
|
|
int local_view_x, int local_view_y, int local_view_cx, int local_view_cy,
|
|
|
int remote_view_x, int remote_view_y, int remote_view_cx, int remote_view_cy,
|
|
|
int local_move, int remote_move, video_session_callback_t* cb)
|
|
|
-{
|
|
|
- char local_ip_str[RVC_MAX_IP_LEN]={0};
|
|
|
- char remtote_ip_str[RVC_MAX_IP_LEN]={0};
|
|
|
-
|
|
|
- translate_ipaddr_from_int(local_ip_str, RVC_MAX_IP_LEN, local_ip);
|
|
|
- translate_ipaddr_from_int(remtote_ip_str, RVC_MAX_IP_LEN, remote_ip);
|
|
|
-
|
|
|
+{
|
|
|
if (call)
|
|
|
{
|
|
|
int i = 0;
|
|
@@ -1510,16 +1495,10 @@ int endpoint_call_start_video(endpoint_call_t *call, unsigned long remote_ip, in
|
|
|
video_desc.param[i++] = remote_view_cy;
|
|
|
video_desc.param[i++] = remote_width;
|
|
|
video_desc.param[i++] = remote_height;
|
|
|
- //add by clp 20190823
|
|
|
video_desc.param[i++] = local_move;
|
|
|
video_desc.param[i++] = remote_move;
|
|
|
endpoint_media_update_video(call, &video_desc, cb);
|
|
|
|
|
|
- char str_local_ip[RVC_MAX_IP_LEN]={0};
|
|
|
- char str_remtote_ip[RVC_MAX_IP_LEN]={0};
|
|
|
- translate_ipaddr_from_int(str_local_ip, RVC_MAX_IP_LEN,video_desc.local_ip);
|
|
|
- translate_ipaddr_from_int(str_remtote_ip, RVC_MAX_IP_LEN, video_desc.remote_ip);
|
|
|
-
|
|
|
return 0;
|
|
|
}
|
|
|
else
|
|
@@ -1530,12 +1509,6 @@ int endpoint_call_start_video(endpoint_call_t *call, unsigned long remote_ip, in
|
|
|
#else
|
|
|
int endpoint_call_start_video(endpoint_call_t* call, endpoint_call_param_t* pcallparam, rvc_video_render_callback_t* render_cb)
|
|
|
{
|
|
|
- char local_ip_str[RVC_MAX_IP_LEN]={0};
|
|
|
- char remtote_ip_str[RVC_MAX_IP_LEN]={0};
|
|
|
-
|
|
|
- translate_ipaddr_from_int(local_ip_str, RVC_MAX_IP_LEN, pcallparam->local_ip);
|
|
|
- translate_ipaddr_from_int(remtote_ip_str, RVC_MAX_IP_LEN, pcallparam->remote_ip);
|
|
|
-
|
|
|
if (call)
|
|
|
{
|
|
|
int i = 0;
|
|
@@ -1562,11 +1535,6 @@ int endpoint_call_start_video(endpoint_call_t* call, endpoint_call_param_t* pcal
|
|
|
video_desc.param[i++] = pcallparam->remote_height;
|
|
|
endpoint_media_update_video(call, &video_desc, render_cb);
|
|
|
|
|
|
- char str_local_ip[RVC_MAX_IP_LEN]={0};
|
|
|
- char str_remtote_ip[RVC_MAX_IP_LEN]={0};
|
|
|
- translate_ipaddr_from_int(str_local_ip, RVC_MAX_IP_LEN,video_desc.local_ip);
|
|
|
- translate_ipaddr_from_int(str_remtote_ip, RVC_MAX_IP_LEN, video_desc.remote_ip);
|
|
|
-
|
|
|
return 0;
|
|
|
}
|
|
|
else
|
|
@@ -1600,67 +1568,6 @@ int endpoint_call_stop_double_record_broadcast_video()
|
|
|
}
|
|
|
|
|
|
|
|
|
-int local_play_start_video(endpoint_call_t *call,int local_view_x, int local_view_y, int local_view_cx, int local_view_cy, int local_move, video_session_callback_t* cb)
|
|
|
-{
|
|
|
- int rc;
|
|
|
- endpoint_conf_t *ep_conf = &call->ep->conf;
|
|
|
- if (call->video)
|
|
|
- {
|
|
|
- video_session_destroy(call->video);
|
|
|
- call->video = NULL;
|
|
|
- }
|
|
|
- video_session_conf_t video_conf = {0};
|
|
|
- video_conf.bit_rate = 256 * 1024;
|
|
|
- video_conf.local_rtp_ip = 0;
|
|
|
- video_conf.local_rtp_port = 0;
|
|
|
- video_conf.local_video_view_x = local_view_x;
|
|
|
- video_conf.local_video_view_y = local_view_y;
|
|
|
- video_conf.local_video_view_cx = local_view_cx;
|
|
|
- video_conf.local_video_view_cy = local_view_cy;
|
|
|
- video_conf.local_move = local_move;
|
|
|
- video_conf.mtu = ep_conf->mtu;
|
|
|
- video_conf.video_quant = ep_conf->quant;
|
|
|
- video_conf.remote_rtp_ip = 0;
|
|
|
- video_conf.remote_rtp_port = 0;
|
|
|
- video_conf.remote_video_view_x = 0;
|
|
|
- video_conf.remote_video_view_y = 0;
|
|
|
- video_conf.remote_video_view_cx = 0;
|
|
|
- video_conf.remote_video_view_cy = 0;
|
|
|
- video_conf.remote_video_width = 0;
|
|
|
- video_conf.remote_video_height = 0;
|
|
|
- video_conf.ref_active_camera = call->ep->conf.ref_active_camera;
|
|
|
- video_conf.ref_camera_switch = call->ep->conf.ref_camera_switch;
|
|
|
- video_conf.ref_camera_state = call->ep->conf.ref_camera_state;
|
|
|
- video_conf.ref_window_state = call->ep->conf.ref_window_state;
|
|
|
- video_conf.ref_active_img = call->ep->conf.ref_active_img;
|
|
|
- video_conf.ref_Is_ActiveInspect = call->ep->conf.ref_Is_ActiveInspect;
|
|
|
- video_conf.ref_Is_showPersonArea = call->ep->conf.ref_Is_showPersonArea;
|
|
|
- video_conf.ref_Is_showRecordArea = call->ep->conf.ref_Is_showRecordArea;
|
|
|
- video_conf.camera_count = call->ep->conf.camera_count;
|
|
|
- video_conf.screen_count = call->ep->conf.screen_count;
|
|
|
- video_conf.eDeviceType = call->eDeviceType;
|
|
|
- video_conf.video_echo_cb = cb;
|
|
|
- video_conf.ilocal_wind_flags = VIDEOPLAYER_FLAG_PULL|VIDEOPLAYER_FLAG_CHECKTOP|VIDEOPLAYER_FLAG_ZOOMOUTSIZE;
|
|
|
- video_conf.iremote_wind_flags = VIDEOPLAYER_FLAG_PUSH|VIDEOPLAYER_FLAG_CHECKTOP;
|
|
|
- video_conf.eType = (eVideoRenderType)call->ep->conf.irendertype;
|
|
|
- rc = Local_video_session_create(&video_conf, &call->video);
|
|
|
- if (rc != 0)
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create video session failed! rc = %d", rc);
|
|
|
- return -1;
|
|
|
- }
|
|
|
- rc = video_session_start(call->video);
|
|
|
- if (rc != 0)
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("start video session failed! rc = %d", rc);
|
|
|
- video_session_destroy(call->video);
|
|
|
- call->video = NULL;
|
|
|
- return -1;
|
|
|
- }
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
int local_remote_show_video(endpoint_call_t *call,int local_view_x, int local_view_y, int local_view_cx, int local_view_cy,int remote_view_x, int remote_view_y, int remote_view_cx, int remote_view_cy, int local_move, int remote_move, video_session_callback_t* cb)
|
|
|
{
|
|
|
int rc;
|
|
@@ -1711,7 +1618,7 @@ int local_remote_show_video(endpoint_call_t *call,int local_view_x, int local_vi
|
|
|
video_conf.ilocal_wind_flags = VIDEOPLAYER_FLAG_PULL|VIDEOPLAYER_FLAG_CHECKTOP;
|
|
|
video_conf.iremote_wind_flags = VIDEOPLAYER_FLAG_PUSH|VIDEOPLAYER_FLAG_CHECKTOP;
|
|
|
video_conf.eType = (eVideoRenderType)call->ep->conf.irendertype;
|
|
|
- rc = Local_video_session_create(&video_conf, &call->video, true);
|
|
|
+ rc = local_video_session_create(&video_conf, &call->video, true);
|
|
|
if (rc != 0){
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create video session failed! rc = %d", rc);
|
|
|
return -1;
|
|
@@ -1754,24 +1661,4 @@ static void __endpoint_call_destroy(endpoint_call_t *call)
|
|
|
}
|
|
|
|
|
|
|
|
|
-int translate_ipaddr_from_int(char* strdst, unsigned ulen, unsigned long uip)
|
|
|
-{
|
|
|
- int iret = -1;
|
|
|
- if (NULL == strdst){
|
|
|
- return iret;
|
|
|
- }
|
|
|
-
|
|
|
- char* pstr_ip = inet_ntoa(__lton(uip));
|
|
|
- size_t ulen_ip = 0;
|
|
|
- if (NULL != pstr_ip){
|
|
|
- ulen_ip = strlen(pstr_ip);
|
|
|
- if (ulen_ip < ulen){
|
|
|
- memcpy(strdst, pstr_ip, ulen_ip);
|
|
|
- iret = 0;
|
|
|
- }
|
|
|
- }
|
|
|
- return iret;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
IMPLEMENT_REF_COUNT_MT_STATIC(endpoint_call, endpoint_call_t, ref_cnt, __endpoint_call_destroy)
|