Переглянути джерело

Z991239-3329 #comment 视频渲染频率支持通过集中配置设置

陈礼鹏80274480 3 роки тому
батько
коміт
a2cb66b434

+ 3 - 4
Other/libvideoframework/videortp.c

@@ -1151,9 +1151,10 @@ void* recv_proc(void* arg)
 #endif
 {
 	videortp_t *vrtp = (videortp_t*)arg;
+	int ifresh_time = vrtp->config.fresh_time;
 	int rtp_timeout_cnt = 0;
 	int64_t pre_500_ms = TimeInMilliseconds();
-	rtpDbg(vrtp,"enter recv_proc.");
+	rtpDbg(vrtp,"enter recv_proc,and ifresh time is %dms.", ifresh_time);
 #ifdef _WIN32
 	SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
 #else
@@ -1172,11 +1173,9 @@ void* recv_proc(void* arg)
 		struct timespec ts;
 		//int ivalue = -1;
 		clock_gettime(CLOCK_REALTIME, &ts);
-		long unsec = ts.tv_nsec + (1000 * 1000 * 100);
+		long unsec = ts.tv_nsec + (1000 * 1000 * ifresh_time);
 		ts.tv_sec += (unsec / 1000000000);
 		ts.tv_nsec = (unsec % 1000000000);
-		//sem_getvalue(&vrtp->sem_evt, &ivalue);
-		//rtpDbg(vrtp,"%s:%d sem value is %d", __FUNCTION__, __LINE__, ivalue);
 		if (0 != sem_timedwait(&vrtp->sem_evt, &ts) && (ETIMEDOUT == errno))
 #endif
 		{

+ 1 - 0
Other/libvideoframework/videortp.h

@@ -32,6 +32,7 @@ typedef struct videortp_config_t
 	int fps_num;
 	int bit_rate;
 	int quant;
+	int fresh_time;
 	// if use frame, return TRUE, else 0
 	int (*on_rx_frame)(video_frame *frame, void *user_data);
 	void (*on_tx_udp)(const char *buf, int size, void *user_data); // for debug