From fa96f09ceadcad5247a84245ad933782b4b71ee6 Mon Sep 17 00:00:00 2001 From: iovar Date: Sat, 20 Jan 2007 22:21:28 +0000 Subject: Concatated all UPDATE_YUV_BUFFER_* macros into one, UPDATE_YUV_BUFFER. This one is further broken into UPDATE_(X)_PLANE(S)_(Y) macros, where X is Y or UV and Y is 32 or 16(color depth). This will allow easier incorporation of 16bpp support, without code duplication(where it can be avoided) and without bloating the toplevel calls of these macros with multiple similar blocks of code. Also changed toplevel check of depth, to allow running on 16 bpp git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@259 f606c939-3180-4ac9-a4b8-4b8779d57d0a --- recordmydesktop/src/update_image.c | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) (limited to 'recordmydesktop/src/update_image.c') diff --git a/recordmydesktop/src/update_image.c b/recordmydesktop/src/update_image.c index 2725011..1bf0cd5 100644 --- a/recordmydesktop/src/update_image.c +++ b/recordmydesktop/src/update_image.c @@ -40,7 +40,7 @@ void UpdateImage(Display * dpy, RectArea *temp; unsigned char *dtap=(unsigned char*)datatemp; temp=*root; - + if(temp!=NULL){ do{ if(noshmem){ @@ -51,34 +51,14 @@ void UpdateImage(Display * dpy, temp->geom.y, temp->geom.width, temp->geom.height); - - pthread_mutex_lock(yuv_mutex); - if(no_quick_subsample){ - UPDATE_YUV_BUFFER_IM_AVG(yuv,dtap, - (temp->geom.x-brwin->rgeom.x+enc->x_offset),(temp->geom.y-brwin->rgeom.y+enc->y_offset), - (temp->geom.width),(temp->geom.height)); - } - else{ - UPDATE_YUV_BUFFER_IM(yuv,dtap, - (temp->geom.x-brwin->rgeom.x+enc->x_offset),(temp->geom.y-brwin->rgeom.y+enc->y_offset), - (temp->geom.width),(temp->geom.height)); - } - - pthread_mutex_unlock(yuv_mutex); - } - else{ - if(no_quick_subsample){ - UPDATE_YUV_BUFFER_SH_AVG(yuv,dtap, - (temp->geom.x-brwin->rgeom.x+enc->x_offset),(temp->geom.y-brwin->rgeom.y+enc->y_offset), - (temp->geom.width),(temp->geom.height)); - } - else{ - UPDATE_YUV_BUFFER_SH(yuv,dtap, - (temp->geom.x-brwin->rgeom.x+enc->x_offset),(temp->geom.y-brwin->rgeom.y+enc->y_offset), - (temp->geom.width),(temp->geom.height)); - } - } + pthread_mutex_lock(yuv_mutex); + UPDATE_YUV_BUFFER(yuv,dtap, + (temp->geom.x-brwin->rgeom.x+enc->x_offset), + (temp->geom.y-brwin->rgeom.y+enc->y_offset), + (temp->geom.width),(temp->geom.height), + noshmem,no_quick_subsample); + pthread_mutex_unlock(yuv_mutex); temp=temp->next; }while(temp!=NULL); } -- cgit v1.2.1