123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- #ifndef ENDPOINT_H
- #define ENDPOINT_H
- #pragma once
- #include "../include/EventCode.h"
- #include "../mod_counterconnector/CallType.h"
- #ifdef RVC_OS_WIN
- #include <process.h>
- #include <objbase.h>
- #else
- #endif
- enum e_call_state
- {
- INIT,
- CALLING,
- PROCEEDING,
- COMPLETING,
- READY,
- TERMINATING,
- TERMINATED,
- };
- typedef struct endpoint_conf_t {
- char audio_handfree_in_dev[260];
- char audio_handfree_out_dev[260];
- char audio_pickup_in_dev[260];
- char audio_pickup_out_dev[260];
- 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;
- int mtu;
- int quant;
- int media_start_port;
- int media_stop_port;
- char uri[256];
- 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_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 enum{
- INS_HANGUP = 1
- }endpoint_instruction_type_t;
- typedef struct endpoint_distribute_call_info_s{
- char server_ip[256];
- int server_port;
- endpoint_instruction_type_t etype;
- char call_name[256];
- }endpoint_distribute_call_info_t;
- typedef struct pad_req_switch_packet_s{
- unsigned int ulen; // 整个包的长度,包括当前字段
- unsigned int etype; // 指令类型
- unsigned int uparamlen; // 指令参数长度
- char* szparam; // 指令参数长度内容
- }pad_req_switch_packet_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;
- 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 char *remote_uri, const char*local_ip,DeviceTypeEnum nDeviceType,CallingTypeEnum nCallType,const endpoint_call_callback_t *cb);
- void endpoint_call_destroy(endpoint_call_t *call);
- int endpoint_call_start(endpoint_call_t *call);
- int endpoint_call_hangup(endpoint_call_t *call);
- /*
- add by chenlp 20190826 新增int local_move和int remote_move参数,分别用于设置本地和远端视频窗口是否支持移动
- */
- 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_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 local_play_stop_video(endpoint_call_t *call);
- //add by clp 20190903
- 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);
- int endpoint_distribute_hangup(endpoint_distribute_call_info_t *tinfo);
- int translate_ipaddr_from_int(char* strdst, unsigned ulen, unsigned long uip);
- #endif // ENDPOINT_H
|