static long get_tick_count()
{
struct timeval tv;
gettimeofday(&tv, NULL);
return (tv.tv_sec * 1000 + tv.tv_usec/1000);
}
static void test_fps_bitrate(int frame_size)
{
static int frames_num =0;
static long start_time = 1;
static long total_frame_size = 0;
if(start_time == 1)
{
start_time = get_tick_count();
}
frames_num++;
total_frame_size += frame_size;
if(frames_num%30 == 0)
{
printf("fps = %ld/n", (long)(frames_num*1000/(get_tick_count()-start_time)));
printf("birtate = %ld/n", (long)(total_frame_size*1000/(get_tick_count()-start_time)));
start_time = get_tick_count();
frames_num = 0;
total_frame_size = 0;
}
}