summaryrefslogtreecommitdiff
path: root/rMD-exp/src
diff options
context:
space:
mode:
Diffstat (limited to 'rMD-exp/src')
-rw-r--r--rMD-exp/src/parseargs.c11
-rw-r--r--rMD-exp/src/recordmydesktop.c25
2 files changed, 29 insertions, 7 deletions
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);
}
}
© All Rights Reserved