summaryrefslogtreecommitdiff
path: root/recordmydesktop
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-01-17 16:45:05 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-01-17 16:45:05 +0000
commite4c2e9c97b8419ab4464c8fa30e549853095deb9 (patch)
treea24c42af54c17c1a89eb020c488132f4e6cf1109 /recordmydesktop
parent7c935ab93e9ecaa4e97da84e545c2edcbf4f918f (diff)
fix for xfixes cursor in amd64 (and any arch
with sizeof(long)!=4). Xfixes.h declares the pixels as a list of unsigned long instead of CARD32 that is used on the serverside , resulting in 4 byte padding on amd64, where sizeof(long)==8.This was breaking the XFIXES_POINTER_TO_YUV macro, but is now corrected. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@256 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop')
-rw-r--r--recordmydesktop/include/rmdmacro.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/recordmydesktop/include/rmdmacro.h b/recordmydesktop/include/rmdmacro.h
index b149b11..b8e529a 100644
--- a/recordmydesktop/include/rmdmacro.h
+++ b/recordmydesktop/include/rmdmacro.h
@@ -55,6 +55,12 @@
#define __GVALUE(tmp_val) (((tmp_val)&0x0000ff00)>>8)
#define __BVALUE(tmp_val) (((tmp_val)&0x000000ff))
+//xfixes pointer data are written as unsigned long
+//(even though the server returns CARD32)
+//so we need to set the step accordingly to
+//avoid problems (amd64 has 8byte ulong)
+#define RMD_ULONG_SIZE_T (sizeof(unsigned long))
+
//500 mb file size
#define CACHE_FILE_SIZE_LIMIT (500*1<<20)
@@ -172,8 +178,10 @@
}
#define AVG_4_PIXELS(data_array,width_img,k_tm,i_tm,offset)\
- ((data_array[(k_tm*width_img+i_tm)*4+offset]+data_array[((k_tm-1)*width_img+i_tm)*4+offset]\
- +data_array[(k_tm*width_img+i_tm-1)*4+offset]+data_array[((k_tm-1)*width_img+i_tm-1)*4+offset])/4)
+ ((data_array[(k_tm*width_img+i_tm)*RMD_ULONG_SIZE_T+offset]+\
+ data_array[((k_tm-1)*width_img+i_tm)*RMD_ULONG_SIZE_T+offset]+\
+ data_array[(k_tm*width_img+i_tm-1)*RMD_ULONG_SIZE_T+offset]+\
+ data_array[((k_tm-1)*width_img+i_tm-1)*RMD_ULONG_SIZE_T+offset])/4)
#define UPDATE_YUV_BUFFER_SH(yuv,data,x_tm,y_tm,width_tm,height_tm){\
int k,i;\
@@ -370,8 +378,9 @@
for(k=0;k<height_tm;k++){\
for(i=0;i<width_tm;i++){\
yuv->y[x_tm+i+(k+y_tm)*yuv->y_width]=\
- (yuv->y[x_tm+i+(k+y_tm)*yuv->y_width]*(UCHAR_MAX-data[(j*4)+__ABYTE])+\
- (Yr[data[(j*4)+__RBYTE]] + Yg[data[(j*4)+__GBYTE]] + Yb[data[(j*4)+__BBYTE]])*data[(j*4)+__ABYTE])/UCHAR_MAX ;\
+ (yuv->y[x_tm+i+(k+y_tm)*yuv->y_width]*(UCHAR_MAX-data[(j*RMD_ULONG_SIZE_T)+__ABYTE])+\
+ (Yr[data[(j*RMD_ULONG_SIZE_T)+__RBYTE]] + Yg[data[(j*RMD_ULONG_SIZE_T)+__GBYTE]] +\
+ Yb[data[(j*RMD_ULONG_SIZE_T)+__BBYTE]])*data[(j*RMD_ULONG_SIZE_T)+__ABYTE])/UCHAR_MAX ;\
if((k%2)&&(i%2)){\
avg3=AVG_4_PIXELS(data,(width_tm+column_discard_stride),k,i,__ABYTE);\
avg2=AVG_4_PIXELS(data,(width_tm+column_discard_stride),k,i,__RBYTE);\
© All Rights Reserved