summaryrefslogtreecommitdiff
path: root/recordmydesktop/src
diff options
context:
space:
mode:
Diffstat (limited to 'recordmydesktop/src')
-rw-r--r--recordmydesktop/src/Makefile.am4
-rw-r--r--recordmydesktop/src/cleanup.c41
-rw-r--r--recordmydesktop/src/initialize_data.c7
-rw-r--r--recordmydesktop/src/recordmydesktop.c23
-rw-r--r--recordmydesktop/src/specsfile.c31
5 files changed, 87 insertions, 19 deletions
diff --git a/recordmydesktop/src/Makefile.am b/recordmydesktop/src/Makefile.am
index a1cbc4b..6703f9a 100644
--- a/recordmydesktop/src/Makefile.am
+++ b/recordmydesktop/src/Makefile.am
@@ -28,7 +28,9 @@ recordmydesktop_SOURCES= recordmydesktop.c\
encode_cache.c\
rmdthreads.c\
initialize_data.c\
- rmd_jack.c
+ rmd_jack.c\
+ cleanup.c\
+ specsfile.c
INCLUDES= $(all_includes) -I$(top_srcdir)/include
diff --git a/recordmydesktop/src/cleanup.c b/recordmydesktop/src/cleanup.c
new file mode 100644
index 0000000..9da4704
--- /dev/null
+++ b/recordmydesktop/src/cleanup.c
@@ -0,0 +1,41 @@
+/******************************************************************************
+* recordMyDesktop *
+*******************************************************************************
+* *
+* Copyright (C) 2006,2007 John Varouhakis *
+* *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU General Public License for more details. *
+* *
+* You should have received a copy of the GNU General Public License *
+* along with this program; if not, write to the Free Software *
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+* *
+* *
+* *
+* For further information contact me at johnvarouhakis@gmail.com *
+******************************************************************************/
+
+#include <recordmydesktop.h>
+
+void CleanUp(void){
+
+ free(yblocks);
+ free(ublocks);
+ free(vblocks);
+
+}
+
+
+
+
+
+
diff --git a/recordmydesktop/src/initialize_data.c b/recordmydesktop/src/initialize_data.c
index 69cfad0..6e363f6 100644
--- a/recordmydesktop/src/initialize_data.c
+++ b/recordmydesktop/src/initialize_data.c
@@ -157,6 +157,13 @@ int InitializeData(ProgData *pdata,
pdata->enc_data->yuv.v[i]=pdata->enc_data->yuv.u[i]=127;
}
+ yblocks=malloc(sizeof(u_int32_t)*(pdata->enc_data->yuv.y_width/Y_UNIT_WIDTH)*
+ (pdata->enc_data->yuv.y_height/Y_UNIT_WIDTH));
+ ublocks=malloc(sizeof(u_int32_t)*(pdata->enc_data->yuv.y_width/Y_UNIT_WIDTH)*
+ (pdata->enc_data->yuv.y_height/Y_UNIT_WIDTH));
+ vblocks=malloc(sizeof(u_int32_t)*(pdata->enc_data->yuv.y_width/Y_UNIT_WIDTH)*
+ (pdata->enc_data->yuv.y_height/Y_UNIT_WIDTH));
+
pdata->frametime=(1000000)/pdata->args.fps;
return 0;
diff --git a/recordmydesktop/src/recordmydesktop.c b/recordmydesktop/src/recordmydesktop.c
index 30a2185..b3ba150 100644
--- a/recordmydesktop/src/recordmydesktop.c
+++ b/recordmydesktop/src/recordmydesktop.c
@@ -101,24 +101,11 @@ int main(int argc,char **argv){
if((exit_status=InitializeData(&pdata,&enc_data,&cache_data))==0){
- u_int32_t y_t[(pdata.enc_data->yuv.y_width/Y_UNIT_WIDTH)*
- (pdata.enc_data->yuv.y_height/Y_UNIT_WIDTH)],
- u_t[(pdata.enc_data->yuv.y_width/Y_UNIT_WIDTH)*
- (pdata.enc_data->yuv.y_height/Y_UNIT_WIDTH)],
- v_t[(pdata.enc_data->yuv.y_width/Y_UNIT_WIDTH)*
- (pdata.enc_data->yuv.y_height/Y_UNIT_WIDTH)];
- yblocks=y_t;
- ublocks=u_t;
- vblocks=v_t;
-
-
//this is where the capturing happens.
rmdThreads(&pdata);
-
- fprintf(stderr,".");
-
- fprintf(stderr,"\n");
+ XCloseDisplay(pdata.dpy);
+ fprintf(stderr,".\n");
//encode and then cleanup cache
if(!pdata.args.encOnTheFly && !pdata.args.no_encode){
@@ -132,9 +119,6 @@ int main(int argc,char **argv){
fprintf(stderr,"Done!!!\n");
}
- //This can happen earlier, but in some cases it might get stuck.
- //So we must make sure the recording is not wasted.
- XCloseDisplay(pdata.dpy);
if(Aborted && pdata.args.encOnTheFly){
if(remove(pdata.args.filename)){
@@ -149,6 +133,9 @@ int main(int argc,char **argv){
}
else
fprintf(stderr,"Goodbye!\n");
+
+
+ CleanUp();
}
}
return exit_status;
diff --git a/recordmydesktop/src/specsfile.c b/recordmydesktop/src/specsfile.c
new file mode 100644
index 0000000..cb6e554
--- /dev/null
+++ b/recordmydesktop/src/specsfile.c
@@ -0,0 +1,31 @@
+/******************************************************************************
+* recordMyDesktop *
+*******************************************************************************
+* *
+* Copyright (C) 2006,2007 John Varouhakis *
+* *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU General Public License for more details. *
+* *
+* You should have received a copy of the GNU General Public License *
+* along with this program; if not, write to the Free Software *
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+* *
+* *
+* *
+* For further information contact me at johnvarouhakis@gmail.com *
+******************************************************************************/
+
+
+#include <rmdtypes.h>
+
+
+
© All Rights Reserved