Explorar o código

Z991239-1812 #comment other 增加支持摄像头采集帧率设置

陈礼鹏80274480 %!s(int64=4) %!d(string=hai) anos
pai
achega
b7d2da62c0

+ 6 - 2
Module/mod_mediacontroller/capture.cpp

@@ -898,7 +898,7 @@ static void video_capture_destroy(video_capture_t *video_cap)
 }
 
 
-static int get_video_capture_fps()
+static int get_video_capture_fps(int icapfps)
 {
 	int ifps = REC_COMMON_VIDEO_PADRAW_FPS;
 	if ((ePadtype == g_eDeviceType) || (eMobilePadType == g_eDeviceType) || (eDesk2SType == g_eDeviceType) 
@@ -909,6 +909,10 @@ static int get_video_capture_fps()
 		ifps = REC_COMMON_VIDEO_RAW_FPS;
 	}
 
+	if (icapfps <=30 && icapfps >=5){
+		ifps = icapfps;
+	}
+
 	return ifps;
 }
 
@@ -1019,7 +1023,7 @@ static int video_capture_start_linux(video_capture_t* video_cap)
 	t_param.cap_mode = cap_mode;
 	t_param.dev_id = dev_id;
 	t_param.frame_fmt = VIDEO_FORMAT_RGB24;
-	t_param.fps = get_video_capture_fps();
+	t_param.fps = get_video_capture_fps(video_cap->camera_type == CAMERA_TYPE_ENV ? conf->video_env_fps : conf->video_opt_fps);
 
 	t_param.on_frame = (video_cap->camera_type == CAMERA_TYPE_ENV ? &env_cap_on_frame : &opt_cap_on_frame);
 	t_param.on_frame_i420 = (video_cap->camera_type == CAMERA_TYPE_ENV ? &env_cap_on_frame_i420 : &opt_cap_on_frame_i420);

+ 2 - 0
Module/mod_mediacontroller/capture.h

@@ -39,6 +39,8 @@ namespace MediaController {
 		int video_opt_dev; // -1 means invalid
 		int video_env_rotate; // counter-clockwise degree, ignore currently
 		int video_opt_rotate; // counter-clockwise degree
+		int video_env_fps;
+		int video_opt_fps;
 		CSimpleStringA strAudioIn;
 		CSimpleStringA strAudioOut;
 		CSimpleStringA strVideoEnv;

+ 2 - 0
Module/mod_mediacontroller/mod_mediacontroller.cpp

@@ -1224,6 +1224,8 @@ private:
 			table.AddEntryString("Video", "EwsCamera", strEwsCam, "$");
 			table.AddEntryInt("Video", "EnvRotate", conf->video_env_rotate, 0);
 			table.AddEntryInt("Video", "OptRotate", conf->video_opt_rotate, 0);
+			table.AddEntryInt("Video", "EnvFps", conf->video_env_fps, 0);
+			table.AddEntryInt("Video", "OptFps", conf->video_opt_fps, 0);
 			Error = table.Load(spConfig);
 			if (Error == Error_Succeed)
 			{