summaryrefslogtreecommitdiff
path: root/recordmydesktop/src/cache_frame.c
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-11-12 08:11:33 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-11-12 08:11:33 +0000
commitdb3f843685a5af4f2c774c2a040a330466442536 (patch)
tree7cb06524b3e111e589e1d3736ca42c146fddc7ff /recordmydesktop/src/cache_frame.c
parent03cffc835d4f661bc7b308c85af0fa4b70c68f80 (diff)
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
Diffstat (limited to 'recordmydesktop/src/cache_frame.c')
-rw-r--r--recordmydesktop/src/cache_frame.c15
1 files changed, 15 insertions, 0 deletions
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);
© All Rights Reserved