diff options
Diffstat (limited to 'recordmydesktop/src')
| -rw-r--r-- | recordmydesktop/src/Makefile.am | 2 | ||||
| -rw-r--r-- | recordmydesktop/src/get_frame.c | 30 | ||||
| -rw-r--r-- | recordmydesktop/src/parseargs.c | 8 | ||||
| -rw-r--r-- | recordmydesktop/src/queryextensions.c | 19 | 
4 files changed, 54 insertions, 5 deletions
diff --git a/recordmydesktop/src/Makefile.am b/recordmydesktop/src/Makefile.am index bec4006..e56b856 100644 --- a/recordmydesktop/src/Makefile.am +++ b/recordmydesktop/src/Makefile.am @@ -24,5 +24,5 @@ recordmydesktop_SOURCES=	recordmydesktop.c\  INCLUDES= $(all_includes) -I../include -I$x_includes -recordmydesktop_LDFLAGS = -D_THREAD_SAFE -pthread -Wall -O3 +recordmydesktop_LDFLAGS = -D_THREAD_SAFE -pthread -Wall diff --git a/recordmydesktop/src/get_frame.c b/recordmydesktop/src/get_frame.c index 81ca392..ff935c0 100644 --- a/recordmydesktop/src/get_frame.c +++ b/recordmydesktop/src/get_frame.c @@ -34,6 +34,7 @@ void *GetFrame(void *pdata){      WGeometry mouse_pos_abs,mouse_pos_rel,mouse_pos_temp;      Window root_ret,child_ret;      int pixel_total=((ProgData *)pdata)->brwin.rgeom.width*((ProgData *)pdata)->brwin.rgeom.height; +    XFixesCursorImage *xcim=NULL;      mouse_pos_abs.x=0;      mouse_pos_abs.y=0; @@ -72,6 +73,21 @@ void *GetFrame(void *pdata){  //                 }              }          } +        if(((ProgData *)pdata)->args.xfixes_cursor){ +        //xfixes pointer sequence +        //update previous_position +            //(if full_shots is enabled this is skipped since it's pointless) +            if(!((ProgData *)pdata)->args.full_shots){ +                CLIP_DUMMY_POINTER_AREA(mouse_pos_abs,&((ProgData *)pdata)->brwin,&mouse_pos_temp); +                if((mouse_pos_temp.x>=0)&&(mouse_pos_temp.y>=0)&&(mouse_pos_temp.width>0)&&(mouse_pos_temp.height>0)) +                    RectInsert(&((ProgData *)pdata)->rect_root[tlist_sel],&mouse_pos_temp);         +            } +            xcim=XFixesGetCursorImage(((ProgData *)pdata)->dpy); +            mouse_pos_abs.x=xcim->x; +            mouse_pos_abs.y=xcim->y; +            mouse_pos_abs.width=xcim->width; +            mouse_pos_abs.height=xcim->height; +        }          if(((ProgData *)pdata)->args.have_dummy_cursor){          //dummy pointer sequence          //update previous_position @@ -139,6 +155,20 @@ void *GetFrame(void *pdata){                  pthread_mutex_unlock(&((ProgData *)pdata)->yuv_mutex);              }          } +        if(((ProgData *)pdata)->args.xfixes_cursor){ +        //avoid segfaults +            CLIP_DUMMY_POINTER_AREA(mouse_pos_abs,&((ProgData *)pdata)->brwin,&mouse_pos_temp); +        //draw the cursor +            if((mouse_pos_temp.x>=0)&&(mouse_pos_temp.y>=0)&&(mouse_pos_temp.width>0)&&(mouse_pos_temp.height>0)){ +                XFIXES_POINTER_TO_YUV((&((ProgData *)pdata)->enc_data->yuv),((unsigned char*)xcim->pixels), +                        (mouse_pos_temp.x-((ProgData *)pdata)->brwin.rgeom.x+((ProgData *)pdata)->enc_data->x_offset), +                        (mouse_pos_temp.y-((ProgData *)pdata)->brwin.rgeom.y+((ProgData *)pdata)->enc_data->y_offset), +                        mouse_pos_temp.width, +                        mouse_pos_temp.height, +                        (xcim->width-mouse_pos_temp.width)); +            } +        } +          if(((ProgData *)pdata)->args.have_dummy_cursor){          //avoid segfaults              CLIP_DUMMY_POINTER_AREA(mouse_pos_abs,&((ProgData *)pdata)->brwin,&mouse_pos_temp); diff --git a/recordmydesktop/src/parseargs.c b/recordmydesktop/src/parseargs.c index c858db0..6b40cc9 100644 --- a/recordmydesktop/src/parseargs.c +++ b/recordmydesktop/src/parseargs.c @@ -36,7 +36,7 @@ int ParseArgs(int argc,char **argv,ProgArgs *arg_return){      "\t -v_quality n| -s_quality n| -v_bitrate n| --no-framedrop| -dummy-cursor color|\n"      "\t --no-dummy-cursor| -freq N(number>0)| -channels N(number>0)| -device SOUND_DEVICE|\n"      "\t --nosound| --with-shared| --no-cond-shared| -shared-threshold n| --full-shots|\n" -    "\t --no-quick-subsampling| --scshot| -scale-shot N| -o filename]^filename\n\n\n" +    "\t --quick-subsampling| --scshot| -scale-shot N| -o filename]^filename\n\n\n"      "General Options:\n"      "\t-h or --help\t\tPrint this help and exit.\n" @@ -56,7 +56,7 @@ int ParseArgs(int argc,char **argv,ProgArgs *arg_return){      "\t--no-cond-shared\tDo not use the MIT-shared memory extension when aquiring large areas.\n"      "\t-shared-threshold n\tThreshold over which shared memory is used(default 75).\n"      "\t--full-shots\t\tTake full screenshot at every frame(Not recomended!).\n" -    "\t--no-quick-subsampling\tDo subsampling of the chroma planes by averaging,not discarding.\n" +    "\t--quick-subsampling\tDo subsampling of the chroma planes by discarding,not averaging.\n"      "\t-fps N(number>0.0)\tA positive number denoting desired framerate.\n\n"      "Sound Options:\n" @@ -399,8 +399,8 @@ int ParseArgs(int argc,char **argv,ProgArgs *arg_return){              arg_return->scshot=1;              arg_return->nocondshared=1;          } -        else if(!strcmp(argv[i],"--no-quick-subsampling")){ -            arg_return->no_quick_subsample=1; +        else if(!strcmp(argv[i],"--quick-subsampling")){ +            arg_return->no_quick_subsample=0;          }          else if(!strcmp(argv[i],"--help")||!strcmp(argv[i],"-h")){              fprintf(stderr,"%s",usage); diff --git a/recordmydesktop/src/queryextensions.c b/recordmydesktop/src/queryextensions.c index 056e534..0ccac84 100644 --- a/recordmydesktop/src/queryextensions.c +++ b/recordmydesktop/src/queryextensions.c @@ -28,6 +28,9 @@  #include <recordmydesktop.h>  int QueryExtensions(Display *dpy,ProgArgs *args,int *damage_event,int *damage_error){ +    int xf_event_basep, +        xf_error_basep; +      if(!XDamageQueryExtension( dpy, damage_event, damage_error)){          fprintf(stderr,"XDamage extension not found!!!\n");          return 1; @@ -36,5 +39,21 @@ int QueryExtensions(Display *dpy,ProgArgs *args,int *damage_event,int *damage_er          args->noshared=1;          fprintf(stderr,"Shared Memory extension not present!\nContinuing without it.\n");      } +    if((args->xfixes_cursor)&&(XFixesQueryExtension(dpy,&xf_event_basep,&xf_error_basep)==False)){ +        args->xfixes_cursor=0; +        fprintf(stderr,"Xfixes extension not present!\nContinuing without it.\n"); +    } +//     XFixesCursorImage *xcim; +//     xcim=XFixesGetCursorImage (dpy); +//     fprintf(stderr,"XFIXES:\n\n%d %d\n\n\n%d %d\n\n",xcim->width,xcim->height,xcim->xhot,xcim->yhot); +//     int i=0,k=0; +//     unsigned char *cp=((unsigned char *)xcim->pixels); +//     for(i=0;i<xcim->height;i++){ +//         for(k=0;k<xcim->width*4;k+=4){ +//             fprintf(stderr,"%d",cp[i*xcim->width*4+k]); +//         } +//         fprintf(stderr,"\n"); +//     } +      return 0;  }  | 
