123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- #ifndef MEDIACONTROLLER_VIDEO_H
- #define MEDIACONTROLLER_VIDEO_H
- #pragma once
- #include "EventCode.h"
- #include "mod_counterconnector/CallType.h"
- #include "endpoint.h"
- #if defined(RVC_OS_WIN)
- #include <videortp.h>
- #include <videoutil.h>
- #include "libvideoqueue.h"
- #include "rvc_media_common.h"
- #include <videocommon.h>
- #include <videoplayer.h>
- #include <videocap.h>
- #include <videoclock.h>
- #include <ipp.h>
- #include "cv.h"
- #include "mod_sipphone.h"
- #include "ivideorenderinterface.h"
- #else
- #include "video_render.h"
- #endif //RVC_OS_WIN
- typedef struct video_session_conf_t
- {
- unsigned long local_rtp_ip;
- int local_rtp_port;
- unsigned long remote_rtp_ip;
- int remote_rtp_port;
- int remote_video_width;
- int remote_video_height;
- #if defined(_MSC_VER)
- // remote video params
- int remote_video_view_x;
- int remote_video_view_y;
- int remote_video_view_cx;
- int remote_video_view_cy;
- // local video params
- int local_video_view_x;
- int local_video_view_y;
- int local_video_view_cx;
- int local_video_view_cy;
- int local_move;
- int remote_move;
- video_session_callback_t* video_echo_cb;
- eVideoRenderType eType;
- int ivideotype;
- #else
- rvc_video_render_callback_t video_render_cb;
- #endif //_MSC_VER
- int camera_count;
- int screen_count;
- volatile int *ref_active_camera;
- volatile int *ref_camera_switch;
- volatile int *ref_window_state;
- volatile int *ref_active_img;
- volatile int *ref_camera_state;
- volatile int *ref_Up_Fps;
- volatile int *ref_Is_ActiveInspect;
- volatile int *ref_Is_showPersonArea;
- volatile int *ref_Is_showRecordArea;
- int mtu;
- int video_quant; // 0-10
- int bit_rate; // 256*1024
- DeviceTypeEnum eDeviceType;
- CallingTypeEnum nCallType;
- int local_pt;
- int remote_pt;
- int ilocal_wind_flags;
- int iremote_wind_flags;
- }video_session_conf_t;
- #if defined(RVC_OS_WIN)
- typedef struct video_session_s video_session_t;
- typedef struct picture_record_s
- {
- HANDLE evt;
- HANDLE work_thread;
- video_session_t* session;
- video_frame* show_frame;
- video_frame* record_frame;
- }picture_record_t;
- struct video_session_s
- {
- video_session_conf_t conf;
- Clibvideoqueue* video_shm_q_env;// env rtp queue
- Clibvideoqueue* video_shm_q_opt;// opt rtp queue
- Clibvideoqueue* video_shm_q_preview; // preview queue
- Clibvideoqueue* video_shm_q_remote; // preview queue
- videoq_frame* video_error;
- videortp_t* rtp;
- videoclock_t local_clock;
- struct SwsContext* local_encode_sws_ctx_env;
- struct SwsContext* local_encode_sws_ctx_opt;
- IplImage* personimage;
- IplImage* personmask;
- HANDLE ui_thread;
- HANDLE ui_event;
- videoplayer_t* local_player;
- videoplayer_t* remote_player;
- HWND local_hwnd; // preview window
- HWND remote_hwnd; // remote window
- IVideoRender* plocal_render;
- IVideoRender* premote_render;
- bool bshow_remote;
- int ilast_windstae;
- bool bcamera_error_posted;
- int irecv_frameid;
- picture_record_t* pic_record;
- };
- int local_video_session_create(const video_session_conf_t* conf, video_session_t** p_session, bool bremote = false);
- void double_record_broadcast_video_session_stop();
- #else
- typedef struct video_session_t video_session_t;
- #endif //RVC_OS_WIN
- int video_session_create(const video_session_conf_t *conf, video_session_t **p_session);
- int video_session_start(video_session_t *session);
- void video_session_stop(video_session_t *session);
- void video_session_destroy(video_session_t *session);
- int video_lib_init();
- void video_lib_deinit();
- #endif
|