From e304d0454a9b15f0f9b251ab0cc3a75ed074838b Mon Sep 17 00:00:00 2001 From: iovar Date: Mon, 12 Nov 2007 08:30:31 +0000 Subject: cleanup.c: added a stub cleanup routine. initialize_data.c: y,u,vblocks with malloc. recordmydesktop.c: removed static y,u,vblocks. Makefile.am: added cleanup.c,specsfile.c specsfile.c: stub file for session-restore routines(NI). git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@426 f606c939-3180-4ac9-a4b8-4b8779d57d0a --- recordmydesktop/src/Makefile.am | 4 +++- recordmydesktop/src/cleanup.c | 41 +++++++++++++++++++++++++++++++++++ recordmydesktop/src/initialize_data.c | 7 ++++++ recordmydesktop/src/recordmydesktop.c | 23 +++++--------------- recordmydesktop/src/specsfile.c | 31 ++++++++++++++++++++++++++ 5 files changed, 87 insertions(+), 19 deletions(-) create mode 100644 recordmydesktop/src/cleanup.c create mode 100644 recordmydesktop/src/specsfile.c (limited to 'recordmydesktop/src') 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 + +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 + + + -- cgit v1.2.1