Browse Source

Z991239-6004 #comment 连线功能日志精简优化

80274480 9 months ago
parent
commit
fa712ad2d5

+ 1 - 1
Module/mod_sipphone/mod_sipphone.cpp

@@ -3096,7 +3096,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_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 };

+ 0 - 1
Module/mod_sipphone/unix/video_session.cpp

@@ -910,7 +910,6 @@ static int start_video_rtpsession(video_session_t* session)
 	config.on_rx_udp = &on_rx_udp;
 	config.dbg = &__dbg;
 	config.logevent = &__logevent;
-	//config.fresh_time = session->conf.irvideo_ft;
 	if (0 != videortp_create(&config, &session->rtp)) {
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("videortp create failed!");
 	}

+ 5 - 9
Other/unix/libvideoframework/videoclock.c

@@ -97,7 +97,7 @@ static unsigned int __stdcall worker_thread_proc(void* param)
 				seq.HighPart ++;
 			}
 			GetTick(&tick, &tick);
-//no support VideoSendFreq£¨req dynamics fps£©
+//no support VideoSendFreq(req dynamics fps)
 #if 1
 			if (seq.QuadPart * clock->fps_den * 1000 / clock->fps_num < tick.QuadPart - start_tick.QuadPart) {
 				dwTimeout = 0;
@@ -115,7 +115,7 @@ static unsigned int __stdcall worker_thread_proc(void* param)
 			}
 			else if(*clock->nVideoSendFreq== -1)
 			{
-				//ÔÝÍ£·¢ËÍÊÓÆµ
+				//暂���视频
 				dwTimeout = 200000;
 			}
 			else if(*clock->nVideoSendFreq== 0)
@@ -238,11 +238,10 @@ int videoclock_create(int fps_num,
 	clock->dbglog = dbgfunc;
     *p_clock = clock;
 	
-	clockDbg(clock,"%s:%d videoclock_create success.", __FUNCTION__, __LINE__);
     return 0;
 
 on_error:
-	clockDbg(clock,"%s:%d videoclock_create failed for %s.", __FUNCTION__, __LINE__, strerror(errno));
+	clockDbg(clock,"videoclock_create failed for %s.", strerror(errno));
     free(clock);
     return -1;
 }
@@ -277,11 +276,8 @@ int videoclock_start(videoclock_t vc)
 	pthread_attr_setschedparam(&attr, &param);
 	pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
 	int err = pthread_create(&vc->thread_id, NULL, local_video_sendfunc, vc);
-	if (0 == err) {
-		clockDbg(vc,"%s:%d pthread create success, and thread id is %u.", __FUNCTION__, __LINE__, vc->thread_id);
-	}
-	else {
-		clockDbg(vc,"%s:%d pthread create failed for %s.", __FUNCTION__, __LINE__, strerror(errno));
+	if (0 != err) {
+		clockDbg(vc,"pthread create failed for %s.", strerror(errno));
 		return -1;
 	}
 #endif

+ 49 - 63
Other/unix/libvideoframework/videortp.c

@@ -3,12 +3,12 @@
 #include "videocommon.h"
 #include "bs.h"
 
-#ifdef RVC_OS_WIN
+#ifdef _WIN32
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #else
 #include <semaphore.h>
-#endif // RVC_OS_WIN
+#endif // _WIN32
 
 #include <assert.h>
 #include <malloc.h>
@@ -178,9 +178,6 @@ static void	rtpLogevent(videortp_t* rtp, int itype, const char* strmessage)
 }
 
 
