|
@@ -25,6 +25,7 @@
|
|
|
#include "videorenderobj.h"
|
|
|
#include "../../Other/libvideocapture/ivideocaptureinterface.h"
|
|
|
#include <signal.h>
|
|
|
+#include <semaphore.h>
|
|
|
#endif // RVC_OS_WIN
|
|
|
|
|
|
|
|
@@ -120,6 +121,7 @@ struct video_session_t
|
|
|
VideoRenderObj* plocal_render;
|
|
|
VideoRenderObj* premote_render;
|
|
|
pthread_t ui_threadid;
|
|
|
+ sem_t ui_stop_sem;
|
|
|
#endif // RVC_OS_WIN
|
|
|
|
|
|
picture_record_t* pic_record;
|
|
@@ -218,7 +220,7 @@ static int video_shm_enqueue(Clibvideoqueue *shm_queue, video_frame *frame, int
|
|
|
}
|
|
|
static inline Clibvideoqueue *get_active_videoqueue(video_session_t *session)
|
|
|
{
|
|
|
- LOG_FUNCTION();
|
|
|
+ //LOG_FUNCTION();
|
|
|
int agent_option = *session->conf.ref_camera_switch;
|
|
|
int facetracking_option = *session->conf.ref_active_camera;
|
|
|
int camera_state = *session->conf.ref_camera_state;
|
|
@@ -286,7 +288,7 @@ static inline Clibvideoqueue *get_active_videoqueue(video_session_t *session)
|
|
|
|
|
|
static void local_get_frame(void *user_data, video_frame *frame)
|
|
|
{
|
|
|
- LOG_FUNCTION();
|
|
|
+ //LOG_FUNCTION();
|
|
|
video_session_t *session = (video_session_t*)user_data;
|
|
|
Clibvideoqueue *q = get_active_videoqueue(session);
|
|
|
|
|
@@ -323,7 +325,7 @@ static void local_get_frame(void *user_data, video_frame *frame)
|
|
|
|
|
|
static void local_put_frame(void *user_data, video_frame *frame)
|
|
|
{
|
|
|
- LOG_FUNCTION();
|
|
|
+ //LOG_FUNCTION();
|
|
|
video_session_t *session = (video_session_t*)user_data;
|
|
|
video_frame *tmp_frame_encode = NULL;
|
|
|
|
|
@@ -332,18 +334,14 @@ static void local_put_frame(void *user_data, video_frame *frame)
|
|
|
tmp_frame_encode = video_frame_new(REC_COMMON_VIDEO_RTP_WIDTH, REC_COMMON_VIDEO_RTP_HEIGHT, VIDEO_FORMAT_I420);
|
|
|
video_frame_fill_black(tmp_frame_encode);
|
|
|
if (frame->width == REC_COMMON_VIDEO_RTP_ENV_WIDTH && frame->height == REC_COMMON_VIDEO_RTP_ENV_HEIGHT) { // env
|
|
|
- Dbg("send env %s:%d", __FUNCTION__, __LINE__);
|
|
|
int offset = (REC_COMMON_VIDEO_RTP_HEIGHT - REC_COMMON_VIDEO_RTP_ENV_HEIGHT) / 2;
|
|
|
unsigned char *dst_data[4] = {tmp_frame_encode->data[0], tmp_frame_encode->data[1], tmp_frame_encode->data[2], NULL};
|
|
|
- Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
dst_data[0] += offset * tmp_frame_encode->linesize[0];
|
|
|
dst_data[1] += offset / 2 * tmp_frame_encode->linesize[1];
|
|
|
dst_data[2] += offset / 2 * tmp_frame_encode->linesize[2];
|
|
|
- Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
sws_scale(session->local_encode_sws_ctx_env, frame->data, frame->linesize, 0, frame->height, dst_data, tmp_frame_encode->linesize);
|
|
|
- Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
} else if (frame->width == REC_COMMON_VIDEO_RTP_OPT_WIDTH && frame->height == REC_COMMON_VIDEO_RTP_OPT_HEIGHT) { // opt
|
|
|
- Dbg("send opt %s:%d", __FUNCTION__, __LINE__);
|
|
|
+
|
|
|
video_frame tt;
|
|
|
video_frame_alloc(REC_COMMON_VIDEO_RTP_WIDTH, REC_COMMON_VIDEO_RTP_HEIGHT, VIDEO_FORMAT_RGB24, &tt);
|
|
|
video_frame_fill_black(&tt);
|
|
@@ -362,26 +360,24 @@ static void local_put_frame(void *user_data, video_frame *frame)
|
|
|
|
|
|
|
|
|
}
|
|
|
- Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
sws_scale(session->local_encode_sws_ctx_opt, tt.data, tt.linesize, 0, tt.height, tmp_frame_encode->data, tmp_frame_encode->linesize);
|
|
|
- Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
video_frame_free(&tt);
|
|
|
}
|
|
|
- Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
+
|
|
|
if (session->conf.local_pt == REC_COMMON_VIDEO_PT)
|
|
|
{
|
|
|
- Dbg("%s:%d videortp send frame", __FUNCTION__, __LINE__);
|
|
|
+
|
|
|
videortp_send_frame(session->rtp, tmp_frame_encode);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- Dbg("%s:%d videortp send yuvframe session->rtp = 0x%0x, tmp_frame_encode = 0x%0x", __FUNCTION__, __LINE__, session->rtp, tmp_frame_encode);
|
|
|
+ //Dbg("%s:%d videortp send yuvframe session->rtp = 0x%0x, tmp_frame_encode = 0x%0x", __FUNCTION__, __LINE__, session->rtp, tmp_frame_encode);
|
|
|
videortp_send_yuvframe(session->rtp, tmp_frame_encode);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (tmp_frame_encode) {
|
|
|
- Dbg("%s:%d video frame delete", __FUNCTION__, __LINE__);
|
|
|
+ //Dbg("%s:%d video frame delete", __FUNCTION__, __LINE__);
|
|
|
video_frame_delete(tmp_frame_encode);
|
|
|
}
|
|
|
}
|
|
@@ -912,7 +908,7 @@ static void show_remote_agnet_picture(video_session_t *t_session)
|
|
|
GetCurrentRunPath(strPath);
|
|
|
sprintf(strImgPath, "%s\\bin\\agent.jpg", strPath);
|
|
|
#else
|
|
|
-
|
|
|
+ strcpy_s(strImgPath, MAX_PATH_SIZE, "./bin/agent.jpg");
|
|
|
#endif // RVC_OS_WIN
|
|
|
|
|
|
video_frame* remote_frame = video_frame_new(irecord_video_frame_width, irecord_video_frame_heigt, VIDEO_FORMAT_RGB24);
|
|
@@ -1052,7 +1048,7 @@ static int start_local_video_clock(video_session_t* session)
|
|
|
&local_put_frame, session, &local_get_frame, session, &session->local_clock, session->conf.ref_Up_Fps, &__dbg);
|
|
|
}
|
|
|
|
|
|
- Dbg("create session->local_clock addr is %0x", session->local_clock);
|
|
|
+ Dbg("create session->local_clock addr is 0x%0x", session->local_clock);
|
|
|
|
|
|
if (0 == rc) {
|
|
|
rc = videoclock_start(session->local_clock);
|
|
@@ -1436,39 +1432,42 @@ on_error:
|
|
|
static void stop_video(video_session_t *session)
|
|
|
{
|
|
|
LOG_FUNCTION();
|
|
|
-
|
|
|
- if (session->local_encode_sws_ctx_env) {
|
|
|
- sws_freeContext(session->local_encode_sws_ctx_env);
|
|
|
- session->local_encode_sws_ctx_env = NULL;
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
+ Dbg("stop_video param video_session %0x, session->local_clock is %0x, session->remote_hwnd is %0x.", session, session->local_clock, session->remote_hwnd);
|
|
|
+ if (session->local_clock && session->remote_hwnd)
|
|
|
+ {
|
|
|
+ Dbg("videoclock_stop local_clock addr is %0x", session->local_clock);
|
|
|
+ videoclock_stop(session->local_clock);
|
|
|
+ videoclock_destroy(session->local_clock);
|
|
|
+ session->local_clock = NULL;
|
|
|
+ pg_remote_hwnd = NULL;
|
|
|
+ pg_local_hwnd = NULL;
|
|
|
}
|
|
|
- if (session->local_encode_sws_ctx_opt) {
|
|
|
- sws_freeContext(session->local_encode_sws_ctx_opt);
|
|
|
- session->local_encode_sws_ctx_opt = NULL;
|
|
|
+#else
|
|
|
+ if (session->local_clock)
|
|
|
+ {
|
|
|
+ Dbg("videoclock_stop local_clock addr is 0x%0x", session->local_clock);
|
|
|
+ videoclock_stop(session->local_clock);
|
|
|
+ videoclock_destroy(session->local_clock);
|
|
|
+ session->local_clock = NULL;
|
|
|
}
|
|
|
+#endif // RVC_OS_WIN
|
|
|
|
|
|
if (session->rtp)
|
|
|
{
|
|
|
Dbg("begin stop video rtp.");
|
|
|
videortp_stop(session->rtp);
|
|
|
+ Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
videortp_destroy(session->rtp);
|
|
|
+ Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
session->rtp = NULL;
|
|
|
- }
|
|
|
+ Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
+}
|
|
|
else {
|
|
|
Dbg("session->rtp == null");
|
|
|
}
|
|
|
-
|
|
|
+ Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
#ifdef RVC_OS_WIN
|
|
|
- Dbg("stop_video param video_session %0x, session->local_clock is %0x, session->remote_hwnd is %0x.", session, session->local_clock, session->remote_hwnd);
|
|
|
- if (session->local_clock && session->remote_hwnd)
|
|
|
- {
|
|
|
- Dbg("videoclock_stop local_clock addr is %0x", session->local_clock);
|
|
|
- videoclock_stop(session->local_clock);
|
|
|
- videoclock_destroy(session->local_clock);
|
|
|
- session->local_clock = NULL;
|
|
|
- pg_remote_hwnd = NULL;
|
|
|
- pg_local_hwnd = NULL;
|
|
|
- }
|
|
|
-
|
|
|
if (session->local_player) {
|
|
|
videoplayer_destroy(session->local_player);
|
|
|
session->local_player = NULL;
|
|
@@ -1481,19 +1480,31 @@ static void stop_video(video_session_t *session)
|
|
|
session->remote_player = NULL;
|
|
|
Dbg("remote video player destroy.");
|
|
|
}
|
|
|
-
|
|
|
#else
|
|
|
-
|
|
|
- if (session->local_clock)
|
|
|
- {
|
|
|
- Dbg("videoclock_stop local_clock addr is %0x", session->local_clock);
|
|
|
- videoclock_stop(session->local_clock);
|
|
|
- videoclock_destroy(session->local_clock);
|
|
|
- session->local_clock = NULL;
|
|
|
+ if (session->plocal_render){
|
|
|
+ Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
+ delete session->plocal_render;
|
|
|
+ Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
+ session->plocal_render = NULL;
|
|
|
+ Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
}
|
|
|
|
|
|
+ if (session->premote_render){
|
|
|
+ delete session->premote_render;
|
|
|
+ Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
+ session->premote_render = NULL;
|
|
|
+ Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
+ }
|
|
|
+#endif
|
|
|
|
|
|
-#endif // RVC_OS_WIN
|
|
|
+ if (session->local_encode_sws_ctx_env) {
|
|
|
+ sws_freeContext(session->local_encode_sws_ctx_env);
|
|
|
+ session->local_encode_sws_ctx_env = NULL;
|
|
|
+ }
|
|
|
+ if (session->local_encode_sws_ctx_opt) {
|
|
|
+ sws_freeContext(session->local_encode_sws_ctx_opt);
|
|
|
+ session->local_encode_sws_ctx_opt = NULL;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
#ifdef RVC_OS_WIN
|
|
@@ -1891,9 +1902,12 @@ void* videorender_func(void* arg)
|
|
|
LOG_FUNCTION();
|
|
|
video_session_t* session = (video_session_t*)arg;
|
|
|
Dbg("%s:%d session addr is 0x%0x, session->plocal_render = 0x%0x", __FUNCTION__, __LINE__, session, session->plocal_render);
|
|
|
-
|
|
|
- Dbg("videorender_func local_pt: %d local_ip: %d local_rtp_port: %d.", session->conf.local_pt, session->conf.local_rtp_ip, session->conf.local_rtp_port);
|
|
|
- Dbg("videorender_func remote_pt: %d remote_ip: %d remote_rtp_port: %d.", session->conf.remote_pt, session->conf.remote_rtp_ip, session->conf.remote_rtp_port);
|
|
|
+ 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);
|
|
|
+ Dbg("videorender_func local_pt: %d local_ip: %s local_rtp_port: %d.", session->conf.local_pt, str_local_ip, session->conf.local_rtp_port);
|
|
|
+ Dbg("videorender_func remote_pt: %d remote_ip: %s remote_rtp_port: %d.", session->conf.remote_pt, str_remote_ip, session->conf.remote_rtp_port);
|
|
|
Dbg("videorender_func rx_width: %d rx_height: %d.", session->conf.remote_video_width, session->conf.remote_video_height);
|
|
|
Dbg("%s:%d local(%d,%d,%d,%d) remote(%d,%d,%d,%d).", __FUNCTION__, __LINE__, session->conf.local_video_view_x, session->conf.local_video_view_y, session->conf.local_video_view_cx, session->conf.local_video_view_cy,
|
|
|
session->conf.remote_video_view_x, session->conf.remote_video_view_y, session->conf.remote_video_view_cx, session->conf.remote_video_view_cy);
|
|
@@ -1914,9 +1928,11 @@ void* videorender_func(void* arg)
|
|
|
|
|
|
start_video(session);
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("session remote video render is null.");
|
|
|
+ }
|
|
|
|
|
|
if (NULL != session->plocal_render){
|
|
|
-
|
|
|
videorender_param_t tparam = { 0 };
|
|
|
tparam.icx = session->conf.local_video_view_x;
|
|
|
tparam.icy = session->conf.local_video_view_y;
|
|
@@ -1927,29 +1943,52 @@ void* videorender_func(void* arg)
|
|
|
tparam.ivideoformat = VIDEO_FORMAT_RGB24;
|
|
|
if (0 == session->plocal_render->SetVideoRenderParam(&tparam)){
|
|
|
session->plocal_render->ShowVideoWindow();
|
|
|
- video_frame* frm = video_frame_new(REC_COMMON_VIDEO_PREVIEW_WIDTH, REC_COMMON_VIDEO_PREVIEW_HEIGHT, VIDEO_FORMAT_RGB24);
|
|
|
-
|
|
|
- while (true)
|
|
|
- {
|
|
|
- video_frame_fill_black(frm);
|
|
|
- video_frame* tmp_frame_preview = video_frame_new(REC_COMMON_VIDEO_PREVIEW_WIDTH, REC_COMMON_VIDEO_PREVIEW_HEIGHT, VIDEO_FORMAT_RGB24);
|
|
|
- videoq_frame frm;
|
|
|
- frm.data = tmp_frame_preview->data[0];
|
|
|
- BOOL result = session->video_shm_q_preview->GetVideo(&frm, VIDEOQUEUE_FLAG_HORIZONTAL_FLIP);
|
|
|
- static int icount = 0;
|
|
|
- if (icount == 0) {
|
|
|
- video_frame_save_bmpfile("local_test.bmp", tmp_frame_preview);
|
|
|
- //icount++;
|
|
|
+ video_frame* vfrm = video_frame_new(REC_COMMON_VIDEO_PREVIEW_WIDTH, REC_COMMON_VIDEO_PREVIEW_HEIGHT, VIDEO_FORMAT_RGB24);
|
|
|
+
|
|
|
+ for ( ; ; ){
|
|
|
+ struct timespec ts;
|
|
|
+ clock_gettime(CLOCK_REALTIME, &ts);
|
|
|
+ long unsec = ts.tv_nsec + (1000 * 1000 * 100);
|
|
|
+ ts.tv_sec += (unsec / 1000000000);
|
|
|
+ ts.tv_nsec = (unsec % 1000000000);
|
|
|
+ Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
+ if (0 != sem_timedwait(&session->ui_stop_sem, &ts) && (ETIMEDOUT == errno))
|
|
|
+ {
|
|
|
+ video_frame_fill_black(vfrm);
|
|
|
+ Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
+ video_frame* tmp_frame_preview = video_frame_new(REC_COMMON_VIDEO_PREVIEW_WIDTH, REC_COMMON_VIDEO_PREVIEW_HEIGHT, VIDEO_FORMAT_RGB24);
|
|
|
+ videoq_frame qfrm;
|
|
|
+ qfrm.data = tmp_frame_preview->data[0];
|
|
|
+ Dbg("%s:%d,and current video queue len is %d", __FUNCTION__, __LINE__, session->video_shm_q_preview->GetVideoLens());
|
|
|
+ BOOL result = session->video_shm_q_preview->GetVideo(&qfrm, VIDEOQUEUE_FLAG_HORIZONTAL_FLIP);
|
|
|
+ static int icount = 0;
|
|
|
+ if (icount == 0) {
|
|
|
+ video_frame_save_bmpfile("local_test.bmp", tmp_frame_preview);
|
|
|
+ //icount++;
|
|
|
+ }
|
|
|
+ if (result) {
|
|
|
+ Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
+ session->plocal_render->RenderVideoFrame(tmp_frame_preview);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
+ }
|
|
|
}
|
|
|
- if (result){
|
|
|
- session->plocal_render->RenderVideoFrame(tmp_frame_preview);
|
|
|
+ else {
|
|
|
+ Dbg("%s:%d videorender_func exit!", __FUNCTION__, __LINE__);
|
|
|
+ session->plocal_render->HideVideoWindow();
|
|
|
+ break;
|
|
|
}
|
|
|
- usleep(1000 * 20);
|
|
|
}
|
|
|
- video_frame_delete(frm);
|
|
|
+ video_frame_delete(vfrm);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ Dbg("%s:%d set video render param failed!", __FUNCTION__, __LINE__);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ else {
|
|
|
+ Dbg("%s:%d session local video render is null.", __FUNCTION__, __LINE__);
|
|
|
+ }
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -1959,7 +1998,7 @@ void* videorender_func(void* arg)
|
|
|
static int start_ui(video_session_t *session)
|
|
|
{
|
|
|
LOG_FUNCTION();
|
|
|
- Dbg("start ui session addr is 0x%8x", session);
|
|
|
+ Dbg("start ui session addr is 0x%0x", session);
|
|
|
|
|
|
#ifdef RVC_OS_WIN
|
|
|
session->ui_event = CreateEventA(NULL, FALSE, FALSE, NULL);
|
|
@@ -2002,13 +2041,21 @@ static int start_ui(video_session_t *session)
|
|
|
}
|
|
|
return 0;
|
|
|
#else
|
|
|
-
|
|
|
+ if (0 != sem_init(&session->ui_stop_sem, 0, 0)) {
|
|
|
+ Dbg("%s:%d create ui stop event failed!", __FUNCTION__, __LINE__);
|
|
|
+ return Error_Resource;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Dbg("%s:%d create ui stop event success!", __FUNCTION__, __LINE__);
|
|
|
+ }
|
|
|
int err = pthread_create(&session->ui_threadid, NULL, videorender_func, session);
|
|
|
if (0 == err) {
|
|
|
- Dbg("create video render thread success, %lu.", session->ui_threadid);
|
|
|
+ Dbg("create video render thread success, thread id is %u.", session->ui_threadid);
|
|
|
}
|
|
|
else {
|
|
|
Dbg("create video render thread failed.");
|
|
|
+ return Error_Resource;
|
|
|
}
|
|
|
|
|
|
return err;
|
|
@@ -2018,7 +2065,7 @@ static int start_ui(video_session_t *session)
|
|
|
static void stop_ui(video_session_t *session)
|
|
|
{
|
|
|
LOG_FUNCTION();
|
|
|
- Dbg("stop ui session addr is %0x.", session);
|
|
|
+ Dbg("%s:%d session addr is 0x%0x.", __FUNCTION__, __LINE__, session);
|
|
|
|
|
|
#ifdef RVC_OS_WIN
|
|
|
if (DOUBLERECORD_CALLTYPE == session->conf.nCallType) {
|
|
@@ -2070,17 +2117,15 @@ static void stop_ui(video_session_t *session)
|
|
|
Dbg("set pg_last_session to null.");
|
|
|
|
|
|
#else
|
|
|
- int kill_ret = pthread_kill(session->ui_threadid, 0);
|
|
|
- if (ESRCH == kill_ret){
|
|
|
- Dbg("pthread_kill failed for thread is not exsist or has stopped!");
|
|
|
- }
|
|
|
- else if (EINVAL == kill_ret) {
|
|
|
- Dbg("pthread_kill failed for signal is not valid!");
|
|
|
- }
|
|
|
- else {
|
|
|
- Dbg("pthread_kill success");
|
|
|
+ sem_post(&session->ui_stop_sem);
|
|
|
+ if (session->ui_threadid > 0) {
|
|
|
+ pthread_join(session->ui_threadid, NULL);
|
|
|
}
|
|
|
|
|
|
+ Dbg("ui thread exit!");
|
|
|
+
|
|
|
+ stop_video(session);
|
|
|
+
|
|
|
#endif // RVC_OS_WIN
|
|
|
}
|
|
|
|
|
@@ -2239,7 +2284,7 @@ int video_session_create(const video_session_conf_t *conf, video_session_t **p_s
|
|
|
translate_ipaddr_from_int(str_local, 128, conf->local_rtp_ip);
|
|
|
translate_ipaddr_from_int(str_remote, 128, conf->remote_rtp_ip);
|
|
|
|
|
|
- Dbg("video_session_create session addr = %x,local_rtp_ip = %s,local_rtp_port = %d, local_pt = %d, remote_rtp_ip = %s,remote_rtp_port=%d, remote_pt = %d, call type = %d.",
|
|
|
+ Dbg("video_session_create session addr = 0x%0x,local_rtp_ip = %s,local_rtp_port = %d, local_pt = %d, remote_rtp_ip = %s,remote_rtp_port=%d, remote_pt = %d, call type = %d.",
|
|
|
session, str_local, conf->local_rtp_port,conf->local_pt, str_remote, conf->remote_rtp_port, conf->remote_pt, conf->nCallType);
|
|
|
|
|
|
memcpy(&session->conf, conf, sizeof(video_session_conf_t));
|
|
@@ -2262,7 +2307,7 @@ int video_session_create(const video_session_conf_t *conf, video_session_t **p_s
|
|
|
GetCurrentRunPath(strPath);
|
|
|
sprintf(strImgPath, "%s\\bin\\error.jpg", strPath);
|
|
|
#else
|
|
|
-
|
|
|
+ strcpy_s(strImgPath, MAX_PATH_SIZE, "./bin/error.jpg");
|
|
|
#endif // RVC_OS_WIN
|
|
|
if (ExistsFile(strImgPath))
|
|
|
{
|
|
@@ -2291,7 +2336,7 @@ int video_session_create(const video_session_conf_t *conf, video_session_t **p_s
|
|
|
#ifdef RVC_OS_WIN
|
|
|
sprintf(strPersonPath, "%s\\bin\\rxk.png", strPath);
|
|
|
#else
|
|
|
-
|
|
|
+ strcpy_s(strPersonPath, MAX_PATH_SIZE, "./bin/rxk.png");
|
|
|
#endif // RVC_OS_WIN
|
|
|
if (ExistsFile(strPersonPath))
|
|
|
{
|
|
@@ -2370,7 +2415,7 @@ int video_session_start(video_session_t *session)
|
|
|
{
|
|
|
LOG_FUNCTION();
|
|
|
|
|
|
- Dbg("video_session_start session addr is %0x, session call type is %d.", session, session->conf.nCallType);
|
|
|
+ Dbg("video_session_start session addr is 0x%0x, session call type is %d.", session, session->conf.nCallType);
|
|
|
|
|
|
int rc = start_ui(session);
|
|
|
|
|
@@ -2380,7 +2425,7 @@ int video_session_start(video_session_t *session)
|
|
|
void video_session_stop(video_session_t *session)
|
|
|
{
|
|
|
LOG_FUNCTION();
|
|
|
- Dbg("video session stop session = %0x", session);
|
|
|
+ Dbg("video session stop session = 0x%0x", session);
|
|
|
stop_ui(session);
|
|
|
}
|
|
|
|
|
@@ -2492,7 +2537,6 @@ void video_session_destroy(video_session_t *session)
|
|
|
if (session->recordareamask){
|
|
|
cvReleaseImage(&session->recordareamask);
|
|
|
}
|
|
|
-
|
|
|
free(session);
|
|
|
}
|
|
|
|