|
@@ -53,7 +53,10 @@ void* pg_remote_render = NULL; // remote render
|
|
|
video_session_t* pg_last_session = NULL; // last used session
|
|
|
|
|
|
#define WNDCLS_NAME "sipmedia_video"
|
|
|
-#define MAX_PATH_SIZE 256
|
|
|
+
|
|
|
+#ifndef MAX_PATH
|
|
|
+#define MAX_PATH 260
|
|
|
+#endif
|
|
|
|
|
|
#define DEVICE_STANDARD_TYPE 0
|
|
|
#define DEVICE_PAD_TYPE 1
|
|
@@ -425,12 +428,12 @@ static int on_rx_frame(video_frame *frame, void *user_data)
|
|
|
|
|
|
int GetCurrentRunPath(char* pPath)
|
|
|
{
|
|
|
- char* pBuf = new char[MAX_PATH_SIZE];
|
|
|
+ char* pBuf = new char[MAX_PATH];
|
|
|
if (pBuf == NULL)
|
|
|
return -1;
|
|
|
- ZeroMemory(pBuf, MAX_PATH_SIZE);
|
|
|
- GetModuleFileName(NULL, pBuf, MAX_PATH_SIZE);
|
|
|
- int len = strnlen_s(pBuf, MAX_PATH_SIZE);
|
|
|
+ ZeroMemory(pBuf, MAX_PATH);
|
|
|
+ GetModuleFileName(NULL, pBuf, MAX_PATH);
|
|
|
+ int len = strnlen_s(pBuf, MAX_PATH);
|
|
|
if (len <= 0)
|
|
|
{
|
|
|
delete[]pBuf;
|
|
@@ -440,15 +443,15 @@ int GetCurrentRunPath(char* pPath)
|
|
|
pch = strstr(pBuf, "bin");
|
|
|
if (pch == NULL)
|
|
|
return -3;
|
|
|
- int lenDel = strnlen_s(pch, MAX_PATH_SIZE);
|
|
|
+ int lenDel = strnlen_s(pch, MAX_PATH);
|
|
|
if (len <= 0)
|
|
|
{
|
|
|
delete[]pBuf;
|
|
|
return -3;
|
|
|
}
|
|
|
- strncpy_s(pPath, MAX_PATH_SIZE, pBuf, len - lenDel);
|
|
|
+ strncpy_s(pPath, MAX_PATH, pBuf, len - lenDel);
|
|
|
delete[]pBuf;
|
|
|
- return strnlen_s(pPath, MAX_PATH_SIZE);
|
|
|
+ return strnlen_s(pPath, MAX_PATH);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -513,7 +516,7 @@ static int on_pull(videoplayer_t *player, void *user_data, video_frame **frame)
|
|
|
video_frame_fill_black(tmp_frame_preview);
|
|
|
if (session->video_error == NULL)
|
|
|
{
|
|
|
- char strPath[MAX_PATH_SIZE] = {0};
|
|
|
+ char strPath[MAX_PATH] = {0};
|
|
|
GetCurrentRunPath(strPath);
|
|
|
sprintf(strPath, "%s\\bin\\looklowerscreen.jpg", strPath);
|
|
|
if (_access(strPath,0)!=-1)
|
|
@@ -701,8 +704,8 @@ static int get_local_video_frame(void* user_data, video_frame** frame)
|
|
|
video_frame_fill_black(tmp_frame_preview);
|
|
|
if (session->video_error == NULL)
|
|
|
{
|
|
|
- char strPath[MAX_PATH_SIZE] = { 0 };
|
|
|
- _snprintf(strPath, MAX_PATH_SIZE, "%s", "./bin/looklowerscreen.jpg");
|
|
|
+ char strPath[MAX_PATH] = { 0 };
|
|
|
+ _snprintf(strPath, MAX_PATH, "%s", "./bin/looklowerscreen.jpg");
|
|
|
if (-1 != _access(strPath,0))
|
|
|
{
|
|
|
IplImage* img = cvLoadImage(strPath, 1);
|
|
@@ -898,7 +901,6 @@ static unsigned int __stdcall agent_picture_show_thread(void* arg)
|
|
|
|
|
|
static int agent_picture_video_start(picture_record_t* t_record)
|
|
|
{
|
|
|
- LOG_FUNCTION();
|
|
|
t_record->evt = CreateEventA(NULL, FALSE, FALSE, NULL);
|
|
|
t_record->work_thread = (HANDLE)_beginthreadex(NULL, 0, &agent_picture_show_thread, t_record, 0, NULL);
|
|
|
//sem_init(&t_record->sem_evt, 0, 0);
|
|
@@ -987,9 +989,8 @@ static int record_agent_picture_show_session_destory(video_session_t* session)
|
|
|
|
|
|
static void show_remote_agnet_picture(video_session_t *t_session)
|
|
|
{
|
|
|
- LOG_FUNCTION();
|
|
|
- char strPath[MAX_PATH_SIZE]={0};
|
|
|
- char strImgPath[MAX_PATH_SIZE]={0};
|
|
|
+ char strPath[MAX_PATH]={0};
|
|
|
+ char strImgPath[MAX_PATH]={0};
|
|
|
|
|
|
int irecord_video_frame_width = REC_COMMON_VIDEO_SSM_AGENT_WIDTH;
|
|
|
int irecord_video_frame_heigt = REC_COMMON_VIDEO_SSM_AGENT_HEIGHT;
|
|
@@ -1465,7 +1466,6 @@ static bool ReMoveVideoWindow(HWND hWnd, RECT rect, RECT otherect)
|
|
|
|
|
|
static int HandleVideoMoveEvent(int iMessageType, HWND hWnd, video_session_t* pSession)
|
|
|
{
|
|
|
- LOG_FUNCTION();
|
|
|
int iRet = -1;
|
|
|
if (NULL == pSession || NULL == hWnd) {
|
|
|
return iRet;
|
|
@@ -1755,12 +1755,11 @@ static void __video_render_log(void* user_data, const char* fmt, va_list arg)
|
|
|
//void* videorender_func(void* arg)
|
|
|
static unsigned int __stdcall videorender_func(void* arg)
|
|
|
{
|
|
|
- LOG_FUNCTION();
|
|
|
video_session_t* session = (video_session_t*)arg;
|
|
|
- char str_local_ip[MAX_PATH_SIZE] = { 0 };
|
|
|
- char str_remote_ip[MAX_PATH_SIZE] = { 0 };
|
|
|
- translate_ipaddr_from_int(str_local_ip, MAX_PATH_SIZE, session->conf.local_rtp_ip);
|
|
|
- translate_ipaddr_from_int(str_remote_ip, MAX_PATH_SIZE, session->conf.remote_rtp_ip);
|
|
|
+ char str_local_ip[MAX_PATH] = { 0 };
|
|
|
+ char str_remote_ip[MAX_PATH] = { 0 };
|
|
|
+ translate_ipaddr_from_int(str_local_ip, MAX_PATH, session->conf.local_rtp_ip);
|
|
|
+ translate_ipaddr_from_int(str_remote_ip, MAX_PATH, session->conf.remote_rtp_ip);
|
|
|
|
|
|
videorender_callback_t t_callback = { 0 };
|
|
|
t_callback.debug = &__video_render_log;
|
|
@@ -2040,14 +2039,12 @@ int video_session_create(const video_session_conf_t *conf, video_session_t **p_s
|
|
|
video_session_t *session = ZALLOC_T(video_session_t);
|
|
|
if (session)
|
|
|
{
|
|
|
- char str_local[MAX_PATH_SIZE] = {0};
|
|
|
- char str_remote[MAX_PATH_SIZE] = {0};
|
|
|
- translate_ipaddr_from_int(str_local, MAX_PATH_SIZE, conf->local_rtp_ip);
|
|
|
- translate_ipaddr_from_int(str_remote, MAX_PATH_SIZE, conf->remote_rtp_ip);
|
|
|
+ char str_local[MAX_PATH] = {0};
|
|
|
+ char str_remote[MAX_PATH] = {0};
|
|
|
+ translate_ipaddr_from_int(str_local, MAX_PATH, conf->local_rtp_ip);
|
|
|
+ translate_ipaddr_from_int(str_remote, MAX_PATH, conf->remote_rtp_ip);
|
|
|
|
|
|
memcpy(&session->conf, conf, sizeof(video_session_conf_t));
|
|
|
- //session->bshow_remote = false;
|
|
|
- //session->ilast_windstae = 0;
|
|
|
session->video_shm_q_env = new Clibvideoqueue(REC_COMMON_VIDEO_ENV_SHM_RTP_QUEUE);
|
|
|
if (DOUBLERECORD_CALLTYPE != conf->nCallType){
|
|
|
session->video_shm_q_remote = new Clibvideoqueue(REC_COMMON_VIDEO_REMOTE_SHM_RTP_QUEUE);
|
|
@@ -2060,10 +2057,10 @@ int video_session_create(const video_session_conf_t *conf, video_session_t **p_s
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- char strPath[MAX_PATH_SIZE]={0};
|
|
|
- char strImgPath[MAX_PATH_SIZE]={0};
|
|
|
+ char strPath[MAX_PATH]={0};
|
|
|
+ char strImgPath[MAX_PATH]={0};
|
|
|
GetCurrentRunPath(strPath);
|
|
|
- sprintf(strImgPath,"%s\\bin\\error.jpg",strPath);
|
|
|
+ _snprintf(strImgPath, MAX_PATH,"%s\\bin\\error.jpg",strPath);
|
|
|
if (_access(strImgPath,0)!=-1)
|
|
|
{
|
|
|
IplImage*img = cvLoadImage(strImgPath,1);
|
|
@@ -2085,8 +2082,8 @@ int video_session_create(const video_session_conf_t *conf, video_session_t **p_s
|
|
|
session->video_error = NULL;
|
|
|
}
|
|
|
//加载人形背景框
|
|
|
- char strPersonPath[MAX_PATH_SIZE] ;
|
|
|
- sprintf(strPersonPath,"%s\\bin\\rxk.png",strPath);
|
|
|
+ char strPersonPath[MAX_PATH] = {0};
|
|
|
+ _snprintf(strPersonPath, MAX_PATH,"%s\\bin\\rxk.jpg",strPath);
|
|
|
if (_access(strPersonPath,0)!=-1)
|
|
|
{
|
|
|
if (session->personimage == NULL)
|