diff options
Diffstat (limited to 'recordmydesktop/include/rmdmacro.h')
-rw-r--r-- | recordmydesktop/include/rmdmacro.h | 209 |
1 files changed, 0 insertions, 209 deletions
diff --git a/recordmydesktop/include/rmdmacro.h b/recordmydesktop/include/rmdmacro.h index f3dfcd6..13455ed 100644 --- a/recordmydesktop/include/rmdmacro.h +++ b/recordmydesktop/include/rmdmacro.h @@ -77,10 +77,6 @@ #define COMPARE_STRIDE 4 #endif -//500 mb file size -#define CACHE_FILE_SIZE_LIMIT (500*1<<20) -//minimize hard disk access -#define CACHE_OUT_BUFFER_SIZE 4096 //The width, in bytes, of the blocks @@ -89,16 +85,6 @@ #define Y_UNIT_WIDTH 0x0010 #define UV_UNIT_WIDTH 0x0008 -//The number of bytes for every -//sub-block of the y,u and v planes. -//Since the blocks are square -//these are obviously the squares -//of the widths(specified above), -//but the definitions bellow are only -//for convenience anyway. -#define Y_UNIT_BYTES 0x0100 -#define UV_UNIT_BYTES 0x0040 - #ifdef HAVE_LIBASOUND #define DEFAULT_AUDIO_DEVICE "hw:0,0" #else @@ -107,84 +93,6 @@ -#define CLIP_EVENT_AREA(e,brwin,wgeom){\ - if(((e)->area.x<=(brwin)->rgeom.x)&&((e)->area.y<=(brwin)->rgeom.y)&&\ - ((e)->area.width>=(brwin)->rgeom.width)&&\ - ((e)->area.height<(brwin)->rgeom.height)){\ - (wgeom)->x=(brwin)->rgeom.x;\ - (wgeom)->y=(brwin)->rgeom.y;\ - (wgeom)->width=(brwin)->rgeom.width;\ - (wgeom)->height=(brwin)->rgeom.height;\ - }\ - else{\ - (wgeom)->x=((((e)->area.x+(e)->area.width>=(brwin)->rgeom.x)&&\ - ((e)->area.x<=(brwin)->rgeom.x+(brwin)->rgeom.width))?\ - (((e)->area.x<=(brwin)->rgeom.x)?(brwin)->rgeom.x:(e)->area.x):-1);\ - \ - (wgeom)->y=((((e)->area.y+(e)->area.height>=(brwin)->rgeom.y)&&\ - ((e)->area.y<=(brwin)->rgeom.y+(brwin)->rgeom.height))?\ - (((e)->area.y<=(brwin)->rgeom.y)?(brwin)->rgeom.y:(e)->area.y):-1);\ - \ - (wgeom)->width=((e)->area.x<=(brwin)->rgeom.x)?\ - (e)->area.width-((brwin)->rgeom.x-(e)->area.x):\ - ((e)->area.x<=(brwin)->rgeom.x+(brwin)->rgeom.width)?\ - (((brwin)->rgeom.width-(e)->area.x+(brwin)->rgeom.x<(e)->area.width)?\ - (brwin)->rgeom.width-(e)->area.x+(brwin)->rgeom.x:e->area.width):-1;\ - \ - (wgeom)->height=((e)->area.y<=(brwin)->rgeom.y)?\ - (e)->area.height-((brwin)->rgeom.y-(e)->area.y):\ - ((e)->area.y<=(brwin)->rgeom.y+(brwin)->rgeom.height)?\ - (((brwin)->rgeom.height-(e)->area.y+\ - (brwin)->rgeom.y<(e)->area.height)?\ - (brwin)->rgeom.height-(e)->area.y+\ - (brwin)->rgeom.y:(e)->area.height):-1;\ - \ - if((wgeom)->width>(brwin)->rgeom.width)\ - (wgeom)->width=(brwin)->rgeom.width;\ - if((wgeom)->height>(brwin)->rgeom.height)\ - (wgeom)->height=(brwin)->rgeom.height;\ - }\ -} - -#define CLIP_DUMMY_POINTER_AREA(dummy_p_area,brwin,wgeom){\ - (wgeom)->x=((((dummy_p_area).x+\ - (dummy_p_area).width>=(brwin)->rgeom.x)&&\ - ((dummy_p_area).x<=(brwin)->rgeom.x+\ - (brwin)->rgeom.width))?\ - (((dummy_p_area).x<=(brwin)->rgeom.x)?\ - (brwin)->rgeom.x:(dummy_p_area).x):-1);\ - (wgeom)->y=((((dummy_p_area).y+\ - (dummy_p_area).height>=(brwin)->rgeom.y)&&\ - ((dummy_p_area).y<=(brwin)->rgeom.y+\ - (brwin)->rgeom.height))?\ - (((dummy_p_area).y<=(brwin)->rgeom.y)?\ - (brwin)->rgeom.y:(dummy_p_area).y):-1);\ - (wgeom)->width=((dummy_p_area).x<=(brwin)->rgeom.x)?\ - (dummy_p_area).width-\ - ((brwin)->rgeom.x-(dummy_p_area).x):\ - ((dummy_p_area).x<=(brwin)->rgeom.x+\ - (brwin)->rgeom.width)?\ - ((brwin)->rgeom.width-(dummy_p_area).x+\ - (brwin)->rgeom.x<(dummy_p_area).width)?\ - (brwin)->rgeom.width-(dummy_p_area).x+\ - (brwin)->rgeom.x:(dummy_p_area).width:-1;\ - (wgeom)->height=((dummy_p_area).y<=(brwin)->rgeom.y)?\ - (dummy_p_area).height-\ - ((brwin)->rgeom.y-(dummy_p_area).y):\ - ((dummy_p_area).y<=(brwin)->rgeom.y+\ - (brwin)->rgeom.height)?\ - ((brwin)->rgeom.height-(dummy_p_area).y+\ - (brwin)->rgeom.y<(dummy_p_area).height)?\ - (brwin)->rgeom.height-(dummy_p_area).y+\ - (brwin)->rgeom.y:(dummy_p_area).height:-1;\ - if((wgeom)->width>(brwin)->rgeom.width)\ - (wgeom)->width=(brwin)->rgeom.width;\ - if((wgeom)->height>(brwin)->rgeom.height)\ - (wgeom)->height=(brwin)->rgeom.height;\ -} - - - #define DEFAULT_ARGS(args){\ (args)->delay=0;\ if(getenv("DISPLAY")!=NULL){\ @@ -235,18 +143,6 @@ strcpy((args)->stop_shortcut,"Control+Mod1+s");\ } -#define QUERY_DISPLAY_SPECS(display,specstruct){\ - (specstruct)->screen=DefaultScreen(display);\ - (specstruct)->width=DisplayWidth(display,(specstruct)->screen);\ - (specstruct)->height=DisplayHeight(display,(specstruct)->screen);\ - (specstruct)->root=RootWindow(display,(specstruct)->screen);\ - (specstruct)->visual=DefaultVisual(display,(specstruct)->screen);\ - (specstruct)->gc=DefaultGC(display,(specstruct)->screen);\ - (specstruct)->depth=DefaultDepth(display,(specstruct)->screen);\ - (specstruct)->bpixel=XBlackPixel(display,(specstruct)->screen);\ - (specstruct)->wpixel=XWhitePixel(display,(specstruct)->screen);\ -} - #define AVG_4_PIXELS(data_array,width_img,k_tm,i_tm,offset)\ ((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]+\ @@ -550,58 +446,6 @@ -#define XFIXES_POINTER_TO_YUV(yuv,\ - data,\ - x_tm,\ - y_tm,\ - width_tm,\ - height_tm,\ - x_offset,\ - y_offset,\ - column_discard_stride){\ - int i,k,j=0;\ - unsigned char avg0,avg1,avg2,avg3;\ - int x_2=x_tm/2,y_2=y_tm/2;\ - for(k=y_offset;k<y_offset+height_tm;k++){\ - for(i=x_offset;i<x_offset+width_tm;i++){\ - j=k*(width_tm+column_discard_stride)+i;\ - yuv->y[x_tm+(i-x_offset)+(k+y_tm-y_offset)*yuv->y_width]=\ - (yuv->y[x_tm+(i-x_offset)+(k-y_offset+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);\ - avg1=AVG_4_PIXELS(data,\ - (width_tm+column_discard_stride),\ - k,i,__GBYTE);\ - avg0=AVG_4_PIXELS(data,\ - (width_tm+column_discard_stride),\ - k,i,__BBYTE);\ - yuv->u[x_2+(i-x_offset)/2+((k-y_offset)/2+y_2)*\ - yuv->uv_width]=\ - (yuv->u[x_2+(i-x_offset)/2+((k-y_offset)/2+y_2)*\ - yuv->uv_width]*\ - (UCHAR_MAX-avg3)+\ - (Ur[avg2] + Ug[avg1] +UbVr[avg0])*avg3)/UCHAR_MAX;\ - yuv->v[x_2+(i-x_offset)/2+((k-y_offset)/2+y_2)*\ - yuv->uv_width]=\ - (yuv->v[x_2+(i-x_offset)/2+((k-y_offset)/2+y_2)*\ - yuv->uv_width]*\ - (UCHAR_MAX-avg3)+\ - (UbVr[avg2] + Vg[avg1] +Vb[avg0])*avg3)/UCHAR_MAX;\ - }\ - }\ - }\ -} - #define DUMMY_POINTER_TO_YUV(yuv,\ data_tm,\ x_tm,\ @@ -636,34 +480,6 @@ }\ } -#define MARK_BACK_BUFFER( data,\ - x_tm,\ - y_tm,\ - width_tm,\ - height_tm,\ - buffer_width,\ - __bit_depth__){\ - if((__bit_depth__==24)||(__bit_depth__==32)){\ - MARK_BACK_BUFFER_C( data,\ - x_tm,\ - y_tm,\ - width_tm,\ - height_tm,\ - buffer_width,\ - 32)\ - }\ - else{\ - MARK_BACK_BUFFER_C( data,\ - x_tm,\ - y_tm,\ - width_tm,\ - height_tm,\ - buffer_width,\ - 16)\ - }\ -}\ - - #define MARK_BACK_BUFFER_C( data,\ x_tm,\ y_tm,\ @@ -701,36 +517,11 @@ free(t_buf);\ };\ -#define INIT_FRAME(frame_t,fheader_t,yuv_t,\ - YBlocks_t,UBlocks_t,VBlocks_t){\ - (frame_t)->header=(fheader_t);\ - (frame_t)->YBlocks=YBlocks_t;\ - (frame_t)->UBlocks=UBlocks_t;\ - (frame_t)->VBlocks=VBlocks_t;\ - (frame_t)->YData=malloc((yuv_t)->y_width*(yuv_t)->y_height);\ - (frame_t)->UData=malloc((yuv_t)->uv_width*(yuv_t)->uv_height);\ - (frame_t)->VData=malloc((yuv_t)->uv_width*(yuv_t)->uv_height);\ -}; - #define CLEAR_FRAME(frame_t){\ free((frame_t)->YData);\ free((frame_t)->UData);\ free((frame_t)->VData);\ }; -#ifdef HAVE_JACK_H - -#define CHECK_DLERRORS_FATAL(__error_p)\ - if((__error_p=dlerror())!=NULL){\ - fprintf(stderr,"%s\n",__error_p);\ - return 1;\ - } - -#define DLSYM_AND_CHECK(lib_handle,__call_name__,__error_p)\ - __call_name__##_p=dlsym(lib_handle,#__call_name__);\ - CHECK_DLERRORS_FATAL(__error_p) - -#endif - #endif |