From db3f843685a5af4f2c774c2a040a330466442536 Mon Sep 17 00:00:00 2001 From: iovar Date: Mon, 12 Nov 2007 08:11:33 +0000 Subject: cache_frame.c: added compression statistics to output git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@425 f606c939-3180-4ac9-a4b8-4b8779d57d0a --- recordmydesktop/src/cache_frame.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'recordmydesktop/src') diff --git a/recordmydesktop/src/cache_frame.c b/recordmydesktop/src/cache_frame.c index 08f503f..d4260e3 100644 --- a/recordmydesktop/src/cache_frame.c +++ b/recordmydesktop/src/cache_frame.c @@ -78,6 +78,8 @@ void *CacheImageBuffer(ProgData *pdata){ frameno=0, nbytes=0, nth_cache=1; + unsigned int total_bytes=0, + total_received_bytes=0; u_int32_t ynum,unum,vnum, y_short_blocks[blocknum_x*blocknum_y], u_short_blocks[blocknum_x*blocknum_y], @@ -241,10 +243,23 @@ void *CacheImageBuffer(ProgData *pdata){ //space is freed the recording //can be proccessed later. } + total_bytes+=(nbytes>>20); nth_cache++; nbytes=0; } } + total_bytes+=(nbytes>>20); + total_received_bytes=((frameno*((pdata->specs.depth>=24)?4:2)* + pdata->brwin.rgeom.width*pdata->brwin.rgeom.height)>>20); + fprintf(stderr,"\n*********************************************\n" + "\nCached %d MB, from %d MB that were received.\n" + "Average cache compression ratio: %u %%\n" + "\n*********************************************\n", + total_bytes, + total_received_bytes, + (total_bytes*100)/total_received_bytes + ); + fprintf(stderr,"Saved %d frames in a total of %d requests\n", frameno,frames_total);fflush(stderr); -- cgit v1.2.3