|
@@ -1951,28 +1951,17 @@ void* videorender_func(void* arg)
|
|
|
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++;
|
|
|
- }
|
|
|
+ //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);
|
|
|
if (result) {
|
|
|
- Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
session->plocal_render->RenderVideoFrame(tmp_frame_preview);
|
|
|
}
|
|
|
- else {
|
|
|
- Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
- }
|
|
|
}
|
|
|
else {
|
|
|
Dbg("%s:%d videorender_func exit!", __FUNCTION__, __LINE__);
|
|
@@ -2279,10 +2268,10 @@ 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[128] = {0};
|
|
|
- char str_remote[128] = {0};
|
|
|
- translate_ipaddr_from_int(str_local, 128, conf->local_rtp_ip);
|
|
|
- translate_ipaddr_from_int(str_remote, 128, conf->remote_rtp_ip);
|
|
|
+ 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);
|
|
|
|
|
|
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);
|
|
@@ -2480,7 +2469,6 @@ void double_record_broadcast_video_session_stop()
|
|
|
void video_session_destroy(video_session_t *session)
|
|
|
{
|
|
|
LOG_FUNCTION();
|
|
|
-
|
|
|
#ifdef RVC_OS_WIN
|
|
|
if (NULL != session) {
|
|
|
if (NULL != session->pic_record) {
|
|
@@ -2496,28 +2484,32 @@ void video_session_destroy(video_session_t *session)
|
|
|
session->pic_record->evt = NULL;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if (session->video_shm_q_env) {
|
|
|
+ delete session->video_shm_q_env;
|
|
|
+ session->video_shm_q_env = NULL;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (session->video_shm_q_opt) {
|
|
|
+ delete session->video_shm_q_opt;
|
|
|
+ session->video_shm_q_opt = NULL;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (session->video_shm_q_preview) {
|
|
|
+ delete session->video_shm_q_preview;
|
|
|
+ session->video_shm_q_preview = NULL;
|
|
|
+ }
|
|
|
}
|
|
|
#else
|
|
|
|
|
|
#endif // RVC_OS_WIN
|
|
|
|
|
|
- if (session->video_shm_q_env) {
|
|
|
- delete session->video_shm_q_env;
|
|
|
- session->video_shm_q_env = NULL;
|
|
|
- }
|
|
|
- if (session->video_shm_q_opt) {
|
|
|
- delete session->video_shm_q_opt;
|
|
|
- session->video_shm_q_opt = NULL;
|
|
|
- }
|
|
|
- if (session->video_shm_q_preview) {
|
|
|
- delete session->video_shm_q_preview;
|
|
|
- session->video_shm_q_preview = NULL;
|
|
|
- }
|
|
|
if (session->video_error){
|
|
|
delete session->video_error->data;
|
|
|
delete session->video_error;
|
|
|
}
|
|
|
- if (session->video_shm_q_remote){
|
|
|
+
|
|
|
+ if (session->video_shm_q_remote) {
|
|
|
delete session->video_shm_q_remote;
|
|
|
session->video_shm_q_remote = NULL;
|
|
|
}
|