-//#define Dbg(__fmt__, ...) __Dbg(vrtp, __fmt__, __VA_ARGS__)
-
-
 static void get_start_config_bitrate(videortp_config_t *config, int *max_bitrate, int *target_bitrate, int *min_bitrate){
 	*max_bitrate = config->bit_rate; //bps
 	*min_bitrate = 50*1000 > config->bit_rate ? config->bit_rate : 50*1000; //bps
@@ -307,7 +304,7 @@ static __inline void receiver_notify_peer_fast_update(videortp_t *vrtp)
 	DWORD dwNow = GetTickCount();
 	if (dwNow - vrtp->last_peer_update_tick >= PEER_UPDATE_INTERVAL) {
 
-		rtpDbg(vrtp,"%I64d receiver_notify_peer_fast_update!", TimeInMilliseconds());
+		//rtpDbg(vrtp,"%I64d receiver_notify_peer_fast_update!", TimeInMilliseconds());
 		rtp_session_send_rtcp_h261_fir(vrtp->rtp_sess);
 		vrtp->last_peer_update_tick = dwNow;
 	}
@@ -450,15 +447,15 @@ void decoder_create(videortp_t *vrtp, const videortp_config_t *config){
 	log_func.userdata = vrtp;
 	vrtp->decoder = video_decoder_open(&decoder_config, &log_func);
 
-	rtpDbg(vrtp,"decoder_create color_space: %d decode_id: %d width: %d height: %d.", 
-		decoder_config.color_space, decoder_config.decode_id, decoder_config.width, decoder_config.height);
+	//rtpDbg(vrtp,"decoder_create color_space: %d decode_id: %d width: %d height: %d.", 
+	//	decoder_config.color_space, decoder_config.decode_id, decoder_config.width, decoder_config.height);
 }
 
 void decoder_destroy(videortp_t *vrtp){
 	if (vrtp->decoder != NULL) {
 		video_decoder_close(vrtp->decoder);
 	}
-	rtpDbg(vrtp,"decoder_destroy.");
+	//rtpDbg(vrtp,"decoder_destroy.");
 }
 
 
@@ -565,7 +562,7 @@ static int receiver_standard_h264_add_encoded_buffer_startcode(videortp_t *vrtp,
 	uint8_t *output_buf)
 {
 	uint8_t *dst = NULL;
-	bool_t start_picture=TRUE;
+	bool_t start_picture=true;
 	int output_len = 0;
 	int i = 0;
 
@@ -579,7 +576,7 @@ static int receiver_standard_h264_add_encoded_buffer_startcode(videortp_t *vrtp,
 
 		if (start_picture || nalu_type==NAL_SPS || nalu_type==NAL_PPS){
 			*dst++=0;
-			start_picture=FALSE;
+			start_picture=false;
 		}
 		*dst++ = 0;
 		*dst++ = 0;
@@ -795,7 +792,7 @@ rtpframe_t *receiver_standard_h264_assemble(videortp_t *vrtp,
 
 	int ret = -1;
 	int iret = -1;
-	rtpframe_t *frame = NULL;
+	//rtpframe_t *frame = NULL;
 	int key = 0;
 
 	x264_hdr *hdr = (x264_hdr*)&part_data->buf[0];
@@ -874,7 +871,7 @@ static int receiver_process_standard_h264_packet(
 			
 			decoded = receiver_standard_h264_decode(vrtp, frame);
 			if (decoded) {
-				//Dbg("decode_frame ok!");
+				//rtpDbg(vrtp,"decode_frame ok!");
 				if (vrtp->frame_duration==0 && vrtp->prev_dec_seq+1 == rtpframe_get_first_seq(frame)) {
 					vrtp->frame_duration = frame->ts - vrtp->prev_dec_ts;
 					rtpDbg(vrtp,"decode frame duration: %d", vrtp->frame_duration);
@@ -989,7 +986,7 @@ static int receiver_custom_h264_decode(videortp_t *vrtp, rtpframe_t *frame)
 {
 	if (frame->used) {
 		rtpframe_part_t *pos = NULL;
-		int got_picture = 0;
+		//int got_picture = 0;
 		uint8_t *input_buf = NULL;
 		int input_len = 0;
 
@@ -1151,17 +1148,15 @@ 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,and ifresh time is %dms.", ifresh_time);
 #ifdef _WIN32
 	SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
 #else
 	struct sched_param param;
 	int policy;
 	pthread_getschedparam(pthread_self(), &policy, &param);
-	rtpDbg(vrtp,"%s:%d current thread policy is %d, priority is %d.", __FUNCTION__, __LINE__, policy, param.sched_priority);
+	rtpDbg(vrtp,"current thread policy is %d, priority is %d.", policy, param.sched_priority);
 #endif
 	receiver_notify_peer_fast_update_now(vrtp);
 
@@ -1173,7 +1168,7 @@ void* recv_proc(void* arg)
 		struct timespec ts;
 		//int ivalue = -1;
 		clock_gettime(CLOCK_REALTIME, &ts);
-		long unsec = ts.tv_nsec + (1000 * 1000 * ifresh_time);
+		long unsec = ts.tv_nsec + (1000 * 1000 * 10);
 		ts.tv_sec += (unsec / 1000000000);
 		ts.tv_nsec = (unsec % 1000000000);
 		if (0 != sem_timedwait(&vrtp->sem_evt, &ts) && (ETIMEDOUT == errno))
@@ -1286,7 +1281,7 @@ void* recv_proc(void* arg)
 			break;
 		}
 	}
-	rtpDbg(vrtp, "exit recv_proc.");
+	//rtpDbg(vrtp, "exit recv_proc.");
 	return 0;
 }
 
@@ -1948,12 +1943,12 @@ void ffmpeg_encoder_create(videortp_t *vrtp, const videortp_config_t *config){
 	encoder_config.min_qp = 10;
 	video_encoder_api_configure_encoder(vrtp->encoder, &encoder_config, get_mtu(config->mtu) - 5/*padding*/ - ((sizeof(h26x_hdr)-2 + 32/*rtp_header_extension_length*/)));
 
-	rtpDbg(vrtp,"ffmpeg_encoder_create color_space: %d encode_id: %d width: %d height: %d.", 
-		encoder_config.color_space, encoder_config.encode_id, encoder_config.width, encoder_config.height);
-	rtpDbg(vrtp,"ffmpeg_encoder_create max_bitrate: %d min_bitrate: %d target_bitrate: %d.", 
-		max_bitrate, min_bitrate, target_bitrate);
-	rtpDbg(vrtp,"ffmpeg_encoder_create min_framerate: %d key_frame_interval: %d target_qp: %d.", 
-		encoder_config.min_framerate, encoder_config.key_frame_interval, encoder_config.target_qp);
+	//rtpDbg(vrtp,"ffmpeg_encoder_create color_space: %d encode_id: %d width: %d height: %d.", 
+	//	encoder_config.color_space, encoder_config.encode_id, encoder_config.width, encoder_config.height);
+	//rtpDbg(vrtp,"ffmpeg_encoder_create max_bitrate: %d min_bitrate: %d target_bitrate: %d.", 
+	//	max_bitrate, min_bitrate, target_bitrate);
+	//rtpDbg(vrtp,"ffmpeg_encoder_create min_framerate: %d key_frame_interval: %d target_qp: %d.", 
+	//	encoder_config.min_framerate, encoder_config.key_frame_interval, encoder_config.target_qp);
 
 }
 
@@ -1963,7 +1958,7 @@ void ffmpeg_encoder_destory(videortp_t *vrtp){
 		video_encoder_api_stop(vrtp->encoder);
 		video_encoder_api_destroy(vrtp->encoder);
 	}
-	rtpDbg(vrtp,"ffmpeg_encoder_destory.");
+	//rtpDbg(vrtp,"ffmpeg_encoder_destory.");
 }
 
 
@@ -2000,7 +1995,7 @@ void jitter_buffer_create(videortp_t *vrtp, const videortp_config_t *config){
 	log_func.userdata = vrtp;
 	vrtp->jbuffer = video_jbuffer_api_new(&video_jbuffer_observer, &log_func);
 	
-	rtpDbg(vrtp,"jitter_buffer_create.");
+	//rtpDbg(vrtp,"jitter_buffer_create.");
 }
 
 
@@ -2008,7 +2003,7 @@ void jitter_buffer_destory(videortp_t *vrtp){
 	if (vrtp->jbuffer != NULL) {
 		video_jbuffer_api_destroy(vrtp->jbuffer);
 	}
-	rtpDbg(vrtp,"jitter_buffer_destory.");
+	//rtpDbg(vrtp,"jitter_buffer_destory.");
 }
 
 
@@ -2071,12 +2066,12 @@ int videortp_create(const videortp_config_t *config, videortp_t **p_rtp)
 	vrtp->remote_support_cc = 0;
 	memcpy((void *)(&vrtp->config), (const void *)config, sizeof(videortp_config_t));
 
-	rtpDbg(vrtp,"videortp_create local_pt: %d local_ip: %d local_rtp_port: %d.", config->local_pt, config->local_ip, config->local_rtp_port);
-	rtpDbg(vrtp,"videortp_create remote_pt: %d remote_ip: %d remote_rtp_port: %d.", config->remote_pt, config->remote_ip, config->remote_rtp_port);
-	rtpDbg(vrtp,"videortp_create tx_width: %d tx_height: %d.", config->tx_width, config->tx_height);
-	rtpDbg(vrtp,"videortp_create rx_width: %d rx_height: %d.", config->rx_width, config->rx_height);
-	rtpDbg(vrtp,"videortp_create capture_width: %d capture_height: %d.", config->capture_width, config->capture_height);
-	rtpDbg(vrtp,"videortp_create fps_num: %d bit_rate: %d dir: %d.", config->fps_num, config->bit_rate, config->dir);
+	//rtpDbg(vrtp,"videortp_create local_pt: %d local_ip: %d local_rtp_port: %d.", config->local_pt, config->local_ip, config->local_rtp_port);
+	//rtpDbg(vrtp,"videortp_create remote_pt: %d remote_ip: %d remote_rtp_port: %d.", config->remote_pt, config->remote_ip, config->remote_rtp_port);
+	//rtpDbg(vrtp,"videortp_create tx_width: %d tx_height: %d.", config->tx_width, config->tx_height);
+	//rtpDbg(vrtp,"videortp_create rx_width: %d rx_height: %d.", config->rx_width, config->rx_height);
+	//rtpDbg(vrtp,"videortp_create capture_width: %d capture_height: %d.", config->capture_width, config->capture_height);
+	//rtpDbg(vrtp,"videortp_create fps_num: %d bit_rate: %d dir: %d.", config->fps_num, config->bit_rate, config->dir);
 
 	INIT_LIST_HEAD(&vrtp->free_part_list);
 	for (i = 0; i < FRAME_WIN_SIZE; ++i) {
@@ -2092,11 +2087,11 @@ int videortp_create(const videortp_config_t *config, videortp_t **p_rtp)
 		rtpLogevent(vrtp, 0, strMessage);
 		goto on_error;
 	}
-	else {
-		char strInfo[MAX_PATH] = { 0 };
-		snprintf(strInfo, MAX_PATH, "video rtp create success and local port is %d.", config->local_rtp_port);
-		rtpLogevent(vrtp, 0, strInfo);
-	}
+	//else {
+	//	char strmsg[MAX_PATH] = { 0 };
+	//	_snprintf(strmsg, MAX_PATH, "video rtp create success and local port is %d.", config->local_rtp_port);
+	//	rtpLogevent(vrtp, 0, strmsg);
+	//}
 
 	{
 		VideoStatsLogCallBack log_func;
@@ -2146,7 +2141,7 @@ void videortp_destroy(videortp_t *vrtp)
 	}
 	config = &vrtp->config;
 
-	rtpDbg(vrtp,"videortp_destroy.");
+	//rtpDbg(vrtp,"videortp_destroy.");
 
 	receiver_clear_window(vrtp);
 	while (!list_empty(&vrtp->free_part_list)) {
@@ -2166,11 +2161,11 @@ void videortp_destroy(videortp_t *vrtp)
 	rtp_session_get_local_rtp_port(vrtp->rtp_sess, &ilocal_port);
 	
 	rtp_session_destroy(vrtp->rtp_sess);
-	{
-		char strInfo[MAX_PATH] = { 0 };
-		snprintf(strInfo, MAX_PATH, "video rtp destroy and local port is %u.", ilocal_port);
-		rtpLogevent(vrtp, 1, strInfo);
-	}
+	//{
+	//	char strmsg[MAX_PATH] = { 0 };
+	//	_snprintf(strmsg, MAX_PATH, "video rtp destroy and local port is %u.", ilocal_port);
+	//	rtpLogevent(vrtp, 1, strmsg);
+	//}
 	vrtp->rtp_sess = NULL;
 
 	if (config->dir & DIR_RX) {
@@ -2210,15 +2205,11 @@ int videortp_start(videortp_t *vrtp)
 		pthread_attr_setschedparam(&attr, &param);
 		pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
 		int err = pthread_create(&vrtp->recv_threadid, NULL, recv_proc, vrtp);
-		if (0 == err) {
-			rtpDbg(vrtp,"create vrtp recv thread success, and thread id is %u.", vrtp->recv_threadid);
-		}
-		else {
+		if (0 != err) {
 			rtpDbg(vrtp,"create vrtp recv thread failed for %s.", strerror(errno));
 		}
 #endif
 	}
-	rtpDbg(vrtp,"videortp_start.");
 
 	receiver_config_stats.remote_pt = vrtp->config.remote_pt;
 	receiver_config_stats.local_ip = vrtp->config.local_ip;
@@ -2247,7 +2238,7 @@ int videortp_start(videortp_t *vrtp)
 void videortp_stop(videortp_t* vrtp)
 {
 	int64_t now = TimeInMilliseconds();
-	rtpDbg(vrtp,"%s:%d start call videortp_stop.", __FUNCTION__, __LINE__);
+	//rtpDbg(vrtp,"start call videortp_stop.");
 #ifdef _WIN32
 	if (vrtp->evt) {
 		SetEvent(vrtp->evt);
@@ -2264,7 +2255,6 @@ void videortp_stop(videortp_t* vrtp)
 		sem_post(&vrtp->sem_evt);
 		if (0 != vrtp->recv_threadid) {
 			if (0 == pthread_join(vrtp->recv_threadid, NULL)){
-				rtpDbg(vrtp, "%s:%d vrtp receive thread %u thread join success.", __FUNCTION__, __LINE__, vrtp->recv_threadid);
 				vrtp->recv_threadid = 0;
 			}
 			else {
@@ -2275,13 +2265,10 @@ void videortp_stop(videortp_t* vrtp)
 	}
 #endif
 
-	rtpDbg(vrtp,"%s:%d stop rtp recv thread.", __FUNCTION__, __LINE__);
-
 	video_stats_receiver_on_stopped(now);
 	video_stats_sender_on_stopped(now);
+	
 	video_jbuffer_api_stop(vrtp->jbuffer);
-
-	rtpDbg(vrtp,"%s:%d  videortp_stop func end.", __FUNCTION__, __LINE__);
 }
 
 int videortp_send_frame(videortp_t *vrtp, const video_frame *frame)
@@ -2290,7 +2277,7 @@ int videortp_send_frame(videortp_t *vrtp, const video_frame *frame)
 		int64_t now;
 
 		if(DEBUG_TX){
-		rtpDbg(vrtp,"%s:%d: videortp_send_frame width: %d height: %d format: %d.", __FILE__, __LINE__, frame->width, frame->height, frame->format);
+			rtpDbg(vrtp,"%s:%d: videortp_send_frame width: %d height: %d format: %d.", __FILE__, __LINE__, frame->width, frame->height, frame->format);
 		}
 		
 		if (VIDEO_FORMAT_RGB24 != frame->format)
@@ -2308,8 +2295,7 @@ int videortp_send_frame(videortp_t *vrtp, const video_frame *frame)
 			vrtp->force_key_frames = 0;
 
 			if(DEBUG_TX){
-			rtpDbg(vrtp,"%s:%d: videortp_send_frame force_key_frames.", __FILE__, __LINE__);
-
+				rtpDbg(vrtp,"%s:%d: videortp_send_frame force_key_frames.", __FILE__, __LINE__);
 			}
 		}
 		//在编码器中固定i帧间隔为2s,不再需要自己主动设置了
@@ -2322,7 +2308,7 @@ int videortp_send_frame(videortp_t *vrtp, const video_frame *frame)
 				if (vrtp->framenum % start_key_interval == 0) {
 					video_encoder_api_send_key_frame(vrtp->encoder);
 					if(DEBUG_TX){
-					rtpDbg(vrtp,"%s:%d: videortp_send_frame framenum: %d force_key_frames.", __FILE__, __LINE__, vrtp->framenum);
+						rtpDbg(vrtp,"%s:%d: videortp_send_frame framenum: %d force_key_frames.", __FILE__, __LINE__, vrtp->framenum);
 					}
 				}
 			}
@@ -2363,9 +2349,9 @@ int videortp_send_yuvframe(videortp_t *vrtp, const video_frame *vframe)
 	return 0;
 }
 
-int videortp_reconfig_local_pt(videortp_t *vrtp, unsigned int local_pt){
-	rtpDbg(vrtp,"videortp_reconfig_local_pt:%u .", local_pt);
-
+int videortp_reconfig_local_pt(videortp_t *vrtp, unsigned int local_pt)
+{
+	//rtpDbg(vrtp,"videortp_reconfig_local_pt:%u .", local_pt);
 	vrtp->config.local_pt = local_pt;
 }
 

+ 0 - 1
Other/unix/libvideoframework/videortp.h

@@ -32,7 +32,6 @@ 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

+ 2 - 3
Other/win/libvideoframework/videoclock.c

@@ -177,12 +177,11 @@ int videoclock_create(int fps_num,
 	clock->nVideoSendFreq = nFps;
 	clock->dbglog = dbgfunc;
     *p_clock = clock;
-    
-	//clockDbg(clock,"%s:%d videoclock_create success.", __FUNCTION__, __LINE__);
+	
     return 0;
 
 on_error:
-	clockDbg(clock,"%s:%d videoclock_create failed for %s.", __FUNCTION__, __LINE__, strerror(errno));
+	clockDbg(clock,"videoclock_create failed for %s.", strerror(errno));
     CloseHandle(clock->exit_evt);
     free(clock);
     return -1;

+ 27 - 36
Other/win/libvideoframework/videortp.c

@@ -447,15 +447,15 @@ void decoder_create(videortp_t *vrtp, const videortp_config_t *config){
 	log_func.userdata = vrtp;
 	vrtp->decoder = video_decoder_open(&decoder_config, &log_func);
 
-	rtpDbg(vrtp,"decoder_create color_space: %d decode_id: %d width: %d height: %d.", 
-		decoder_config.color_space, decoder_config.decode_id, decoder_config.width, decoder_config.height);
+	//rtpDbg(vrtp,"decoder_create color_space: %d decode_id: %d width: %d height: %d.", 
+	//	decoder_config.color_space, decoder_config.decode_id, decoder_config.width, decoder_config.height);
 }
 
 void decoder_destroy(videortp_t *vrtp){
 	if (vrtp->decoder != NULL) {
 		video_decoder_close(vrtp->decoder);
 	}
-	rtpDbg(vrtp,"decoder_destroy.");
+	//rtpDbg(vrtp,"decoder_destroy.");
 }
 
 
@@ -562,7 +562,7 @@ static int receiver_standard_h264_add_encoded_buffer_startcode(videortp_t *vrtp,
 	uint8_t *output_buf)
 {
 	uint8_t *dst = NULL;
-	bool_t start_picture=TRUE;
+	bool_t start_picture=true;
 	int output_len = 0;
 	int i = 0;
 
@@ -576,7 +576,7 @@ static int receiver_standard_h264_add_encoded_buffer_startcode(videortp_t *vrtp,
 
 		if (start_picture || nalu_type==NAL_SPS || nalu_type==NAL_PPS){
 			*dst++=0;
-			start_picture=FALSE;
+			start_picture=false;
 		}
 		*dst++ = 0;
 		*dst++ = 0;
@@ -1156,7 +1156,7 @@ void* recv_proc(void* arg)
 	struct sched_param param;
 	int policy;
 	pthread_getschedparam(pthread_self(), &policy, &param);
-	rtpDbg(vrtp,"%s:%d current thread policy is %d, priority is %d.", __FUNCTION__, __LINE__, policy, param.sched_priority);
+	rtpDbg(vrtp,"current thread policy is %d, priority is %d.", policy, param.sched_priority);
 #endif
 	receiver_notify_peer_fast_update_now(vrtp);
 
@@ -1168,7 +1168,7 @@ void* recv_proc(void* arg)
 		struct timespec ts;
 		//int ivalue = -1;
 		clock_gettime(CLOCK_REALTIME, &ts);
-		long unsec = ts.tv_nsec + (1000 * 1000 * ifresh_time);
+		long unsec = ts.tv_nsec + (1000 * 1000 * 10);
 		ts.tv_sec += (unsec / 1000000000);
 		ts.tv_nsec = (unsec % 1000000000);
 		if (0 != sem_timedwait(&vrtp->sem_evt, &ts) && (ETIMEDOUT == errno))
@@ -1281,7 +1281,7 @@ void* recv_proc(void* arg)
 			break;
 		}
 	}
-	rtpDbg(vrtp, "exit recv_proc.");
+	//rtpDbg(vrtp, "exit recv_proc.");
 	return 0;
 }
 
@@ -1943,12 +1943,12 @@ void ffmpeg_encoder_create(videortp_t *vrtp, const videortp_config_t *config){
 	encoder_config.min_qp = 10;
 	video_encoder_api_configure_encoder(vrtp->encoder, &encoder_config, get_mtu(config->mtu) - 5/*padding*/ - ((sizeof(h26x_hdr)-2 + 32/*rtp_header_extension_length*/)));
 
-	rtpDbg(vrtp,"ffmpeg_encoder_create color_space: %d encode_id: %d width: %d height: %d.", 
-		encoder_config.color_space, encoder_config.encode_id, encoder_config.width, encoder_config.height);
-	rtpDbg(vrtp,"ffmpeg_encoder_create max_bitrate: %d min_bitrate: %d target_bitrate: %d.", 
-		max_bitrate, min_bitrate, target_bitrate);
-	rtpDbg(vrtp,"ffmpeg_encoder_create min_framerate: %d key_frame_interval: %d target_qp: %d.", 
-		encoder_config.min_framerate, encoder_config.key_frame_interval, encoder_config.target_qp);
+	//rtpDbg(vrtp,"ffmpeg_encoder_create color_space: %d encode_id: %d width: %d height: %d.", 
+	//	encoder_config.color_space, encoder_config.encode_id, encoder_config.width, encoder_config.height);
+	//rtpDbg(vrtp,"ffmpeg_encoder_create max_bitrate: %d min_bitrate: %d target_bitrate: %d.", 
+	//	max_bitrate, min_bitrate, target_bitrate);
+	//rtpDbg(vrtp,"ffmpeg_encoder_create min_framerate: %d key_frame_interval: %d target_qp: %d.", 
+	//	encoder_config.min_framerate, encoder_config.key_frame_interval, encoder_config.target_qp);
 
 }
 
@@ -1958,7 +1958,7 @@ void ffmpeg_encoder_destory(videortp_t *vrtp){
 		video_encoder_api_stop(vrtp->encoder);
 		video_encoder_api_destroy(vrtp->encoder);
 	}
-	rtpDbg(vrtp,"ffmpeg_encoder_destory.");
+	//rtpDbg(vrtp,"ffmpeg_encoder_destory.");
 }
 
 
@@ -1995,7 +1995,7 @@ void jitter_buffer_create(videortp_t *vrtp, const videortp_config_t *config){
 	log_func.userdata = vrtp;
 	vrtp->jbuffer = video_jbuffer_api_new(&video_jbuffer_observer, &log_func);
 	
-	rtpDbg(vrtp,"jitter_buffer_create.");
+	//rtpDbg(vrtp,"jitter_buffer_create.");
 }
 
 
@@ -2003,7 +2003,7 @@ void jitter_buffer_destory(videortp_t *vrtp){
 	if (vrtp->jbuffer != NULL) {
 		video_jbuffer_api_destroy(vrtp->jbuffer);
 	}
-	rtpDbg(vrtp,"jitter_buffer_destory.");
+	//rtpDbg(vrtp,"jitter_buffer_destory.");
 }
 
 
@@ -2141,7 +2141,7 @@ void videortp_destroy(videortp_t *vrtp)
 	}
 	config = &vrtp->config;
 
-	rtpDbg(vrtp,"videortp_destroy.");
+	//rtpDbg(vrtp,"videortp_destroy.");
 
 	receiver_clear_window(vrtp);
 	while (!list_empty(&vrtp->free_part_list)) {
@@ -2205,15 +2205,11 @@ int videortp_start(videortp_t *vrtp)
 		pthread_attr_setschedparam(&attr, &param);
 		pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
 		int err = pthread_create(&vrtp->recv_threadid, NULL, recv_proc, vrtp);
-		if (0 == err) {
-			rtpDbg(vrtp,"create vrtp recv thread success, and thread id is %u.", vrtp->recv_threadid);
-		}
-		else {
+		if (0 != err) {
 			rtpDbg(vrtp,"create vrtp recv thread failed for %s.", strerror(errno));
 		}
 #endif
 	}
-	rtpDbg(vrtp,"videortp_start.");
 
 	receiver_config_stats.remote_pt = vrtp->config.remote_pt;
 	receiver_config_stats.local_ip = vrtp->config.local_ip;
@@ -2239,10 +2235,10 @@ int videortp_start(videortp_t *vrtp)
 	return 0;
 }
 
-void videortp_stop(videortp_t *vrtp)
+void videortp_stop(videortp_t* vrtp)
 {
 	int64_t now = TimeInMilliseconds();
-	rtpDbg(vrtp,"start call videortp_stop.");
+	//rtpDbg(vrtp,"start call videortp_stop.");
 #ifdef _WIN32
 	if (vrtp->evt) {
 		SetEvent(vrtp->evt);
@@ -2259,7 +2255,6 @@ void videortp_stop(videortp_t *vrtp)
 		sem_post(&vrtp->sem_evt);
 		if (0 != vrtp->recv_threadid) {
 			if (0 == pthread_join(vrtp->recv_threadid, NULL)){
-				rtpDbg(vrtp, "%s:%d vrtp receive thread %u thread join success.", __FUNCTION__, __LINE__, vrtp->recv_threadid);
 				vrtp->recv_threadid = 0;
 			}
 			else {
@@ -2270,13 +2265,10 @@ void videortp_stop(videortp_t *vrtp)
 	}
 #endif
 
-	rtpDbg(vrtp,"stop rtp recv thread.");
-
 	video_stats_receiver_on_stopped(now);
 	video_stats_sender_on_stopped(now);
 	
 	video_jbuffer_api_stop(vrtp->jbuffer);
-	rtpDbg(vrtp,"videortp_stop func end.");
 }
 
 int videortp_send_frame(videortp_t *vrtp, const video_frame *frame)
@@ -2285,7 +2277,7 @@ int videortp_send_frame(videortp_t *vrtp, const video_frame *frame)
 		int64_t now;
 
 		if(DEBUG_TX){
-		rtpDbg(vrtp,"%s:%d: videortp_send_frame width: %d height: %d format: %d.", __FILE__, __LINE__, frame->width, frame->height, frame->format);
+			rtpDbg(vrtp,"%s:%d: videortp_send_frame width: %d height: %d format: %d.", __FILE__, __LINE__, frame->width, frame->height, frame->format);
 		}
 		
 		if (VIDEO_FORMAT_RGB24 != frame->format)
@@ -2303,8 +2295,7 @@ int videortp_send_frame(videortp_t *vrtp, const video_frame *frame)
 			vrtp->force_key_frames = 0;
 
 			if(DEBUG_TX){
-			rtpDbg(vrtp,"%s:%d: videortp_send_frame force_key_frames.", __FILE__, __LINE__);
-
+				rtpDbg(vrtp,"%s:%d: videortp_send_frame force_key_frames.", __FILE__, __LINE__);
 			}
 		}
 		//在编码器中固定i帧间隔为2s,不再需要自己主动设置了
@@ -2317,7 +2308,7 @@ int videortp_send_frame(videortp_t *vrtp, const video_frame *frame)
 				if (vrtp->framenum % start_key_interval == 0) {
 					video_encoder_api_send_key_frame(vrtp->encoder);
 					if(DEBUG_TX){
-					rtpDbg(vrtp,"%s:%d: videortp_send_frame framenum: %d force_key_frames.", __FILE__, __LINE__, vrtp->framenum);
+						rtpDbg(vrtp,"%s:%d: videortp_send_frame framenum: %d force_key_frames.", __FILE__, __LINE__, vrtp->framenum);
 					}
 				}
 			}
@@ -2407,7 +2398,7 @@ int videortp_send_yuvframe(videortp_t *vrtp, const video_frame *vframe)
 	}
 
 	if(DEBUG_TX){
-	rtpDbg(vrtp,"%s:%d: videortp_send_yuvframe width: %d height: %d format: %d.", __FILE__, __LINE__, vframe->width, vframe->height, vframe->format);
+		rtpDbg(vrtp,"%s:%d: videortp_send_yuvframe width: %d height: %d format: %d.", __FILE__, __LINE__, vframe->width, vframe->height, vframe->format);
 	}
 	
 	memset(&xpic, 0, sizeof(xpic));
@@ -2456,7 +2447,7 @@ int videortp_send_yuvframe(videortp_t *vrtp, const video_frame *vframe)
 	if (0 == icount++%IDR_INTERVAL){
 		xpic.i_type = X264_TYPE_IDR;
 		if(DEBUG_TX){
-		rtpDbg(vrtp,"%s:%d: videortp_send_yuvframe icount: %d force_key_frames.", __FILE__, __LINE__, icount);
+			rtpDbg(vrtp,"%s:%d: videortp_send_yuvframe icount: %d force_key_frames.", __FILE__, __LINE__, icount);
 		}
 	}
 	else{
@@ -2491,7 +2482,7 @@ int videortp_send_yuvframe(videortp_t *vrtp, const video_frame *vframe)
 }
 
 int videortp_reconfig_local_pt(videortp_t *vrtp, unsigned int local_pt){
-	rtpDbg(vrtp,"videortp_reconfig_local_pt:%u .", local_pt);
+	//rtpDbg(vrtp,"videortp_reconfig_local_pt:%u .", local_pt);
 
 	vrtp->config.local_pt = local_pt;
 }