#ifndef ENDPOINT_H #define ENDPOINT_H #pragma once #include "EventCode.h" #include "mod_counterconnector/CallType.h" #include "CommEntityUtil.hpp" #ifdef _WIN32 #else #include "video_render.h" #endif #ifndef RVC_MAX_IP_LEN #define RVC_MAX_IP_LEN 128 #endif #ifndef MAX_PATH #define MAX_PATH 260 #endif enum e_call_state { INIT, CALLING, PROCEEDING, COMPLETING, READY, TERMINATING, TERMINATED, }; typedef struct endpoint_audiodsp_config_s { bool audio_pickup_in_agc; bool audio_pickup_out_agc; bool audio_handfree_in_agc; bool audio_handfree_out_agc; bool audio_pickup_in_ns; bool audio_pickup_out_ns; bool audio_handfree_in_ns; bool audio_handfree_out_ns; bool audio_pickup_aec; bool audio_handfree_aec; }endpoint_audiodsp_config_t; typedef struct endpoint_conf_t { char audio_handfree_in_dev[MAX_PATH]; char audio_handfree_out_dev[MAX_PATH]; char audio_pickup_in_dev[MAX_PATH]; char audio_pickup_out_dev[MAX_PATH]; endpoint_audiodsp_config_t audio_dsp; #ifdef _WIN32 int irendertype; #endif //_WIN32 int mtu; int quant; int media_start_port; int media_stop_port; char uri[MAX_PATH]; int camera_count; int screen_count; volatile int *ref_active_camera; volatile int *ref_camera_switch; volatile int *ref_window_state; volatile int *ref_camera_state; volatile int *ref_active_img; volatile int *ref_Up_Fps; volatile int *ref_Is_ActiveInspect; volatile int *ref_Is_showPersonArea; volatile int *ref_Is_showRecordArea; }endpoint_conf_t; typedef struct endpoint_call_param_s { unsigned long local_ip; int local_port; unsigned long remote_ip; int remote_port; int remote_width; int remote_height; }endpoint_call_param_t; typedef struct endpoint_call_callback_t { void (*on_call_state)(int state, const char *state_desc, const char *phase, void *user_data); void *user_data; }endpoint_call_callback_t; typedef struct endpoint_call_t endpoint_call_t; typedef struct endpoint_t endpoint_t; typedef struct video_session_callback_s{ void (*on_video_box_move)(int imessagetype, int ivideotype, int ileft, int ibottom, void *user_data); void *user_data; }video_session_callback_t; typedef struct endpoint_call_params_s{ const char *to_uri; const char *from_uri; const char *call_id; const char *local_ip; int ilocal_audio_port; int ilocal_video_port; DeviceTypeEnum nDeviceType; CallingTypeEnum nCallType; }endpoint_call_params_t; int endpoint_init_lib(); void endpoint_deinit_lib(); class CEntityBase; endpoint_t *endpoint_create(CEntityBase *pEntity, const endpoint_conf_t *conf,int nDev); void endpoint_destroy(endpoint_t *ep); int endpoint_invoke(endpoint_t *ep, int (*func)(void*), void *user_data, int *result); void endpoint_change_audio_dev(endpoint_t *ep, int dev_type); endpoint_call_t* endpoint_call_create(endpoint_t* ep, const endpoint_call_params_t* pcallparam, const endpoint_call_callback_t* cb); int new_media_port(endpoint_t *ep); void endpoint_call_destroy(endpoint_call_t *call); int endpoint_call_start(endpoint_call_t *call); int endpoint_call_hangup(endpoint_call_t *call); #ifdef _WIN32 int endpoint_call_start_video(endpoint_call_t* call, unsigned long remote_ip, int remote_video_rtp, unsigned long local_ip, int local_video_rtp, int remote_width, int remote_height, 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 endpoint_call_stop_video(endpoint_call_t* call); int endpoint_call_stop_double_record_broadcast_video(); int local_play_stop_video(endpoint_call_t* call); 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); void terminatedcall(endpoint_call_t* call); #else int endpoint_call_start_video(endpoint_call_t* call, endpoint_call_param_t* pcallparam, rvc_video_render_callback_t* render_cb); int endpoint_call_stop_video(endpoint_call_t* call); void terminatedcall(endpoint_call_t* call); #endif //_WIN32 #endif // ENDPOINT_H