From 27bbb3232b48ca03312ae455b38f0aa1a1849000 Mon Sep 17 00:00:00 2001 From: iovar Date: Fri, 3 Nov 2006 07:13:24 +0000 Subject: utilized window manager check, added option to disable checking, renamed --nosound option to --no-sound updated man page acoording to the above changes git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@139 f606c939-3180-4ac9-a4b8-4b8779d57d0a --- rMD-exp/doc/recordmydesktop.1 | 13 ++++++++++--- rMD-exp/include/recordmydesktop.h | 6 ++++-- rMD-exp/src/parseargs.c | 11 +++++++---- rMD-exp/src/recordmydesktop.c | 25 ++++++++++++++++++++++--- 4 files changed, 43 insertions(+), 12 deletions(-) (limited to 'rMD-exp') diff --git a/rMD-exp/doc/recordmydesktop.1 b/rMD-exp/doc/recordmydesktop.1 index e0fca05..8602262 100644 --- a/rMD-exp/doc/recordmydesktop.1 +++ b/rMD-exp/doc/recordmydesktop.1 @@ -266,7 +266,7 @@ Sound Options: .br .TP .B - \-\-nosound + \-\-no\-sound Do not record sound. .br .PP @@ -305,6 +305,13 @@ Encoding Options: Misc Options: .br .TP +.B + \-\-no\-wm\-check + When a 3d compositing window manager is detected the program will function as if the + \-\-full\-shots and \-\-with\-shared options have been specified. This option disables that + behavior alltogether. +.br +.TP .B \-\-zero\-compression Image data are always cached uncompressed. @@ -343,9 +350,9 @@ If no other option is specified, filename can be given without the \-o switch. .br \-\-no\-cursor| \-freq N(number>0)| \-channels N(number>0)| \-device SOUND_DEVICE| .br -\-\-nosound| \-\-with\-shared| \-\-no\-cond\-shared| \-shared\-threshold n| \-\-full\-shots| +\-\-no\-sound| \-\-with\-shared| \-\-no\-cond\-shared| \-shared\-threshold n| \-\-full\-shots| .br -\-\-quick\-subsampling| \-workdir DIR| \-\-zero\-compression| \-o filename]^filename +\-\-quick\-subsampling| \-workdir DIR| \-\-zero\-compression| \-\-no\-wm\-check| \-o filename]^filename .br .br .br diff --git a/rMD-exp/include/recordmydesktop.h b/rMD-exp/include/recordmydesktop.h index a84708d..5069bc1 100644 --- a/rMD-exp/include/recordmydesktop.h +++ b/rMD-exp/include/recordmydesktop.h @@ -138,7 +138,9 @@ typedef struct _ProgArgs{ char *device; //default sound device(default according to alsa or oss) int nosound; //do not record sound(default 0) int noshared; //do not use shared memory extension(default 1) - int nocondshared; //de not use shared memory on large image aquititions + int nocondshared; //do not use shared memory on large image aquititions + int nowmcheck; //do not check if there's a 3d comp window manager + //(which changes full-shots and with-shared to 1) int shared_thres; //threshold to use shared memory int full_shots; //do not poll damage, take full screenshots int no_quick_subsample;//average pixels in chroma planes @@ -384,7 +386,7 @@ int capture_busy, (args)->windowid=(args)->x=(args)->y\ =(args)->width=(args)->height=(args)->quietmode\ =(args)->nosound=(args)->full_shots=(args)->encOnTheFly\ - =(args)->zerocompression=0;\ + =(args)->zerocompression=(args)->nowmcheck=0;\ (args)->noshared=1;\ (args)->dropframes=(args)->nocondshared=0;\ (args)->no_quick_subsample=1;\ diff --git a/rMD-exp/src/parseargs.c b/rMD-exp/src/parseargs.c index 009e733..72a2681 100644 --- a/rMD-exp/src/parseargs.c +++ b/rMD-exp/src/parseargs.c @@ -35,8 +35,8 @@ int ParseArgs(int argc,char **argv,ProgArgs *arg_return){ "\t-display DISPLAY| -x X| -y Y|-width N| -height N| -fps N(number>0)| --on-the-fly-encoding|\n" "\t -v_quality n| -s_quality n| -v_bitrate n| --no-framedrop| -dummy-cursor color|\n" "\t --no-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 --quick-subsampling| -workdir DIR| --zero-compression| -o filename]^filename\n\n\n" + "\t --no-sound| --with-shared| --no-cond-shared| -shared-threshold n| --full-shots|\n" + "\t --quick-subsampling| -workdir DIR| --zero-compression| --no-wm-check| -o filename]^filename\n\n\n" "General Options:\n" "\t-h or --help\t\tPrint this help and exit.\n" @@ -63,7 +63,7 @@ int ParseArgs(int argc,char **argv,ProgArgs *arg_return){ "\t-channels N(number>0)\tA positive number denoting desired sound channels in recording.\n" "\t-freq N(number>0)\tA positive number denoting desired sound frequency.\n" "\t-device SOUND_DEVICE\tSound device(default hw0:0).\n" - "\t--nosound\t\tDo not record sound.\n\n" + "\t--no-sound\t\tDo not record sound.\n\n" "Encoding Options\n" "\t--on-the-fly-encoding\tEncode the audio-video data, while recording.\n" @@ -73,6 +73,7 @@ int ParseArgs(int argc,char **argv,ProgArgs *arg_return){ "\t-s_quality n\t\tDesired audio quality(-1 to 10).\n\n" "Misc Options:\n" + "\t--no-wm-check\tDo not try to detect the window manager(and set options according to it)\n" "\t--zero-compression\tImage data are always cached uncompressed.\n" "\t-workdir DIR\t\tLocation where a temporary directory will be created to hold project files(default $HOME).\n" "\t-delay n[H|h|M|m]\tNumber of secs(default),minutes or hours before capture starts(number can be float)\n" @@ -378,7 +379,7 @@ int ParseArgs(int argc,char **argv,ProgArgs *arg_return){ } i++; } - else if(!strcmp(argv[i],"--nosound")) + else if(!strcmp(argv[i],"--no-sound")) arg_return->nosound=1; else if(!strcmp(argv[i],"--drop-frames")) arg_return->dropframes=1; @@ -398,6 +399,8 @@ int ParseArgs(int argc,char **argv,ProgArgs *arg_return){ else if(!strcmp(argv[i],"--on-the-fly-encoding")){ arg_return->encOnTheFly=1; } + else if(!strcmp(argv[i],"--no-wm-check")) + arg_return->nowmcheck=1; else if(!strcmp(argv[i],"--zero-compression")){ arg_return->zerocompression=1; } diff --git a/rMD-exp/src/recordmydesktop.c b/rMD-exp/src/recordmydesktop.c index 648780d..2550ee0 100644 --- a/rMD-exp/src/recordmydesktop.c +++ b/rMD-exp/src/recordmydesktop.c @@ -72,13 +72,32 @@ int main(int argc,char **argv){ if(SetBRWindow(pdata.dpy,&pdata.brwin,&pdata.specs,&pdata.args)) exit(11); + + //check if we are under compiz or beryl,in which case we must enable full-shots + //and with it use of shared memory.User can override this + pdata.window_manager=((pdata.args.nowmcheck)?NULL:rmdWMCheck(pdata.dpy,pdata.specs.root)); + if(pdata.window_manager==NULL){ + fprintf(stderr,"Not taking window manager into account.\n"); + } + //Right now only wm's that I know of performing 3d compositing are beryl and compiz. + //No, the blue screen in metacity doesn't count :) + else if(!strcmp(pdata.window_manager,"compiz") || !strcmp(pdata.window_manager,"beryl")){ + fprintf(stderr,"\nDetected 3d compositing window manager.\n" + "Reverting to full screen capture at every frame.\n" + "To disable this check run with --no-wm-check\n" + "(though that is not advised, since it will probably produce faulty results).\n\n"); + pdata.args.full_shots=1; + pdata.args.noshared=0; + pdata.args.nocondshared=1; + } + QueryExtensions(pdata.dpy,&pdata.args,&pdata.damage_event, &pdata.damage_error); - pdata.window_manager=rmdWMCheck(pdata.dpy,pdata.specs.root); - //init data + //init data + //these are globals, look for them at the header frames_total=frames_lost=encoder_busy=capture_busy=0; @@ -136,7 +155,7 @@ int main(int argc,char **argv){ if(!pdata.args.nosound){ pdata.sound_handle=OpenDev(pdata.args.device,&pdata.args.channels,&pdata.args.frequency,&pdata.periodsize, &pdata.periodtime,&pdata.hard_pause); if(pdata.sound_handle==NULL){ - fprintf(stderr,"Error while opening/configuring soundcard %s\nTry running with the --nosound or specify a correct device.\n",pdata.args.device); + fprintf(stderr,"Error while opening/configuring soundcard %s\nTry running with the --no-sound or specify a correct device.\n",pdata.args.device); exit(3); } } -- cgit v1.2.1