From 1849f72f524948dddc02e530f7bfaa108a107ef1 Mon Sep 17 00:00:00 2001 From: iovar Date: Thu, 26 Oct 2006 14:49:51 +0000 Subject: stub load_cache.c git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@122 f606c939-3180-4ac9-a4b8-4b8779d57d0a --- rMD-exp/include/recordmydesktop.h | 1 + rMD-exp/src/Makefile.am | 3 ++- rMD-exp/src/load_cache.c | 42 ++++++++++++++++++++++++++++++++++++++ rMD-exp/src/recordmydesktop.c | 43 ++++++++++++++++++++++++++++++++------- 4 files changed, 81 insertions(+), 8 deletions(-) create mode 100644 rMD-exp/src/load_cache.c diff --git a/rMD-exp/include/recordmydesktop.h b/rMD-exp/include/recordmydesktop.h index 9c55caf..e0eb0d9 100644 --- a/rMD-exp/include/recordmydesktop.h +++ b/rMD-exp/include/recordmydesktop.h @@ -590,5 +590,6 @@ void SizePack2_8_16(int *start,int *size,int limit); void *CacheImageBuffer(void *pdata); void InitCacheData(ProgData *pdata,EncData *enc_data_t,CacheData *cache_data_t); void *CacheSoundBuffer(void *pdata); +void *LoadCache(void *pdata); #endif diff --git a/rMD-exp/src/Makefile.am b/rMD-exp/src/Makefile.am index 66b8706..7bc3e1b 100644 --- a/rMD-exp/src/Makefile.am +++ b/rMD-exp/src/Makefile.am @@ -22,7 +22,8 @@ recordmydesktop_SOURCES= recordmydesktop.c\ init_encoder.c\ cache_frame.c\ cache_audio.c\ - rmd_cache.c + rmd_cache.c\ + load_cache.c INCLUDES= $(all_includes) -I../include -I$x_includes diff --git a/rMD-exp/src/load_cache.c b/rMD-exp/src/load_cache.c new file mode 100644 index 0000000..dbe6057 --- /dev/null +++ b/rMD-exp/src/load_cache.c @@ -0,0 +1,42 @@ +/********************************************************************************* +* recordMyDesktop * +********************************************************************************** +* * +* Copyright (C) 2006 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 *LoadCache(void *pdata){ + + + + + + + + + pthread_exit(&errno); +} + diff --git a/rMD-exp/src/recordmydesktop.c b/rMD-exp/src/recordmydesktop.c index 24037ce..9d05bf0 100644 --- a/rMD-exp/src/recordmydesktop.c +++ b/rMD-exp/src/recordmydesktop.c @@ -59,7 +59,8 @@ int main(int argc,char **argv){ sound_capture_t, sound_encode_t, sound_cache_t, - flush_to_ogg_t; + flush_to_ogg_t, + load_cache_t; XShmSegmentInfo shminfo; int i; @@ -265,13 +266,41 @@ int main(int argc,char **argv){ /** Encoding */ + if(!pdata.args.encOnTheFly){ + if(!Aborted){ + + pdata.running=1; + InitEncoder(&pdata,&enc_data,1); + + //load encoding and flushing threads + pthread_create(&image_encode_t,NULL,EncodeImageBuffer,(void *)&pdata); + if(!pdata.args.nosound) + pthread_create(&sound_encode_t,NULL,EncodeSoundBuffer,(void *)&pdata); + pthread_create(&flush_to_ogg_t,NULL,FlushToOgg,(void *)&pdata); + + + //start loading image and audio + pthread_create(&load_cache_t,NULL,LoadCache,(void *)&pdata); + + + //call loading func{ + //if avd>=0 + //load image from cache + //signal buffer + ////if avd<0 + //load sound from cache + //signal buffer + //} + + //join and finish + pthread_join(load_cache_t,NULL); + pthread_join(image_encode_t,NULL); + if(!pdata.args.nosound) + pthread_join(sound_encode_t,NULL); - - - - - - + } + //clean-up data + } /**@_______________________________________________@*/ -- cgit v1.2.3