Просмотр исходного кода

Z991239-5614 #comment 解决UOS版本下摄像头回显图像倒立问题

80274480 1 год назад
Родитель
Сommit
687f9e37f9

+ 3 - 4
Module/mod_mediacontroller/capture.cpp

@@ -885,10 +885,9 @@ static void env_cap_on_frame(void *user_data, video_frame *frame)
 		video_frame_free(&preview_frame);
 
 		//static int ipreview_shm_queue = 0;
-		//if (ipreview_shm_queue == 0) {
-		//	video_frame_save_bmpfile("preview_shm_queue_1.bmp", frame);
-		//	ipreview_shm_queue++;
-		//}
+		//char strname[MAX_PATH] = { 0 };
+		//snprintf(strname, MAX_PATH, "env_preview_shm_queue_%d.bmp", ipreview_shm_queue++);
+		//video_frame_save_bmpfile(strname, &preview_frame);
 	}
 	// rtp
 	{

+ 1 - 1
Module/mod_sipphone/mod_sipphone.cpp

@@ -2939,7 +2939,7 @@ void CSIPPhoneSession::control_video( ControlVideoCommand_t *pCmd )
 			t_callback.user_data = m_pEntity;
 			t_callback.on_remote_video_render = &__remote_video_render_callback;
 			t_callback.on_stop_remote_video_render = &__on_stop_remote_video_render_callback;
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s:%d video_render_cb = 0x%08x and video_render_cb->on_video_render = 0x%08x, video_render_cb->user_data = 0x%08x.", __FUNCTION__, __LINE__, &t_callback, t_callback.on_remote_video_render, t_callback.user_data);
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s:%d video_render_cb = 0x%08x and video_render_cb->on_video_render = 0x%08x, video_render_cb->user_data = 0x%08x.", __FUNCTION__, __LINE__, &t_callback, t_callback.on_remote_video_render, t_callback.user_data);
 			endpoint_call_start_video(m_pCall, &callparam, &t_callback);
 			if (DOUBLERECORD_CALLTYPE != m_pEntity->m_nCallType) {
 				rvc_video_render_params_t render_param = { 0 };

+ 7 - 5
Module/mod_sipphone/video_render.cpp

@@ -82,7 +82,7 @@ static int get_local_video_frame(video_frame** frame, int itype, Clibvideoqueue*
 		int ivideo_width = 0;
 		int ivideo_height = 0;
 		int isize = local_video_queue->GetFrameSize(ivideo_width, ivideo_height);
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("isize = %d, ivideo_width = %d, ivideo_height = %d.", isize, ivideo_width, ivideo_height);
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("isize = %d, ivideo_width = %d, ivideo_height = %d.", isize, ivideo_width, ivideo_height);
 		blog = false;
 	}
 
@@ -144,6 +144,7 @@ void* rvc_videorender_func(void* arg)
 	}
 
 	Clibvideoqueue* local_video_queue = NULL;
+	RVC_RendererFlip renderflip = RVC_FLIP_VERTICAL;
 	int iwidth = 0;
 	int iheight = 0;
 	if (CAMERA_TYPE_ENV == irender_camera) {
@@ -155,12 +156,13 @@ void* rvc_videorender_func(void* arg)
 		local_video_queue = new Clibvideoqueue(REC_COMMON_VIDEO_OPT_SHM_PREVIEW_QUEUE);
 		iwidth = REC_COMMON_VIDEO_PREVIEW_HEIGHT;
 		iheight = REC_COMMON_VIDEO_PREVIEW_WIDTH;
+		renderflip = RVC_FLIP_NONE;
 	}
 
 	int ivideo_width = 0;
 	int ivideo_height = 0;
 	int isize = local_video_queue->GetFrameSize(ivideo_width, ivideo_height);
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s:%d isize = %d, ivideo_width = %d, ivideo_height = %d.",__FUNCTION__, __LINE__, isize, ivideo_width, ivideo_height);
+	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s:%d isize = %d, ivideo_width = %d, ivideo_height = %d.",__FUNCTION__, __LINE__, isize, ivideo_width, ivideo_height);
 	if (ivideo_width > 0 && ivideo_height > 0) {
 		iwidth = ivideo_width;
 		iheight = ivideo_height;
@@ -216,7 +218,7 @@ void* rvc_videorender_func(void* arg)
 		ivideo_width = 0;
 		ivideo_height = 0;
 		isize = local_video_queue->GetFrameSize(ivideo_width, ivideo_height);
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s:%d isize = %d, ivideo_width = %d, ivideo_height = %d.", __FUNCTION__, __LINE__, isize, ivideo_width, ivideo_height);
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s:%d isize = %d, ivideo_width = %d, ivideo_height = %d.", __FUNCTION__, __LINE__, isize, ivideo_width, ivideo_height);
 
 		for (; ; ) {
 			struct timespec ts;
@@ -233,12 +235,12 @@ void* rvc_videorender_func(void* arg)
 				if (NULL != local_video_frame) {
 					video_frame* localframe = NULL;
 					if (0 == translate_image_resolution(&localframe, param->render_param.ilocal_view_cx, param->render_param.ilocal_view_cy, local_video_frame)) {					
-						param->plocal_render->RenderVideoFrame(localframe, RVC_FLIP_VERTICAL);
+						param->plocal_render->RenderVideoFrame(localframe, renderflip);
 						video_frame_delete(localframe);
 						localframe = NULL;
 					}
 					else {
-						param->plocal_render->RenderVideoFrame(local_video_frame, RVC_FLIP_VERTICAL);
+						param->plocal_render->RenderVideoFrame(local_video_frame, renderflip);
 					}
 
 					bshow_local = true;