recordmydesktop-svn-commit Mailing List for recordMyDesktop (Page 3)
Status: Alpha
Brought to you by:
enselic
You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(39) |
Oct
(6) |
Nov
(16) |
Dec
(2) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(14) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2010 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-15 23:51:46
|
Revision: 550
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=550&view=rev
Author: enselic
Date: 2008-09-16 06:51:44 +0000 (Tue, 16 Sep 2008)
Log Message:
-----------
src/rmd_types.h: Update comment, the DEFAULTS_ARGS() macro is replaced
with the SetupDefaultArgs() function.
Modified Paths:
--------------
trunk/recordmydesktop/src/rmd_types.h
Modified: trunk/recordmydesktop/src/rmd_types.h
===================================================================
--- trunk/recordmydesktop/src/rmd_types.h 2008-09-16 06:25:52 UTC (rev 549)
+++ trunk/recordmydesktop/src/rmd_types.h 2008-09-16 06:51:44 UTC (rev 550)
@@ -108,7 +108,7 @@
}BRWindow;
//defaults in the following comment lines may be out of sync with reality
-//check DEFAULT_ARGS macro further bellow
+//check the SetupDefaultArgs() function further bellow
typedef struct _ProgArgs{
int delay; //start up delay
Window windowid; //window to record(default root)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-15 23:25:55
|
Revision: 549
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=549&view=rev
Author: enselic
Date: 2008-09-16 06:25:52 +0000 (Tue, 16 Sep 2008)
Log Message:
-----------
src/rmd_types.h: Remove DisplaySpecs::bpixel and wpixel.
src/rmd_make_dummy_pointer.[ch]: Take Display as a parameter to
MakeDummyPointer() and put bpixel and wpixel locally here instead.
src/rmd.c: Remove initialization of DisplaySpecs::bpixel and wpixel.
src/rmd_initialize_data.c: Pass Display to MakeDummyPointer().
Modified Paths:
--------------
trunk/recordmydesktop/src/rmd.c
trunk/recordmydesktop/src/rmd_initialize_data.c
trunk/recordmydesktop/src/rmd_make_dummy_pointer.c
trunk/recordmydesktop/src/rmd_make_dummy_pointer.h
trunk/recordmydesktop/src/rmd_types.h
Modified: trunk/recordmydesktop/src/rmd.c
===================================================================
--- trunk/recordmydesktop/src/rmd.c 2008-09-16 05:57:17 UTC (rev 548)
+++ trunk/recordmydesktop/src/rmd.c 2008-09-16 06:25:52 UTC (rev 549)
@@ -84,8 +84,6 @@
pdata.specs.visual = DefaultVisual(pdata.dpy, pdata.specs.screen);
pdata.specs.gc = DefaultGC(pdata.dpy, pdata.specs.screen);
pdata.specs.depth = DefaultDepth(pdata.dpy, pdata.specs.screen);
- pdata.specs.bpixel = XBlackPixel(pdata.dpy, pdata.specs.screen);
- pdata.specs.wpixel = XWhitePixel(pdata.dpy, pdata.specs.screen);
if((pdata.specs.depth!=32)&&
(pdata.specs.depth!=24)&&
Modified: trunk/recordmydesktop/src/rmd_initialize_data.c
===================================================================
--- trunk/recordmydesktop/src/rmd_initialize_data.c 2008-09-16 05:57:17 UTC (rev 548)
+++ trunk/recordmydesktop/src/rmd_initialize_data.c 2008-09-16 06:25:52 UTC (rev 549)
@@ -63,9 +63,12 @@
fprintf(stderr,"Initializing...\n");
MakeMatrices();
if(pdata->args.have_dummy_cursor){
- pdata->dummy_pointer=MakeDummyPointer(&pdata->specs,16,
- pdata->args.cursor_color,0,
- &pdata->npxl);
+ pdata->dummy_pointer = MakeDummyPointer(pdata->dpy,
+ &pdata->specs,
+ 16,
+ pdata->args.cursor_color,
+ 0,
+ &pdata->npxl);
pdata->dummy_p_size=16;
}
else
Modified: trunk/recordmydesktop/src/rmd_make_dummy_pointer.c
===================================================================
--- trunk/recordmydesktop/src/rmd_make_dummy_pointer.c 2008-09-16 05:57:17 UTC (rev 548)
+++ trunk/recordmydesktop/src/rmd_make_dummy_pointer.c 2008-09-16 06:25:52 UTC (rev 549)
@@ -26,17 +26,22 @@
#include "config.h"
+#include <X11/Xlib.h>
+
#include "rmd_types.h"
#include "rmd_macro.h"
#include "rmd_make_dummy_pointer.h"
-unsigned char *MakeDummyPointer(DisplaySpecs *specs,
+unsigned char *MakeDummyPointer(Display *display,
+ DisplaySpecs *specs,
int size,
int color,
int type,
unsigned char *npxl){
+ unsigned long bpixel = XBlackPixel(display, specs->screen);
+ unsigned long wpixel = XWhitePixel(display, specs->screen);
int i,k,o='.';
unsigned long b=(color)?'w':'b',
w=(color)?'b':'w';
@@ -59,18 +64,15 @@
{o,o,o,o,o,o,w,w,o,o,o,o,o,o,o,o}}
};
unsigned char *ret=malloc(size*sizeof(char[size*4]));
- unsigned char wp[4]={
- ((specs->wpixel^0xff000000)>>24),
- ((specs->wpixel^0x00ff0000)>>16),
- ((specs->wpixel^0x0000ff00)>>8),
- ((specs->wpixel^0x000000ff))
- };
- unsigned char bp[4]={
- ((specs->bpixel^0xff000000)>>24),
- ((specs->bpixel^0x00ff0000)>>16),
- ((specs->bpixel^0x0000ff00)>>8),
- ((specs->bpixel^0x000000ff))
- };
+ unsigned char wp[4]={ (wpixel ^ 0xff000000) >> 24,
+ (wpixel ^ 0x00ff0000) >> 16,
+ (wpixel ^ 0x0000ff00) >> 8,
+ (wpixel ^ 0x000000ff) };
+ unsigned char bp[4]={ (bpixel ^ 0xff000000) >> 24,
+ (bpixel ^ 0x00ff0000) >> 16,
+ (bpixel ^ 0x0000ff00) >> 8,
+ (bpixel ^ 0x000000ff) };
+
*npxl=((wp[0]-1)!=bp[0])?wp[0]-100:wp[0]-102;
for(i=0;i<size;i++){
for(k=0;k<size;k++){
Modified: trunk/recordmydesktop/src/rmd_make_dummy_pointer.h
===================================================================
--- trunk/recordmydesktop/src/rmd_make_dummy_pointer.h 2008-09-16 05:57:17 UTC (rev 548)
+++ trunk/recordmydesktop/src/rmd_make_dummy_pointer.h 2008-09-16 06:25:52 UTC (rev 549)
@@ -48,7 +48,8 @@
*
* \returns Pointer to pixel data of the cursor
*/
-unsigned char *MakeDummyPointer(DisplaySpecs *specs,
+unsigned char *MakeDummyPointer(Display *display,
+ DisplaySpecs *specs,
int size,
int color,
int type,
Modified: trunk/recordmydesktop/src/rmd_types.h
===================================================================
--- trunk/recordmydesktop/src/rmd_types.h 2008-09-16 05:57:17 UTC (rev 548)
+++ trunk/recordmydesktop/src/rmd_types.h 2008-09-16 06:25:52 UTC (rev 549)
@@ -86,8 +86,6 @@
Visual *visual;
GC gc;
int depth;
- unsigned long bpixel;
- unsigned long wpixel;
}DisplaySpecs;
typedef struct _WGeometry{ //basic geometry of a window or area
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-15 22:47:40
|
Revision: 547
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=547&view=rev
Author: enselic
Date: 2008-09-16 05:47:37 +0000 (Tue, 16 Sep 2008)
Log Message:
-----------
src/recordmydesktop.c: Renamed to
src/rmd.c this, it feels cleaner this way.
configure.ac
src/Makefile.am: Changed accordingly.
Modified Paths:
--------------
trunk/recordmydesktop/configure.ac
trunk/recordmydesktop/src/Makefile.am
Added Paths:
-----------
trunk/recordmydesktop/src/rmd.c
Removed Paths:
-------------
trunk/recordmydesktop/src/recordmydesktop.c
Modified: trunk/recordmydesktop/configure.ac
===================================================================
--- trunk/recordmydesktop/configure.ac 2008-09-14 13:06:20 UTC (rev 546)
+++ trunk/recordmydesktop/configure.ac 2008-09-16 05:47:37 UTC (rev 547)
@@ -2,10 +2,10 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT(src/recordmydesktop.c)
+AC_INIT(src/rmd.c)
AM_INIT_AUTOMAKE(recordmydesktop,0.3.7.3,)
-AC_CONFIG_SRCDIR([src/recordmydesktop.c])
+AC_CONFIG_SRCDIR([src/rmd.c])
AM_CONFIG_HEADER(config.h)
Modified: trunk/recordmydesktop/src/Makefile.am
===================================================================
--- trunk/recordmydesktop/src/Makefile.am 2008-09-14 13:06:20 UTC (rev 546)
+++ trunk/recordmydesktop/src/Makefile.am 2008-09-16 05:47:37 UTC (rev 547)
@@ -1,7 +1,7 @@
bin_PROGRAMS = recordmydesktop
recordmydesktop_SOURCES = \
- recordmydesktop.c \
+ rmd.c \
rmd_block_utils.c \
rmd_block_utils.h \
rmd_cache.c \
Deleted: trunk/recordmydesktop/src/recordmydesktop.c
===================================================================
--- trunk/recordmydesktop/src/recordmydesktop.c 2008-09-14 13:06:20 UTC (rev 546)
+++ trunk/recordmydesktop/src/recordmydesktop.c 2008-09-16 05:47:37 UTC (rev 547)
@@ -1,212 +0,0 @@
-/******************************************************************************
-* recordMyDesktop *
-*******************************************************************************
-* *
-* Copyright (C) 2006,2007,2008 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 joh...@gm... *
-******************************************************************************/
-
-#include "config.h"
-
-#include "rmd_types.h"
-
-#include "rmd_encode_cache.h"
-#include "rmd_initialize_data.h"
-#include "rmd_parseargs.h"
-#include "rmd_queryextensions.h"
-#include "rmd_cache.h"
-#include "rmd_error.h"
-#include "rmd_threads.h"
-#include "rmd_setbrwindow.h"
-#include "rmd_shortcuts.h"
-#include "rmd_wm_check.h"
-
-
-int main(int argc,char **argv){
- ProgData pdata;
- int exit_status = 0;
-
- SetupDefaultArgs(&pdata.args);
-
- if (!ParseArgs(argc, argv, &pdata.args)) {
- exit(1);
- }
- if(XInitThreads ()==0){
- fprintf(stderr,"Couldn't initialize thread support!\n");
- exit(7);
- }
- if(pdata.args.display!=NULL){
- pdata.dpy = XOpenDisplay(pdata.args.display);
- XSetErrorHandler(rmdErrorHandler);
- }
- else{
- fprintf(stderr,"No display specified for connection!\n");
- exit(8);
- }
- if (pdata.dpy == NULL) {
- fprintf(stderr, "Cannot connect to X server %s\n",pdata.args.display);
- exit(9);
- }
- else{
- EncData enc_data;
- CacheData cache_data;
-#ifdef HAVE_JACK_H
- JackData jdata;
-
- // Give jack access to program data, mainly for program state
- jdata.pdata = &pdata;
- pdata.jdata = &jdata;
-#endif
-
- // Query display specs
- pdata.specs.screen = DefaultScreen(pdata.dpy);
- pdata.specs.width = DisplayWidth(pdata.dpy, pdata.specs.screen);
- pdata.specs.height = DisplayHeight(pdata.dpy, pdata.specs.screen);
- pdata.specs.root = RootWindow(pdata.dpy, pdata.specs.screen);
- pdata.specs.visual = DefaultVisual(pdata.dpy, pdata.specs.screen);
- pdata.specs.gc = DefaultGC(pdata.dpy, pdata.specs.screen);
- pdata.specs.depth = DefaultDepth(pdata.dpy, pdata.specs.screen);
- pdata.specs.bpixel = XBlackPixel(pdata.dpy, pdata.specs.screen);
- pdata.specs.wpixel = XWhitePixel(pdata.dpy, pdata.specs.screen);
-
- if((pdata.specs.depth!=32)&&
- (pdata.specs.depth!=24)&&
- (pdata.specs.depth!=16)){
- fprintf(stderr,"Only 32bpp,24bpp and 16bpp"
- " color depth modes are currently supported.\n");
- exit(10);
- }
- 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 :)
- //names can be compiz for compiz and beryl/beryl-co/beryl-core
- //for beryl(so it's strncmp )
- else if(!strcmp(pdata.window_manager,"compiz") ||
- !strncmp(pdata.window_manager,"beryl",5)){
- 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;
- }
-
- QueryExtensions(pdata.dpy,
- &pdata.args,
- &pdata.damage_event,
- &pdata.damage_error,
- &pdata.shm_opcode);
-
-
- if((exit_status=InitializeData(&pdata,&enc_data,&cache_data))==0){
-
- if(!strcmp(pdata.args.pause_shortcut,
- pdata.args.stop_shortcut)||
- RegisterShortcut(pdata.dpy,
- pdata.specs.root,
- pdata.args.pause_shortcut,
- &(pdata.pause_key)) ||
- RegisterShortcut(pdata.dpy,
- pdata.specs.root,
- pdata.args.stop_shortcut,
- &(pdata.stop_key))){
-
- fprintf(stderr,"Invalid shortcut,"
- " or shortcuts are the same!\n\n"
- "Using defaults.\n");
-
- RegisterShortcut(pdata.dpy,
- pdata.specs.root,
- "Control+Mod1+p",
- &(pdata.pause_key));
- RegisterShortcut(pdata.dpy,
- pdata.specs.root,
- "Control+Mod1+s",
- &(pdata.stop_key));
- }
-
- //this is where the capturing happens.
- rmdThreads(&pdata);
-
- XCloseDisplay(pdata.dpy);
- fprintf(stderr,".\n");
-
- //encode and then cleanup cache
- if(!pdata.args.encOnTheFly && !pdata.args.no_encode){
- if (!pdata.aborted) {
- EncodeCache(&pdata);
- }
- fprintf(stderr,"Cleanning up cache...\n");
- if(PurgeCache(pdata.cache_data,!pdata.args.nosound))
- fprintf(stderr,"Some error occured "
- "while cleaning up cache!\n");
- fprintf(stderr,"Done!!!\n");
- }
-
-
- if (pdata.aborted && pdata.args.encOnTheFly) {
- if(remove(pdata.args.filename)){
- perror("Error while removing file:\n");
- return 1;
- }
- else{
- fprintf(stderr,"SIGABRT received,file %s removed\n",
- pdata.args.filename);
- return 0;
- }
- }
- else
- fprintf(stderr,"Goodbye!\n");
-
-
- CleanUp();
- }
- }
-
- return exit_status;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Copied: trunk/recordmydesktop/src/rmd.c (from rev 546, trunk/recordmydesktop/src/recordmydesktop.c)
===================================================================
--- trunk/recordmydesktop/src/rmd.c (rev 0)
+++ trunk/recordmydesktop/src/rmd.c 2008-09-16 05:47:37 UTC (rev 547)
@@ -0,0 +1,197 @@
+/******************************************************************************
+* recordMyDesktop *
+*******************************************************************************
+* *
+* Copyright (C) 2006,2007,2008 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 joh...@gm... *
+******************************************************************************/
+
+#include "config.h"
+
+#include "rmd_types.h"
+
+#include "rmd_encode_cache.h"
+#include "rmd_initialize_data.h"
+#include "rmd_parseargs.h"
+#include "rmd_queryextensions.h"
+#include "rmd_cache.h"
+#include "rmd_error.h"
+#include "rmd_threads.h"
+#include "rmd_setbrwindow.h"
+#include "rmd_shortcuts.h"
+#include "rmd_wm_check.h"
+
+
+int main(int argc,char **argv){
+ ProgData pdata;
+ int exit_status = 0;
+
+ SetupDefaultArgs(&pdata.args);
+
+ if (!ParseArgs(argc, argv, &pdata.args)) {
+ exit(1);
+ }
+ if(XInitThreads ()==0){
+ fprintf(stderr,"Couldn't initialize thread support!\n");
+ exit(7);
+ }
+ if(pdata.args.display!=NULL){
+ pdata.dpy = XOpenDisplay(pdata.args.display);
+ XSetErrorHandler(rmdErrorHandler);
+ }
+ else{
+ fprintf(stderr,"No display specified for connection!\n");
+ exit(8);
+ }
+ if (pdata.dpy == NULL) {
+ fprintf(stderr, "Cannot connect to X server %s\n",pdata.args.display);
+ exit(9);
+ }
+ else{
+ EncData enc_data;
+ CacheData cache_data;
+#ifdef HAVE_JACK_H
+ JackData jdata;
+
+ // Give jack access to program data, mainly for program state
+ jdata.pdata = &pdata;
+ pdata.jdata = &jdata;
+#endif
+
+ // Query display specs
+ pdata.specs.screen = DefaultScreen(pdata.dpy);
+ pdata.specs.width = DisplayWidth(pdata.dpy, pdata.specs.screen);
+ pdata.specs.height = DisplayHeight(pdata.dpy, pdata.specs.screen);
+ pdata.specs.root = RootWindow(pdata.dpy, pdata.specs.screen);
+ pdata.specs.visual = DefaultVisual(pdata.dpy, pdata.specs.screen);
+ pdata.specs.gc = DefaultGC(pdata.dpy, pdata.specs.screen);
+ pdata.specs.depth = DefaultDepth(pdata.dpy, pdata.specs.screen);
+ pdata.specs.bpixel = XBlackPixel(pdata.dpy, pdata.specs.screen);
+ pdata.specs.wpixel = XWhitePixel(pdata.dpy, pdata.specs.screen);
+
+ if((pdata.specs.depth!=32)&&
+ (pdata.specs.depth!=24)&&
+ (pdata.specs.depth!=16)){
+ fprintf(stderr,"Only 32bpp,24bpp and 16bpp"
+ " color depth modes are currently supported.\n");
+ exit(10);
+ }
+ 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 :)
+ //names can be compiz for compiz and beryl/beryl-co/beryl-core
+ //for beryl(so it's strncmp )
+ else if(!strcmp(pdata.window_manager,"compiz") ||
+ !strncmp(pdata.window_manager,"beryl",5)){
+ 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;
+ }
+
+ QueryExtensions(pdata.dpy,
+ &pdata.args,
+ &pdata.damage_event,
+ &pdata.damage_error,
+ &pdata.shm_opcode);
+
+
+ if((exit_status=InitializeData(&pdata,&enc_data,&cache_data))==0){
+
+ if(!strcmp(pdata.args.pause_shortcut,
+ pdata.args.stop_shortcut)||
+ RegisterShortcut(pdata.dpy,
+ pdata.specs.root,
+ pdata.args.pause_shortcut,
+ &(pdata.pause_key)) ||
+ RegisterShortcut(pdata.dpy,
+ pdata.specs.root,
+ pdata.args.stop_shortcut,
+ &(pdata.stop_key))){
+
+ fprintf(stderr,"Invalid shortcut,"
+ " or shortcuts are the same!\n\n"
+ "Using defaults.\n");
+
+ RegisterShortcut(pdata.dpy,
+ pdata.specs.root,
+ "Control+Mod1+p",
+ &(pdata.pause_key));
+ RegisterShortcut(pdata.dpy,
+ pdata.specs.root,
+ "Control+Mod1+s",
+ &(pdata.stop_key));
+ }
+
+ //this is where the capturing happens.
+ rmdThreads(&pdata);
+
+ XCloseDisplay(pdata.dpy);
+ fprintf(stderr,".\n");
+
+ //encode and then cleanup cache
+ if(!pdata.args.encOnTheFly && !pdata.args.no_encode){
+ if (!pdata.aborted) {
+ EncodeCache(&pdata);
+ }
+ fprintf(stderr,"Cleanning up cache...\n");
+ if(PurgeCache(pdata.cache_data,!pdata.args.nosound))
+ fprintf(stderr,"Some error occured "
+ "while cleaning up cache!\n");
+ fprintf(stderr,"Done!!!\n");
+ }
+
+
+ if (pdata.aborted && pdata.args.encOnTheFly) {
+ if(remove(pdata.args.filename)){
+ perror("Error while removing file:\n");
+ return 1;
+ }
+ else{
+ fprintf(stderr,"SIGABRT received,file %s removed\n",
+ pdata.args.filename);
+ return 0;
+ }
+ }
+ else
+ fprintf(stderr,"Goodbye!\n");
+
+
+ CleanUp();
+ }
+ }
+
+ return exit_status;
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-14 13:06:33
|
Revision: 546
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=546&view=rev
Author: enselic
Date: 2008-09-14 13:06:20 +0000 (Sun, 14 Sep 2008)
Log Message:
-----------
src/*.[ch]: Rename files so that the name becomes
rmd_some_file.[ch]. The exceptions are recordmydesktop.c which is the
main file and skeleton.[ch] which are external files.
src/Makefile.am: Adapt.
Modified Paths:
--------------
trunk/recordmydesktop/src/Makefile.am
trunk/recordmydesktop/src/recordmydesktop.c
trunk/recordmydesktop/src/rmd_cache.c
trunk/recordmydesktop/src/rmd_cache.h
trunk/recordmydesktop/src/rmd_error.h
trunk/recordmydesktop/src/rmd_frame.h
trunk/recordmydesktop/src/rmd_jack.c
trunk/recordmydesktop/src/rmd_jack.h
trunk/recordmydesktop/src/rmd_rescue.c
trunk/recordmydesktop/src/rmd_timer.c
trunk/recordmydesktop/src/rmd_timer.h
trunk/recordmydesktop/src/test-rectinsert-types.h
trunk/recordmydesktop/src/test-rectinsert.c
Added Paths:
-----------
trunk/recordmydesktop/src/rmd_block_utils.c
trunk/recordmydesktop/src/rmd_block_utils.h
trunk/recordmydesktop/src/rmd_cache_audio.c
trunk/recordmydesktop/src/rmd_cache_audio.h
trunk/recordmydesktop/src/rmd_cache_frame.c
trunk/recordmydesktop/src/rmd_cache_frame.h
trunk/recordmydesktop/src/rmd_capture_sound.c
trunk/recordmydesktop/src/rmd_capture_sound.h
trunk/recordmydesktop/src/rmd_encode_cache.c
trunk/recordmydesktop/src/rmd_encode_cache.h
trunk/recordmydesktop/src/rmd_encode_image_buffer.c
trunk/recordmydesktop/src/rmd_encode_image_buffer.h
trunk/recordmydesktop/src/rmd_encode_sound_buffer.c
trunk/recordmydesktop/src/rmd_encode_sound_buffer.h
trunk/recordmydesktop/src/rmd_flush_to_ogg.c
trunk/recordmydesktop/src/rmd_flush_to_ogg.h
trunk/recordmydesktop/src/rmd_get_frame.c
trunk/recordmydesktop/src/rmd_get_frame.h
trunk/recordmydesktop/src/rmd_getzpixmap.c
trunk/recordmydesktop/src/rmd_getzpixmap.h
trunk/recordmydesktop/src/rmd_init_encoder.c
trunk/recordmydesktop/src/rmd_init_encoder.h
trunk/recordmydesktop/src/rmd_initialize_data.c
trunk/recordmydesktop/src/rmd_initialize_data.h
trunk/recordmydesktop/src/rmd_load_cache.c
trunk/recordmydesktop/src/rmd_load_cache.h
trunk/recordmydesktop/src/rmd_macro.h
trunk/recordmydesktop/src/rmd_make_dummy_pointer.c
trunk/recordmydesktop/src/rmd_make_dummy_pointer.h
trunk/recordmydesktop/src/rmd_opendev.c
trunk/recordmydesktop/src/rmd_opendev.h
trunk/recordmydesktop/src/rmd_parseargs.c
trunk/recordmydesktop/src/rmd_parseargs.h
trunk/recordmydesktop/src/rmd_poll_events.c
trunk/recordmydesktop/src/rmd_poll_events.h
trunk/recordmydesktop/src/rmd_queryextensions.c
trunk/recordmydesktop/src/rmd_queryextensions.h
trunk/recordmydesktop/src/rmd_rectinsert.c
trunk/recordmydesktop/src/rmd_rectinsert.h
trunk/recordmydesktop/src/rmd_register_callbacks.c
trunk/recordmydesktop/src/rmd_register_callbacks.h
trunk/recordmydesktop/src/rmd_setbrwindow.c
trunk/recordmydesktop/src/rmd_setbrwindow.h
trunk/recordmydesktop/src/rmd_shortcuts.c
trunk/recordmydesktop/src/rmd_shortcuts.h
trunk/recordmydesktop/src/rmd_specsfile.c
trunk/recordmydesktop/src/rmd_specsfile.h
trunk/recordmydesktop/src/rmd_threads.c
trunk/recordmydesktop/src/rmd_threads.h
trunk/recordmydesktop/src/rmd_types.h
trunk/recordmydesktop/src/rmd_update_image.c
trunk/recordmydesktop/src/rmd_update_image.h
trunk/recordmydesktop/src/rmd_wm_check.c
trunk/recordmydesktop/src/rmd_wm_check.h
trunk/recordmydesktop/src/rmd_yuv_utils.c
trunk/recordmydesktop/src/rmd_yuv_utils.h
Removed Paths:
-------------
trunk/recordmydesktop/src/block_utils.c
trunk/recordmydesktop/src/block_utils.h
trunk/recordmydesktop/src/cache_audio.c
trunk/recordmydesktop/src/cache_audio.h
trunk/recordmydesktop/src/cache_frame.c
trunk/recordmydesktop/src/cache_frame.h
trunk/recordmydesktop/src/capture_sound.c
trunk/recordmydesktop/src/capture_sound.h
trunk/recordmydesktop/src/encode_cache.c
trunk/recordmydesktop/src/encode_cache.h
trunk/recordmydesktop/src/encode_image_buffer.c
trunk/recordmydesktop/src/encode_image_buffer.h
trunk/recordmydesktop/src/encode_sound_buffer.c
trunk/recordmydesktop/src/encode_sound_buffer.h
trunk/recordmydesktop/src/flush_to_ogg.c
trunk/recordmydesktop/src/flush_to_ogg.h
trunk/recordmydesktop/src/get_frame.c
trunk/recordmydesktop/src/get_frame.h
trunk/recordmydesktop/src/getzpixmap.c
trunk/recordmydesktop/src/getzpixmap.h
trunk/recordmydesktop/src/init_encoder.c
trunk/recordmydesktop/src/init_encoder.h
trunk/recordmydesktop/src/initialize_data.c
trunk/recordmydesktop/src/initialize_data.h
trunk/recordmydesktop/src/load_cache.c
trunk/recordmydesktop/src/load_cache.h
trunk/recordmydesktop/src/make_dummy_pointer.c
trunk/recordmydesktop/src/make_dummy_pointer.h
trunk/recordmydesktop/src/opendev.c
trunk/recordmydesktop/src/opendev.h
trunk/recordmydesktop/src/parseargs.c
trunk/recordmydesktop/src/parseargs.h
trunk/recordmydesktop/src/poll_events.c
trunk/recordmydesktop/src/poll_events.h
trunk/recordmydesktop/src/queryextensions.c
trunk/recordmydesktop/src/queryextensions.h
trunk/recordmydesktop/src/rectinsert.c
trunk/recordmydesktop/src/rectinsert.h
trunk/recordmydesktop/src/register_callbacks.c
trunk/recordmydesktop/src/register_callbacks.h
trunk/recordmydesktop/src/rmdmacro.h
trunk/recordmydesktop/src/rmdthreads.c
trunk/recordmydesktop/src/rmdthreads.h
trunk/recordmydesktop/src/rmdtypes.h
trunk/recordmydesktop/src/setbrwindow.c
trunk/recordmydesktop/src/setbrwindow.h
trunk/recordmydesktop/src/shortcuts.c
trunk/recordmydesktop/src/shortcuts.h
trunk/recordmydesktop/src/specsfile.c
trunk/recordmydesktop/src/specsfile.h
trunk/recordmydesktop/src/update_image.c
trunk/recordmydesktop/src/update_image.h
trunk/recordmydesktop/src/wm_check.c
trunk/recordmydesktop/src/wm_check.h
trunk/recordmydesktop/src/yuv_utils.c
trunk/recordmydesktop/src/yuv_utils.h
Modified: trunk/recordmydesktop/src/Makefile.am
===================================================================
--- trunk/recordmydesktop/src/Makefile.am 2008-09-14 12:09:31 UTC (rev 545)
+++ trunk/recordmydesktop/src/Makefile.am 2008-09-14 13:06:20 UTC (rev 546)
@@ -1,77 +1,77 @@
bin_PROGRAMS = recordmydesktop
recordmydesktop_SOURCES = \
- block_utils.c \
- block_utils.h \
- cache_audio.c \
- cache_audio.h \
- cache_frame.c \
- cache_frame.h \
- capture_sound.c \
- capture_sound.h \
- encode_cache.c \
- encode_cache.h \
- encode_image_buffer.c \
- encode_image_buffer.h \
- encode_sound_buffer.c \
- encode_sound_buffer.h \
- flush_to_ogg.c \
- flush_to_ogg.h \
- get_frame.c \
- get_frame.h \
- getzpixmap.c \
- getzpixmap.h \
- init_encoder.c \
- init_encoder.h \
- initialize_data.c \
- initialize_data.h \
- load_cache.c \
- load_cache.h \
- make_dummy_pointer.c \
- make_dummy_pointer.h \
- opendev.c \
- opendev.h \
- parseargs.c \
- parseargs.h \
- poll_events.c \
- poll_events.h \
- queryextensions.c \
- queryextensions.h \
- recordmydesktop.c \
- rectinsert.c \
- rectinsert.h \
- register_callbacks.c \
- register_callbacks.h \
- rmd_cache.c \
- rmd_cache.h \
- rmd_error.c \
- rmd_error.h \
- rmd_frame.c \
- rmd_frame.h \
- rmd_jack.c \
- rmd_jack.h \
- rmd_rescue.c \
- rmd_rescue.h \
- rmd_timer.c \
- rmd_timer.h \
- rmdthreads.c \
- rmdthreads.h \
- rmdmacro.h \
- rmdtypes.h \
- setbrwindow.c \
- setbrwindow.h \
- shortcuts.c \
- shortcuts.h \
- skeleton.c \
- skeleton.h \
- specsfile.c \
- specsfile.h \
- update_image.c \
- update_image.h \
- yuv_utils.c \
- yuv_utils.h \
- wm_check.c \
- wm_check.h
+ recordmydesktop.c \
+ rmd_block_utils.c \
+ rmd_block_utils.h \
+ rmd_cache.c \
+ rmd_cache.h \
+ rmd_cache_audio.c \
+ rmd_cache_audio.h \
+ rmd_cache_frame.c \
+ rmd_cache_frame.h \
+ rmd_capture_sound.c \
+ rmd_capture_sound.h \
+ rmd_encode_cache.c \
+ rmd_encode_cache.h \
+ rmd_encode_image_buffer.c \
+ rmd_encode_image_buffer.h \
+ rmd_encode_sound_buffer.c \
+ rmd_encode_sound_buffer.h \
+ rmd_error.c \
+ rmd_error.h \
+ rmd_flush_to_ogg.c \
+ rmd_flush_to_ogg.h \
+ rmd_frame.c \
+ rmd_frame.h \
+ rmd_get_frame.c \
+ rmd_get_frame.h \
+ rmd_getzpixmap.c \
+ rmd_getzpixmap.h \
+ rmd_init_encoder.c \
+ rmd_init_encoder.h \
+ rmd_initialize_data.c \
+ rmd_initialize_data.h \
+ rmd_jack.c \
+ rmd_jack.h \
+ rmd_load_cache.c \
+ rmd_load_cache.h \
+ rmd_macro.h \
+ rmd_make_dummy_pointer.c \
+ rmd_make_dummy_pointer.h \
+ rmd_opendev.c \
+ rmd_opendev.h \
+ rmd_parseargs.c \
+ rmd_parseargs.h \
+ rmd_poll_events.c \
+ rmd_poll_events.h \
+ rmd_queryextensions.c \
+ rmd_queryextensions.h \
+ rmd_rectinsert.c \
+ rmd_rectinsert.h \
+ rmd_register_callbacks.c \
+ rmd_register_callbacks.h \
+ rmd_rescue.c \
+ rmd_rescue.h \
+ rmd_setbrwindow.c \
+ rmd_setbrwindow.h \
+ rmd_shortcuts.c \
+ rmd_shortcuts.h \
+ rmd_specsfile.c \
+ rmd_specsfile.h \
+ rmd_threads.c \
+ rmd_threads.h \
+ rmd_timer.c \
+ rmd_timer.h \
+ rmd_types.h \
+ rmd_update_image.c \
+ rmd_update_image.h \
+ rmd_wm_check.c \
+ rmd_wm_check.h \
+ rmd_yuv_utils.c \
+ rmd_yuv_utils.h \
+ skeleton.c \
+ skeleton.h
recordmydesktop_CPPFLAGS = -D_THREAD_SAFE -pthread -Wall
recordmydesktop_LDFLAGS = @X_LIBS@ @X_EXTRA_LIBS@ @X_PRE_LIBS@
@@ -83,10 +83,10 @@
CLEANFILES = $(EXTRA_PROGRAMS)
test_rectinsert_SOURCES = \
- test-rectinsert.c \
- test-rectinsert-data.c \
- test-rectinsert-data.h \
- test-rectinsert-types.h \
- rectinsert.c
+ test-rectinsert.c \
+ test-rectinsert-data.c \
+ test-rectinsert-data.h \
+ test-rectinsert-types.h \
+ rmd_rectinsert.c
test_rectinsert_CFLAGS = -Wall
Deleted: trunk/recordmydesktop/src/block_utils.c
===================================================================
--- trunk/recordmydesktop/src/block_utils.c 2008-09-14 12:09:31 UTC (rev 545)
+++ trunk/recordmydesktop/src/block_utils.c 2008-09-14 13:06:20 UTC (rev 546)
@@ -1,37 +0,0 @@
-/******************************************************************************
-* recordMyDesktop *
-*******************************************************************************
-* *
-* Copyright (C) 2006,2007,2008 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 joh...@gm... *
-******************************************************************************/
-
-#include "config.h"
-
-#include "block_utils.h"
-
-
-// FIXME: These globals are modified in other source files! We keep
-// thsee here for now. These are the cache blocks. They need to be
-// accesible in the dbuf macros
-u_int32_t *yblocks,
- *ublocks,
- *vblocks;
Deleted: trunk/recordmydesktop/src/block_utils.h
===================================================================
--- trunk/recordmydesktop/src/block_utils.h 2008-09-14 12:09:31 UTC (rev 545)
+++ trunk/recordmydesktop/src/block_utils.h 2008-09-14 13:06:20 UTC (rev 546)
@@ -1,170 +0,0 @@
-/******************************************************************************
-* recordMyDesktop *
-*******************************************************************************
-* *
-* Copyright (C) 2006,2007,2008 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 joh...@gm... *
-******************************************************************************/
-
-#ifndef BLOCK_UTILS_H
-#define BLOCK_UTILS_H 1
-
-#include "rmdtypes.h"
-#include "rmdmacro.h"
-#include "yuv_utils.h"
-
-
-// We keep these global for now. FIXME: Isolate them.
-extern u_int32_t *yblocks,
- *ublocks,
- *vblocks;
-
-#define POINT_IN_BLOCK(xv,yv,widthv,blocksize) ((yv/blocksize)*\
- (widthv/blocksize)+\
- (xv/blocksize))
-
-#define UPDATE_Y_PLANE_DBUF(data,\
- data_back,\
- x_tm,\
- y_tm,\
- height_tm,\
- width_tm,\
- yuv,\
- __bit_depth__){ \
- int k,i;\
- register u_int##__bit_depth__##_t t_val;\
- register unsigned char *yuv_y=yuv->y+x_tm+y_tm*yuv->y_width,\
- *_yr=Yr,*_yg=Yg,*_yb=Yb;\
- register u_int##__bit_depth__##_t *datapi=(u_int##__bit_depth__##_t *)data,\
- *datapi_back=(u_int##__bit_depth__##_t *)data_back;\
- for(k=0;k<height_tm;k++){\
- for(i=0;i<width_tm;i++){\
- if(*datapi!=*datapi_back){\
- t_val=*datapi;\
- *yuv_y=_yr[__RVALUE_##__bit_depth__(t_val)] +\
- _yg[__GVALUE_##__bit_depth__(t_val)] +\
- _yb[__BVALUE_##__bit_depth__(t_val)] ;\
- yblocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
- }\
- datapi++;\
- datapi_back++;\
- yuv_y++;\
- }\
- yuv_y+=yuv->y_width-width_tm;\
- }\
-}
-
-#define UPDATE_UV_PLANES_DBUF( data,\
- data_back,\
- x_tm,\
- y_tm,\
- height_tm,\
- width_tm,\
- yuv,\
- __sampling_type,\
- __bit_depth__){ \
- int k,i;\
- register u_int##__bit_depth__##_t t_val;\
- register unsigned char *yuv_u=yuv->u+x_tm/2+(y_tm*yuv->uv_width)/2,\
- *yuv_v=yuv->v+x_tm/2+(y_tm*yuv->uv_width)/2,\
- *_ur=Ur,*_ug=Ug,*_ubvr=UbVr,\
- *_vg=Vg,*_vb=Vb;\
- register u_int##__bit_depth__##_t *datapi=(u_int##__bit_depth__##_t *)data,\
- *datapi_next=NULL,\
- *datapi_back=(u_int##__bit_depth__##_t *)data_back,\
- *datapi_back_next=NULL;\
- if(__sampling_type==__PXL_AVERAGE){\
- datapi_next=datapi+width_tm;\
- datapi_back_next=datapi_back+width_tm;\
- for(k=0;k<height_tm;k+=2){\
- for(i=0;i<width_tm;i+=2){\
- if(( (*datapi!=*datapi_back) ||\
- (*(datapi+1)!=*(datapi_back+1)) ||\
- (*datapi_next!=*datapi_back_next) ||\
- (*(datapi_next+1)!=*(datapi_back_next+1)))){\
- UPDATE_A_UV_PIXEL( yuv_u,\
- yuv_v,\
- t_val,\
- datapi,\
- datapi_next,\
- _ur,_ug,_ubvr,_vg,_vb,\
- __sampling_type,\
- __bit_depth__)\
- ublocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
- vblocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
- }\
- datapi+=2;\
- datapi_back+=2;\
- if(__sampling_type==__PXL_AVERAGE){\
- datapi_next+=2;\
- datapi_back_next+=2;\
- }\
- yuv_u++;\
- yuv_v++;\
- }\
- yuv_u+=(yuv->y_width-width_tm)/2;\
- yuv_v+=(yuv->y_width-width_tm)/2;\
- datapi+=width_tm;\
- datapi_back+=width_tm;\
- if(__sampling_type==__PXL_AVERAGE){\
- datapi_next+=width_tm;\
- datapi_back_next+=width_tm;\
- }\
- }\
- }\
- else{\
- for(k=0;k<height_tm;k+=2){\
- for(i=0;i<width_tm;i+=2){\
- if ((*datapi!=*datapi_back)){\
- UPDATE_A_UV_PIXEL( yuv_u,\
- yuv_v,\
- t_val,\
- datapi,\
- datapi_next,\
- _ur,_ug,_ubvr,_vg,_vb,\
- __sampling_type,\
- __bit_depth__)\
- ublocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
- vblocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
- }\
- datapi+=2;\
- datapi_back+=2;\
- if(__sampling_type==__PXL_AVERAGE){\
- datapi_next+=2;\
- datapi_back_next+=2;\
- }\
- yuv_u++;\
- yuv_v++;\
- }\
- yuv_u+=(yuv->y_width-width_tm)/2;\
- yuv_v+=(yuv->y_width-width_tm)/2;\
- datapi+=width_tm;\
- datapi_back+=width_tm;\
- if(__sampling_type==__PXL_AVERAGE){\
- datapi_next+=width_tm;\
- datapi_back_next+=width_tm;\
- }\
- }\
- }\
-}
-
-
-#endif
Deleted: trunk/recordmydesktop/src/cache_audio.c
===================================================================
--- trunk/recordmydesktop/src/cache_audio.c 2008-09-14 12:09:31 UTC (rev 545)
+++ trunk/recordmydesktop/src/cache_audio.c 2008-09-14 13:06:20 UTC (rev 546)
@@ -1,108 +0,0 @@
-/******************************************************************************
-* recordMyDesktop *
-*******************************************************************************
-* *
-* Copyright (C) 2006,2007,2008 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 joh...@gm... *
-******************************************************************************/
-
-#include "config.h"
-
-#include <pthread.h>
-
-#include "rmdtypes.h"
-
-#include "cache_audio.h"
-#include "rmd_jack.h"
-
-
-void *CacheSoundBuffer(ProgData *pdata){
-//We are simply going to throw sound on the disk.
-//It's sound is tiny compared to that of image, so
-//compressing would reducethe overall size by only an
-//insignificant fraction.
-#ifdef HAVE_JACK_H
- void *jackbuf=NULL;
- if(pdata->args.use_jack){
- jackbuf=malloc(pdata->sound_framesize*pdata->jdata->buffersize);
- }
-#endif
- while((pdata->running)){
- SndBuffer *buff=NULL;
-
- if (pdata->paused) {
- pthread_mutex_lock(&pdata->pause_mutex);
- pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
- pthread_mutex_unlock(&pdata->pause_mutex);
- }
- if(!pdata->args.use_jack){
- if(pdata->sound_buffer==NULL){
- pdata->v_enc_thread_waiting=1;
- pthread_mutex_lock(&pdata->snd_buff_ready_mutex);
- pthread_cond_wait(&pdata->sound_data_read,
- &pdata->snd_buff_ready_mutex);
- pthread_mutex_unlock(&pdata->snd_buff_ready_mutex);
- pdata->v_enc_thread_waiting=0;
- }
- if(pdata->sound_buffer==NULL || !pdata->running){
- break;
- }
- pthread_mutex_lock(&pdata->sound_buffer_mutex);
- buff=pdata->sound_buffer;
- //advance the list
- pdata->sound_buffer=pdata->sound_buffer->next;
- pthread_mutex_unlock(&pdata->sound_buffer_mutex);
- fwrite(buff->data,1,pdata->periodsize*pdata->sound_framesize,
- pdata->cache_data->afp);
- free(buff->data);
- free(buff);
- }
- else{
-#ifdef HAVE_JACK_H
- if((*jack_ringbuffer_read_space_p)(pdata->jdata->sound_buffer)>=
- (pdata->sound_framesize*pdata->jdata->buffersize)){
- (*jack_ringbuffer_read_p)(pdata->jdata->sound_buffer,
- jackbuf,
- (pdata->sound_framesize*
- pdata->jdata->buffersize));
- fwrite(jackbuf,1,(pdata->sound_framesize*
- pdata->jdata->buffersize),
- pdata->cache_data->afp);
- }
- else{
- pdata->v_enc_thread_waiting=1;
- pthread_mutex_lock(&pdata->snd_buff_ready_mutex);
- pthread_cond_wait(&pdata->sound_data_read,
- &pdata->snd_buff_ready_mutex);
- pthread_mutex_unlock(&pdata->snd_buff_ready_mutex);
- pdata->v_enc_thread_waiting=0;
- continue;
- }
-#endif
- }
- pdata->avd-=pdata->periodtime;
- }
-
- fclose(pdata->cache_data->afp);
- pthread_exit(&errno);
-}
-
-
Deleted: trunk/recordmydesktop/src/cache_audio.h
===================================================================
--- trunk/recordmydesktop/src/cache_audio.h 2008-09-14 12:09:31 UTC (rev 545)
+++ trunk/recordmydesktop/src/cache_audio.h 2008-09-14 13:06:20 UTC (rev 546)
@@ -1,42 +0,0 @@
-/******************************************************************************
-* recordMyDesktop *
-*******************************************************************************
-* *
-* Copyright (C) 2006,2007,2008 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 joh...@gm... *
-******************************************************************************/
-
-#ifndef CACHE_AUDIO_H
-#define CACHE_AUDIO_H 1
-
-#include "rmdtypes.h"
-
-
-/**
-* Sound caching thread. Simply writes the pcm buffers on disk
-*
-* \param pdata ProgData struct containing all program data
-*
-*/
-void *CacheSoundBuffer(ProgData *pdata);
-
-
-#endif
Deleted: trunk/recordmydesktop/src/cache_frame.c
===================================================================
--- trunk/recordmydesktop/src/cache_frame.c 2008-09-14 12:09:31 UTC (rev 545)
+++ trunk/recordmydesktop/src/cache_frame.c 2008-09-14 13:06:20 UTC (rev 546)
@@ -1,295 +0,0 @@
-/******************************************************************************
-* recordMyDesktop *
-*******************************************************************************
-* *
-* Copyright (C) 2006,2007,2008 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 joh...@gm... *
-******************************************************************************/
-
-#include "config.h"
-
-#include <signal.h>
-#include <math.h>
-
-#include "rmdtypes.h"
-
-#include "cache_frame.h"
-#include "rmd_cache.h"
-#include "block_utils.h"
-
-
-//minimize hard disk access
-#define CACHE_OUT_BUFFER_SIZE 4096
-//500 mb file size
-#define CACHE_FILE_SIZE_LIMIT (500*1<<20)
-
-
-static int FlushBlock(unsigned char *buf,
- int blockno,
- int width,
- int height,
- int blockwidth,
- gzFile *fp,
- FILE *ucfp,
- int flush) {
- int j,i,
- bytes_written=0,
- block_i=(!blockwidth)?0:(blockno/(width/blockwidth)),//place on the grid
- block_k=(!blockwidth)?0:(blockno%(width/blockwidth));
- register unsigned char *buf_reg=(&buf[(block_i*
- width+
- block_k)*blockwidth]);
- static unsigned char out_buffer[CACHE_OUT_BUFFER_SIZE];
- static unsigned int out_buffer_bytes=0;
-
- if(out_buffer_bytes+pow(blockwidth,2)>=CACHE_OUT_BUFFER_SIZE ||
- (flush && out_buffer_bytes)){
- if(ucfp==NULL)
- gzwrite(fp,(void *)out_buffer,out_buffer_bytes);
- else
- fwrite((void *)out_buffer,1,out_buffer_bytes,ucfp);
- bytes_written=out_buffer_bytes;
- out_buffer_bytes=0;
- }
- if(!flush){
- register unsigned char *out_buf_reg=&out_buffer[out_buffer_bytes];
- for(j=0;j<blockwidth;j++){
- for(i=0;i<blockwidth;i++)
- (*out_buf_reg++)=(*buf_reg++);
- out_buffer_bytes+=blockwidth;
- buf_reg+=width-blockwidth;
- }
- }
-
- return bytes_written;
-}
-
-void *CacheImageBuffer(ProgData *pdata){
-
- gzFile *fp=NULL;
- FILE *ucfp=NULL;
- int index_entry_size=sizeof(u_int32_t),
- blocknum_x=pdata->enc_data->yuv.y_width/Y_UNIT_WIDTH,
- blocknum_y=pdata->enc_data->yuv.y_height/Y_UNIT_WIDTH,
- firstrun=1,
- frameno=0,
- nbytes=0,
- nth_cache=1;
- unsigned int total_bytes=0,
- total_received_bytes=0;
- u_int32_t ynum,unum,vnum,
- y_short_blocks[blocknum_x*blocknum_y],
- u_short_blocks[blocknum_x*blocknum_y],
- v_short_blocks[blocknum_x*blocknum_y];
-
- if(!pdata->args.zerocompression){
- fp=pdata->cache_data->ifp;
- if(fp==NULL)exit(13);
- }
- else{
- ucfp=pdata->cache_data->uncifp;
- if(ucfp==NULL)exit(13);
- }
-
-
- while(pdata->running){
- int j;
- FrameHeader fheader;
- ynum=unum=vnum=0;
-
- pdata->th_enc_thread_waiting=1;
- pthread_mutex_lock(&pdata->img_buff_ready_mutex);
- pthread_cond_wait(&pdata->image_buffer_ready,
- &pdata->img_buff_ready_mutex);
- pthread_mutex_unlock(&pdata->img_buff_ready_mutex);
- pdata->th_enc_thread_waiting=0;
-
- if (pdata->paused) {
- pthread_mutex_lock(&pdata->pause_mutex);
- pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
- pthread_mutex_unlock(&pdata->pause_mutex);
- }
-
- pthread_mutex_lock(&pdata->yuv_mutex);
-
- //find and flush different blocks
- if(firstrun){
- firstrun=0;
- for(j=0;j<blocknum_x*blocknum_y;j++){
- ynum++;
- yblocks[ynum-1]=1;
- y_short_blocks[ynum-1]=j;
- unum++;
- ublocks[unum-1]=1;
- u_short_blocks[ynum-1]=j;
- vnum++;
- vblocks[vnum-1]=1;
- v_short_blocks[ynum-1]=j;
- }
- }
- else{
- /**COMPRESS ARRAYS*/
- for(j=0;j<blocknum_x*blocknum_y;j++){
- if(yblocks[j]){
- ynum++;
- y_short_blocks[ynum-1]=j;
- }
- if(ublocks[j]){
- unum++;
- u_short_blocks[unum-1]=j;
- }
- if(vblocks[j]){
- vnum++;
- v_short_blocks[vnum-1]=j;
- }
- }
- }
-
- /**WRITE FRAME TO DISK*/
- if(!pdata->args.zerocompression){
- if(ynum*4+unum+vnum>(blocknum_x*blocknum_y*6)/10)
- gzsetparams (fp,1,Z_FILTERED);
- else
- gzsetparams (fp,0,Z_FILTERED);
- }
-
- strncpy(fheader.frame_prefix,"FRAM",4);
- fheader.frameno=++frameno;
- fheader.current_total = pdata->frames_total;
-
- fheader.Ynum=ynum;
- fheader.Unum=unum;
- fheader.Vnum=vnum;
- if(!pdata->args.zerocompression){
- nbytes+=gzwrite(fp,(void*)&fheader,sizeof(FrameHeader));
- //flush indexes
- if(ynum)nbytes+=gzwrite(fp,
- (void*)y_short_blocks,
- ynum*index_entry_size);
- if(unum)nbytes+=gzwrite(fp,
- (void*)u_short_blocks,
- unum*index_entry_size);
- if(vnum)nbytes+=gzwrite(fp,
- (void*)v_short_blocks,
- vnum*index_entry_size);
- }
- else{
- nbytes+=sizeof(FrameHeader)*
- fwrite((void*)&fheader,sizeof(FrameHeader),1,ucfp);
- //flush indexes
- if(ynum)nbytes+=index_entry_size*
- fwrite(y_short_blocks,index_entry_size,ynum,ucfp);
- if(unum)nbytes+=index_entry_size*
- fwrite(u_short_blocks,index_entry_size,unum,ucfp);
- if(vnum)nbytes+=index_entry_size*
- fwrite(v_short_blocks,index_entry_size,vnum,ucfp);
- }
- //flush the blocks for each buffer
- if(ynum){
- for(j=0;j<ynum;j++)
- nbytes+=FlushBlock( pdata->enc_data->yuv.y,y_short_blocks[j],
- pdata->enc_data->yuv.y_width,
- pdata->enc_data->yuv.y_height,
- Y_UNIT_WIDTH,
- fp,
- ucfp,
- 0);
- }
- if(unum){
- for(j=0;j<unum;j++)
- nbytes+=FlushBlock( pdata->enc_data->yuv.u,u_short_blocks[j],
- pdata->enc_data->yuv.uv_width,
- pdata->enc_data->yuv.uv_height,
- UV_UNIT_WIDTH,
- fp,
- ucfp,
- 0);
- }
- if(vnum){
- for(j=0;j<vnum;j++)
- nbytes+=FlushBlock( pdata->enc_data->yuv.v,v_short_blocks[j],
- pdata->enc_data->yuv.uv_width,
- pdata->enc_data->yuv.uv_height,
- UV_UNIT_WIDTH,
- fp,
- ucfp,
- 0);
- }
- //release main buffer
- pthread_mutex_unlock(&pdata->yuv_mutex);
-
- nbytes+=FlushBlock(NULL,0,0,0,0,fp,ucfp,1);
- /**@________________@**/
- pdata->avd+=pdata->frametime;
- if(nbytes>CACHE_FILE_SIZE_LIMIT){
- if(SwapCacheFilesWrite(pdata->cache_data->imgdata,
- nth_cache,&fp,&ucfp)){
- fprintf(stderr,"New cache file could not be created.\n"
- "Ending recording...\n");
- fflush(stderr);
- raise(SIGINT); //if for some reason we cannot make a new file
- //we have to stop. If we are out of space,
- //which means
- //that encoding cannot happen either,
- //InitEncoder will cause an abrupt end with an
- //error code and the cache will remain intact.
- //If we've chosen separate two-stages,
- //the program will make a
- //clean exit.
- //In either case data will be preserved so if
- //space is freed the recording
- //can be proccessed later.
- }
- total_bytes+=(nbytes>>20);
- nth_cache++;
- nbytes=0;
- }
- }
- total_bytes+=(nbytes>>20);
- total_received_bytes=((frameno*((pdata->specs.depth>=24)?4:2)*
- pdata->brwin.rgeom.width*pdata->brwin.rgeom.height)>>20);
- if(total_received_bytes){
- fprintf(stderr,"\n*********************************************\n"
- "\nCached %u MB, from %u MB that were received.\n"
- "Average cache compression ratio: %u %%\n"
- "\n*********************************************\n",
- total_bytes,
- total_received_bytes,
- (total_bytes*100)/total_received_bytes);
-
- }
-
- fprintf(stderr,
- "Saved %d frames in a total of %d requests\n",
- frameno,
- pdata->frames_total);
- fflush(stderr);
-
- if(!pdata->args.zerocompression){
- gzflush(fp,Z_FINISH);
- gzclose(fp);
- }
- else{
- fflush(ucfp);
- fclose(ucfp);
- }
- pthread_exit(&errno);
-}
Deleted: trunk/recordmydesktop/src/cache_frame.h
===================================================================
--- trunk/recordmydesktop/src/cache_frame.h 2008-09-14 12:09:31 UTC (rev 545)
+++ trunk/recordmydesktop/src/cache_frame.h 2008-09-14 13:06:20 UTC (rev 546)
@@ -1,43 +0,0 @@
-/******************************************************************************
-* recordMyDesktop *
-*******************************************************************************
-* *
-* Copyright (C) 2006,2007,2008 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 joh...@gm... *
-******************************************************************************/
-
-#ifndef CACHE_FRAME_H
-#define CACHE_FRAME_H 1
-
-#include "rmdtypes.h"
-
-
-/**
-* Image caching thread. Copies the yuv buffer, compares with the last one and
-* caches the result.
-*
-* \param pdata ProgData struct containing all program data
-*
-*/
-void *CacheImageBuffer(ProgData *pdata);
-
-
-#endif
Deleted: trunk/recordmydesktop/src/capture_sound.c
===================================================================
--- trunk/recordmydesktop/src/capture_sound.c 2008-09-14 12:09:31 UTC (rev 545)
+++ trunk/recordmydesktop/src/capture_sound.c 2008-09-14 13:06:20 UTC (rev 546)
@@ -1,174 +0,0 @@
-/******************************************************************************
-* recordMyDesktop *
-*******************************************************************************
-* *
-* Copyright (C) 2006,2007,2008 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 joh...@gm... *
-******************************************************************************/
-
-#include "config.h"
-
-#include <pthread.h>
-
-#include "rmdtypes.h"
-
-#include "capture_sound.h"
-#include "opendev.h"
-#include "rmd_jack.h"
-
-
-void *CaptureSound(ProgData *pdata){
-
-#ifdef HAVE_LIBASOUND
- int frames=pdata->periodsize;
-#endif
- //start capturing only after first frame is taken
- usleep(pdata->frametime);
-
- while(pdata->running){
- int sret=0;
- SndBuffer *newbuf,*tmp;
- if (pdata->paused) {
-#ifdef HAVE_LIBASOUND
- if(!pdata->hard_pause){
- snd_pcm_pause(pdata->sound_handle,1);
- pthread_mutex_lock(&pdata->pause_mutex);
- pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
- pthread_mutex_unlock(&pdata->pause_mutex);
- snd_pcm_pause(pdata->sound_handle,0);
- }
- else{//device doesn't support pause(is this the norm?mine doesn't)
- snd_pcm_close(pdata->sound_handle);
- pthread_mutex_lock(&pdata->pause_mutex);
- pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
- pthread_mutex_unlock(&pdata->pause_mutex);
- pdata->sound_handle=
- OpenDev(pdata->args.device,
- &pdata->args.channels,
- &pdata->args.frequency,
- &pdata->args.buffsize,
- NULL,
- NULL,
- NULL//let's hope that the device capabilities
- //didn't magically change
- );
- if(pdata->sound_handle==NULL){
- fprintf(stderr,"Couldn't reopen sound device.Exiting\n");
- pdata->running = FALSE;
- errno=3;
- pthread_exit(&errno);
- }
- }
-#else
- close(pdata->sound_handle);
- pthread_mutex_lock(&pdata->pause_mutex);
- pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
- pthread_mutex_unlock(&pdata->pause_mutex);
- pdata->sound_handle=
- OpenDev(pdata->args.device,
- pdata->args.channels,
- pdata->args.frequency);
- if(pdata->sound_handle<0){
- fprintf(stderr,"Couldn't reopen sound device.Exiting\n");
- pdata->running = FALSE;
- errno=3;
- pthread_exit(&errno);
- }
-#endif
- }
-
- //create new buffer
- newbuf=(SndBuffer *)malloc(sizeof(SndBuffer));
-#ifdef HAVE_LIBASOUND
- newbuf->data=(signed char *)malloc(frames*pdata->sound_framesize);
-#else
- newbuf->data=(signed char *)malloc(((pdata->args.buffsize<<1)*
- pdata->args.channels));
-#endif
- newbuf->next=NULL;
-
- //read data into new buffer
-#ifdef HAVE_LIBASOUND
- while(sret<frames){
- int temp_sret=snd_pcm_readi(pdata->sound_handle,
- newbuf->data+pdata->sound_framesize*sret,
- frames-sret);
- if(temp_sret==-EPIPE){
- fprintf(stderr,"%s: Overrun occurred.\n",
- snd_strerror(temp_sret));
- snd_pcm_prepare(pdata->sound_handle);
- }
- else if (temp_sret<0){
- fprintf(stderr,"An error occured while reading sound data:\n"
- " %s\n",
- snd_strerror(temp_sret));
- snd_pcm_prepare(pdata->sound_handle);
- }
- else
- sret+=temp_sret;
- }
-#else
- sret=0;
- //oss recording loop
- do{
- int temp_sret=read(pdata->sound_handle,
- &newbuf->data[sret],
- ((pdata->args.buffsize<<1)*
- pdata->args.channels)-sret);
- if(temp_sret<0){
- fprintf(stderr,"An error occured while reading from soundcard"
- "%s\n"
- "Error description:\n"
- "%s\n",pdata->args.device,strerror(errno));
- }
- else
- sret+=temp_sret;
- }while(sret<((pdata->args.buffsize<<1)*
- pdata->args.channels));
-#endif
- //queue the new buffer
- pthread_mutex_lock(&pdata->sound_buffer_mutex);
- tmp=pdata->sound_buffer;
- if(pdata->sound_buffer==NULL)
- pdata->sound_buffer=newbuf;
- else{
- while(tmp->next!=NULL)
- tmp=tmp->next;
- tmp->next=newbuf;
- }
- pthread_mutex_unlock(&pdata->sound_buffer_mutex);
-
-
- //signal that there are data to be proccessed
- pthread_mutex_lock(&pdata->snd_buff_ready_mutex);
- pthread_cond_signal(&pdata->sound_data_read);
- pthread_mutex_unlock(&pdata->snd_buff_ready_mutex);
- }
-#ifdef HAVE_LIBASOUND
- snd_pcm_close(pdata->sound_handle);
-#else
- close(pdata->sound_handle);
-#endif
- pthread_exit(&errno);
-}
-
-
-
Deleted: trunk/recordmydesktop/src/capture_sound.h
===================================================================
--- trunk/recordmydesktop/src/capture_sound.h 2008-09-14 12:09:31 UTC (rev 545)
+++ trunk/recordmydesktop/src/capture_sound.h 2008-09-14 13:06:20 UTC (rev 546)
@@ -1,42 +0,0 @@
-/******************************************************************************
-* recordMyDesktop *
-*******************************************************************************
-* *
-* Copyright (C) 2006,2007,2008 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 joh...@gm... *
-******************************************************************************/
-
-#ifndef CAPTURE_SOUND_H
-#define CAPTURE_SOUND_H 1
-
-#include "rmdtypes.h"
-
-
-/**
-* Sound capturing thread. Data are placed on a
-* list to be picked up by other threads.
-*
-* \param pdata ProgData struct containing all program data
-*/
-void *CaptureSound(ProgData *pdata);
-
-
-#endif
Deleted: trunk/recordmydesktop/src/encode_cache.c
===================================================================
--- trunk/recordmydesktop/src/encode_cache.c 2008-09-14 12:09:31 UTC (rev 545)
+++ trunk/recordmydesktop/src/encode_cache.c 2008-09-14 13:06:20 UTC (rev 546)
@@ -1,71 +0,0 @@
-/******************************************************************************
-* recordMyDesktop *
-*******************************************************************************
-* *
-* Copyright (C) 2006,2007,2008 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 joh...@gm... *
-******************************************************************************/
-
-#include "config.h"
-
-#include <pthread.h>
-
-#include "rmdtypes.h"
-
-#include "encode_cache.h"
-#include "flush_to_ogg.h"
-#include "init_encoder.h"
-#include "load_cache.h"
-
-
-void EncodeCache(ProgData *pdata){
- pthread_t flush_to_ogg_t,
- load_cache_t;
- fprintf(stderr,"STATE:ENCODING\n");fflush(stderr);
- fprintf(stderr,"Encoding started!\nThis may take several minutes.\n"
- "Pressing Ctrl-C will cancel the procedure"
- " (resuming will not be possible, but\n"
- "any portion of the video, which is already encoded won't be deleted).\n"
- "Please wait...\n");
- pdata->running = TRUE;
- InitEncoder(pdata,pdata->enc_data,1);
- //load encoding and flushing threads
- if(!pdata->args.nosound){
- //before we start loading again
- //we need to free any left-overs
- while(pdata->sound_buffer!=NULL){
- free(pdata->sound_buffer->data);
- pdata->sound_buffer=pdata->sound_buffer->next;
- }
- }
- pthread_create(&flush_to_ogg_t,NULL,(void *)FlushToOgg,(void *)pdata);
-
- //start loading image and audio
- pthread_create(&load_cache_t,NULL,(void *)LoadCache,(void *)pdata);
-
- //join and finish
- pthread_join(load_cache_t,NULL);
- fprintf(stderr,"Encoding finished!\nWait a moment please...\n");
- pthread_join(flush_to_ogg_t,NULL);
-
-}
-
-
Deleted: trunk/recordmydesktop/src/encode_cache.h
===================================================================
--- trunk/recordmydesktop/src/encode_cache.h 2008-09-14 12:09:31 UTC (rev 545)
+++ trunk/recordmydesktop/src/encode_cache.h 2008-09-14 13:06:20 UTC (rev 546)
@@ -1,41 +0,0 @@
-/******************************************************************************
-* recordMyDesktop *
-*******************************************************************************
-* *
-* Copyright (C) 2006,2007,2008 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 joh...@gm... *
-******************************************************************************/
-
-#ifndef ENCODE_CACHE_H
-#define ENCODE_CACHE_H 1
-
-#include "rmdtypes.h"
-
-
-/**
-* Encode cache into an
-* ogg stream.
-* \param pdata ProgData struct containing all program data
-*/
-void EncodeCache(ProgData *pdata);
-
-
-#endif
Deleted: trunk/recordmydesktop/src/encode_image_buffer.c
===================================================================
--- trunk/recordmydesktop/src/encode_image_buffer.c 2008-09-14 12:09:31 UTC (rev 545)
+++ trunk/recordmydesktop/src/encode_image_buffer.c 2008-09-14 13:06:20 UTC (rev 546)
@@ -1,95 +0,0 @@
-/******************************************************************************
-* recordMyDesktop *
-*******************************************************************************
-* *
-* Copyright (C) 2006,2007,2008 John Varouhakis *
-* *
-* ...
[truncated message content] |
|
From: svn c. f. r. <rec...@li...> - 2008-09-14 08:30:01
|
Revision: 544
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=544&view=rev
Author: enselic
Date: 2008-09-14 08:29:53 +0000 (Sun, 14 Sep 2008)
Log Message:
-----------
src/block_utils.c
src/cache_audio.c
src/cache_frame.c
src/capture_sound.c
src/encode_cache.c
src/encode_image_buffer.c
src/encode_sound_buffer.c
src/flush_to_ogg.c
src/get_frame.c
src/getzpixmap.c
src/init_encoder.c
src/initialize_data.c
src/load_cache.c
src/make_dummy_pointer.c
src/opendev.c
src/parseargs.c
src/poll_events.c
src/queryextensions.c
src/recordmydesktop.c
src/rectinsert.c
src/register_callbacks.c
src/rmd_cache.c
src/rmd_error.c
src/rmd_frame.c
src/rmd_jack.c
src/rmd_rescue.c
src/rmd_timer.c
src/rmdmacro.h
src/rmdthreads.c
src/rmdtypes.h
src/setbrwindow.c
src/shortcuts.c
src/specsfile.c
src/test-rectinsert-data.c
src/test-rectinsert.c
src/update_image.c
src/wm_check.c
src/yuv_utils.c: There is no need for us to test if config.h
exists. It's our pacakge, we know it exists. Also make sure that
each .c files includes config.h as the first include.
Modified Paths:
--------------
trunk/recordmydesktop/src/block_utils.c
trunk/recordmydesktop/src/cache_audio.c
trunk/recordmydesktop/src/cache_frame.c
trunk/recordmydesktop/src/capture_sound.c
trunk/recordmydesktop/src/encode_cache.c
trunk/recordmydesktop/src/encode_image_buffer.c
trunk/recordmydesktop/src/encode_sound_buffer.c
trunk/recordmydesktop/src/flush_to_ogg.c
trunk/recordmydesktop/src/get_frame.c
trunk/recordmydesktop/src/getzpixmap.c
trunk/recordmydesktop/src/init_encoder.c
trunk/recordmydesktop/src/initialize_data.c
trunk/recordmydesktop/src/load_cache.c
trunk/recordmydesktop/src/make_dummy_pointer.c
trunk/recordmydesktop/src/opendev.c
trunk/recordmydesktop/src/parseargs.c
trunk/recordmydesktop/src/poll_events.c
trunk/recordmydesktop/src/queryextensions.c
trunk/recordmydesktop/src/recordmydesktop.c
trunk/recordmydesktop/src/rectinsert.c
trunk/recordmydesktop/src/register_callbacks.c
trunk/recordmydesktop/src/rmd_cache.c
trunk/recordmydesktop/src/rmd_error.c
trunk/recordmydesktop/src/rmd_frame.c
trunk/recordmydesktop/src/rmd_jack.c
trunk/recordmydesktop/src/rmd_rescue.c
trunk/recordmydesktop/src/rmd_timer.c
trunk/recordmydesktop/src/rmdmacro.h
trunk/recordmydesktop/src/rmdthreads.c
trunk/recordmydesktop/src/rmdtypes.h
trunk/recordmydesktop/src/setbrwindow.c
trunk/recordmydesktop/src/shortcuts.c
trunk/recordmydesktop/src/specsfile.c
trunk/recordmydesktop/src/test-rectinsert-data.c
trunk/recordmydesktop/src/test-rectinsert.c
trunk/recordmydesktop/src/update_image.c
trunk/recordmydesktop/src/wm_check.c
trunk/recordmydesktop/src/yuv_utils.c
Modified: trunk/recordmydesktop/src/block_utils.c
===================================================================
--- trunk/recordmydesktop/src/block_utils.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/block_utils.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include "block_utils.h"
Modified: trunk/recordmydesktop/src/cache_audio.c
===================================================================
--- trunk/recordmydesktop/src/cache_audio.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/cache_audio.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include <pthread.h>
#include "rmdtypes.h"
Modified: trunk/recordmydesktop/src/cache_frame.c
===================================================================
--- trunk/recordmydesktop/src/cache_frame.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/cache_frame.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include <signal.h>
#include <math.h>
Modified: trunk/recordmydesktop/src/capture_sound.c
===================================================================
--- trunk/recordmydesktop/src/capture_sound.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/capture_sound.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include <pthread.h>
#include "rmdtypes.h"
Modified: trunk/recordmydesktop/src/encode_cache.c
===================================================================
--- trunk/recordmydesktop/src/encode_cache.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/encode_cache.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include <pthread.h>
#include "rmdtypes.h"
Modified: trunk/recordmydesktop/src/encode_image_buffer.c
===================================================================
--- trunk/recordmydesktop/src/encode_image_buffer.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/encode_image_buffer.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include "rmdtypes.h"
#include "encode_image_buffer.h"
Modified: trunk/recordmydesktop/src/encode_sound_buffer.c
===================================================================
--- trunk/recordmydesktop/src/encode_sound_buffer.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/encode_sound_buffer.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include <pthread.h>
#include "rmdtypes.h"
Modified: trunk/recordmydesktop/src/flush_to_ogg.c
===================================================================
--- trunk/recordmydesktop/src/flush_to_ogg.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/flush_to_ogg.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include <pthread.h>
#include "rmdtypes.h"
Modified: trunk/recordmydesktop/src/get_frame.c
===================================================================
--- trunk/recordmydesktop/src/get_frame.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/get_frame.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include <limits.h>
#include <pthread.h>
#include <sys/shm.h>
Modified: trunk/recordmydesktop/src/getzpixmap.c
===================================================================
--- trunk/recordmydesktop/src/getzpixmap.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/getzpixmap.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include <X11/Xlib.h>
#include <X11/Xlibint.h>
#include <X11/extensions/shmstr.h>
Modified: trunk/recordmydesktop/src/init_encoder.c
===================================================================
--- trunk/recordmydesktop/src/init_encoder.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/init_encoder.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,7 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
#include <string.h>
#include <sys/stat.h>
Modified: trunk/recordmydesktop/src/initialize_data.c
===================================================================
--- trunk/recordmydesktop/src/initialize_data.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/initialize_data.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include <pthread.h>
#include "rmdtypes.h"
Modified: trunk/recordmydesktop/src/load_cache.c
===================================================================
--- trunk/recordmydesktop/src/load_cache.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/load_cache.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include <pthread.h>
#include <signal.h>
Modified: trunk/recordmydesktop/src/make_dummy_pointer.c
===================================================================
--- trunk/recordmydesktop/src/make_dummy_pointer.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/make_dummy_pointer.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include "rmdtypes.h"
#include "make_dummy_pointer.h"
Modified: trunk/recordmydesktop/src/opendev.c
===================================================================
--- trunk/recordmydesktop/src/opendev.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/opendev.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,14 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
-
-
-// #include "recordmydesktop.h"
-#ifdef HAVE_CONFIG_H
- #include "config.h"
-#endif
-
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
Modified: trunk/recordmydesktop/src/parseargs.c
===================================================================
--- trunk/recordmydesktop/src/parseargs.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/parseargs.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include "rmdtypes.h"
#include "rmd_rescue.h"
Modified: trunk/recordmydesktop/src/poll_events.c
===================================================================
--- trunk/recordmydesktop/src/poll_events.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/poll_events.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,9 +24,7 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-#ifdef HAVE_CONFIG_H
- #include "config.h"
-#endif
+#include "config.h"
#include <stdio.h>
#include <stdlib.h>
Modified: trunk/recordmydesktop/src/queryextensions.c
===================================================================
--- trunk/recordmydesktop/src/queryextensions.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/queryextensions.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include <X11/extensions/shape.h>
#include <X11/extensions/Xfixes.h>
#include <X11/extensions/Xdamage.h>
Modified: trunk/recordmydesktop/src/recordmydesktop.c
===================================================================
--- trunk/recordmydesktop/src/recordmydesktop.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/recordmydesktop.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include "rmdtypes.h"
#include "encode_cache.h"
Modified: trunk/recordmydesktop/src/rectinsert.c
===================================================================
--- trunk/recordmydesktop/src/rectinsert.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/rectinsert.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,7 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
#include "rmdtypes.h"
#include "rectinsert.h"
Modified: trunk/recordmydesktop/src/register_callbacks.c
===================================================================
--- trunk/recordmydesktop/src/register_callbacks.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/register_callbacks.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include <signal.h>
#include "rmdtypes.h"
Modified: trunk/recordmydesktop/src/rmd_cache.c
===================================================================
--- trunk/recordmydesktop/src/rmd_cache.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/rmd_cache.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include <sys/stat.h>
#include "rmdtypes.h"
Modified: trunk/recordmydesktop/src/rmd_error.c
===================================================================
--- trunk/recordmydesktop/src/rmd_error.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/rmd_error.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,11 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
-#ifdef HAVE_CONFIG_H
- #include "config.h"
-#endif
-
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
Modified: trunk/recordmydesktop/src/rmd_frame.c
===================================================================
--- trunk/recordmydesktop/src/rmd_frame.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/rmd_frame.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
Modified: trunk/recordmydesktop/src/rmd_jack.c
===================================================================
--- trunk/recordmydesktop/src/rmd_jack.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/rmd_jack.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include <pthread.h>
#include "rmdtypes.h"
Modified: trunk/recordmydesktop/src/rmd_rescue.c
===================================================================
--- trunk/recordmydesktop/src/rmd_rescue.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/rmd_rescue.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include <pthread.h>
#include "rmdtypes.h"
Modified: trunk/recordmydesktop/src/rmd_timer.c
===================================================================
--- trunk/recordmydesktop/src/rmd_timer.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/rmd_timer.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,9 +24,7 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-#ifdef HAVE_CONFIG_H
- #include "config.h"
-#endif
+#include "config.h"
#include <pthread.h>
#include <stdio.h>
Modified: trunk/recordmydesktop/src/rmdmacro.h
===================================================================
--- trunk/recordmydesktop/src/rmdmacro.h 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/rmdmacro.h 2008-09-14 08:29:53 UTC (rev 544)
@@ -27,9 +27,7 @@
#ifndef RMDMACRO_H
#define RMDMACRO_H 1
-#ifdef HAVE_CONFIG_H
- #include "config.h"
-#endif
+#include "config.h"
#include <limits.h>
Modified: trunk/recordmydesktop/src/rmdthreads.c
===================================================================
--- trunk/recordmydesktop/src/rmdthreads.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/rmdthreads.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,9 +24,7 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-#ifdef HAVE_CONFIG_H
- #include "config.h"
-#endif
+#include "config.h"
#include <pthread.h>
#include <stdio.h>
Modified: trunk/recordmydesktop/src/rmdtypes.h
===================================================================
--- trunk/recordmydesktop/src/rmdtypes.h 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/rmdtypes.h 2008-09-14 08:29:53 UTC (rev 544)
@@ -25,9 +25,7 @@
#ifndef RMDTYPES_H
#define RMDTYPES_H 1
-#ifdef HAVE_CONFIG_H
- #include "config.h"
-#endif
+#include "config.h"
#include <pthread.h>
#include <zlib.h>
Modified: trunk/recordmydesktop/src/setbrwindow.c
===================================================================
--- trunk/recordmydesktop/src/setbrwindow.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/setbrwindow.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include "rmdtypes.h"
#include "setbrwindow.h"
Modified: trunk/recordmydesktop/src/shortcuts.c
===================================================================
--- trunk/recordmydesktop/src/shortcuts.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/shortcuts.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,11 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
-#ifdef HAVE_CONFIG_H
- #include "config.h"
-#endif
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Modified: trunk/recordmydesktop/src/specsfile.c
===================================================================
--- trunk/recordmydesktop/src/specsfile.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/specsfile.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,11 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
-#ifdef HAVE_CONFIG_H
- #include "config.h"
-#endif
-
#include <stdlib.h>
#include <stdio.h>
Modified: trunk/recordmydesktop/src/test-rectinsert-data.c
===================================================================
--- trunk/recordmydesktop/src/test-rectinsert-data.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/test-rectinsert-data.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -20,6 +20,8 @@
* *
******************************************************************************/
+#include "config.h"
+
#include "test-rectinsert-types.h"
#include "test-rectinsert-data.h"
Modified: trunk/recordmydesktop/src/test-rectinsert.c
===================================================================
--- trunk/recordmydesktop/src/test-rectinsert.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/test-rectinsert.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -20,6 +20,7 @@
* *
******************************************************************************/
+#include "config.h"
#include "rmdtypes.h"
#include "test-rectinsert-types.h"
Modified: trunk/recordmydesktop/src/update_image.c
===================================================================
--- trunk/recordmydesktop/src/update_image.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/update_image.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include <X11/Xlibint.h>
#include <X11/extensions/shmstr.h>
#include <X11/extensions/XShm.h>
Modified: trunk/recordmydesktop/src/wm_check.c
===================================================================
--- trunk/recordmydesktop/src/wm_check.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/wm_check.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include <X11/Xatom.h>
#include "rmdtypes.h"
Modified: trunk/recordmydesktop/src/yuv_utils.c
===================================================================
--- trunk/recordmydesktop/src/yuv_utils.c 2008-09-14 08:03:16 UTC (rev 543)
+++ trunk/recordmydesktop/src/yuv_utils.c 2008-09-14 08:29:53 UTC (rev 544)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "config.h"
+
#include "yuv_utils.h"
// Keep these global (for performance reasons I assume).
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-14 08:03:21
|
Revision: 543
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=543&view=rev
Author: enselic
Date: 2008-09-14 08:03:16 +0000 (Sun, 14 Sep 2008)
Log Message:
-----------
src/rmdtypes.h: Move out a lot of includes to the .c files that needs them.
src/cache_audio.c
src/cache_frame.c
src/capture_sound.c
src/encode_cache.c
src/encode_sound_buffer.c
src/flush_to_ogg.c
src/get_frame.c
src/getzpixmap.c
src/init_encoder.c
src/initialize_data.c
src/load_cache.c
src/queryextensions.c
src/rmd_cache.c
src/rmd_jack.c
src/rmd_rescue.c
src/rmd_timer.c
src/rmdmacro.h
src/rmdthreads.c
src/update_image.c
src/wm_check.c: Adapted.
Modified Paths:
--------------
trunk/recordmydesktop/src/cache_audio.c
trunk/recordmydesktop/src/cache_frame.c
trunk/recordmydesktop/src/capture_sound.c
trunk/recordmydesktop/src/encode_cache.c
trunk/recordmydesktop/src/encode_sound_buffer.c
trunk/recordmydesktop/src/flush_to_ogg.c
trunk/recordmydesktop/src/get_frame.c
trunk/recordmydesktop/src/getzpixmap.c
trunk/recordmydesktop/src/init_encoder.c
trunk/recordmydesktop/src/initialize_data.c
trunk/recordmydesktop/src/load_cache.c
trunk/recordmydesktop/src/queryextensions.c
trunk/recordmydesktop/src/rmd_cache.c
trunk/recordmydesktop/src/rmd_jack.c
trunk/recordmydesktop/src/rmd_rescue.c
trunk/recordmydesktop/src/rmd_timer.c
trunk/recordmydesktop/src/rmdmacro.h
trunk/recordmydesktop/src/rmdthreads.c
trunk/recordmydesktop/src/rmdtypes.h
trunk/recordmydesktop/src/update_image.c
trunk/recordmydesktop/src/wm_check.c
Modified: trunk/recordmydesktop/src/cache_audio.c
===================================================================
--- trunk/recordmydesktop/src/cache_audio.c 2008-09-14 07:36:57 UTC (rev 542)
+++ trunk/recordmydesktop/src/cache_audio.c 2008-09-14 08:03:16 UTC (rev 543)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include <pthread.h>
+
#include "rmdtypes.h"
#include "cache_audio.h"
Modified: trunk/recordmydesktop/src/cache_frame.c
===================================================================
--- trunk/recordmydesktop/src/cache_frame.c 2008-09-14 07:36:57 UTC (rev 542)
+++ trunk/recordmydesktop/src/cache_frame.c 2008-09-14 08:03:16 UTC (rev 543)
@@ -25,6 +25,7 @@
******************************************************************************/
#include <signal.h>
+#include <math.h>
#include "rmdtypes.h"
Modified: trunk/recordmydesktop/src/capture_sound.c
===================================================================
--- trunk/recordmydesktop/src/capture_sound.c 2008-09-14 07:36:57 UTC (rev 542)
+++ trunk/recordmydesktop/src/capture_sound.c 2008-09-14 08:03:16 UTC (rev 543)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include <pthread.h>
+
#include "rmdtypes.h"
#include "capture_sound.h"
Modified: trunk/recordmydesktop/src/encode_cache.c
===================================================================
--- trunk/recordmydesktop/src/encode_cache.c 2008-09-14 07:36:57 UTC (rev 542)
+++ trunk/recordmydesktop/src/encode_cache.c 2008-09-14 08:03:16 UTC (rev 543)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include <pthread.h>
+
#include "rmdtypes.h"
#include "encode_cache.h"
Modified: trunk/recordmydesktop/src/encode_sound_buffer.c
===================================================================
--- trunk/recordmydesktop/src/encode_sound_buffer.c 2008-09-14 07:36:57 UTC (rev 542)
+++ trunk/recordmydesktop/src/encode_sound_buffer.c 2008-09-14 08:03:16 UTC (rev 543)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include <pthread.h>
+
#include "rmdtypes.h"
#include "encode_sound_buffer.h"
Modified: trunk/recordmydesktop/src/flush_to_ogg.c
===================================================================
--- trunk/recordmydesktop/src/flush_to_ogg.c 2008-09-14 07:36:57 UTC (rev 542)
+++ trunk/recordmydesktop/src/flush_to_ogg.c 2008-09-14 08:03:16 UTC (rev 543)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include <pthread.h>
+
#include "rmdtypes.h"
#include "encode_image_buffer.h"
Modified: trunk/recordmydesktop/src/get_frame.c
===================================================================
--- trunk/recordmydesktop/src/get_frame.c 2008-09-14 07:36:57 UTC (rev 542)
+++ trunk/recordmydesktop/src/get_frame.c 2008-09-14 08:03:16 UTC (rev 543)
@@ -24,6 +24,13 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include <limits.h>
+#include <pthread.h>
+#include <sys/shm.h>
+
+#include <X11/extensions/Xfixes.h>
+#include <X11/extensions/XShm.h>
+
#include "rmdtypes.h"
#include "get_frame.h"
Modified: trunk/recordmydesktop/src/getzpixmap.c
===================================================================
--- trunk/recordmydesktop/src/getzpixmap.c 2008-09-14 07:36:57 UTC (rev 542)
+++ trunk/recordmydesktop/src/getzpixmap.c 2008-09-14 08:03:16 UTC (rev 543)
@@ -24,6 +24,11 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include <X11/Xlib.h>
+#include <X11/Xlibint.h>
+#include <X11/extensions/shmstr.h>
+#include <X11/extensions/XShm.h>
+
#include "rmdtypes.h"
#include "getzpixmap.h"
Modified: trunk/recordmydesktop/src/init_encoder.c
===================================================================
--- trunk/recordmydesktop/src/init_encoder.c 2008-09-14 07:36:57 UTC (rev 542)
+++ trunk/recordmydesktop/src/init_encoder.c 2008-09-14 08:03:16 UTC (rev 543)
@@ -26,6 +26,7 @@
#include <string.h>
+#include <sys/stat.h>
#include "rmdtypes.h"
Modified: trunk/recordmydesktop/src/initialize_data.c
===================================================================
--- trunk/recordmydesktop/src/initialize_data.c 2008-09-14 07:36:57 UTC (rev 542)
+++ trunk/recordmydesktop/src/initialize_data.c 2008-09-14 08:03:16 UTC (rev 543)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include <pthread.h>
+
#include "rmdtypes.h"
#include "block_utils.h"
Modified: trunk/recordmydesktop/src/load_cache.c
===================================================================
--- trunk/recordmydesktop/src/load_cache.c 2008-09-14 07:36:57 UTC (rev 542)
+++ trunk/recordmydesktop/src/load_cache.c 2008-09-14 08:03:16 UTC (rev 543)
@@ -24,6 +24,7 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include <pthread.h>
#include <signal.h>
#include "rmdtypes.h"
Modified: trunk/recordmydesktop/src/queryextensions.c
===================================================================
--- trunk/recordmydesktop/src/queryextensions.c 2008-09-14 07:36:57 UTC (rev 542)
+++ trunk/recordmydesktop/src/queryextensions.c 2008-09-14 08:03:16 UTC (rev 543)
@@ -25,6 +25,8 @@
******************************************************************************/
#include <X11/extensions/shape.h>
+#include <X11/extensions/Xfixes.h>
+#include <X11/extensions/Xdamage.h>
#include "rmdtypes.h"
Modified: trunk/recordmydesktop/src/rmd_cache.c
===================================================================
--- trunk/recordmydesktop/src/rmd_cache.c 2008-09-14 07:36:57 UTC (rev 542)
+++ trunk/recordmydesktop/src/rmd_cache.c 2008-09-14 08:03:16 UTC (rev 543)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include <sys/stat.h>
+
#include "rmdtypes.h"
#include "rmd_cache.h"
Modified: trunk/recordmydesktop/src/rmd_jack.c
===================================================================
--- trunk/recordmydesktop/src/rmd_jack.c 2008-09-14 07:36:57 UTC (rev 542)
+++ trunk/recordmydesktop/src/rmd_jack.c 2008-09-14 08:03:16 UTC (rev 543)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include <pthread.h>
+
#include "rmdtypes.h"
#include "rmd_jack.h"
Modified: trunk/recordmydesktop/src/rmd_rescue.c
===================================================================
--- trunk/recordmydesktop/src/rmd_rescue.c 2008-09-14 07:36:57 UTC (rev 542)
+++ trunk/recordmydesktop/src/rmd_rescue.c 2008-09-14 08:03:16 UTC (rev 543)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include <pthread.h>
+
#include "rmdtypes.h"
#include "block_utils.h"
Modified: trunk/recordmydesktop/src/rmd_timer.c
===================================================================
--- trunk/recordmydesktop/src/rmd_timer.c 2008-09-14 07:36:57 UTC (rev 542)
+++ trunk/recordmydesktop/src/rmd_timer.c 2008-09-14 08:03:16 UTC (rev 543)
@@ -24,11 +24,11 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
Modified: trunk/recordmydesktop/src/rmdmacro.h
===================================================================
--- trunk/recordmydesktop/src/rmdmacro.h 2008-09-14 07:36:57 UTC (rev 542)
+++ trunk/recordmydesktop/src/rmdmacro.h 2008-09-14 08:03:16 UTC (rev 543)
@@ -31,6 +31,8 @@
#include "config.h"
#endif
+#include <limits.h>
+
#include "rmdtypes.h"
Modified: trunk/recordmydesktop/src/rmdthreads.c
===================================================================
--- trunk/recordmydesktop/src/rmdthreads.c 2008-09-14 07:36:57 UTC (rev 542)
+++ trunk/recordmydesktop/src/rmdthreads.c 2008-09-14 08:03:16 UTC (rev 543)
@@ -28,9 +28,9 @@
#include "config.h"
#endif
+#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
-#include <pthread.h>
#include <unistd.h>
#include "cache_audio.h"
Modified: trunk/recordmydesktop/src/rmdtypes.h
===================================================================
--- trunk/recordmydesktop/src/rmdtypes.h 2008-09-14 07:36:57 UTC (rev 542)
+++ trunk/recordmydesktop/src/rmdtypes.h 2008-09-14 08:03:16 UTC (rev 543)
@@ -29,35 +29,9 @@
#include "config.h"
#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <math.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <time.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#ifdef HAVE_MACHINE_ENDIAN_H
- #include <machine/endian.h>
-#else
- #include <endian.h>
-#endif
-#include <limits.h>
-#include <sys/stat.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
#include <pthread.h>
#include <zlib.h>
#include <X11/Xlib.h>
-#include <X11/Xlibint.h>
-#include <X11/Xatom.h>
-#include <X11/extensions/Xfixes.h>
-#include <X11/extensions/Xdamage.h>
-#include <X11/extensions/XShm.h>
-#include <X11/extensions/shmstr.h>
#include <theora/theora.h>
#include <vorbis/codec.h>
#include <vorbis/vorbisenc.h>
Modified: trunk/recordmydesktop/src/update_image.c
===================================================================
--- trunk/recordmydesktop/src/update_image.c 2008-09-14 07:36:57 UTC (rev 542)
+++ trunk/recordmydesktop/src/update_image.c 2008-09-14 08:03:16 UTC (rev 543)
@@ -24,6 +24,10 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include <X11/Xlibint.h>
+#include <X11/extensions/shmstr.h>
+#include <X11/extensions/XShm.h>
+
#include "rmdtypes.h"
#include "getzpixmap.h"
Modified: trunk/recordmydesktop/src/wm_check.c
===================================================================
--- trunk/recordmydesktop/src/wm_check.c 2008-09-14 07:36:57 UTC (rev 542)
+++ trunk/recordmydesktop/src/wm_check.c 2008-09-14 08:03:16 UTC (rev 543)
@@ -24,6 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include <X11/Xatom.h>
+
#include "rmdtypes.h"
#include "wm_check.h"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-14 07:37:00
|
Revision: 542
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=542&view=rev
Author: enselic
Date: 2008-09-14 07:36:57 +0000 (Sun, 14 Sep 2008)
Log Message:
-----------
src/rmdtypes.h: Made ProgData::capture_busy and encoder_busy booleans.
src/get_frame.c
src/initialize_data.c
src/encode_image_buffer.c: Adapt.
Modified Paths:
--------------
trunk/recordmydesktop/src/encode_image_buffer.c
trunk/recordmydesktop/src/get_frame.c
trunk/recordmydesktop/src/initialize_data.c
trunk/recordmydesktop/src/rmdtypes.h
Modified: trunk/recordmydesktop/src/encode_image_buffer.c
===================================================================
--- trunk/recordmydesktop/src/encode_image_buffer.c 2008-09-14 07:27:50 UTC (rev 541)
+++ trunk/recordmydesktop/src/encode_image_buffer.c 2008-09-14 07:36:57 UTC (rev 542)
@@ -38,7 +38,7 @@
&pdata->img_buff_ready_mutex);
pthread_mutex_unlock(&pdata->img_buff_ready_mutex);
pdata->th_enc_thread_waiting=0;
- pdata->encoder_busy = 1;
+ pdata->encoder_busy = TRUE;
if (pdata->paused) {
pthread_mutex_lock(&pdata->pause_mutex);
pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
@@ -62,7 +62,7 @@
pdata->avd+=pdata->frametime;
}
}
- pdata->encoder_busy = 0;
+ pdata->encoder_busy = FALSE;
}
//last packet
pdata->th_encoding_clean=1;
Modified: trunk/recordmydesktop/src/get_frame.c
===================================================================
--- trunk/recordmydesktop/src/get_frame.c 2008-09-14 07:27:50 UTC (rev 541)
+++ trunk/recordmydesktop/src/get_frame.c 2008-09-14 07:36:57 UTC (rev 542)
@@ -440,7 +440,7 @@
//switch back and front buffers (full_shots only)
if(d_buff)
img_sel=(img_sel)?0:1;
- pdata->capture_busy = 1;
+ pdata->capture_busy = TRUE;
BRWinCpy(&temp_brwin,&pdata->brwin);
@@ -634,7 +634,7 @@
pthread_mutex_lock(&pdata->img_buff_ready_mutex);
pthread_cond_broadcast(&pdata->image_buffer_ready);
pthread_mutex_unlock(&pdata->img_buff_ready_mutex);
- pdata->capture_busy = 0;
+ pdata->capture_busy = FALSE;
}
if(!pdata->args.noframe){
Modified: trunk/recordmydesktop/src/initialize_data.c
===================================================================
--- trunk/recordmydesktop/src/initialize_data.c 2008-09-14 07:27:50 UTC (rev 541)
+++ trunk/recordmydesktop/src/initialize_data.c 2008-09-14 07:36:57 UTC (rev 542)
@@ -94,8 +94,8 @@
pdata->pause_state_changed = FALSE;
pdata->frames_total = 0;
pdata->frames_lost = 0;
- pdata->encoder_busy = 0;
- pdata->capture_busy = 0;
+ pdata->encoder_busy = FALSE;
+ pdata->capture_busy = FALSE;
if(!pdata->args.nosound){
if(!pdata->args.use_jack){
Modified: trunk/recordmydesktop/src/rmdtypes.h
===================================================================
--- trunk/recordmydesktop/src/rmdtypes.h 2008-09-14 07:27:50 UTC (rev 541)
+++ trunk/recordmydesktop/src/rmdtypes.h 2008-09-14 07:36:57 UTC (rev 542)
@@ -355,8 +355,8 @@
//used to determine frame drop which can
//happen on failure to receive a signal over a condition variable
- int capture_busy,
- encoder_busy;
+ boolean capture_busy,
+ encoder_busy;
pthread_mutex_t pause_mutex;
pthread_mutex_t time_mutex;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-14 07:27:58
|
Revision: 541
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=541&view=rev
Author: enselic
Date: 2008-09-14 07:27:50 +0000 (Sun, 14 Sep 2008)
Log Message:
-----------
src/recordmydesktop.h: Deleted. The last globals were migrated to
ProgData. recordmydesktop.h should actually never exist (as long as
rmd isn't e.g. a library) since recordmydesktop.c is the main()
program and it would be weird if other modules had a dependeny to it.
src/rmdtypes.h: Put the last globals in ProgData instead.
src/Makefile.am
src/cache_audio.c
src/cache_frame.c
src/capture_sound.c
src/encode_cache.c
src/encode_image_buffer.c
src/encode_sound_buffer.c
src/flush_to_ogg.c
src/get_frame.c
src/getzpixmap.c
src/init_encoder.c
src/initialize_data.c
src/load_cache.c
src/make_dummy_pointer.c
src/parseargs.c
src/queryextensions.c
src/recordmydesktop.c
src/register_callbacks.c
src/rmd_cache.c
src/rmd_jack.c
src/rmd_rescue.c
src/rmd_timer.c
src/setbrwindow.c
src/update_image.c
src/wm_check.c: Adapted.
Modified Paths:
--------------
trunk/recordmydesktop/src/Makefile.am
trunk/recordmydesktop/src/cache_audio.c
trunk/recordmydesktop/src/cache_frame.c
trunk/recordmydesktop/src/capture_sound.c
trunk/recordmydesktop/src/encode_cache.c
trunk/recordmydesktop/src/encode_image_buffer.c
trunk/recordmydesktop/src/encode_sound_buffer.c
trunk/recordmydesktop/src/flush_to_ogg.c
trunk/recordmydesktop/src/get_frame.c
trunk/recordmydesktop/src/getzpixmap.c
trunk/recordmydesktop/src/init_encoder.c
trunk/recordmydesktop/src/initialize_data.c
trunk/recordmydesktop/src/load_cache.c
trunk/recordmydesktop/src/make_dummy_pointer.c
trunk/recordmydesktop/src/parseargs.c
trunk/recordmydesktop/src/queryextensions.c
trunk/recordmydesktop/src/recordmydesktop.c
trunk/recordmydesktop/src/register_callbacks.c
trunk/recordmydesktop/src/rmd_cache.c
trunk/recordmydesktop/src/rmd_jack.c
trunk/recordmydesktop/src/rmd_rescue.c
trunk/recordmydesktop/src/rmd_timer.c
trunk/recordmydesktop/src/rmdtypes.h
trunk/recordmydesktop/src/setbrwindow.c
trunk/recordmydesktop/src/update_image.c
trunk/recordmydesktop/src/wm_check.c
Removed Paths:
-------------
trunk/recordmydesktop/src/recordmydesktop.h
Modified: trunk/recordmydesktop/src/Makefile.am
===================================================================
--- trunk/recordmydesktop/src/Makefile.am 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/Makefile.am 2008-09-14 07:27:50 UTC (rev 541)
@@ -38,7 +38,6 @@
queryextensions.c \
queryextensions.h \
recordmydesktop.c \
- recordmydesktop.h \
rectinsert.c \
rectinsert.h \
register_callbacks.c \
Modified: trunk/recordmydesktop/src/cache_audio.c
===================================================================
--- trunk/recordmydesktop/src/cache_audio.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/cache_audio.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -24,8 +24,9 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "rmdtypes.h"
+
#include "cache_audio.h"
-#include "recordmydesktop.h"
#include "rmd_jack.h"
Modified: trunk/recordmydesktop/src/cache_frame.c
===================================================================
--- trunk/recordmydesktop/src/cache_frame.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/cache_frame.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -26,8 +26,9 @@
#include <signal.h>
+#include "rmdtypes.h"
+
#include "cache_frame.h"
-#include "recordmydesktop.h"
#include "rmd_cache.h"
#include "block_utils.h"
@@ -169,7 +170,7 @@
strncpy(fheader.frame_prefix,"FRAM",4);
fheader.frameno=++frameno;
- fheader.current_total=frames_total;
+ fheader.current_total = pdata->frames_total;
fheader.Ynum=ynum;
fheader.Unum=unum;
@@ -273,8 +274,12 @@
}
- fprintf(stderr,"Saved %d frames in a total of %d requests\n",
- frameno,frames_total);fflush(stderr);
+ fprintf(stderr,
+ "Saved %d frames in a total of %d requests\n",
+ frameno,
+ pdata->frames_total);
+ fflush(stderr);
+
if(!pdata->args.zerocompression){
gzflush(fp,Z_FINISH);
gzclose(fp);
Modified: trunk/recordmydesktop/src/capture_sound.c
===================================================================
--- trunk/recordmydesktop/src/capture_sound.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/capture_sound.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -24,12 +24,10 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-#include "opendev.h"
-#include "recordmydesktop.h"
-#include "rmd_jack.h"
+#include "rmdtypes.h"
#include "capture_sound.h"
-#include "recordmydesktop.h"
+#include "opendev.h"
#include "rmd_jack.h"
Modified: trunk/recordmydesktop/src/encode_cache.c
===================================================================
--- trunk/recordmydesktop/src/encode_cache.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/encode_cache.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -24,11 +24,12 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "rmdtypes.h"
+
#include "encode_cache.h"
#include "flush_to_ogg.h"
#include "init_encoder.h"
#include "load_cache.h"
-#include "recordmydesktop.h"
void EncodeCache(ProgData *pdata){
Modified: trunk/recordmydesktop/src/encode_image_buffer.c
===================================================================
--- trunk/recordmydesktop/src/encode_image_buffer.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/encode_image_buffer.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -24,7 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-#include "recordmydesktop.h"
+#include "rmdtypes.h"
+
#include "encode_image_buffer.h"
@@ -37,7 +38,7 @@
&pdata->img_buff_ready_mutex);
pthread_mutex_unlock(&pdata->img_buff_ready_mutex);
pdata->th_enc_thread_waiting=0;
- encoder_busy=1;
+ pdata->encoder_busy = 1;
if (pdata->paused) {
pthread_mutex_lock(&pdata->pause_mutex);
pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
@@ -61,7 +62,7 @@
pdata->avd+=pdata->frametime;
}
}
- encoder_busy=0;
+ pdata->encoder_busy = 0;
}
//last packet
pdata->th_encoding_clean=1;
Modified: trunk/recordmydesktop/src/encode_sound_buffer.c
===================================================================
--- trunk/recordmydesktop/src/encode_sound_buffer.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/encode_sound_buffer.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -24,8 +24,9 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "rmdtypes.h"
+
#include "encode_sound_buffer.h"
-#include "recordmydesktop.h"
#include "rmd_jack.h"
Modified: trunk/recordmydesktop/src/flush_to_ogg.c
===================================================================
--- trunk/recordmydesktop/src/flush_to_ogg.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/flush_to_ogg.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -24,10 +24,11 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "rmdtypes.h"
+
#include "encode_image_buffer.h"
#include "encode_sound_buffer.h"
#include "flush_to_ogg.h"
-#include "recordmydesktop.h"
//we copy the page because the next call to ogg_stream_pageout
Modified: trunk/recordmydesktop/src/get_frame.c
===================================================================
--- trunk/recordmydesktop/src/get_frame.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/get_frame.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -24,10 +24,11 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "rmdtypes.h"
+
#include "get_frame.h"
#include "getzpixmap.h"
#include "poll_events.h"
-#include "recordmydesktop.h"
#include "rectinsert.h"
#include "rmd_cache.h"
#include "rmd_frame.h"
@@ -439,7 +440,7 @@
//switch back and front buffers (full_shots only)
if(d_buff)
img_sel=(img_sel)?0:1;
- capture_busy=1;
+ pdata->capture_busy = 1;
BRWinCpy(&temp_brwin,&pdata->brwin);
@@ -627,13 +628,13 @@
if(!pdata->args.full_shots){
ClearList(&pdata->rect_root);
}
- if(encoder_busy){
- frames_lost++;
+ if (pdata->encoder_busy) {
+ pdata->frames_lost++;
}
pthread_mutex_lock(&pdata->img_buff_ready_mutex);
pthread_cond_broadcast(&pdata->image_buffer_ready);
pthread_mutex_unlock(&pdata->img_buff_ready_mutex);
- capture_busy=0;
+ pdata->capture_busy = 0;
}
if(!pdata->args.noframe){
Modified: trunk/recordmydesktop/src/getzpixmap.c
===================================================================
--- trunk/recordmydesktop/src/getzpixmap.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/getzpixmap.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -24,7 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-#include "recordmydesktop.h"
+#include "rmdtypes.h"
+
#include "getzpixmap.h"
Modified: trunk/recordmydesktop/src/init_encoder.c
===================================================================
--- trunk/recordmydesktop/src/init_encoder.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/init_encoder.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -27,8 +27,10 @@
#include <string.h>
+#include "rmdtypes.h"
+
#include "init_encoder.h"
-#include "recordmydesktop.h"
+#include "rmdmacro.h"
#include "skeleton.h"
Modified: trunk/recordmydesktop/src/initialize_data.c
===================================================================
--- trunk/recordmydesktop/src/initialize_data.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/initialize_data.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -24,11 +24,12 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "rmdtypes.h"
+
#include "block_utils.h"
#include "init_encoder.h"
#include "make_dummy_pointer.h"
#include "opendev.h"
-#include "recordmydesktop.h"
#include "rmd_cache.h"
#include "rmd_jack.h"
#include "yuv_utils.h"
@@ -54,8 +55,6 @@
EncData *enc_data,
CacheData *cache_data){
int i;
- //these are globals, look for them at the header
- frames_total=frames_lost=encoder_busy=capture_busy=0;
fprintf(stderr,"Initializing...\n");
MakeMatrices();
@@ -93,6 +92,10 @@
pdata->paused = FALSE;
pdata->aborted = FALSE;
pdata->pause_state_changed = FALSE;
+ pdata->frames_total = 0;
+ pdata->frames_lost = 0;
+ pdata->encoder_busy = 0;
+ pdata->capture_busy = 0;
if(!pdata->args.nosound){
if(!pdata->args.use_jack){
Modified: trunk/recordmydesktop/src/load_cache.c
===================================================================
--- trunk/recordmydesktop/src/load_cache.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/load_cache.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -26,11 +26,13 @@
#include <signal.h>
+#include "rmdtypes.h"
+
#include "encode_image_buffer.h"
#include "encode_sound_buffer.h"
#include "load_cache.h"
-#include "recordmydesktop.h"
#include "rmd_cache.h"
+#include "rmdmacro.h"
//The number of bytes for every
@@ -225,9 +227,11 @@
//sync
missing_frames+=frame.header->current_total-
(extra_frames+frame.header->frameno);
- if(frames_total)
- fprintf(stdout,"\r[%d%%] ",
- ((frame.header->frameno+extra_frames)*100)/frames_total);
+ if (pdata->frames_total) {
+ fprintf(stdout,
+ "\r[%d%%] ",
+ ((frame.header->frameno + extra_frames) * 100) / pdata->frames_total);
+ }
else
fprintf(stdout,"\r[%d frames rendered] ",
(frame.header->frameno+extra_frames));
Modified: trunk/recordmydesktop/src/make_dummy_pointer.c
===================================================================
--- trunk/recordmydesktop/src/make_dummy_pointer.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/make_dummy_pointer.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -24,8 +24,10 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-#include "recordmydesktop.h"
+#include "rmdtypes.h"
+
#include "make_dummy_pointer.h"
+#include "rmdmacro.h"
unsigned char *MakeDummyPointer(DisplaySpecs *specs,
Modified: trunk/recordmydesktop/src/parseargs.c
===================================================================
--- trunk/recordmydesktop/src/parseargs.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/parseargs.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -24,9 +24,10 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "rmdtypes.h"
-#include "recordmydesktop.h"
#include "rmd_rescue.h"
+#include "rmdmacro.h"
static void PrintConfig(void) {
Modified: trunk/recordmydesktop/src/queryextensions.c
===================================================================
--- trunk/recordmydesktop/src/queryextensions.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/queryextensions.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -26,7 +26,8 @@
#include <X11/extensions/shape.h>
-#include "recordmydesktop.h"
+#include "rmdtypes.h"
+
#include "queryextensions.h"
Modified: trunk/recordmydesktop/src/recordmydesktop.c
===================================================================
--- trunk/recordmydesktop/src/recordmydesktop.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/recordmydesktop.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -24,17 +24,18 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-#include "recordmydesktop.h"
+#include "rmdtypes.h"
+
+#include "encode_cache.h"
#include "initialize_data.h"
+#include "parseargs.h"
+#include "queryextensions.h"
+#include "rmd_cache.h"
#include "rmd_error.h"
-#include "parseargs.h"
+#include "rmdthreads.h"
#include "setbrwindow.h"
+#include "shortcuts.h"
#include "wm_check.h"
-#include "queryextensions.h"
-#include "shortcuts.h"
-#include "rmdthreads.h"
-#include "rmd_cache.h"
-#include "encode_cache.h"
int main(int argc,char **argv){
Deleted: trunk/recordmydesktop/src/recordmydesktop.h
===================================================================
--- trunk/recordmydesktop/src/recordmydesktop.h 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/recordmydesktop.h 2008-09-14 07:27:50 UTC (rev 541)
@@ -1,59 +0,0 @@
-/******************************************************************************
-* recordMyDesktop *
-*******************************************************************************
-* *
-* Copyright (C) 2006,2007,2008 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 joh...@gm... *
-******************************************************************************/
-
-
-#ifndef RECORDMYDESKTOP_H
-#define RECORDMYDESKTOP_H 1
-
-#ifdef HAVE_CONFIG_H
- #include "config.h"
-#endif
-
-//header inclusion is completely fucked up
-//I'll fix it, I promise
-#include "rmdtypes.h"
-
-#include "rmdmacro.h"
-
-
-
-/**Globals*/
-//I've read somewhere that I'll go to hell for using globals...
-
-//the following values are of no effect
-//but they might be usefull later for profiling
-unsigned int frames_total, //frames calculated by total time expirations
- frames_lost; //the value of shame
-
-
-
-//used to determine frame drop which can
-//happen on failure to receive a signal over a condition variable
-int capture_busy,
- encoder_busy;
-
-#endif
-
Modified: trunk/recordmydesktop/src/register_callbacks.c
===================================================================
--- trunk/recordmydesktop/src/register_callbacks.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/register_callbacks.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -26,7 +26,8 @@
#include <signal.h>
-#include "recordmydesktop.h"
+#include "rmdtypes.h"
+
#include "register_callbacks.h"
Modified: trunk/recordmydesktop/src/rmd_cache.c
===================================================================
--- trunk/recordmydesktop/src/rmd_cache.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/rmd_cache.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -24,9 +24,11 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-#include "recordmydesktop.h"
+#include "rmdtypes.h"
+
#include "rmd_cache.h"
#include "specsfile.h"
+#include "rmdmacro.h"
/**
Modified: trunk/recordmydesktop/src/rmd_jack.c
===================================================================
--- trunk/recordmydesktop/src/rmd_jack.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/rmd_jack.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -24,8 +24,10 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-#include "recordmydesktop.h"
+#include "rmdtypes.h"
+
#include "rmd_jack.h"
+#include "rmdmacro.h"
#ifdef HAVE_JACK_H
Modified: trunk/recordmydesktop/src/rmd_rescue.c
===================================================================
--- trunk/recordmydesktop/src/rmd_rescue.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/rmd_rescue.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -24,13 +24,14 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "rmdtypes.h"
+
+#include "block_utils.h"
#include "encode_cache.h"
#include "initialize_data.h"
-#include "recordmydesktop.h"
#include "register_callbacks.h"
#include "rmd_rescue.h"
#include "specsfile.h"
-#include "block_utils.h"
int rmdRescue(const char *path){
Modified: trunk/recordmydesktop/src/rmd_timer.c
===================================================================
--- trunk/recordmydesktop/src/rmd_timer.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/rmd_timer.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -32,7 +32,8 @@
#include <stdio.h>
#include <stdlib.h>
-#include "recordmydesktop.h"
+#include "rmdtypes.h"
+
#include "rmd_timer.h"
@@ -62,9 +63,9 @@
}
if (!pdata->paused) {
- frames_total++;
- if(capture_busy){
- frames_lost++;
+ pdata->frames_total++;
+ if (pdata->capture_busy) {
+ pdata->frames_lost++;
}
}
Modified: trunk/recordmydesktop/src/rmdtypes.h
===================================================================
--- trunk/recordmydesktop/src/rmdtypes.h 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/rmdtypes.h 2008-09-14 07:27:50 UTC (rev 541)
@@ -348,6 +348,16 @@
boolean aborted; //1 if we should abort
boolean pause_state_changed; //1 if pause state changed
+ //the following values are of no effect
+ //but they might be usefull later for profiling
+ unsigned int frames_total, //frames calculated by total time expirations
+ frames_lost; //the value of shame
+
+ //used to determine frame drop which can
+ //happen on failure to receive a signal over a condition variable
+ int capture_busy,
+ encoder_busy;
+
pthread_mutex_t pause_mutex;
pthread_mutex_t time_mutex;
Modified: trunk/recordmydesktop/src/setbrwindow.c
===================================================================
--- trunk/recordmydesktop/src/setbrwindow.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/setbrwindow.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -24,7 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-#include "recordmydesktop.h"
+#include "rmdtypes.h"
+
#include "setbrwindow.h"
Modified: trunk/recordmydesktop/src/update_image.c
===================================================================
--- trunk/recordmydesktop/src/update_image.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/update_image.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -24,8 +24,9 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "rmdtypes.h"
+
#include "getzpixmap.h"
-#include "recordmydesktop.h"
#include "update_image.h"
#include "yuv_utils.h"
Modified: trunk/recordmydesktop/src/wm_check.c
===================================================================
--- trunk/recordmydesktop/src/wm_check.c 2008-09-14 07:01:35 UTC (rev 540)
+++ trunk/recordmydesktop/src/wm_check.c 2008-09-14 07:27:50 UTC (rev 541)
@@ -24,7 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-#include "recordmydesktop.h"
+#include "rmdtypes.h"
+
#include "wm_check.h"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-14 07:01:39
|
Revision: 540
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=540&view=rev
Author: enselic
Date: 2008-09-14 07:01:35 +0000 (Sun, 14 Sep 2008)
Log Message:
-----------
src/recordmydesktop.h: Move away the [yuv]blocks globals.
src/yuv_utils.h: Move out the DBUF- and the MARK_BACK_BUFFER_C() macros.
src/block_utils.[ch]: New files hosting the [yuv]blocks globals and DBUF-macros.
src/get_frame.c: Put MARK_BACK_BUFFER_C() locally here.
src/Makefile.am
src/rmd_rescue.c
src/cache_frame.c
src/initialize_data.c: Adapt to changes.
Modified Paths:
--------------
trunk/recordmydesktop/src/Makefile.am
trunk/recordmydesktop/src/cache_frame.c
trunk/recordmydesktop/src/get_frame.c
trunk/recordmydesktop/src/initialize_data.c
trunk/recordmydesktop/src/recordmydesktop.h
trunk/recordmydesktop/src/rmd_rescue.c
trunk/recordmydesktop/src/yuv_utils.h
Added Paths:
-----------
trunk/recordmydesktop/src/block_utils.c
trunk/recordmydesktop/src/block_utils.h
Modified: trunk/recordmydesktop/src/Makefile.am
===================================================================
--- trunk/recordmydesktop/src/Makefile.am 2008-09-13 21:35:43 UTC (rev 539)
+++ trunk/recordmydesktop/src/Makefile.am 2008-09-14 07:01:35 UTC (rev 540)
@@ -1,6 +1,8 @@
bin_PROGRAMS = recordmydesktop
recordmydesktop_SOURCES = \
+ block_utils.c \
+ block_utils.h \
cache_audio.c \
cache_audio.h \
cache_frame.c \
Added: trunk/recordmydesktop/src/block_utils.c
===================================================================
--- trunk/recordmydesktop/src/block_utils.c (rev 0)
+++ trunk/recordmydesktop/src/block_utils.c 2008-09-14 07:01:35 UTC (rev 540)
@@ -0,0 +1,35 @@
+/******************************************************************************
+* recordMyDesktop *
+*******************************************************************************
+* *
+* Copyright (C) 2006,2007,2008 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 joh...@gm... *
+******************************************************************************/
+
+#include "block_utils.h"
+
+
+// FIXME: These globals are modified in other source files! We keep
+// thsee here for now. These are the cache blocks. They need to be
+// accesible in the dbuf macros
+u_int32_t *yblocks,
+ *ublocks,
+ *vblocks;
Added: trunk/recordmydesktop/src/block_utils.h
===================================================================
--- trunk/recordmydesktop/src/block_utils.h (rev 0)
+++ trunk/recordmydesktop/src/block_utils.h 2008-09-14 07:01:35 UTC (rev 540)
@@ -0,0 +1,170 @@
+/******************************************************************************
+* recordMyDesktop *
+*******************************************************************************
+* *
+* Copyright (C) 2006,2007,2008 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 joh...@gm... *
+******************************************************************************/
+
+#ifndef BLOCK_UTILS_H
+#define BLOCK_UTILS_H 1
+
+#include "rmdtypes.h"
+#include "rmdmacro.h"
+#include "yuv_utils.h"
+
+
+// We keep these global for now. FIXME: Isolate them.
+extern u_int32_t *yblocks,
+ *ublocks,
+ *vblocks;
+
+#define POINT_IN_BLOCK(xv,yv,widthv,blocksize) ((yv/blocksize)*\
+ (widthv/blocksize)+\
+ (xv/blocksize))
+
+#define UPDATE_Y_PLANE_DBUF(data,\
+ data_back,\
+ x_tm,\
+ y_tm,\
+ height_tm,\
+ width_tm,\
+ yuv,\
+ __bit_depth__){ \
+ int k,i;\
+ register u_int##__bit_depth__##_t t_val;\
+ register unsigned char *yuv_y=yuv->y+x_tm+y_tm*yuv->y_width,\
+ *_yr=Yr,*_yg=Yg,*_yb=Yb;\
+ register u_int##__bit_depth__##_t *datapi=(u_int##__bit_depth__##_t *)data,\
+ *datapi_back=(u_int##__bit_depth__##_t *)data_back;\
+ for(k=0;k<height_tm;k++){\
+ for(i=0;i<width_tm;i++){\
+ if(*datapi!=*datapi_back){\
+ t_val=*datapi;\
+ *yuv_y=_yr[__RVALUE_##__bit_depth__(t_val)] +\
+ _yg[__GVALUE_##__bit_depth__(t_val)] +\
+ _yb[__BVALUE_##__bit_depth__(t_val)] ;\
+ yblocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
+ }\
+ datapi++;\
+ datapi_back++;\
+ yuv_y++;\
+ }\
+ yuv_y+=yuv->y_width-width_tm;\
+ }\
+}
+
+#define UPDATE_UV_PLANES_DBUF( data,\
+ data_back,\
+ x_tm,\
+ y_tm,\
+ height_tm,\
+ width_tm,\
+ yuv,\
+ __sampling_type,\
+ __bit_depth__){ \
+ int k,i;\
+ register u_int##__bit_depth__##_t t_val;\
+ register unsigned char *yuv_u=yuv->u+x_tm/2+(y_tm*yuv->uv_width)/2,\
+ *yuv_v=yuv->v+x_tm/2+(y_tm*yuv->uv_width)/2,\
+ *_ur=Ur,*_ug=Ug,*_ubvr=UbVr,\
+ *_vg=Vg,*_vb=Vb;\
+ register u_int##__bit_depth__##_t *datapi=(u_int##__bit_depth__##_t *)data,\
+ *datapi_next=NULL,\
+ *datapi_back=(u_int##__bit_depth__##_t *)data_back,\
+ *datapi_back_next=NULL;\
+ if(__sampling_type==__PXL_AVERAGE){\
+ datapi_next=datapi+width_tm;\
+ datapi_back_next=datapi_back+width_tm;\
+ for(k=0;k<height_tm;k+=2){\
+ for(i=0;i<width_tm;i+=2){\
+ if(( (*datapi!=*datapi_back) ||\
+ (*(datapi+1)!=*(datapi_back+1)) ||\
+ (*datapi_next!=*datapi_back_next) ||\
+ (*(datapi_next+1)!=*(datapi_back_next+1)))){\
+ UPDATE_A_UV_PIXEL( yuv_u,\
+ yuv_v,\
+ t_val,\
+ datapi,\
+ datapi_next,\
+ _ur,_ug,_ubvr,_vg,_vb,\
+ __sampling_type,\
+ __bit_depth__)\
+ ublocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
+ vblocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
+ }\
+ datapi+=2;\
+ datapi_back+=2;\
+ if(__sampling_type==__PXL_AVERAGE){\
+ datapi_next+=2;\
+ datapi_back_next+=2;\
+ }\
+ yuv_u++;\
+ yuv_v++;\
+ }\
+ yuv_u+=(yuv->y_width-width_tm)/2;\
+ yuv_v+=(yuv->y_width-width_tm)/2;\
+ datapi+=width_tm;\
+ datapi_back+=width_tm;\
+ if(__sampling_type==__PXL_AVERAGE){\
+ datapi_next+=width_tm;\
+ datapi_back_next+=width_tm;\
+ }\
+ }\
+ }\
+ else{\
+ for(k=0;k<height_tm;k+=2){\
+ for(i=0;i<width_tm;i+=2){\
+ if ((*datapi!=*datapi_back)){\
+ UPDATE_A_UV_PIXEL( yuv_u,\
+ yuv_v,\
+ t_val,\
+ datapi,\
+ datapi_next,\
+ _ur,_ug,_ubvr,_vg,_vb,\
+ __sampling_type,\
+ __bit_depth__)\
+ ublocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
+ vblocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
+ }\
+ datapi+=2;\
+ datapi_back+=2;\
+ if(__sampling_type==__PXL_AVERAGE){\
+ datapi_next+=2;\
+ datapi_back_next+=2;\
+ }\
+ yuv_u++;\
+ yuv_v++;\
+ }\
+ yuv_u+=(yuv->y_width-width_tm)/2;\
+ yuv_v+=(yuv->y_width-width_tm)/2;\
+ datapi+=width_tm;\
+ datapi_back+=width_tm;\
+ if(__sampling_type==__PXL_AVERAGE){\
+ datapi_next+=width_tm;\
+ datapi_back_next+=width_tm;\
+ }\
+ }\
+ }\
+}
+
+
+#endif
Modified: trunk/recordmydesktop/src/cache_frame.c
===================================================================
--- trunk/recordmydesktop/src/cache_frame.c 2008-09-13 21:35:43 UTC (rev 539)
+++ trunk/recordmydesktop/src/cache_frame.c 2008-09-14 07:01:35 UTC (rev 540)
@@ -29,6 +29,7 @@
#include "cache_frame.h"
#include "recordmydesktop.h"
#include "rmd_cache.h"
+#include "block_utils.h"
//minimize hard disk access
Modified: trunk/recordmydesktop/src/get_frame.c
===================================================================
--- trunk/recordmydesktop/src/get_frame.c 2008-09-13 21:35:43 UTC (rev 539)
+++ trunk/recordmydesktop/src/get_frame.c 2008-09-14 07:01:35 UTC (rev 540)
@@ -130,6 +130,26 @@
}\
}
+#define MARK_BACK_BUFFER_C( data,\
+ x_tm,\
+ y_tm,\
+ width_tm,\
+ height_tm,\
+ buffer_width,\
+ __bit_depth__){\
+ int k,i;\
+ register u_int##__bit_depth__##_t\
+ *datapi=\
+ ((u_int##__bit_depth__##_t *)data)+y_tm*buffer_width+x_tm;\
+ for(k=0;k<height_tm;k++){\
+ for(i=0;i<width_tm;i++){\
+ *datapi+=1;\
+ datapi++;\
+ }\
+ datapi+=buffer_width-width_tm;\
+ }\
+}
+
#define MARK_BACK_BUFFER( data,\
x_tm,\
y_tm,\
Modified: trunk/recordmydesktop/src/initialize_data.c
===================================================================
--- trunk/recordmydesktop/src/initialize_data.c 2008-09-13 21:35:43 UTC (rev 539)
+++ trunk/recordmydesktop/src/initialize_data.c 2008-09-14 07:01:35 UTC (rev 540)
@@ -24,13 +24,14 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-#include "recordmydesktop.h"
-#include "yuv_utils.h"
+#include "block_utils.h"
+#include "init_encoder.h"
#include "make_dummy_pointer.h"
#include "opendev.h"
+#include "recordmydesktop.h"
+#include "rmd_cache.h"
#include "rmd_jack.h"
-#include "init_encoder.h"
-#include "rmd_cache.h"
+#include "yuv_utils.h"
#ifdef HAVE_LIBASOUND
Modified: trunk/recordmydesktop/src/recordmydesktop.h
===================================================================
--- trunk/recordmydesktop/src/recordmydesktop.h 2008-09-13 21:35:43 UTC (rev 539)
+++ trunk/recordmydesktop/src/recordmydesktop.h 2008-09-14 07:01:35 UTC (rev 540)
@@ -36,12 +36,6 @@
//I'll fix it, I promise
#include "rmdtypes.h"
-//These are the cache blocks. They need to be accesible in the
-//dbuf macros
-u_int32_t *yblocks,
- *ublocks,
- *vblocks;
-
#include "rmdmacro.h"
Modified: trunk/recordmydesktop/src/rmd_rescue.c
===================================================================
--- trunk/recordmydesktop/src/rmd_rescue.c 2008-09-13 21:35:43 UTC (rev 539)
+++ trunk/recordmydesktop/src/rmd_rescue.c 2008-09-14 07:01:35 UTC (rev 540)
@@ -30,6 +30,7 @@
#include "register_callbacks.h"
#include "rmd_rescue.h"
#include "specsfile.h"
+#include "block_utils.h"
int rmdRescue(const char *path){
Modified: trunk/recordmydesktop/src/yuv_utils.h
===================================================================
--- trunk/recordmydesktop/src/yuv_utils.h 2008-09-13 21:35:43 UTC (rev 539)
+++ trunk/recordmydesktop/src/yuv_utils.h 2008-09-14 07:01:35 UTC (rev 540)
@@ -27,7 +27,11 @@
#ifndef YUV_UTILS_H
#define YUV_UTILS_H 1
+#include "rmdtypes.h"
+#include "block_utils.h"
+#include "rmdmacro.h"
+
// The macros work directly on this data (for performance reasons I
// suppose) so we keep this global
extern unsigned char Yr[256], Yg[256], Yb[256],
@@ -72,10 +76,6 @@
(t3&0x000000ff)+(t4&0x000000ff))/4)&0x000000ff);\
}
-#define POINT_IN_BLOCK(xv,yv,widthv,blocksize) ((yv/blocksize)*\
- (widthv/blocksize)+\
- (xv/blocksize))
-
#define UPDATE_Y_PLANE(data,\
x_tm,\
y_tm,\
@@ -101,37 +101,6 @@
}\
}
-#define UPDATE_Y_PLANE_DBUF(data,\
- data_back,\
- x_tm,\
- y_tm,\
- height_tm,\
- width_tm,\
- yuv,\
- __bit_depth__){ \
- int k,i;\
- register u_int##__bit_depth__##_t t_val;\
- register unsigned char *yuv_y=yuv->y+x_tm+y_tm*yuv->y_width,\
- *_yr=Yr,*_yg=Yg,*_yb=Yb;\
- register u_int##__bit_depth__##_t *datapi=(u_int##__bit_depth__##_t *)data,\
- *datapi_back=(u_int##__bit_depth__##_t *)data_back;\
- for(k=0;k<height_tm;k++){\
- for(i=0;i<width_tm;i++){\
- if(*datapi!=*datapi_back){\
- t_val=*datapi;\
- *yuv_y=_yr[__RVALUE_##__bit_depth__(t_val)] +\
- _yg[__GVALUE_##__bit_depth__(t_val)] +\
- _yb[__BVALUE_##__bit_depth__(t_val)] ;\
- yblocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
- }\
- datapi++;\
- datapi_back++;\
- yuv_y++;\
- }\
- yuv_y+=yuv->y_width-width_tm;\
- }\
-}
-
#define UPDATE_A_UV_PIXEL(yuv_u,\
yuv_v,\
t_val,\
@@ -198,100 +167,6 @@
}\
}
-#define UPDATE_UV_PLANES_DBUF( data,\
- data_back,\
- x_tm,\
- y_tm,\
- height_tm,\
- width_tm,\
- yuv,\
- __sampling_type,\
- __bit_depth__){ \
- int k,i;\
- register u_int##__bit_depth__##_t t_val;\
- register unsigned char *yuv_u=yuv->u+x_tm/2+(y_tm*yuv->uv_width)/2,\
- *yuv_v=yuv->v+x_tm/2+(y_tm*yuv->uv_width)/2,\
- *_ur=Ur,*_ug=Ug,*_ubvr=UbVr,\
- *_vg=Vg,*_vb=Vb;\
- register u_int##__bit_depth__##_t *datapi=(u_int##__bit_depth__##_t *)data,\
- *datapi_next=NULL,\
- *datapi_back=(u_int##__bit_depth__##_t *)data_back,\
- *datapi_back_next=NULL;\
- if(__sampling_type==__PXL_AVERAGE){\
- datapi_next=datapi+width_tm;\
- datapi_back_next=datapi_back+width_tm;\
- for(k=0;k<height_tm;k+=2){\
- for(i=0;i<width_tm;i+=2){\
- if(( (*datapi!=*datapi_back) ||\
- (*(datapi+1)!=*(datapi_back+1)) ||\
- (*datapi_next!=*datapi_back_next) ||\
- (*(datapi_next+1)!=*(datapi_back_next+1)))){\
- UPDATE_A_UV_PIXEL( yuv_u,\
- yuv_v,\
- t_val,\
- datapi,\
- datapi_next,\
- _ur,_ug,_ubvr,_vg,_vb,\
- __sampling_type,\
- __bit_depth__)\
- ublocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
- vblocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
- }\
- datapi+=2;\
- datapi_back+=2;\
- if(__sampling_type==__PXL_AVERAGE){\
- datapi_next+=2;\
- datapi_back_next+=2;\
- }\
- yuv_u++;\
- yuv_v++;\
- }\
- yuv_u+=(yuv->y_width-width_tm)/2;\
- yuv_v+=(yuv->y_width-width_tm)/2;\
- datapi+=width_tm;\
- datapi_back+=width_tm;\
- if(__sampling_type==__PXL_AVERAGE){\
- datapi_next+=width_tm;\
- datapi_back_next+=width_tm;\
- }\
- }\
- }\
- else{\
- for(k=0;k<height_tm;k+=2){\
- for(i=0;i<width_tm;i+=2){\
- if ((*datapi!=*datapi_back)){\
- UPDATE_A_UV_PIXEL( yuv_u,\
- yuv_v,\
- t_val,\
- datapi,\
- datapi_next,\
- _ur,_ug,_ubvr,_vg,_vb,\
- __sampling_type,\
- __bit_depth__)\
- ublocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
- vblocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
- }\
- datapi+=2;\
- datapi_back+=2;\
- if(__sampling_type==__PXL_AVERAGE){\
- datapi_next+=2;\
- datapi_back_next+=2;\
- }\
- yuv_u++;\
- yuv_v++;\
- }\
- yuv_u+=(yuv->y_width-width_tm)/2;\
- yuv_v+=(yuv->y_width-width_tm)/2;\
- datapi+=width_tm;\
- datapi_back+=width_tm;\
- if(__sampling_type==__PXL_AVERAGE){\
- datapi_next+=width_tm;\
- datapi_back_next+=width_tm;\
- }\
- }\
- }\
-}
-
#define UPDATE_YUV_BUFFER(yuv,\
data,\
data_back,\
@@ -363,27 +238,6 @@
}\
}
-#define MARK_BACK_BUFFER_C( data,\
- x_tm,\
- y_tm,\
- width_tm,\
- height_tm,\
- buffer_width,\
- __bit_depth__){\
- int k,i;\
- register u_int##__bit_depth__##_t\
- *datapi=\
- ((u_int##__bit_depth__##_t *)data)+y_tm*buffer_width+x_tm;\
- for(k=0;k<height_tm;k++){\
- for(i=0;i<width_tm;i++){\
- *datapi+=1;\
- datapi++;\
- }\
- datapi+=buffer_width-width_tm;\
- }\
-}
-
-
/**
* Fill Yr,Yg,Yb,Ur,Ug.Ub,Vr,Vg,Vb arrays(globals) with values.
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-13 20:03:32
|
Revision: 538
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=538&view=rev
Author: enselic
Date: 2008-09-13 20:03:27 +0000 (Sat, 13 Sep 2008)
Log Message:
-----------
include/rmdfunc.h: Removed and replaced with a header file for (almost) each .c file.
include/recordmydesktop.h
include/Makefile.am:
src/cache_audio.[ch]
src/cache_frame.[ch]
src/capture_sound.[ch]
src/encode_cache.[ch]
src/encode_image_buffer.[ch]
src/encode_sound_buffer.[ch]
src/flush_to_ogg.[ch]
src/get_frame.[ch]
src/getzpixmap.[ch]
src/init_encoder.[ch]
src/initialize_data.c
src/load_cache.[ch]
src/make_dummy_pointer.[ch]
src/opendev.[ch]
src/parseargs.c
src/poll_events.[ch]
src/queryextensions.[ch]
src/recordmydesktop.c
src/rectinsert.h
src/rmd_cache.[ch]
src/rmd_error.[ch]
src/rmd_frame.[ch]
src/rmd_jack.[ch]
src/rmd_rescue.[ch]
src/rmd_timer.[ch]
src/rmdthreads.[ch]
src/setbrwindow.[ch]
src/shortcuts.[ch]
src/specsfile.[ch]
src/update_image.[ch]
src/wm_check.[ch]
src/Makefile.am: Changed acordingly and adjust includes in .c files.
Modified Paths:
--------------
trunk/recordmydesktop/include/Makefile.am
trunk/recordmydesktop/include/recordmydesktop.h
trunk/recordmydesktop/src/Makefile.am
trunk/recordmydesktop/src/cache_audio.c
trunk/recordmydesktop/src/cache_frame.c
trunk/recordmydesktop/src/capture_sound.c
trunk/recordmydesktop/src/encode_cache.c
trunk/recordmydesktop/src/encode_image_buffer.c
trunk/recordmydesktop/src/encode_sound_buffer.c
trunk/recordmydesktop/src/flush_to_ogg.c
trunk/recordmydesktop/src/get_frame.c
trunk/recordmydesktop/src/getzpixmap.c
trunk/recordmydesktop/src/init_encoder.c
trunk/recordmydesktop/src/initialize_data.c
trunk/recordmydesktop/src/load_cache.c
trunk/recordmydesktop/src/make_dummy_pointer.c
trunk/recordmydesktop/src/opendev.c
trunk/recordmydesktop/src/parseargs.c
trunk/recordmydesktop/src/poll_events.c
trunk/recordmydesktop/src/queryextensions.c
trunk/recordmydesktop/src/recordmydesktop.c
trunk/recordmydesktop/src/rectinsert.h
trunk/recordmydesktop/src/rmd_cache.c
trunk/recordmydesktop/src/rmd_error.c
trunk/recordmydesktop/src/rmd_frame.c
trunk/recordmydesktop/src/rmd_jack.c
trunk/recordmydesktop/src/rmd_rescue.c
trunk/recordmydesktop/src/rmd_timer.c
trunk/recordmydesktop/src/rmdthreads.c
trunk/recordmydesktop/src/setbrwindow.c
trunk/recordmydesktop/src/shortcuts.c
trunk/recordmydesktop/src/specsfile.c
trunk/recordmydesktop/src/update_image.c
trunk/recordmydesktop/src/wm_check.c
Added Paths:
-----------
trunk/recordmydesktop/src/cache_audio.h
trunk/recordmydesktop/src/cache_frame.h
trunk/recordmydesktop/src/capture_sound.h
trunk/recordmydesktop/src/encode_cache.h
trunk/recordmydesktop/src/encode_image_buffer.h
trunk/recordmydesktop/src/encode_sound_buffer.h
trunk/recordmydesktop/src/flush_to_ogg.h
trunk/recordmydesktop/src/get_frame.h
trunk/recordmydesktop/src/getzpixmap.h
trunk/recordmydesktop/src/init_encoder.h
trunk/recordmydesktop/src/load_cache.h
trunk/recordmydesktop/src/make_dummy_pointer.h
trunk/recordmydesktop/src/opendev.h
trunk/recordmydesktop/src/poll_events.h
trunk/recordmydesktop/src/queryextensions.h
trunk/recordmydesktop/src/rmd_cache.h
trunk/recordmydesktop/src/rmd_error.h
trunk/recordmydesktop/src/rmd_frame.h
trunk/recordmydesktop/src/rmd_jack.h
trunk/recordmydesktop/src/rmd_rescue.h
trunk/recordmydesktop/src/rmd_timer.h
trunk/recordmydesktop/src/rmdthreads.h
trunk/recordmydesktop/src/setbrwindow.h
trunk/recordmydesktop/src/shortcuts.h
trunk/recordmydesktop/src/specsfile.h
trunk/recordmydesktop/src/update_image.h
trunk/recordmydesktop/src/wm_check.h
Removed Paths:
-------------
trunk/recordmydesktop/include/rmdfunc.h
Modified: trunk/recordmydesktop/include/Makefile.am
===================================================================
--- trunk/recordmydesktop/include/Makefile.am 2008-09-13 17:06:27 UTC (rev 537)
+++ trunk/recordmydesktop/include/Makefile.am 2008-09-13 20:03:27 UTC (rev 538)
@@ -1 +1 @@
-noinst_HEADERS= recordmydesktop.h rmdfunc.h rmdtypes.h rmdmacro.h skeleton.h
+noinst_HEADERS = recordmydesktop.h rmdtypes.h rmdmacro.h skeleton.h
Modified: trunk/recordmydesktop/include/recordmydesktop.h
===================================================================
--- trunk/recordmydesktop/include/recordmydesktop.h 2008-09-13 17:06:27 UTC (rev 537)
+++ trunk/recordmydesktop/include/recordmydesktop.h 2008-09-13 20:03:27 UTC (rev 538)
@@ -43,7 +43,6 @@
*vblocks;
#include "rmdmacro.h"
-#include "rmdfunc.h"
Deleted: trunk/recordmydesktop/include/rmdfunc.h
===================================================================
--- trunk/recordmydesktop/include/rmdfunc.h 2008-09-13 17:06:27 UTC (rev 537)
+++ trunk/recordmydesktop/include/rmdfunc.h 2008-09-13 20:03:27 UTC (rev 538)
@@ -1,636 +0,0 @@
-/******************************************************************************
-* recordMyDesktop *
-*******************************************************************************
-* *
-* Copyright (C) 2006,2007,2008 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 joh...@gm... *
-******************************************************************************/
-
-
-#ifndef RMDFUNC_H
-#define RMDFUNC_H 1
-
-#ifdef HAVE_CONFIG_H
- #include "config.h"
-#endif
-
-#include "rmdtypes.h"
-
-
-/**Function prototypes*/
-
-/**
-* Start listening to damage and substructure notify events
-* (needed before EventLoop call)
-* \param pdata ProgData struct containing all program data
-*/
-void InitEventsPolling(ProgData *pdata);
-
-
-/**
-* Loop calling XNextEvent.Retrieve and place on
-* list damage events that arive, create damage for new windows
-* and pickup key events for shortcuts.
-* \param pdata ProgData struct containing all program data
-*/
-void EventLoop(ProgData *pdata);
-
-/**
-* Loop ,signal timer cond var,sleep-\
-* ^ |
-* |________________________________/
-*
-*
-* \param pdata ProgData struct containing all program data
-*/
-void *rmdTimer(ProgData *pdata);
-
-/**
-* Retrieve frame form xserver, and transform to a yuv buffer,
-* either directly(full shots) or by calling UpdateImage.
-* \param pdata ProgData struct containing all program data
-*/
-void *GetFrame(ProgData *pdata);
-
-/**
-* feed a yuv buffer to the theora encoder and submit outcome to
-* the ogg stream.
-* \param pdata ProgData struct containing all program data
-*/
-void *EncodeImageBuffer(ProgData *pdata);
-
-/**
-* Query theora and vorbis streams for ready packages and
-* flush them on the disk
-* \param pdata ProgData struct containing all program data
-*/
-void *FlushToOgg(ProgData *pdata);
-
-/**
-* Clean up a list of areas marked for update.
-* \param root Root entry of the list
-*/
-void ClearList(RectArea **root);
-
-/**
-* Retrieve and apply all changes, if xdamage is used.
-*
-* \param dpy Connection to the server
-*
-* \param yuv yuv_buffer that is to be modified
-*
-* \param specs DisplaySpecs struct with
-* information about the display to be recorded
-*
-* \param root Root entry of the list with damaged areas
-*
-* \param brwin BRWindow struct contaning the recording window specs
-*
-* \param enc Encoding options
-*
-* \param datatemp Buffer for pixel data to be
-* retrieved before placed on the yuv buffer
-*
-* \param noshmem don't use MIT_Shm extension
-*
-* \param no_quick_subsample Don't do quick subsampling
-*
-*/
-void UpdateImage(Display * dpy,
- yuv_buffer *yuv,
- DisplaySpecs *specs,
- RectArea **root,
- BRWindow *brwin,
- EncData *enc,
- char *datatemp,
- int noshmem,
- XShmSegmentInfo *shminfo,
- int shm_opcode,
- int no_quick_subsample);
-
-/**
-* Rerieve pixmap data from xserver
-*
-* \param dpy Connection to the server
-*
-* \param root root window of the display
-*
-* \param data (preallocated)buffer to place the data
-*
-* \param x x position of the screenshot
-*
-* \param y y position of the screenshot
-*
-* \param x x position of the screenshot
-*
-* \param width width of the screenshot
-*
-* \param height height position of the screenshot
-*
-* \returns 0 on Success 1 on Failure
-*/
-int GetZPixmap(Display *dpy,
- Window root,
- char *data,
- int x,
- int y,
- int width,
- int height);
-
-/**
-* Rerieve pixmap data from xserver through the MIT-Shm extension
-*
-* \param dpy Connection to the server
-*
-* \param root root window of the display
-*
-* \param shminfo Info for the shared memory segment
-*
-* \param shm_opcode Opcode of Shm extension
-*
-* \param data (preallocated)buffer to place the data
-*
-* \param x x position of the screenshot
-*
-* \param y y position of the screenshot
-*
-* \param x x position of the screenshot
-*
-* \param width width of the screenshot
-*
-* \param height height position of the screenshot
-*
-* \returns 0 on Success 1 on Failure
-*/
-int GetZPixmapSHM(Display *dpy,
- Window root,
- XShmSegmentInfo *shminfo,
- int shm_opcode,
- char *data,
- int x,
- int y,
- int width,
- int height);
-
-/**
-* Check if needed extensions are present
-*
-* \param dpy Connection to the server
-*
-* \param args ProgArgs struct containing the user-set options
-*
-* \param damage_event gets filled with damage event number
-*
-* \param damage_error gets filled with damage error number
-*
-* \note Can be an exit point if extensions are not found
-*/
-void QueryExtensions(Display *dpy,
- ProgArgs *args,
- int *damage_event,
- int *damage_error,
- int *shm_opcode);
-
-/**
-* Check and align window size
-*
-* \param dpy Connection to the server
-*
-* \param brwin BRWindow struct contaning the initial and final window
-*
-* \param specs DisplaySpecs struct with
-* information about the display to be recorded
-*
-* \param args ProgArgs struct containing the user-set options
-*
-* \returns 0 on Success 1 on Failure
-*/
-int SetBRWindow(Display *dpy,
- BRWindow *brwin,
- DisplaySpecs *specs,
- ProgArgs *args);
-
-/**
-* Create an array containing the data for the dummy pointer
-*
-* \param specs DisplaySpecs struct with
-* information about the display to be recorded
-*
-* \param size Pointer size, always square, always 16.(exists only
-* for the possibility to create more dummy cursors)
-* \param color 0 white, 1 black
-*
-* \param type Always 0.(exists only for the possibility to create
-* more dummy cursors)
-*
-* \param npxl Return of pixel value that denotes non-drawing, while
-* applying the cursor on the target image
-*
-* \returns Pointer to pixel data of the cursor
-*/
-unsigned char *MakeDummyPointer(DisplaySpecs *specs,
- int size,
- int color,
- int type,
- unsigned char *npxl);
-
-/**
-* Sound capturing thread. Data are placed on a
-* list to be picked up by other threads.
-*
-* \param pdata ProgData struct containing all program data
-*/
-void *CaptureSound(ProgData *pdata);
-
-/**
-* Sound encoding thread. Picks up data from the buffer queue ,
-* encodes and places them on the vorbis stream.
-*
-* \param pdata ProgData struct containing all program data
-*/
-void *EncodeSoundBuffer(ProgData *pdata);
-#ifdef HAVE_LIBASOUND
-/**
-* Try to open (alsa) sound device, with the desired parameters,
-* and place the obtained ones on their place
-*
-* \param pcm_dev name of the device
-*
-* \param channels desired number of channels
-* (gets modified with the acieved value)
-*
-* \param frequency desired frequency(gets modified with the acieved value)
-*
-* \param buffsize Size of buffer
-*
-* \param periodsize Size of a period(can be NULL)
-*
-* \param periodtime Duration of a period(can be NULL)
-*
-* \param hardpause Set to 1 when the device has to be stopped during pause
-* and to 0 when it supports pausing
-* (can be NULL)
-*
-* \returns snd_pcm_t handle on success, NULL on failure
-*/
-snd_pcm_t *OpenDev( const char *pcm_dev,
- unsigned int *channels,
- unsigned int *frequency,
- snd_pcm_uframes_t *buffsize,
- snd_pcm_uframes_t *periodsize,
- unsigned int *periodtime,
- int *hardpause);
-#else
-/**
-* Try to open (OSS) sound device, with the desired parameters.
-*
-*
-* \param pcm_dev name of the device
-*
-* \param channels desired number of channels
-*
-* \param frequency desired frequency
-*
-*
-* \returns file descriptor of open device,-1 on failure
-*/
-int OpenDev( const char *pcm_dev,
- unsigned int channels,
- unsigned int frequency);
-#endif
-/**
-* Initialize theora,vorbis encoders, and their respective ogg streams.
-*
-* \param pdata ProgData struct containing all program data
-*
-* \param enc_data_t Encoding options
-*
-* \param buffer_ready when 1, the yuv buffer must be preallocated
-* when 0 InitEncoder will alocate a new one
-*
-*/
-void InitEncoder(ProgData *pdata,EncData *enc_data_t,int buffer_ready);
-
-/**
-* Image caching thread. Copies the yuv buffer, compares with the last one and
-* caches the result.
-*
-* \param pdata ProgData struct containing all program data
-*
-*/
-void *CacheImageBuffer(ProgData *pdata);
-
-/**
-* Initializes paths and everything else needed to start caching
-*
-* \param pdata ProgData struct containing all program data
-*
-* \param enc_data_t Encoding options
-*
-* \param cache_data_t Caching options
-*
-*/
-void InitCacheData(ProgData *pdata,
- EncData *enc_data_t,
- CacheData *cache_data_t);
-
-/**
-* Sound caching thread. Simply writes the pcm buffers on disk
-*
-* \param pdata ProgData struct containing all program data
-*
-*/
-void *CacheSoundBuffer(ProgData *pdata);
-
-/**
-* Cache loading and processing thread
-*
-* \param pdata ProgData struct containing all program data
-*
-*/
-void *LoadCache(ProgData *pdata);
-
-/**
-* As EncodeImageBuffer, only with the assumption that
-* this is not a thread on it's own
-*
-* \param pdata ProgData struct containing all program data
-*
-*/
-void SyncEncodeImageBuffer(ProgData *pdata);
-
-
-/**
-* As EncodeSoundBuffer, only with the assumption that
-* this is not a thread on it's own
-*
-* \param pdata ProgData struct containing all program data
-*
-*/
-void SyncEncodeSoundBuffer(ProgData *pdata,signed char *buff);
-
-/**
-*Check current running window manager.
-*
-* \param dpy Connection to the server
-*
-* \param root root window of the display
-*
-* \returns Window manager name
-*/
-char *rmdWMCheck(Display *dpy,Window root);
-
-/**
-* Change file pointer to a new file while writting
-* (file name is incremented with CacheFileN)
-*
-* \param name base file name
-*
-* \param n number to be used as a postfix
-*
-* \param fp File pointer if compression is used(must be NULL otherwise)
-*
-* \param ucfp File pointer if compression is NOT used(must be NULL otherwise)
-*
-* \returns 0 on Success 1 on Failure
-*/
-int SwapCacheFilesWrite(char *name,int n,gzFile **fp,FILE **ucfp);
-
-/**
-* Change file pointer to a new file while reading
-* (file name is incremented with CacheFileN)
-*
-* \param name base file name
-*
-* \param n number to be used as a postfix
-*
-* \param fp File pointer if compression is used(must be NULL otherwise)
-*
-* \param ucfp File pointer if compression is NOT used(must be NULL otherwise)
-*
-* \returns 0 on Success 1 on Failure
-*/
-int SwapCacheFilesRead(char *name,int n,gzFile **fp,FILE **ucfp);
-
-/**
-* Delete all cache files
-*
-* \param cache_data_t Caching options(file names etc.)
-*
-* \returns 0 if all files and folders where deleted, 1 otherwise
-*/
-int PurgeCache(CacheData *cache_data_t,int sound);
-
-/**
-* Encode cache into an
-* ogg stream.
-* \param pdata ProgData struct containing all program data
-*/
-void EncodeCache(ProgData *pdata);
-
-/**
-* Launch and wait capture threads.
-* Also creates and waits the encoding threads when
-* encode-on-the-fly is enabled.
-*
-* \param pdata ProgData struct containing all program data
-*/
-void rmdThreads(ProgData *pdata);
-
-#ifdef HAVE_JACK_H
-
-size_t (*jack_ringbuffer_read_p)(jack_ringbuffer_t *rb,
- char *dest, size_t cnt);
-size_t (*jack_ringbuffer_read_space_p)(const jack_ringbuffer_t *rb);
-
-/**
-* Load libjack, create and activate client,register ports
-*
-* \param jdata_t Pointer to JackData struct containing port
-* and client information
-*
-* \returns 0 on Success, error code on failure
-* (depending on where the error occured)
-*/
-int StartJackClient(JackData *jdata);
-
-/**
-* Close Jack Client
-*
-* \param jdata_t Pointer to JackData struct containing port
-* and client information
-*
-* \returns 0 on Success, 1 on failure
-*/
-int StopJackClient(JackData *jdata);
-
-#endif
-
-/*
- * Check a shortcut combination and if valid,
- * register it, on the root window.
- *
- * \param dpy Connection to the X Server
- *
- * \param root Root window id
- *
- * \param shortcut String represantation of the shortcut
- *
- * \param HotKey Pre-allocated struct that is filled with the
- * modifiers and the keycode, for checks on incoming
- * keypress events. Left untouched if the call fails.
- *
- *
- * \returns 0 on Success, 1 on Failure.
- *
- */
-int RegisterShortcut(Display *dpy,
- Window root,
- const char *shortcut,
- HotKey *hotkey);
-
-/*
- * Handling of X errors.
- * Ignores, bad access when registering shortcuts
- * and BadWindow on XQueryTree
- *
- * \param dpy Connection to the X Server
- *
- * \param e XErrorEvent struct containing error info
- *
- * \returns 0 on the two ignored cases, calls exit(1)
- * otherwise.
- *
- */
-int rmdErrorHandler(Display *dpy,XErrorEvent *e);
-
-/*
- * Create a frame that marks the recording area.
- *
- * \param dpy Connection to the X Server
- *
- * \param screen Recorded screen
- *
- * \param root Root window of the display
- *
- * \param x X pos of the recorded area
- *
- * \param y Y pos of the recorded area
- *
- * \param width Width of the recorded area
- *
- * \param height Height of the recorded area
- *
- * \returns The WindowID of the frame
- *
- */
-Window rmdFrameInit(Display *dpy,
- int screen,
- Window root,
- int x,
- int y,
- int width,
- int height);
-
-
-/*
- * Move the frame (subtracts the borderwidth)
- *
- * \param dpy Connection to the X Server
- *
- * \param win WindowId of the frame
- *
- * \param x New X pos of the recorded area
- *
- * \param y New Y pos of the recorded area
- *
- */
-void rmdMoveFrame(Display *dpy,
- Window win,
- int x,
- int y);
-
-
-/*
- * Redraw the frame that marks the recording area.
- *
- * \param dpy Connection to the X Server
- *
- * \param screen Recorded screen
- *
- * \param win WindoID of the frame
- *
- * \param width Width of the recorded area
- *
- * \param height Height of the recorded area
- *
- */
-void rmdDrawFrame(Display *dpy,
- int screen,
- Window win,
- int width,
- int height);
-
-
-/*
- * Create a text file that holds the required
- * capture attributes, in the cache directory.
- *
- * \param pdata ProgData struct containing all program data
- *
- * \returns 0 on Success, 1 on failure
- *
- */
-int WriteSpecsFile(ProgData *pdata);
-
-
-
-/*
- * Read the text file that holds the required
- * capture attributes, in the cache directory.
- *
- * \param pdata ProgData struct that will be fille
- * with all program data
- *
- * \returns 0 on Success, 1 on failure
- *
- */
-int ReadSpecsFile(ProgData *pdata);
-
-
-/*
- * Rescue a previous recording, found in
- * the given path.
- *
- * \param path Path to the cache folder.
- *
- * \returns 0 on Success, 1 on failure
- *
- */
-int rmdRescue(const char *path);
-
-#endif
-
-
-
-
-
-
Modified: trunk/recordmydesktop/src/Makefile.am
===================================================================
--- trunk/recordmydesktop/src/Makefile.am 2008-09-13 17:06:27 UTC (rev 537)
+++ trunk/recordmydesktop/src/Makefile.am 2008-09-13 20:03:27 UTC (rev 538)
@@ -2,44 +2,71 @@
recordmydesktop_SOURCES = \
cache_audio.c \
+ cache_audio.h \
cache_frame.c \
+ cache_frame.h \
capture_sound.c \
+ capture_sound.h \
encode_cache.c \
+ encode_cache.h \
encode_image_buffer.c \
+ encode_image_buffer.h \
encode_sound_buffer.c \
+ encode_sound_buffer.h \
flush_to_ogg.c \
+ flush_to_ogg.h \
get_frame.c \
+ get_frame.h \
getzpixmap.c \
+ getzpixmap.h \
init_encoder.c \
+ init_encoder.h \
initialize_data.c \
initialize_data.h \
load_cache.c \
+ load_cache.h \
make_dummy_pointer.c \
+ make_dummy_pointer.h \
opendev.c \
+ opendev.h \
parseargs.c \
parseargs.h \
poll_events.c \
+ poll_events.h \
queryextensions.c \
+ queryextensions.h \
recordmydesktop.c \
rectinsert.c \
rectinsert.h \
register_callbacks.c \
register_callbacks.h \
rmd_cache.c \
+ rmd_cache.h \
rmd_error.c \
+ rmd_error.h \
rmd_frame.c \
+ rmd_frame.h \
rmd_jack.c \
+ rmd_jack.h \
rmd_rescue.c \
+ rmd_rescue.h \
rmd_timer.c \
+ rmd_timer.h \
rmdthreads.c \
+ rmdthreads.h \
setbrwindow.c \
+ setbrwindow.h \
shortcuts.c \
+ shortcuts.h \
skeleton.c \
specsfile.c \
+ specsfile.h \
update_image.c \
+ update_image.h \
yuv_utils.c \
yuv_utils.h \
- wm_check.c
+ wm_check.c \
+ wm_check.h
INCLUDES = $(all_includes) -I$(top_srcdir)/include
Modified: trunk/recordmydesktop/src/cache_audio.c
===================================================================
--- trunk/recordmydesktop/src/cache_audio.c 2008-09-13 17:06:27 UTC (rev 537)
+++ trunk/recordmydesktop/src/cache_audio.c 2008-09-13 20:03:27 UTC (rev 538)
@@ -24,8 +24,9 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-
+#include "cache_audio.h"
#include "recordmydesktop.h"
+#include "rmd_jack.h"
void *CacheSoundBuffer(ProgData *pdata){
Added: trunk/recordmydesktop/src/cache_audio.h
===================================================================
--- trunk/recordmydesktop/src/cache_audio.h (rev 0)
+++ trunk/recordmydesktop/src/cache_audio.h 2008-09-13 20:03:27 UTC (rev 538)
@@ -0,0 +1,42 @@
+/******************************************************************************
+* recordMyDesktop *
+*******************************************************************************
+* *
+* Copyright (C) 2006,2007,2008 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 joh...@gm... *
+******************************************************************************/
+
+#ifndef CACHE_AUDIO_H
+#define CACHE_AUDIO_H 1
+
+#include "rmdtypes.h"
+
+
+/**
+* Sound caching thread. Simply writes the pcm buffers on disk
+*
+* \param pdata ProgData struct containing all program data
+*
+*/
+void *CacheSoundBuffer(ProgData *pdata);
+
+
+#endif
Modified: trunk/recordmydesktop/src/cache_frame.c
===================================================================
--- trunk/recordmydesktop/src/cache_frame.c 2008-09-13 17:06:27 UTC (rev 537)
+++ trunk/recordmydesktop/src/cache_frame.c 2008-09-13 20:03:27 UTC (rev 538)
@@ -26,7 +26,9 @@
#include <signal.h>
+#include "cache_frame.h"
#include "recordmydesktop.h"
+#include "rmd_cache.h"
//minimize hard disk access
Added: trunk/recordmydesktop/src/cache_frame.h
===================================================================
--- trunk/recordmydesktop/src/cache_frame.h (rev 0)
+++ trunk/recordmydesktop/src/cache_frame.h 2008-09-13 20:03:27 UTC (rev 538)
@@ -0,0 +1,43 @@
+/******************************************************************************
+* recordMyDesktop *
+*******************************************************************************
+* *
+* Copyright (C) 2006,2007,2008 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 joh...@gm... *
+******************************************************************************/
+
+#ifndef CACHE_FRAME_H
+#define CACHE_FRAME_H 1
+
+#include "rmdtypes.h"
+
+
+/**
+* Image caching thread. Copies the yuv buffer, compares with the last one and
+* caches the result.
+*
+* \param pdata ProgData struct containing all program data
+*
+*/
+void *CacheImageBuffer(ProgData *pdata);
+
+
+#endif
Modified: trunk/recordmydesktop/src/capture_sound.c
===================================================================
--- trunk/recordmydesktop/src/capture_sound.c 2008-09-13 17:06:27 UTC (rev 537)
+++ trunk/recordmydesktop/src/capture_sound.c 2008-09-13 20:03:27 UTC (rev 538)
@@ -24,8 +24,13 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "opendev.h"
+#include "recordmydesktop.h"
+#include "rmd_jack.h"
+#include "capture_sound.h"
#include "recordmydesktop.h"
+#include "rmd_jack.h"
void *CaptureSound(ProgData *pdata){
Added: trunk/recordmydesktop/src/capture_sound.h
===================================================================
--- trunk/recordmydesktop/src/capture_sound.h (rev 0)
+++ trunk/recordmydesktop/src/capture_sound.h 2008-09-13 20:03:27 UTC (rev 538)
@@ -0,0 +1,42 @@
+/******************************************************************************
+* recordMyDesktop *
+*******************************************************************************
+* *
+* Copyright (C) 2006,2007,2008 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 joh...@gm... *
+******************************************************************************/
+
+#ifndef CAPTURE_SOUND_H
+#define CAPTURE_SOUND_H 1
+
+#include "rmdtypes.h"
+
+
+/**
+* Sound capturing thread. Data are placed on a
+* list to be picked up by other threads.
+*
+* \param pdata ProgData struct containing all program data
+*/
+void *CaptureSound(ProgData *pdata);
+
+
+#endif
Modified: trunk/recordmydesktop/src/encode_cache.c
===================================================================
--- trunk/recordmydesktop/src/encode_cache.c 2008-09-13 17:06:27 UTC (rev 537)
+++ trunk/recordmydesktop/src/encode_cache.c 2008-09-13 20:03:27 UTC (rev 538)
@@ -24,7 +24,10 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-
+#include "encode_cache.h"
+#include "flush_to_ogg.h"
+#include "init_encoder.h"
+#include "load_cache.h"
#include "recordmydesktop.h"
Added: trunk/recordmydesktop/src/encode_cache.h
===================================================================
--- trunk/recordmydesktop/src/encode_cache.h (rev 0)
+++ trunk/recordmydesktop/src/encode_cache.h 2008-09-13 20:03:27 UTC (rev 538)
@@ -0,0 +1,41 @@
+/******************************************************************************
+* recordMyDesktop *
+*******************************************************************************
+* *
+* Copyright (C) 2006,2007,2008 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 joh...@gm... *
+******************************************************************************/
+
+#ifndef ENCODE_CACHE_H
+#define ENCODE_CACHE_H 1
+
+#include "rmdtypes.h"
+
+
+/**
+* Encode cache into an
+* ogg stream.
+* \param pdata ProgData struct containing all program data
+*/
+void EncodeCache(ProgData *pdata);
+
+
+#endif
Modified: trunk/recordmydesktop/src/encode_image_buffer.c
===================================================================
--- trunk/recordmydesktop/src/encode_image_buffer.c 2008-09-13 17:06:27 UTC (rev 537)
+++ trunk/recordmydesktop/src/encode_image_buffer.c 2008-09-13 20:03:27 UTC (rev 538)
@@ -24,8 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-
#include "recordmydesktop.h"
+#include "encode_image_buffer.h"
void *EncodeImageBuffer(ProgData *pdata){
@@ -90,4 +90,3 @@
}
}
}
-
Added: trunk/recordmydesktop/src/encode_image_buffer.h
===================================================================
--- trunk/recordmydesktop/src/encode_image_buffer.h (rev 0)
+++ trunk/recordmydesktop/src/encode_image_buffer.h 2008-09-13 20:03:27 UTC (rev 538)
@@ -0,0 +1,50 @@
+/******************************************************************************
+* recordMyDesktop *
+*******************************************************************************
+* *
+* Copyright (C) 2006,2007,2008 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 joh...@gm... *
+******************************************************************************/
+
+#ifndef ENCODE_IMAGE_BUFFER_H
+#define ENCODE_IMAGE_BUFFER_H 1
+
+#include "rmdtypes.h"
+
+
+/**
+* feed a yuv buffer to the theora encoder and submit outcome to
+* the ogg stream.
+* \param pdata ProgData struct containing all program data
+*/
+void *EncodeImageBuffer(ProgData *pdata);
+
+/**
+* As EncodeImageBuffer, only with the assumption that
+* this is not a thread on it's own
+*
+* \param pdata ProgData struct containing all program data
+*
+*/
+void SyncEncodeImageBuffer(ProgData *pdata);
+
+
+#endif
Modified: trunk/recordmydesktop/src/encode_sound_buffer.c
===================================================================
--- trunk/recordmydesktop/src/encode_sound_buffer.c 2008-09-13 17:06:27 UTC (rev 537)
+++ trunk/recordmydesktop/src/encode_sound_buffer.c 2008-09-13 20:03:27 UTC (rev 538)
@@ -24,8 +24,9 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-
+#include "encode_sound_buffer.h"
#include "recordmydesktop.h"
+#include "rmd_jack.h"
void *EncodeSoundBuffer(ProgData *pdata){
Added: trunk/recordmydesktop/src/encode_sound_buffer.h
===================================================================
--- trunk/recordmydesktop/src/encode_sound_buffer.h (rev 0)
+++ trunk/recordmydesktop/src/encode_sound_buffer.h 2008-09-13 20:03:27 UTC (rev 538)
@@ -0,0 +1,51 @@
+/******************************************************************************
+* recordMyDesktop *
+*******************************************************************************
+* *
+* Copyright (C) 2006,2007,2008 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 joh...@gm... *
+******************************************************************************/
+
+#ifndef ENCODE_SOUND_BUFFER_H
+#define ENCODE_SOUND_BUFFER_H 1
+
+#include "rmdtypes.h"
+
+
+/**
+* Sound encoding thread. Picks up data from the buffer queue ,
+* encodes and places them on the vorbis stream.
+*
+* \param pdata ProgData struct containing all program data
+*/
+void *EncodeSoundBuffer(ProgData *pdata);
+
+/**
+* As EncodeSoundBuffer, only with the assumption that
+* this is not a thread on it's own
+*
+* \param pdata ProgData struct containing all program data
+*
+*/
+void SyncEncodeSoundBuffer(ProgData *pdata,signed char *buff);
+
+
+#endif
Modified: trunk/recordmydesktop/src/flush_to_ogg.c
===================================================================
--- trunk/recordmydesktop/src/flush_to_ogg.c 2008-09-13 17:06:27 UTC (rev 537)
+++ trunk/recordmydesktop/src/flush_to_ogg.c 2008-09-13 20:03:27 UTC (rev 538)
@@ -24,8 +24,12 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include "encode_image_buffer.h"
+#include "encode_sound_buffer.h"
+#include "flush_to_ogg.h"
#include "recordmydesktop.h"
+
//we copy the page because the next call to ogg_stream_pageout
//will invalidate it. But we must have pages from
//both streams at every time in
Added: trunk/recordmydesktop/src/flush_to_ogg.h
===================================================================
--- trunk/recordmydesktop/src/flush_to_ogg.h (rev 0)
+++ trunk/recordmydesktop/src/flush_to_ogg.h 2008-09-13 20:03:27 UTC (rev 538)
@@ -0,0 +1,40 @@
+/******************************************************************************
+* recordMyDesktop *
+*******************************************************************************
+* *
+* Copyright (C) 2006,2007,2008 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 joh...@gm... *
+******************************************************************************/
+
+#ifndef FLUSH_TO_OGG_H
+#define FLUSH_TO_OGG_H 1
+
+#include "rmdtypes.h"
+
+
+/**
+* Query theora and vorbis streams for ready packages and
+* flush them on the disk
+* \param pdata ProgData struct containing all program data
+*/
+void *FlushToOgg(ProgData *pdata);
+
+#endif
Modified: trunk/recordmydesktop/src/get_frame.c
===================================================================
--- trunk/recordmydesktop/src/get_frame.c 2008-09-13 17:06:27 UTC (rev 537)
+++ trunk/recordmydesktop/src/get_frame.c 2008-09-13 20:03:27 UTC (rev 538)
@@ -24,9 +24,14 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-
+#include "get_frame.h"
+#include "getzpixmap.h"
+#include "poll_events.h"
#include "recordmydesktop.h"
#include "rectinsert.h"
+#include "rmd_cache.h"
+#include "rmd_frame.h"
+#include "update_image.h"
#include "yuv_utils.h"
Added: trunk/recordmydesktop/src/get_frame.h
===================================================================
--- trunk/recordmydesktop/src/get_frame.h (rev 0)
+++ trunk/recordmydesktop/src/get_frame.h 2008-09-13 20:03:27 UTC (rev 538)
@@ -0,0 +1,41 @@
+/******************************************************************************
+* recordMyDesktop *
+*******************************************************************************
+* *
+* Copyright (C) 2006,2007,2008 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 joh...@gm... *
+******************************************************************************/
+
+#ifndef GET_FRAME_H
+#define GET_FRAME_H 1
+
+#include "rmdtypes.h"
+
+
+/**
+* Retrieve frame form xserver, and transform to a yuv buffer,
+* either directly(full shots) or by calling UpdateImage.
+* \param pdata ProgData struct containing all program data
+*/
+void *GetFrame(ProgData *pdata);
+
+
+#endif
Modified: trunk/recordmydesktop/src/getzpixmap.c
===================================================================
--- trunk/recordmydesktop/src/getzpixmap.c 2008-09-13 17:06:27 UTC (rev 537)
+++ trunk/recordmydesktop/src/getzpixmap.c 2008-09-13 20:03:27 UTC (rev 538)
@@ -24,8 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-
#include "recordmydesktop.h"
+#include "getzpixmap.h"
int GetZPixmap(Display *dpy,
Added: trunk/recordmydesktop/src/getzpixmap.h
===================================================================
--- trunk/recordmydesktop/src/getzpixmap.h (rev 0)
+++ trunk/recordmydesktop/src/getzpixmap.h 2008-09-13 20:03:27 UTC (rev 538)
@@ -0,0 +1,98 @@
+/******************************************************************************
+* recordMyDesktop *
+*******************************************************************************
+* *
+* Copyright (C) 2006,2007,2008 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 joh...@gm... *
+******************************************************************************/
+
+#ifndef GETZPIXMAP_H
+#define GETZPIXMAP_H 1
+
+#include "rmdtypes.h"
+
+
+/**
+* Rerieve pixmap data from xserver
+*
+* \param dpy Connection to the server
+*
+* \param root root window of the display
+*
+* \param data (preallocated)buffer to place the data
+*
+* \param x x position of the screenshot
+*
+* \param y y position of the screenshot
+*
+* \param x x position of the screenshot
+*
+* \param width width of the screenshot
+*
+* \param height height position of the screenshot
+*
+* \returns 0 on Success 1 on Failure
+*/
+int GetZPixmap(Display *dpy,
+ Window root,
+ char *data,
+ int x,
+ int y,
+ int width,
+ int height);
+
+/**
+* Rerieve pixmap data from xserver through the MIT-Shm extension
+*
+* \param dpy Connection to the server
+*
+* \param root root window of the display
+*
+* \param shminfo Info for the shared memory segment
+*
+* \param shm_opcode Opcode of Shm extension
+*
+* \param data (preallocated)buffer to place the data
+*
+* \param x x position of the screenshot
+*
+* \param y y position of the screenshot
+*
+* \param x x position of the screenshot
+*
+* \param width width of the screenshot
+*
+* \param height height position of the screenshot
+*
+* \returns 0 on Success 1 on Failure
+*/
+int GetZPixmapSHM(Display *dpy,
+ Window root,
+ XShmSegmentInfo *shminfo,
+ int shm_opcode,
+ char *data,
+ int x,
+ int y,
+ int width,
+ int height);
+
+
+#endif
Modified: trunk/recordmydesktop/src/init_encoder.c
===================================================================
--- trunk/recordmydesktop/src/init_encoder.c 2008-09-13 17:06:27 UTC (rev 537)
+++ trunk/recordmydesktop/src/init_encoder.c 2008-09-13 20:03:27 UTC (rev 538)
@@ -27,6 +27,7 @@
#include <string.h>
+#include "init_encoder.h"
#include "recordmydesktop.h"
#include "skeleton.h"
Added: trunk/recordmydesktop/src/init_encoder.h
===================================================================
--- trunk/recordmydesktop/src/init_encoder.h (rev 0)
+++ trunk/recordmydesktop/src/init_encoder.h 2008-09-13 20:03:27 UTC (rev 538)
@@ -0,0 +1,47 @@
+/******************************************************************************
+* recordMyDesktop *
+*******************************************************************************
+* *
+* Copyright (C) 2006,2007,2008 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 joh...@gm... *
+******************************************************************************/
+
+#ifndef INIT_ENCODER_H
+#define INIT_ENCODER_H 1
+
+#include "rmdtypes.h"
+
+
+/**
+* Initialize theora,vorbis encoders, and their respective ogg streams.
+*
+* \param pdata ProgData struct containing all program data
+*
+* \param enc_data_t Encoding options
+*
+* \param buffer_ready when 1, the yuv buffer must be preallocated
+* when 0 InitEncoder will alocate a new one
+*
+*/
+void InitEncoder(ProgData *pdata,EncData *enc_data_t,int buffer_ready);
+
+
+#endif
Modified: trunk/recordmydesktop/src/initialize_data.c
===================================================================
--- trunk/recordmydesktop/src/initialize_data.c 2008-09-13 17:06:27 UTC (rev 537)
+++ trunk/recordmydesktop/src/initialize_data.c 2008-09-13 20:03:27 UTC (rev 538)
@@ -26,6 +26,11 @@
#include "recordmydesktop.h"
#include "yuv_utils.h"
+#include "make_dummy_pointer.h"
+#include "opendev.h"
+#include "rmd_jack.h"
+#include "init_encoder.h"
+#include "rmd_cache.h"
#ifdef HAVE_LIBASOUND
Modified: trunk/recordmydesktop/src/load_cache.c
===================================================================
--- trunk/recordmydesktop/src/load_cache.c 2008-09-13 17:06:27 UTC (rev 537)
+++ trunk/recordmydesktop/src/load_cache.c 2008-09-13 20:03:27 UTC (rev 538)
@@ -26,7 +26,11 @@
#include <signal.h>
+#include "encode_image_buffer.h"
+#include "encode_sound_buffer.h"
+#include "load_cache.h"
#include "recordmydesktop.h"
+#include "rmd_cache.h"
//The number of bytes for every
Added: trunk/recordmydesktop/src/load_cache.h
===================================================================
--- trunk/recordmydesktop/src/load_cache.h (rev 0)
+++ trunk/recordmydesktop/src/load_cache.h 2008-09-13 20:03:27 UTC (rev 538)
@@ -0,0 +1,42 @@
+/******************************************************************************
+* recordMyDesktop *
+*******************************************************************************
+* *
+* Copyright (C) 2006,2007,2008 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. ...
[truncated message content] |
|
From: svn c. f. r. <rec...@li...> - 2008-09-13 17:06:30
|
Revision: 537
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=537&view=rev
Author: enselic
Date: 2008-09-13 17:06:27 +0000 (Sat, 13 Sep 2008)
Log Message:
-----------
doc/recordmydesktop.1: Fix a little formating problem for the -rescue option.
Modified Paths:
--------------
trunk/recordmydesktop/doc/recordmydesktop.1
Modified: trunk/recordmydesktop/doc/recordmydesktop.1
===================================================================
--- trunk/recordmydesktop/doc/recordmydesktop.1 2008-09-13 15:22:48 UTC (rev 536)
+++ trunk/recordmydesktop/doc/recordmydesktop.1 2008-09-13 17:06:27 UTC (rev 537)
@@ -359,10 +359,8 @@
and recordMyDesktop will exit after the end of the encoding.
This option was added in recordMyDesktop 0.3.7 and it will not
work with cache files produced from earlier versions.
- When using this option, remember that
-
-.B
-recordMyDesktop's cache is not safe, in respect to type-sizes and endianness.
+ When using this option, remember that recordMyDesktop's cache is
+ not safe, in respect to type-sizes and endianness.
.br
.TP
.B
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-13 15:22:52
|
Revision: 536
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=536&view=rev
Author: enselic
Date: 2008-09-13 15:22:48 +0000 (Sat, 13 Sep 2008)
Log Message:
-----------
include/rmdfunc.h: Removed CleanUp() declaration from here.
src/initialize_data.[ch]: Host CleanUp() here instead. Long-term there
should be much more code shared between rmd_rescue.c and
initialize_data.c.
src/cleanup.c: Removed.
src/Makefile.am: Removed cleanup.c.
Modified Paths:
--------------
trunk/recordmydesktop/include/rmdfunc.h
trunk/recordmydesktop/src/Makefile.am
trunk/recordmydesktop/src/initialize_data.c
trunk/recordmydesktop/src/initialize_data.h
Removed Paths:
-------------
trunk/recordmydesktop/src/cleanup.c
Modified: trunk/recordmydesktop/include/rmdfunc.h
===================================================================
--- trunk/recordmydesktop/include/rmdfunc.h 2008-09-13 15:14:58 UTC (rev 535)
+++ trunk/recordmydesktop/include/rmdfunc.h 2008-09-13 15:22:48 UTC (rev 536)
@@ -484,16 +484,6 @@
#endif
-
-/**
-* Currently only frees some memory
-* (y,u,v blocks)
-*
-*
-*/
-void CleanUp(void);
-
-
/*
* Check a shortcut combination and if valid,
* register it, on the root window.
Modified: trunk/recordmydesktop/src/Makefile.am
===================================================================
--- trunk/recordmydesktop/src/Makefile.am 2008-09-13 15:14:58 UTC (rev 535)
+++ trunk/recordmydesktop/src/Makefile.am 2008-09-13 15:22:48 UTC (rev 536)
@@ -4,7 +4,6 @@
cache_audio.c \
cache_frame.c \
capture_sound.c \
- cleanup.c \
encode_cache.c \
encode_image_buffer.c \
encode_sound_buffer.c \
Deleted: trunk/recordmydesktop/src/cleanup.c
===================================================================
--- trunk/recordmydesktop/src/cleanup.c 2008-09-13 15:14:58 UTC (rev 535)
+++ trunk/recordmydesktop/src/cleanup.c 2008-09-13 15:22:48 UTC (rev 536)
@@ -1,41 +0,0 @@
-/******************************************************************************
-* recordMyDesktop *
-*******************************************************************************
-* *
-* Copyright (C) 2006,2007,2008 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 joh...@gm... *
-******************************************************************************/
-
-#include "recordmydesktop.h"
-
-void CleanUp(void){
-
- free(yblocks);
- free(ublocks);
- free(vblocks);
-
-}
-
-
-
-
-
-
Modified: trunk/recordmydesktop/src/initialize_data.c
===================================================================
--- trunk/recordmydesktop/src/initialize_data.c 2008-09-13 15:14:58 UTC (rev 535)
+++ trunk/recordmydesktop/src/initialize_data.c 2008-09-13 15:22:48 UTC (rev 536)
@@ -233,3 +233,11 @@
args->filename = (char *) malloc(8);
strcpy(args->filename, "out.ogv");
}
+
+void CleanUp(void){
+
+ free(yblocks);
+ free(ublocks);
+ free(vblocks);
+
+}
Modified: trunk/recordmydesktop/src/initialize_data.h
===================================================================
--- trunk/recordmydesktop/src/initialize_data.h 2008-09-13 15:14:58 UTC (rev 535)
+++ trunk/recordmydesktop/src/initialize_data.h 2008-09-13 15:22:48 UTC (rev 536)
@@ -51,5 +51,12 @@
*/
void SetupDefaultArgs(ProgArgs *args);
+/**
+* Currently only frees some memory
+* (y,u,v blocks)
+*
+*/
+void CleanUp(void);
+
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-13 15:15:01
|
Revision: 535
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=535&view=rev
Author: enselic
Date: 2008-09-13 15:14:58 +0000 (Sat, 13 Sep 2008)
Log Message:
-----------
include/rmdmacro.h: Move AVG_4_PIXELS(), CALC_TVAL_AVG_16(),
CALC_TVAL_AVG_32() and CLEAR_FRAME() out of here.
src/get_frame.c: Put AVG_4_PIXELS() here.
src/yuv_utils.h: Put CALC_TVAL_AVG_16() and CALC_TVAL_AVG_32() here.
src/load_cache.c: Expand CLEAR_FRAME() here.
Modified Paths:
--------------
trunk/recordmydesktop/include/rmdmacro.h
trunk/recordmydesktop/src/get_frame.c
trunk/recordmydesktop/src/load_cache.c
trunk/recordmydesktop/src/yuv_utils.h
Modified: trunk/recordmydesktop/include/rmdmacro.h
===================================================================
--- trunk/recordmydesktop/include/rmdmacro.h 2008-09-13 14:41:31 UTC (rev 534)
+++ trunk/recordmydesktop/include/rmdmacro.h 2008-09-13 15:14:58 UTC (rev 535)
@@ -24,7 +24,6 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-
#ifndef RMDMACRO_H
#define RMDMACRO_H 1
@@ -79,8 +78,6 @@
#define COMPARE_STRIDE 4
#endif
-
-
//The width, in bytes, of the blocks
//on which the y,u and v planes are broken.
//These blocks are square.
@@ -93,52 +90,6 @@
#define DEFAULT_AUDIO_DEVICE "/dev/dsp"
#endif
-
-#define AVG_4_PIXELS(data_array,width_img,k_tm,i_tm,offset)\
- ((data_array[(k_tm*width_img+i_tm)*RMD_ULONG_SIZE_T+offset]+\
- data_array[((k_tm-1)*width_img+i_tm)*RMD_ULONG_SIZE_T+offset]+\
- data_array[(k_tm*width_img+i_tm-1)*RMD_ULONG_SIZE_T+offset]+\
- data_array[((k_tm-1)*width_img+i_tm-1)*RMD_ULONG_SIZE_T+offset])/4)
-
-
-//the 4 most significant bytes represent the A component which
-//does not need to be added on t_val, as it is always unused
-#define CALC_TVAL_AVG_32(t_val,datapi,datapi_next){\
- register unsigned int t1,t2,t3,t4;\
- t1=*datapi;\
- t2=*(datapi+1);\
- t3=*datapi_next;\
- t4=*(datapi_next+1);\
- t_val=((((t1&0x00ff0000) +(t2&0x00ff0000)+\
- (t3&0x00ff0000)+(t4&0x00ff0000))/4)&0x00ff0000)+\
- ((((t1&0x0000ff00) +(t2&0x0000ff00)+\
- (t3&0x0000ff00)+(t4&0x0000ff00))/4)&0x0000ff00)+\
- ((((t1&0x000000ff) +(t2&0x000000ff)+\
- (t3&0x000000ff)+(t4&0x000000ff))/4)&0x000000ff);\
-}
-
-//when adding the r values, we go beyond
-//the (16 bit)range of the t_val variable, but we are performing
-//32 bit arithmetics, so there's no problem.
-//(This note is useless, I'm just adding because
-//the addition of the A components in CALC_TVAL_AVG_32,
-//now removed as uneeded, produced an overflow which would have caused
-//color distrtion, where it one of the R,G or B components)
-#define CALC_TVAL_AVG_16(t_val,datapi,datapi_next){\
- register u_int16_t t1,t2,t3,t4;\
- t1=*datapi;\
- t2=*(datapi+1);\
- t3=*datapi_next;\
- t4=*(datapi_next+1);\
- t_val=((((t1&__R16_MASK) +(t2&__R16_MASK)+\
- (t3&__R16_MASK)+(t4&__R16_MASK))/4)&__R16_MASK)+\
- ((((t1&__G16_MASK) +(t2&__G16_MASK)+\
- (t3&__G16_MASK)+(t4&__G16_MASK))/4)&__G16_MASK)+\
- ((((t1&__B16_MASK) +(t2&__B16_MASK)+\
- (t3&__B16_MASK)+(t4&__B16_MASK))/4)&__B16_MASK);\
-}
-
-
#define I16TOA(number,buffer){\
int t_num=(number),__k=0,__i=0;\
char *t_buf=malloc(8);\
@@ -156,11 +107,5 @@
free(t_buf);\
};\
-#define CLEAR_FRAME(frame_t){\
- free((frame_t)->YData);\
- free((frame_t)->UData);\
- free((frame_t)->VData);\
-};
#endif
-
Modified: trunk/recordmydesktop/src/get_frame.c
===================================================================
--- trunk/recordmydesktop/src/get_frame.c 2008-09-13 14:41:31 UTC (rev 534)
+++ trunk/recordmydesktop/src/get_frame.c 2008-09-13 15:14:58 UTC (rev 535)
@@ -30,6 +30,12 @@
#include "yuv_utils.h"
+#define AVG_4_PIXELS(data_array,width_img,k_tm,i_tm,offset)\
+ ((data_array[(k_tm*width_img+i_tm)*RMD_ULONG_SIZE_T+offset]+\
+ data_array[((k_tm-1)*width_img+i_tm)*RMD_ULONG_SIZE_T+offset]+\
+ data_array[(k_tm*width_img+i_tm-1)*RMD_ULONG_SIZE_T+offset]+\
+ data_array[((k_tm-1)*width_img+i_tm-1)*RMD_ULONG_SIZE_T+offset])/4)
+
#define CLIP_DUMMY_POINTER_AREA(dummy_p_area,brwin,wgeom){\
(wgeom)->x=((((dummy_p_area).x+\
(dummy_p_area).width>=(brwin)->rgeom.x)&&\
Modified: trunk/recordmydesktop/src/load_cache.c
===================================================================
--- trunk/recordmydesktop/src/load_cache.c 2008-09-13 14:41:31 UTC (rev 534)
+++ trunk/recordmydesktop/src/load_cache.c 2008-09-13 15:14:58 UTC (rev 535)
@@ -306,7 +306,12 @@
pthread_cond_signal(&pdata->vorbis_lib_clean);
pthread_mutex_unlock(&pdata->vorbis_lib_mutex);
fprintf(stdout,"\n");
- CLEAR_FRAME(&frame)
+
+ // Clear frame
+ free(frame.YData);
+ free(frame.UData);
+ free(frame.VData);
+
free(sound_data);
if(!pdata->args.nosound){
Modified: trunk/recordmydesktop/src/yuv_utils.h
===================================================================
--- trunk/recordmydesktop/src/yuv_utils.h 2008-09-13 14:41:31 UTC (rev 534)
+++ trunk/recordmydesktop/src/yuv_utils.h 2008-09-13 15:14:58 UTC (rev 535)
@@ -35,6 +35,43 @@
Vg[256], Vb[256];
+//when adding the r values, we go beyond
+//the (16 bit)range of the t_val variable, but we are performing
+//32 bit arithmetics, so there's no problem.
+//(This note is useless, I'm just adding because
+//the addition of the A components in CALC_TVAL_AVG_32,
+//now removed as uneeded, produced an overflow which would have caused
+//color distrtion, where it one of the R,G or B components)
+#define CALC_TVAL_AVG_16(t_val,datapi,datapi_next){\
+ register u_int16_t t1,t2,t3,t4;\
+ t1=*datapi;\
+ t2=*(datapi+1);\
+ t3=*datapi_next;\
+ t4=*(datapi_next+1);\
+ t_val=((((t1&__R16_MASK) +(t2&__R16_MASK)+\
+ (t3&__R16_MASK)+(t4&__R16_MASK))/4)&__R16_MASK)+\
+ ((((t1&__G16_MASK) +(t2&__G16_MASK)+\
+ (t3&__G16_MASK)+(t4&__G16_MASK))/4)&__G16_MASK)+\
+ ((((t1&__B16_MASK) +(t2&__B16_MASK)+\
+ (t3&__B16_MASK)+(t4&__B16_MASK))/4)&__B16_MASK);\
+}
+
+//the 4 most significant bytes represent the A component which
+//does not need to be added on t_val, as it is always unused
+#define CALC_TVAL_AVG_32(t_val,datapi,datapi_next){\
+ register unsigned int t1,t2,t3,t4;\
+ t1=*datapi;\
+ t2=*(datapi+1);\
+ t3=*datapi_next;\
+ t4=*(datapi_next+1);\
+ t_val=((((t1&0x00ff0000) +(t2&0x00ff0000)+\
+ (t3&0x00ff0000)+(t4&0x00ff0000))/4)&0x00ff0000)+\
+ ((((t1&0x0000ff00) +(t2&0x0000ff00)+\
+ (t3&0x0000ff00)+(t4&0x0000ff00))/4)&0x0000ff00)+\
+ ((((t1&0x000000ff) +(t2&0x000000ff)+\
+ (t3&0x000000ff)+(t4&0x000000ff))/4)&0x000000ff);\
+}
+
#define POINT_IN_BLOCK(xv,yv,widthv,blocksize) ((yv/blocksize)*\
(widthv/blocksize)+\
(xv/blocksize))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-13 14:41:33
|
Revision: 534
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=534&view=rev
Author: enselic
Date: 2008-09-13 14:41:31 +0000 (Sat, 13 Sep 2008)
Log Message:
-----------
include/rmdfunc.h: Get rid of InitializeData().
include/rmdmacro.h: Get rid of the DEFAULT_ARGS() macro.
src/initialize_data.[ch]: Completely move InitializeData() here and
also put the new DEFAULT_ARGS() replacement, the SetupDefaultArgs()
function, here.
src/Makefile.am
src/rmd_rescue.c
src/recordmydesktop.c: Adapt.
Modified Paths:
--------------
trunk/recordmydesktop/include/rmdfunc.h
trunk/recordmydesktop/include/rmdmacro.h
trunk/recordmydesktop/src/Makefile.am
trunk/recordmydesktop/src/initialize_data.c
trunk/recordmydesktop/src/recordmydesktop.c
trunk/recordmydesktop/src/rmd_rescue.c
Added Paths:
-----------
trunk/recordmydesktop/src/initialize_data.h
Modified: trunk/recordmydesktop/include/rmdfunc.h
===================================================================
--- trunk/recordmydesktop/include/rmdfunc.h 2008-09-13 14:23:12 UTC (rev 533)
+++ trunk/recordmydesktop/include/rmdfunc.h 2008-09-13 14:41:31 UTC (rev 534)
@@ -455,22 +455,6 @@
*/
void rmdThreads(ProgData *pdata);
-/**
-* initialize lists,mutexes,image buffers, take first screenshot,
-* and anything else needed before launching the capture threads.
-*
-* \param pdata ProgData struct containing all program data
-*
-* \param enc_data reference to enc_data structure
-*
-* \param cache_data reference to cache_data structure
-*
-* \returns 0 on success, other values must cause the program to exit
-*/
-int InitializeData(ProgData *pdata,
- EncData *enc_data,
- CacheData *cache_data);
-
#ifdef HAVE_JACK_H
size_t (*jack_ringbuffer_read_p)(jack_ringbuffer_t *rb,
Modified: trunk/recordmydesktop/include/rmdmacro.h
===================================================================
--- trunk/recordmydesktop/include/rmdmacro.h 2008-09-13 14:23:12 UTC (rev 533)
+++ trunk/recordmydesktop/include/rmdmacro.h 2008-09-13 14:41:31 UTC (rev 534)
@@ -94,57 +94,6 @@
#endif
-
-#define DEFAULT_ARGS(args){\
- (args)->delay=0;\
- if(getenv("DISPLAY")!=NULL){\
- (args)->display=(char *)malloc(strlen(getenv("DISPLAY"))+1);\
- strcpy((args)->display,getenv("DISPLAY"));\
- }\
- else\
- (args)->display=NULL;\
- (args)->windowid=\
- (args)->x=\
- (args)->y=\
- (args)->width=\
- (args)->height=\
- (args)->nosound=\
- (args)->full_shots=\
- (args)->follow_mouse=\
- (args)->encOnTheFly=\
- (args)->nowmcheck=\
- (args)->overwrite=\
- (args)->use_jack=\
- (args)->noshared=\
- (args)->no_encode=\
- (args)->noframe=\
- (args)->jack_nports=0;\
- (args)->jack_ringbuffer_secs=3.0;\
- (args)->jack_port_names=NULL;\
- (args)->zerocompression=\
- (args)->no_quick_subsample=1;\
- (args)->filename=(char *)malloc(8);\
- strcpy((args)->filename,"out.ogv");\
- (args)->cursor_color=1;\
- (args)->have_dummy_cursor=0;\
- (args)->xfixes_cursor=1;\
- (args)->device=(char *)malloc(strlen(DEFAULT_AUDIO_DEVICE)+1);\
- strcpy((args)->device,DEFAULT_AUDIO_DEVICE);\
- (args)->fps=15;\
- (args)->channels=1;\
- (args)->frequency=22050;\
- (args)->buffsize=4096;\
- (args)->v_bitrate=45000;\
- (args)->v_quality=63;\
- (args)->s_quality=10;\
- (args)->workdir=(char *)malloc(5);\
- strcpy((args)->workdir,"/tmp");\
- (args)->pause_shortcut=(char *)malloc(15);\
- strcpy((args)->pause_shortcut,"Control+Mod1+p");\
- (args)->stop_shortcut=(char *)malloc(15);\
- strcpy((args)->stop_shortcut,"Control+Mod1+s");\
-}
-
#define AVG_4_PIXELS(data_array,width_img,k_tm,i_tm,offset)\
((data_array[(k_tm*width_img+i_tm)*RMD_ULONG_SIZE_T+offset]+\
data_array[((k_tm-1)*width_img+i_tm)*RMD_ULONG_SIZE_T+offset]+\
Modified: trunk/recordmydesktop/src/Makefile.am
===================================================================
--- trunk/recordmydesktop/src/Makefile.am 2008-09-13 14:23:12 UTC (rev 533)
+++ trunk/recordmydesktop/src/Makefile.am 2008-09-13 14:41:31 UTC (rev 534)
@@ -13,6 +13,7 @@
getzpixmap.c \
init_encoder.c \
initialize_data.c \
+ initialize_data.h \
load_cache.c \
make_dummy_pointer.c \
opendev.c \
Modified: trunk/recordmydesktop/src/initialize_data.c
===================================================================
--- trunk/recordmydesktop/src/initialize_data.c 2008-09-13 14:23:12 UTC (rev 533)
+++ trunk/recordmydesktop/src/initialize_data.c 2008-09-13 14:41:31 UTC (rev 534)
@@ -175,3 +175,61 @@
return 0;
}
+
+void SetupDefaultArgs(ProgArgs *args) {
+
+ args->delay = 0;
+ args->windowid = 0;
+ args->x = 0;
+ args->y = 0;
+ args->width = 0;
+ args->height = 0;
+ args->nosound = 0;
+ args->full_shots = 0;
+ args->follow_mouse = 0;
+ args->encOnTheFly = 0;
+ args->nowmcheck = 0;
+ args->overwrite = 0;
+ args->use_jack = 0;
+ args->noshared = 0;
+ args->no_encode = 0;
+ args->noframe = 0;
+ args->jack_nports = 0;
+ args->jack_ringbuffer_secs = 3.0;
+ args->jack_port_names = NULL;
+ args->zerocompression = 1;
+ args->no_quick_subsample = 1;
+ args->cursor_color = 1;
+ args->have_dummy_cursor = 0;
+ args->xfixes_cursor = 1;
+ args->fps = 15;
+ args->channels = 1;
+ args->frequency = 22050;
+ args->buffsize = 4096;
+ args->v_bitrate = 45000;
+ args->v_quality = 63;
+ args->s_quality = 10;
+
+ if (getenv("DISPLAY") != NULL) {
+ args->display = (char *) malloc(strlen(getenv("DISPLAY")) + 1);
+ strcpy(args->display, getenv("DISPLAY"));
+ }
+ else {
+ args->display = NULL;
+ }
+
+ args->device = (char *) malloc(strlen(DEFAULT_AUDIO_DEVICE) + 1);
+ strcpy(args->device, DEFAULT_AUDIO_DEVICE);
+
+ args->workdir = (char *) malloc(5);
+ strcpy(args->workdir, "/tmp");
+
+ args->pause_shortcut = (char *) malloc(15);
+ strcpy(args->pause_shortcut, "Control+Mod1+p");
+
+ args->stop_shortcut = (char *) malloc(15);
+ strcpy(args->stop_shortcut, "Control+Mod1+s");
+
+ args->filename = (char *) malloc(8);
+ strcpy(args->filename, "out.ogv");
+}
Added: trunk/recordmydesktop/src/initialize_data.h
===================================================================
--- trunk/recordmydesktop/src/initialize_data.h (rev 0)
+++ trunk/recordmydesktop/src/initialize_data.h 2008-09-13 14:41:31 UTC (rev 534)
@@ -0,0 +1,55 @@
+/******************************************************************************
+* recordMyDesktop *
+*******************************************************************************
+* *
+* Copyright (C) 2006,2007,2008 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 joh...@gm... *
+******************************************************************************/
+
+#ifndef INITIALIZE_DATA_H
+#define INITIALIZE_DATA_H 1
+
+#include "rmdtypes.h"
+
+
+/**
+* initialize lists,mutexes,image buffers, take first screenshot,
+* and anything else needed before launching the capture threads.
+*
+* \param pdata ProgData struct containing all program data
+*
+* \param enc_data reference to enc_data structure
+*
+* \param cache_data reference to cache_data structure
+*
+* \returns 0 on success, other values must cause the program to exit
+*/
+int InitializeData(ProgData *pdata,
+ EncData *enc_data,
+ CacheData *cache_data);
+
+/**
+* Sets up the ProgArgs structure to default values.
+*/
+void SetupDefaultArgs(ProgArgs *args);
+
+
+#endif
Modified: trunk/recordmydesktop/src/recordmydesktop.c
===================================================================
--- trunk/recordmydesktop/src/recordmydesktop.c 2008-09-13 14:23:12 UTC (rev 533)
+++ trunk/recordmydesktop/src/recordmydesktop.c 2008-09-13 14:41:31 UTC (rev 534)
@@ -26,6 +26,7 @@
#include "recordmydesktop.h"
+#include "initialize_data.h"
#include "parseargs.h"
@@ -33,7 +34,8 @@
ProgData pdata;
int exit_status = 0;
- DEFAULT_ARGS(&pdata.args);
+ SetupDefaultArgs(&pdata.args);
+
if (!ParseArgs(argc, argv, &pdata.args)) {
exit(1);
}
Modified: trunk/recordmydesktop/src/rmd_rescue.c
===================================================================
--- trunk/recordmydesktop/src/rmd_rescue.c 2008-09-13 14:23:12 UTC (rev 533)
+++ trunk/recordmydesktop/src/rmd_rescue.c 2008-09-13 14:41:31 UTC (rev 534)
@@ -25,6 +25,7 @@
******************************************************************************/
#include "recordmydesktop.h"
+#include "initialize_data.h"
#include "register_callbacks.h"
@@ -40,9 +41,8 @@
EncData enc_data;
CacheData cache_data;
+ SetupDefaultArgs(&pdata.args);
- DEFAULT_ARGS(&pdata.args);
-
pdata.enc_data=&enc_data;
pdata.cache_data=&cache_data;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-13 14:23:15
|
Revision: 533
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=533&view=rev
Author: enselic
Date: 2008-09-13 14:23:12 +0000 (Sat, 13 Sep 2008)
Log Message:
-----------
include/recordmydesktop.h: Get rid of YUV data variables (which were
insanely *defined* in this header (like the other globals)).
include/rmdmacro.h: Get rid of YUV utility macros.
src/initialize_data.c: Get rid of MakeMatrices() and include the new yuv_utils.h.
src/yuv_utils.[ch]: New files to host the YUV data variables and the
MakeMatrices() function. The globals are now properly defined in
the .c and exposed in the .h which also contains the YUV utility macros.
src/get_frame.c
src/update_image.c: Include the new yuv_utils.h
src/Makefile.am: Added yuv_utils.[ch].
Modified Paths:
--------------
trunk/recordmydesktop/include/recordmydesktop.h
trunk/recordmydesktop/include/rmdmacro.h
trunk/recordmydesktop/src/Makefile.am
trunk/recordmydesktop/src/get_frame.c
trunk/recordmydesktop/src/initialize_data.c
trunk/recordmydesktop/src/update_image.c
Added Paths:
-----------
trunk/recordmydesktop/src/yuv_utils.c
trunk/recordmydesktop/src/yuv_utils.h
Modified: trunk/recordmydesktop/include/recordmydesktop.h
===================================================================
--- trunk/recordmydesktop/include/recordmydesktop.h 2008-09-13 13:28:47 UTC (rev 532)
+++ trunk/recordmydesktop/include/recordmydesktop.h 2008-09-13 14:23:12 UTC (rev 533)
@@ -50,9 +50,6 @@
/**Globals*/
//I've read somewhere that I'll go to hell for using globals...
-unsigned char Yr[256],Yg[256],Yb[256],
- Ur[256],Ug[256],UbVr[256],
- Vg[256],Vb[256];
//the following values are of no effect
//but they might be usefull later for profiling
unsigned int frames_total, //frames calculated by total time expirations
Modified: trunk/recordmydesktop/include/rmdmacro.h
===================================================================
--- trunk/recordmydesktop/include/rmdmacro.h 2008-09-13 13:28:47 UTC (rev 532)
+++ trunk/recordmydesktop/include/rmdmacro.h 2008-09-13 14:23:12 UTC (rev 533)
@@ -189,319 +189,7 @@
(t3&__B16_MASK)+(t4&__B16_MASK))/4)&__B16_MASK);\
}
-#define POINT_IN_BLOCK(xv,yv,widthv,blocksize) ((yv/blocksize)*\
- (widthv/blocksize)+\
- (xv/blocksize))
-#define UPDATE_Y_PLANE(data,\
- x_tm,\
- y_tm,\
- height_tm,\
- width_tm,\
- yuv,\
- __bit_depth__){ \
- int k,i;\
- register u_int##__bit_depth__##_t t_val;\
- register unsigned char *yuv_y=yuv->y+x_tm+y_tm*yuv->y_width,\
- *_yr=Yr,*_yg=Yg,*_yb=Yb;\
- register u_int##__bit_depth__##_t *datapi=(u_int##__bit_depth__##_t *)data;\
- for(k=0;k<height_tm;k++){\
- for(i=0;i<width_tm;i++){\
- t_val=*datapi;\
- *yuv_y=_yr[__RVALUE_##__bit_depth__(t_val)] +\
- _yg[__GVALUE_##__bit_depth__(t_val)] +\
- _yb[__BVALUE_##__bit_depth__(t_val)] ;\
- datapi++;\
- yuv_y++;\
- }\
- yuv_y+=yuv->y_width-width_tm;\
- }\
-}
-
-#define UPDATE_Y_PLANE_DBUF(data,\
- data_back,\
- x_tm,\
- y_tm,\
- height_tm,\
- width_tm,\
- yuv,\
- __bit_depth__){ \
- int k,i;\
- register u_int##__bit_depth__##_t t_val;\
- register unsigned char *yuv_y=yuv->y+x_tm+y_tm*yuv->y_width,\
- *_yr=Yr,*_yg=Yg,*_yb=Yb;\
- register u_int##__bit_depth__##_t *datapi=(u_int##__bit_depth__##_t *)data,\
- *datapi_back=(u_int##__bit_depth__##_t *)data_back;\
- for(k=0;k<height_tm;k++){\
- for(i=0;i<width_tm;i++){\
- if(*datapi!=*datapi_back){\
- t_val=*datapi;\
- *yuv_y=_yr[__RVALUE_##__bit_depth__(t_val)] +\
- _yg[__GVALUE_##__bit_depth__(t_val)] +\
- _yb[__BVALUE_##__bit_depth__(t_val)] ;\
- yblocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
- }\
- datapi++;\
- datapi_back++;\
- yuv_y++;\
- }\
- yuv_y+=yuv->y_width-width_tm;\
- }\
-}
-
-#define UPDATE_A_UV_PIXEL(yuv_u,\
- yuv_v,\
- t_val,\
- datapi,\
- datapi_next,\
- _ur,_ug,_ubvr,_vg,_vb,\
- __sampling_type,\
- __bit_depth__)\
- if(__sampling_type==__PXL_AVERAGE){\
- CALC_TVAL_AVG_##__bit_depth__(t_val,datapi,datapi_next)\
- }\
- else\
- t_val=*datapi;\
- *yuv_u=\
- _ur[__RVALUE_##__bit_depth__(t_val)] +\
- _ug[__GVALUE_##__bit_depth__(t_val)] +\
- _ubvr[__BVALUE_##__bit_depth__(t_val)];\
- *yuv_v=\
- _ubvr[__RVALUE_##__bit_depth__(t_val)] +\
- _vg[__GVALUE_##__bit_depth__(t_val)] +\
- _vb[__BVALUE_##__bit_depth__(t_val)];\
-
-
-#define UPDATE_UV_PLANES(data,\
- x_tm,\
- y_tm,\
- height_tm,\
- width_tm,\
- yuv,\
- __sampling_type,\
- __bit_depth__){ \
- int k,i;\
- register u_int##__bit_depth__##_t t_val;\
- register unsigned char *yuv_u=yuv->u+x_tm/2+(y_tm*yuv->uv_width)/2,\
- *yuv_v=yuv->v+x_tm/2+(y_tm*yuv->uv_width)/2,\
- *_ur=Ur,*_ug=Ug,*_ubvr=UbVr,\
- *_vg=Vg,*_vb=Vb;\
- register u_int##__bit_depth__##_t *datapi=(u_int##__bit_depth__##_t *)data,\
- *datapi_next=NULL;\
- if(__sampling_type==__PXL_AVERAGE){\
- datapi_next=datapi+width_tm;\
- }\
- for(k=0;k<height_tm;k+=2){\
- for(i=0;i<width_tm;i+=2){\
- UPDATE_A_UV_PIXEL( yuv_u,\
- yuv_v,\
- t_val,\
- datapi,\
- datapi_next,\
- _ur,_ug,_ubvr,_vg,_vb,\
- __sampling_type,\
- __bit_depth__)\
- datapi+=2;\
- if(__sampling_type==__PXL_AVERAGE)\
- datapi_next+=2;\
- yuv_u++;\
- yuv_v++;\
- }\
- yuv_u+=(yuv->y_width-width_tm)/2;\
- yuv_v+=(yuv->y_width-width_tm)/2;\
- datapi+=width_tm;\
- if(__sampling_type==__PXL_AVERAGE)\
- datapi_next+=width_tm;\
- }\
-}
-
-#define UPDATE_UV_PLANES_DBUF( data,\
- data_back,\
- x_tm,\
- y_tm,\
- height_tm,\
- width_tm,\
- yuv,\
- __sampling_type,\
- __bit_depth__){ \
- int k,i;\
- register u_int##__bit_depth__##_t t_val;\
- register unsigned char *yuv_u=yuv->u+x_tm/2+(y_tm*yuv->uv_width)/2,\
- *yuv_v=yuv->v+x_tm/2+(y_tm*yuv->uv_width)/2,\
- *_ur=Ur,*_ug=Ug,*_ubvr=UbVr,\
- *_vg=Vg,*_vb=Vb;\
- register u_int##__bit_depth__##_t *datapi=(u_int##__bit_depth__##_t *)data,\
- *datapi_next=NULL,\
- *datapi_back=(u_int##__bit_depth__##_t *)data_back,\
- *datapi_back_next=NULL;\
- if(__sampling_type==__PXL_AVERAGE){\
- datapi_next=datapi+width_tm;\
- datapi_back_next=datapi_back+width_tm;\
- for(k=0;k<height_tm;k+=2){\
- for(i=0;i<width_tm;i+=2){\
- if(( (*datapi!=*datapi_back) ||\
- (*(datapi+1)!=*(datapi_back+1)) ||\
- (*datapi_next!=*datapi_back_next) ||\
- (*(datapi_next+1)!=*(datapi_back_next+1)))){\
- UPDATE_A_UV_PIXEL( yuv_u,\
- yuv_v,\
- t_val,\
- datapi,\
- datapi_next,\
- _ur,_ug,_ubvr,_vg,_vb,\
- __sampling_type,\
- __bit_depth__)\
- ublocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
- vblocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
- }\
- datapi+=2;\
- datapi_back+=2;\
- if(__sampling_type==__PXL_AVERAGE){\
- datapi_next+=2;\
- datapi_back_next+=2;\
- }\
- yuv_u++;\
- yuv_v++;\
- }\
- yuv_u+=(yuv->y_width-width_tm)/2;\
- yuv_v+=(yuv->y_width-width_tm)/2;\
- datapi+=width_tm;\
- datapi_back+=width_tm;\
- if(__sampling_type==__PXL_AVERAGE){\
- datapi_next+=width_tm;\
- datapi_back_next+=width_tm;\
- }\
- }\
- }\
- else{\
- for(k=0;k<height_tm;k+=2){\
- for(i=0;i<width_tm;i+=2){\
- if ((*datapi!=*datapi_back)){\
- UPDATE_A_UV_PIXEL( yuv_u,\
- yuv_v,\
- t_val,\
- datapi,\
- datapi_next,\
- _ur,_ug,_ubvr,_vg,_vb,\
- __sampling_type,\
- __bit_depth__)\
- ublocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
- vblocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
- }\
- datapi+=2;\
- datapi_back+=2;\
- if(__sampling_type==__PXL_AVERAGE){\
- datapi_next+=2;\
- datapi_back_next+=2;\
- }\
- yuv_u++;\
- yuv_v++;\
- }\
- yuv_u+=(yuv->y_width-width_tm)/2;\
- yuv_v+=(yuv->y_width-width_tm)/2;\
- datapi+=width_tm;\
- datapi_back+=width_tm;\
- if(__sampling_type==__PXL_AVERAGE){\
- datapi_next+=width_tm;\
- datapi_back_next+=width_tm;\
- }\
- }\
- }\
-}
-
-#define UPDATE_YUV_BUFFER(yuv,\
- data,\
- data_back,\
- x_tm,\
- y_tm,\
- width_tm,\
- height_tm,\
- __sampling_type,\
- __color_depth){\
- if(data_back==NULL){\
- if((__color_depth==24)||(__color_depth==32)){\
- UPDATE_Y_PLANE(data,x_tm,y_tm,height_tm,width_tm,yuv,32)\
- UPDATE_UV_PLANES(data,x_tm,y_tm,height_tm,width_tm,\
- yuv,__sampling_type,32)\
- }\
- else if(__color_depth==16){\
- UPDATE_Y_PLANE(data,x_tm,y_tm,height_tm,width_tm,yuv,16)\
- UPDATE_UV_PLANES(data,x_tm,y_tm,height_tm,width_tm,\
- yuv,__sampling_type,16)\
- }\
- }\
- else{\
- if((__color_depth==24)||(__color_depth==32)){\
- UPDATE_Y_PLANE_DBUF(data,data_back,x_tm,y_tm,\
- height_tm,width_tm,yuv,32)\
- UPDATE_UV_PLANES_DBUF(data,data_back,x_tm,y_tm,height_tm,width_tm,\
- yuv,__sampling_type,32)\
- }\
- else if(__color_depth==16){\
- UPDATE_Y_PLANE_DBUF(data,data_back,x_tm,y_tm,\
- height_tm,width_tm,yuv,16)\
- UPDATE_UV_PLANES_DBUF(data,data_back,x_tm,y_tm,height_tm,width_tm,\
- yuv,__sampling_type,16)\
- }\
- }\
-}
-
-
-
-#define DUMMY_POINTER_TO_YUV(yuv,\
- data_tm,\
- x_tm,\
- y_tm,\
- width_tm,\
- height_tm,\
- x_offset,\
- y_offset,\
- no_pixel){\
- int i,k,j=0;\
- int x_2=x_tm/2,y_2=y_tm/2,y_width_2=(yuv)->y_width/2;\
- for(k=y_offset;k<y_offset+height_tm;k++){\
- for(i=x_offset;i<x_offset+width_tm;i++){\
- j=k*16+i;\
- if(data_tm[(j*4)]!=(no_pixel)){\
- (yuv)->y[x_tm+(i-x_offset)+((k-y_offset)+y_tm)*(yuv)->y_width]=\
- Yr[data_tm[(j*4)+__RBYTE]] +\
- Yg[data_tm[(j*4)+__GBYTE]] +\
- Yb[data_tm[(j*4)+__BBYTE]];\
- if((k%2)&&(i%2)){\
- yuv->u[x_2+(i-x_offset)/2+((k-y_offset)/2+y_2)*y_width_2]=\
- Ur[data_tm[(k*width_tm+i)*4+__RBYTE]] +\
- Ug[data_tm[(k*width_tm+i)*4+__GBYTE]] +\
- UbVr[data_tm[(k*width_tm+i)*4+__BBYTE]];\
- yuv->v[x_2+(i-x_offset)/2+((k-y_offset)/2+y_2)*y_width_2]=\
- UbVr[data_tm[(k*width_tm+i)*4+__RBYTE]] +\
- Vg[data_tm[(k*width_tm+i)*4+__GBYTE]] +\
- Vb[data_tm[(k*width_tm+i)*4+__BBYTE]] ;\
- }\
- }\
- }\
- }\
-}
-
-#define MARK_BACK_BUFFER_C( data,\
- x_tm,\
- y_tm,\
- width_tm,\
- height_tm,\
- buffer_width,\
- __bit_depth__){\
- int k,i;\
- register u_int##__bit_depth__##_t\
- *datapi=\
- ((u_int##__bit_depth__##_t *)data)+y_tm*buffer_width+x_tm;\
- for(k=0;k<height_tm;k++){\
- for(i=0;i<width_tm;i++){\
- *datapi+=1;\
- datapi++;\
- }\
- datapi+=buffer_width-width_tm;\
- }\
-}
-
#define I16TOA(number,buffer){\
int t_num=(number),__k=0,__i=0;\
char *t_buf=malloc(8);\
Modified: trunk/recordmydesktop/src/Makefile.am
===================================================================
--- trunk/recordmydesktop/src/Makefile.am 2008-09-13 13:28:47 UTC (rev 532)
+++ trunk/recordmydesktop/src/Makefile.am 2008-09-13 14:23:12 UTC (rev 533)
@@ -37,6 +37,8 @@
skeleton.c \
specsfile.c \
update_image.c \
+ yuv_utils.c \
+ yuv_utils.h \
wm_check.c
Modified: trunk/recordmydesktop/src/get_frame.c
===================================================================
--- trunk/recordmydesktop/src/get_frame.c 2008-09-13 13:28:47 UTC (rev 532)
+++ trunk/recordmydesktop/src/get_frame.c 2008-09-13 14:23:12 UTC (rev 533)
@@ -27,6 +27,7 @@
#include "recordmydesktop.h"
#include "rectinsert.h"
+#include "yuv_utils.h"
#define CLIP_DUMMY_POINTER_AREA(dummy_p_area,brwin,wgeom){\
Modified: trunk/recordmydesktop/src/initialize_data.c
===================================================================
--- trunk/recordmydesktop/src/initialize_data.c 2008-09-13 13:28:47 UTC (rev 532)
+++ trunk/recordmydesktop/src/initialize_data.c 2008-09-13 14:23:12 UTC (rev 533)
@@ -24,8 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-
#include "recordmydesktop.h"
+#include "yuv_utils.h"
#ifdef HAVE_LIBASOUND
@@ -44,32 +44,6 @@
(int)buffsize_ret,(int)*buffsize);
}
-/**
-* Fill Yr,Yg,Yb,Ur,Ug.Ub,Vr,Vg,Vb arrays(globals) with values.
-*/
-static void MakeMatrices () {
- int i;
-
- for (i = 0; i < 256; i++)
- Yr[i] = (2104.0 * i) / 8192.0 + 8.0;
- for (i = 0; i < 256; i++)
- Yg[i] = (4130.0 * i) / 8192.0 + 8.0;
- for (i = 0; i < 256; i++)
- Yb[i] = (802.0 * i) / 8192.0;
-
- for (i = 0; i < 256; i++)
- Ur[i] = 37.8 - (1204.0 * i) / 8192.0 + 8.0;
- for (i = 0; i < 256; i++)
- Ug[i] = 74.2 - (2384.0 * i) / 8192.0 + 8.0;
- for (i = 0; i < 256; i++)
- UbVr[i] = (3598.0 * i) / 8192.0 ;
-
- for (i = 0; i < 256; i++)
- Vg[i] = 93.8 - (3013.0 * i) / 8192.0 + 8.0;
- for (i = 0; i < 256; i++)
- Vb[i] = 18.2 - (585.0 * i) / 8192.0 + 8.0;
-}
-
int InitializeData(ProgData *pdata,
EncData *enc_data,
CacheData *cache_data){
Modified: trunk/recordmydesktop/src/update_image.c
===================================================================
--- trunk/recordmydesktop/src/update_image.c 2008-09-13 13:28:47 UTC (rev 532)
+++ trunk/recordmydesktop/src/update_image.c 2008-09-13 14:23:12 UTC (rev 533)
@@ -26,6 +26,7 @@
#include "recordmydesktop.h"
+#include "yuv_utils.h"
void UpdateImage(Display * dpy,
Added: trunk/recordmydesktop/src/yuv_utils.c
===================================================================
--- trunk/recordmydesktop/src/yuv_utils.c (rev 0)
+++ trunk/recordmydesktop/src/yuv_utils.c 2008-09-13 14:23:12 UTC (rev 533)
@@ -0,0 +1,55 @@
+/******************************************************************************
+* recordMyDesktop *
+*******************************************************************************
+* *
+* Copyright (C) 2006,2007,2008 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 joh...@gm... *
+******************************************************************************/
+
+#include "yuv_utils.h"
+
+// Keep these global (for performance reasons I assume).
+unsigned char Yr[256], Yg[256], Yb[256],
+ Ur[256], Ug[256], UbVr[256],
+ Vg[256], Vb[256];
+
+void MakeMatrices (void) {
+ int i;
+
+ for (i = 0; i < 256; i++)
+ Yr[i] = (2104.0 * i) / 8192.0 + 8.0;
+ for (i = 0; i < 256; i++)
+ Yg[i] = (4130.0 * i) / 8192.0 + 8.0;
+ for (i = 0; i < 256; i++)
+ Yb[i] = (802.0 * i) / 8192.0;
+
+ for (i = 0; i < 256; i++)
+ Ur[i] = 37.8 - (1204.0 * i) / 8192.0 + 8.0;
+ for (i = 0; i < 256; i++)
+ Ug[i] = 74.2 - (2384.0 * i) / 8192.0 + 8.0;
+ for (i = 0; i < 256; i++)
+ UbVr[i] = (3598.0 * i) / 8192.0 ;
+
+ for (i = 0; i < 256; i++)
+ Vg[i] = 93.8 - (3013.0 * i) / 8192.0 + 8.0;
+ for (i = 0; i < 256; i++)
+ Vb[i] = 18.2 - (585.0 * i) / 8192.0 + 8.0;
+}
Added: trunk/recordmydesktop/src/yuv_utils.h
===================================================================
--- trunk/recordmydesktop/src/yuv_utils.h (rev 0)
+++ trunk/recordmydesktop/src/yuv_utils.h 2008-09-13 14:23:12 UTC (rev 533)
@@ -0,0 +1,356 @@
+/******************************************************************************
+* recordMyDesktop *
+*******************************************************************************
+* *
+* Copyright (C) 2006,2007,2008 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 joh...@gm... *
+******************************************************************************/
+
+#ifndef YUV_UTILS_H
+#define YUV_UTILS_H 1
+
+
+// The macros work directly on this data (for performance reasons I
+// suppose) so we keep this global
+extern unsigned char Yr[256], Yg[256], Yb[256],
+ Ur[256], Ug[256], UbVr[256],
+ Vg[256], Vb[256];
+
+
+#define POINT_IN_BLOCK(xv,yv,widthv,blocksize) ((yv/blocksize)*\
+ (widthv/blocksize)+\
+ (xv/blocksize))
+
+#define UPDATE_Y_PLANE(data,\
+ x_tm,\
+ y_tm,\
+ height_tm,\
+ width_tm,\
+ yuv,\
+ __bit_depth__){ \
+ int k,i;\
+ register u_int##__bit_depth__##_t t_val;\
+ register unsigned char *yuv_y=yuv->y+x_tm+y_tm*yuv->y_width,\
+ *_yr=Yr,*_yg=Yg,*_yb=Yb;\
+ register u_int##__bit_depth__##_t *datapi=(u_int##__bit_depth__##_t *)data;\
+ for(k=0;k<height_tm;k++){\
+ for(i=0;i<width_tm;i++){\
+ t_val=*datapi;\
+ *yuv_y=_yr[__RVALUE_##__bit_depth__(t_val)] +\
+ _yg[__GVALUE_##__bit_depth__(t_val)] +\
+ _yb[__BVALUE_##__bit_depth__(t_val)] ;\
+ datapi++;\
+ yuv_y++;\
+ }\
+ yuv_y+=yuv->y_width-width_tm;\
+ }\
+}
+
+#define UPDATE_Y_PLANE_DBUF(data,\
+ data_back,\
+ x_tm,\
+ y_tm,\
+ height_tm,\
+ width_tm,\
+ yuv,\
+ __bit_depth__){ \
+ int k,i;\
+ register u_int##__bit_depth__##_t t_val;\
+ register unsigned char *yuv_y=yuv->y+x_tm+y_tm*yuv->y_width,\
+ *_yr=Yr,*_yg=Yg,*_yb=Yb;\
+ register u_int##__bit_depth__##_t *datapi=(u_int##__bit_depth__##_t *)data,\
+ *datapi_back=(u_int##__bit_depth__##_t *)data_back;\
+ for(k=0;k<height_tm;k++){\
+ for(i=0;i<width_tm;i++){\
+ if(*datapi!=*datapi_back){\
+ t_val=*datapi;\
+ *yuv_y=_yr[__RVALUE_##__bit_depth__(t_val)] +\
+ _yg[__GVALUE_##__bit_depth__(t_val)] +\
+ _yb[__BVALUE_##__bit_depth__(t_val)] ;\
+ yblocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
+ }\
+ datapi++;\
+ datapi_back++;\
+ yuv_y++;\
+ }\
+ yuv_y+=yuv->y_width-width_tm;\
+ }\
+}
+
+#define UPDATE_A_UV_PIXEL(yuv_u,\
+ yuv_v,\
+ t_val,\
+ datapi,\
+ datapi_next,\
+ _ur,_ug,_ubvr,_vg,_vb,\
+ __sampling_type,\
+ __bit_depth__)\
+ if(__sampling_type==__PXL_AVERAGE){\
+ CALC_TVAL_AVG_##__bit_depth__(t_val,datapi,datapi_next)\
+ }\
+ else\
+ t_val=*datapi;\
+ *yuv_u=\
+ _ur[__RVALUE_##__bit_depth__(t_val)] +\
+ _ug[__GVALUE_##__bit_depth__(t_val)] +\
+ _ubvr[__BVALUE_##__bit_depth__(t_val)];\
+ *yuv_v=\
+ _ubvr[__RVALUE_##__bit_depth__(t_val)] +\
+ _vg[__GVALUE_##__bit_depth__(t_val)] +\
+ _vb[__BVALUE_##__bit_depth__(t_val)];\
+
+
+#define UPDATE_UV_PLANES(data,\
+ x_tm,\
+ y_tm,\
+ height_tm,\
+ width_tm,\
+ yuv,\
+ __sampling_type,\
+ __bit_depth__){ \
+ int k,i;\
+ register u_int##__bit_depth__##_t t_val;\
+ register unsigned char *yuv_u=yuv->u+x_tm/2+(y_tm*yuv->uv_width)/2,\
+ *yuv_v=yuv->v+x_tm/2+(y_tm*yuv->uv_width)/2,\
+ *_ur=Ur,*_ug=Ug,*_ubvr=UbVr,\
+ *_vg=Vg,*_vb=Vb;\
+ register u_int##__bit_depth__##_t *datapi=(u_int##__bit_depth__##_t *)data,\
+ *datapi_next=NULL;\
+ if(__sampling_type==__PXL_AVERAGE){\
+ datapi_next=datapi+width_tm;\
+ }\
+ for(k=0;k<height_tm;k+=2){\
+ for(i=0;i<width_tm;i+=2){\
+ UPDATE_A_UV_PIXEL( yuv_u,\
+ yuv_v,\
+ t_val,\
+ datapi,\
+ datapi_next,\
+ _ur,_ug,_ubvr,_vg,_vb,\
+ __sampling_type,\
+ __bit_depth__)\
+ datapi+=2;\
+ if(__sampling_type==__PXL_AVERAGE)\
+ datapi_next+=2;\
+ yuv_u++;\
+ yuv_v++;\
+ }\
+ yuv_u+=(yuv->y_width-width_tm)/2;\
+ yuv_v+=(yuv->y_width-width_tm)/2;\
+ datapi+=width_tm;\
+ if(__sampling_type==__PXL_AVERAGE)\
+ datapi_next+=width_tm;\
+ }\
+}
+
+#define UPDATE_UV_PLANES_DBUF( data,\
+ data_back,\
+ x_tm,\
+ y_tm,\
+ height_tm,\
+ width_tm,\
+ yuv,\
+ __sampling_type,\
+ __bit_depth__){ \
+ int k,i;\
+ register u_int##__bit_depth__##_t t_val;\
+ register unsigned char *yuv_u=yuv->u+x_tm/2+(y_tm*yuv->uv_width)/2,\
+ *yuv_v=yuv->v+x_tm/2+(y_tm*yuv->uv_width)/2,\
+ *_ur=Ur,*_ug=Ug,*_ubvr=UbVr,\
+ *_vg=Vg,*_vb=Vb;\
+ register u_int##__bit_depth__##_t *datapi=(u_int##__bit_depth__##_t *)data,\
+ *datapi_next=NULL,\
+ *datapi_back=(u_int##__bit_depth__##_t *)data_back,\
+ *datapi_back_next=NULL;\
+ if(__sampling_type==__PXL_AVERAGE){\
+ datapi_next=datapi+width_tm;\
+ datapi_back_next=datapi_back+width_tm;\
+ for(k=0;k<height_tm;k+=2){\
+ for(i=0;i<width_tm;i+=2){\
+ if(( (*datapi!=*datapi_back) ||\
+ (*(datapi+1)!=*(datapi_back+1)) ||\
+ (*datapi_next!=*datapi_back_next) ||\
+ (*(datapi_next+1)!=*(datapi_back_next+1)))){\
+ UPDATE_A_UV_PIXEL( yuv_u,\
+ yuv_v,\
+ t_val,\
+ datapi,\
+ datapi_next,\
+ _ur,_ug,_ubvr,_vg,_vb,\
+ __sampling_type,\
+ __bit_depth__)\
+ ublocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
+ vblocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
+ }\
+ datapi+=2;\
+ datapi_back+=2;\
+ if(__sampling_type==__PXL_AVERAGE){\
+ datapi_next+=2;\
+ datapi_back_next+=2;\
+ }\
+ yuv_u++;\
+ yuv_v++;\
+ }\
+ yuv_u+=(yuv->y_width-width_tm)/2;\
+ yuv_v+=(yuv->y_width-width_tm)/2;\
+ datapi+=width_tm;\
+ datapi_back+=width_tm;\
+ if(__sampling_type==__PXL_AVERAGE){\
+ datapi_next+=width_tm;\
+ datapi_back_next+=width_tm;\
+ }\
+ }\
+ }\
+ else{\
+ for(k=0;k<height_tm;k+=2){\
+ for(i=0;i<width_tm;i+=2){\
+ if ((*datapi!=*datapi_back)){\
+ UPDATE_A_UV_PIXEL( yuv_u,\
+ yuv_v,\
+ t_val,\
+ datapi,\
+ datapi_next,\
+ _ur,_ug,_ubvr,_vg,_vb,\
+ __sampling_type,\
+ __bit_depth__)\
+ ublocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
+ vblocks[POINT_IN_BLOCK(i,k,width_tm,Y_UNIT_WIDTH)]=1;\
+ }\
+ datapi+=2;\
+ datapi_back+=2;\
+ if(__sampling_type==__PXL_AVERAGE){\
+ datapi_next+=2;\
+ datapi_back_next+=2;\
+ }\
+ yuv_u++;\
+ yuv_v++;\
+ }\
+ yuv_u+=(yuv->y_width-width_tm)/2;\
+ yuv_v+=(yuv->y_width-width_tm)/2;\
+ datapi+=width_tm;\
+ datapi_back+=width_tm;\
+ if(__sampling_type==__PXL_AVERAGE){\
+ datapi_next+=width_tm;\
+ datapi_back_next+=width_tm;\
+ }\
+ }\
+ }\
+}
+
+#define UPDATE_YUV_BUFFER(yuv,\
+ data,\
+ data_back,\
+ x_tm,\
+ y_tm,\
+ width_tm,\
+ height_tm,\
+ __sampling_type,\
+ __color_depth){\
+ if(data_back==NULL){\
+ if((__color_depth==24)||(__color_depth==32)){\
+ UPDATE_Y_PLANE(data,x_tm,y_tm,height_tm,width_tm,yuv,32)\
+ UPDATE_UV_PLANES(data,x_tm,y_tm,height_tm,width_tm,\
+ yuv,__sampling_type,32)\
+ }\
+ else if(__color_depth==16){\
+ UPDATE_Y_PLANE(data,x_tm,y_tm,height_tm,width_tm,yuv,16)\
+ UPDATE_UV_PLANES(data,x_tm,y_tm,height_tm,width_tm,\
+ yuv,__sampling_type,16)\
+ }\
+ }\
+ else{\
+ if((__color_depth==24)||(__color_depth==32)){\
+ UPDATE_Y_PLANE_DBUF(data,data_back,x_tm,y_tm,\
+ height_tm,width_tm,yuv,32)\
+ UPDATE_UV_PLANES_DBUF(data,data_back,x_tm,y_tm,height_tm,width_tm,\
+ yuv,__sampling_type,32)\
+ }\
+ else if(__color_depth==16){\
+ UPDATE_Y_PLANE_DBUF(data,data_back,x_tm,y_tm,\
+ height_tm,width_tm,yuv,16)\
+ UPDATE_UV_PLANES_DBUF(data,data_back,x_tm,y_tm,height_tm,width_tm,\
+ yuv,__sampling_type,16)\
+ }\
+ }\
+}
+
+#define DUMMY_POINTER_TO_YUV(yuv,\
+ data_tm,\
+ x_tm,\
+ y_tm,\
+ width_tm,\
+ height_tm,\
+ x_offset,\
+ y_offset,\
+ no_pixel){\
+ int i,k,j=0;\
+ int x_2=x_tm/2,y_2=y_tm/2,y_width_2=(yuv)->y_width/2;\
+ for(k=y_offset;k<y_offset+height_tm;k++){\
+ for(i=x_offset;i<x_offset+width_tm;i++){\
+ j=k*16+i;\
+ if(data_tm[(j*4)]!=(no_pixel)){\
+ (yuv)->y[x_tm+(i-x_offset)+((k-y_offset)+y_tm)*(yuv)->y_width]=\
+ Yr[data_tm[(j*4)+__RBYTE]] +\
+ Yg[data_tm[(j*4)+__GBYTE]] +\
+ Yb[data_tm[(j*4)+__BBYTE]];\
+ if((k%2)&&(i%2)){\
+ yuv->u[x_2+(i-x_offset)/2+((k-y_offset)/2+y_2)*y_width_2]=\
+ Ur[data_tm[(k*width_tm+i)*4+__RBYTE]] +\
+ Ug[data_tm[(k*width_tm+i)*4+__GBYTE]] +\
+ UbVr[data_tm[(k*width_tm+i)*4+__BBYTE]];\
+ yuv->v[x_2+(i-x_offset)/2+((k-y_offset)/2+y_2)*y_width_2]=\
+ UbVr[data_tm[(k*width_tm+i)*4+__RBYTE]] +\
+ Vg[data_tm[(k*width_tm+i)*4+__GBYTE]] +\
+ Vb[data_tm[(k*width_tm+i)*4+__BBYTE]] ;\
+ }\
+ }\
+ }\
+ }\
+}
+
+#define MARK_BACK_BUFFER_C( data,\
+ x_tm,\
+ y_tm,\
+ width_tm,\
+ height_tm,\
+ buffer_width,\
+ __bit_depth__){\
+ int k,i;\
+ register u_int##__bit_depth__##_t\
+ *datapi=\
+ ((u_int##__bit_depth__##_t *)data)+y_tm*buffer_width+x_tm;\
+ for(k=0;k<height_tm;k++){\
+ for(i=0;i<width_tm;i++){\
+ *datapi+=1;\
+ datapi++;\
+ }\
+ datapi+=buffer_width-width_tm;\
+ }\
+}
+
+
+/**
+* Fill Yr,Yg,Yb,Ur,Ug.Ub,Vr,Vg,Vb arrays(globals) with values.
+*/
+void MakeMatrices(void);
+
+
+#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-13 13:28:50
|
Revision: 532
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=532&view=rev
Author: enselic
Date: 2008-09-13 13:28:47 +0000 (Sat, 13 Sep 2008)
Log Message:
-----------
include/rmdtypes.h
include/recordmydesktop.h: Continue the globals killing spree by
putting pause_mutex and time_mutex in ProgData instead of having them
as globals.
src/get_frame.c
src/rmd_timer.c
src/cache_audio.c
src/cache_frame.c
src/capture_sound.c
src/initialize_data.c
src/encode_image_buffer.c
src/encode_sound_buffer.c: Adapt.
Modified Paths:
--------------
trunk/recordmydesktop/include/recordmydesktop.h
trunk/recordmydesktop/include/rmdtypes.h
trunk/recordmydesktop/src/cache_audio.c
trunk/recordmydesktop/src/cache_frame.c
trunk/recordmydesktop/src/capture_sound.c
trunk/recordmydesktop/src/encode_image_buffer.c
trunk/recordmydesktop/src/encode_sound_buffer.c
trunk/recordmydesktop/src/get_frame.c
trunk/recordmydesktop/src/initialize_data.c
trunk/recordmydesktop/src/rmd_timer.c
Modified: trunk/recordmydesktop/include/recordmydesktop.h
===================================================================
--- trunk/recordmydesktop/include/recordmydesktop.h 2008-09-13 13:13:46 UTC (rev 531)
+++ trunk/recordmydesktop/include/recordmydesktop.h 2008-09-13 13:28:47 UTC (rev 532)
@@ -50,7 +50,6 @@
/**Globals*/
//I've read somewhere that I'll go to hell for using globals...
-pthread_mutex_t pause_mutex,time_mutex;
unsigned char Yr[256],Yg[256],Yb[256],
Ur[256],Ug[256],UbVr[256],
Vg[256],Vb[256];
Modified: trunk/recordmydesktop/include/rmdtypes.h
===================================================================
--- trunk/recordmydesktop/include/rmdtypes.h 2008-09-13 13:13:46 UTC (rev 531)
+++ trunk/recordmydesktop/include/rmdtypes.h 2008-09-13 13:28:47 UTC (rev 532)
@@ -348,6 +348,9 @@
boolean aborted; //1 if we should abort
boolean pause_state_changed; //1 if pause state changed
+ pthread_mutex_t pause_mutex;
+ pthread_mutex_t time_mutex;
+
#ifdef HAVE_LIBASOUND
snd_pcm_t *sound_handle;
snd_pcm_uframes_t periodsize;
Modified: trunk/recordmydesktop/src/cache_audio.c
===================================================================
--- trunk/recordmydesktop/src/cache_audio.c 2008-09-13 13:13:46 UTC (rev 531)
+++ trunk/recordmydesktop/src/cache_audio.c 2008-09-13 13:28:47 UTC (rev 532)
@@ -43,9 +43,9 @@
SndBuffer *buff=NULL;
if (pdata->paused) {
- pthread_mutex_lock(&pause_mutex);
- pthread_cond_wait(&pdata->pause_cond,&pause_mutex);
- pthread_mutex_unlock(&pause_mutex);
+ pthread_mutex_lock(&pdata->pause_mutex);
+ pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
+ pthread_mutex_unlock(&pdata->pause_mutex);
}
if(!pdata->args.use_jack){
if(pdata->sound_buffer==NULL){
Modified: trunk/recordmydesktop/src/cache_frame.c
===================================================================
--- trunk/recordmydesktop/src/cache_frame.c 2008-09-13 13:13:46 UTC (rev 531)
+++ trunk/recordmydesktop/src/cache_frame.c 2008-09-13 13:28:47 UTC (rev 532)
@@ -116,9 +116,9 @@
pdata->th_enc_thread_waiting=0;
if (pdata->paused) {
- pthread_mutex_lock(&pause_mutex);
- pthread_cond_wait(&pdata->pause_cond,&pause_mutex);
- pthread_mutex_unlock(&pause_mutex);
+ pthread_mutex_lock(&pdata->pause_mutex);
+ pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
+ pthread_mutex_unlock(&pdata->pause_mutex);
}
pthread_mutex_lock(&pdata->yuv_mutex);
Modified: trunk/recordmydesktop/src/capture_sound.c
===================================================================
--- trunk/recordmydesktop/src/capture_sound.c 2008-09-13 13:13:46 UTC (rev 531)
+++ trunk/recordmydesktop/src/capture_sound.c 2008-09-13 13:28:47 UTC (rev 532)
@@ -43,16 +43,16 @@
#ifdef HAVE_LIBASOUND
if(!pdata->hard_pause){
snd_pcm_pause(pdata->sound_handle,1);
- pthread_mutex_lock(&pause_mutex);
- pthread_cond_wait(&pdata->pause_cond,&pause_mutex);
- pthread_mutex_unlock(&pause_mutex);
+ pthread_mutex_lock(&pdata->pause_mutex);
+ pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
+ pthread_mutex_unlock(&pdata->pause_mutex);
snd_pcm_pause(pdata->sound_handle,0);
}
else{//device doesn't support pause(is this the norm?mine doesn't)
snd_pcm_close(pdata->sound_handle);
- pthread_mutex_lock(&pause_mutex);
- pthread_cond_wait(&pdata->pause_cond,&pause_mutex);
- pthread_mutex_unlock(&pause_mutex);
+ pthread_mutex_lock(&pdata->pause_mutex);
+ pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
+ pthread_mutex_unlock(&pdata->pause_mutex);
pdata->sound_handle=
OpenDev(pdata->args.device,
&pdata->args.channels,
@@ -72,9 +72,9 @@
}
#else
close(pdata->sound_handle);
- pthread_mutex_lock(&pause_mutex);
- pthread_cond_wait(&pdata->pause_cond,&pause_mutex);
- pthread_mutex_unlock(&pause_mutex);
+ pthread_mutex_lock(&pdata->pause_mutex);
+ pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
+ pthread_mutex_unlock(&pdata->pause_mutex);
pdata->sound_handle=
OpenDev(pdata->args.device,
pdata->args.channels,
Modified: trunk/recordmydesktop/src/encode_image_buffer.c
===================================================================
--- trunk/recordmydesktop/src/encode_image_buffer.c 2008-09-13 13:13:46 UTC (rev 531)
+++ trunk/recordmydesktop/src/encode_image_buffer.c 2008-09-13 13:28:47 UTC (rev 532)
@@ -39,9 +39,9 @@
pdata->th_enc_thread_waiting=0;
encoder_busy=1;
if (pdata->paused) {
- pthread_mutex_lock(&pause_mutex);
- pthread_cond_wait(&pdata->pause_cond,&pause_mutex);
- pthread_mutex_unlock(&pause_mutex);
+ pthread_mutex_lock(&pdata->pause_mutex);
+ pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
+ pthread_mutex_unlock(&pdata->pause_mutex);
}
pthread_mutex_lock(&pdata->yuv_mutex);
Modified: trunk/recordmydesktop/src/encode_sound_buffer.c
===================================================================
--- trunk/recordmydesktop/src/encode_sound_buffer.c 2008-09-13 13:13:46 UTC (rev 531)
+++ trunk/recordmydesktop/src/encode_sound_buffer.c 2008-09-13 13:28:47 UTC (rev 532)
@@ -43,9 +43,9 @@
SndBuffer *buff=NULL;
if (pdata->paused) {
- pthread_mutex_lock(&pause_mutex);
- pthread_cond_wait(&pdata->pause_cond,&pause_mutex);
- pthread_mutex_unlock(&pause_mutex);
+ pthread_mutex_lock(&pdata->pause_mutex);
+ pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
+ pthread_mutex_unlock(&pdata->pause_mutex);
}
if(!pdata->args.use_jack){
if(pdata->sound_buffer==NULL){
Modified: trunk/recordmydesktop/src/get_frame.c
===================================================================
--- trunk/recordmydesktop/src/get_frame.c 2008-09-13 13:13:46 UTC (rev 531)
+++ trunk/recordmydesktop/src/get_frame.c 2008-09-13 13:28:47 UTC (rev 532)
@@ -390,9 +390,9 @@
//also before actually pausing we must make sure the streams
//are synced. sound stops so this should only happen quickly.
if(pdata->avd>0 || pdata->args.nosound){
- pthread_mutex_lock(&time_mutex);
- pthread_cond_wait(&pdata->time_cond,&time_mutex);
- pthread_mutex_unlock(&time_mutex);
+ pthread_mutex_lock(&pdata->time_mutex);
+ pthread_cond_wait(&pdata->time_cond, &pdata->time_mutex);
+ pthread_mutex_unlock(&pdata->time_mutex);
if (pdata->paused) {
//this is necessary since event loop processes
//the shortcuts which will unpause the program
Modified: trunk/recordmydesktop/src/initialize_data.c
===================================================================
--- trunk/recordmydesktop/src/initialize_data.c 2008-09-13 13:13:46 UTC (rev 531)
+++ trunk/recordmydesktop/src/initialize_data.c 2008-09-13 13:28:47 UTC (rev 532)
@@ -97,8 +97,8 @@
pthread_mutex_init(&pdata->vorbis_lib_mutex,NULL);
pthread_mutex_init(&pdata->libogg_mutex,NULL);
pthread_mutex_init(&pdata->yuv_mutex,NULL);
- pthread_mutex_init(&pause_mutex,NULL);
- pthread_mutex_init(&time_mutex,NULL);
+ pthread_mutex_init(&pdata->pause_mutex, NULL);
+ pthread_mutex_init(&pdata->time_mutex, NULL);
pthread_cond_init(&pdata->time_cond,NULL);
pthread_cond_init(&pdata->pause_cond,NULL);
pthread_cond_init(&pdata->image_buffer_ready,NULL);
Modified: trunk/recordmydesktop/src/rmd_timer.c
===================================================================
--- trunk/recordmydesktop/src/rmd_timer.c 2008-09-13 13:13:46 UTC (rev 531)
+++ trunk/recordmydesktop/src/rmd_timer.c 2008-09-13 13:28:47 UTC (rev 532)
@@ -53,9 +53,9 @@
else{
pdata->paused = FALSE;
fprintf(stderr,"STATE:RECORDING\n");fflush(stderr);
- pthread_mutex_lock(&pause_mutex);
+ pthread_mutex_lock(&pdata->pause_mutex);
pthread_cond_broadcast(&pdata->pause_cond);
- pthread_mutex_unlock(&pause_mutex);
+ pthread_mutex_unlock(&pdata->pause_mutex);
}
}
@@ -67,9 +67,9 @@
}
}
- pthread_mutex_lock(&time_mutex);
+ pthread_mutex_lock(&pdata->time_mutex);
pthread_cond_broadcast(&pdata->time_cond);
- pthread_mutex_unlock(&time_mutex);
+ pthread_mutex_unlock(&pdata->time_mutex);
if(secs_tw)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-13 13:13:50
|
Revision: 531
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=531&view=rev
Author: enselic
Date: 2008-09-13 13:13:46 +0000 (Sat, 13 Sep 2008)
Log Message:
-----------
include/recordmydesktop.h: Remove the globals time_cond and
pause_cond. They are completely unnecessary.
src/rmd_timer.c
src/initialize_data.c: Adapt.
Modified Paths:
--------------
trunk/recordmydesktop/include/recordmydesktop.h
trunk/recordmydesktop/src/initialize_data.c
trunk/recordmydesktop/src/rmd_timer.c
Modified: trunk/recordmydesktop/include/recordmydesktop.h
===================================================================
--- trunk/recordmydesktop/include/recordmydesktop.h 2008-09-13 12:52:30 UTC (rev 530)
+++ trunk/recordmydesktop/include/recordmydesktop.h 2008-09-13 13:13:46 UTC (rev 531)
@@ -50,7 +50,6 @@
/**Globals*/
//I've read somewhere that I'll go to hell for using globals...
-pthread_cond_t *time_cond,*pause_cond;
pthread_mutex_t pause_mutex,time_mutex;
unsigned char Yr[256],Yg[256],Yb[256],
Ur[256],Ug[256],UbVr[256],
Modified: trunk/recordmydesktop/src/initialize_data.c
===================================================================
--- trunk/recordmydesktop/src/initialize_data.c 2008-09-13 12:52:30 UTC (rev 530)
+++ trunk/recordmydesktop/src/initialize_data.c 2008-09-13 13:13:46 UTC (rev 531)
@@ -113,8 +113,6 @@
pdata->paused = FALSE;
pdata->aborted = FALSE;
pdata->pause_state_changed = FALSE;
- time_cond=&pdata->time_cond;
- pause_cond=&pdata->pause_cond;
if(!pdata->args.nosound){
if(!pdata->args.use_jack){
Modified: trunk/recordmydesktop/src/rmd_timer.c
===================================================================
--- trunk/recordmydesktop/src/rmd_timer.c 2008-09-13 12:52:30 UTC (rev 530)
+++ trunk/recordmydesktop/src/rmd_timer.c 2008-09-13 13:13:46 UTC (rev 531)
@@ -54,7 +54,7 @@
pdata->paused = FALSE;
fprintf(stderr,"STATE:RECORDING\n");fflush(stderr);
pthread_mutex_lock(&pause_mutex);
- pthread_cond_broadcast(pause_cond);
+ pthread_cond_broadcast(&pdata->pause_cond);
pthread_mutex_unlock(&pause_mutex);
}
@@ -68,7 +68,7 @@
}
pthread_mutex_lock(&time_mutex);
- pthread_cond_broadcast(time_cond);
+ pthread_cond_broadcast(&pdata->time_cond);
pthread_mutex_unlock(&time_mutex);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-13 12:52:32
|
Revision: 530
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=530&view=rev
Author: enselic
Date: 2008-09-13 12:52:30 +0000 (Sat, 13 Sep 2008)
Log Message:
-----------
include/rmdtypes.h: Make ProgData::running, paused, aborted and
pause_state_changed booleans.
src/rmd_jack.c
src/rmd_timer.c
src/rmd_rescue.c
src/encode_cache.c
src/capture_sound.c
src/initialize_data.c
src/register_callbacks.c: Adapt.
Modified Paths:
--------------
trunk/recordmydesktop/include/rmdtypes.h
trunk/recordmydesktop/src/capture_sound.c
trunk/recordmydesktop/src/encode_cache.c
trunk/recordmydesktop/src/initialize_data.c
trunk/recordmydesktop/src/register_callbacks.c
trunk/recordmydesktop/src/rmd_jack.c
trunk/recordmydesktop/src/rmd_rescue.c
trunk/recordmydesktop/src/rmd_timer.c
Modified: trunk/recordmydesktop/include/rmdtypes.h
===================================================================
--- trunk/recordmydesktop/include/rmdtypes.h 2008-09-13 12:37:57 UTC (rev 529)
+++ trunk/recordmydesktop/include/rmdtypes.h 2008-09-13 12:52:30 UTC (rev 530)
@@ -343,10 +343,10 @@
sound_framesize; //size of each sound frame
/** Progam state vars */
- int running; //1 while the program is capturing/paused/encoding
- int paused; //1 while the program is paused
- int aborted; //1 if we should abort
- int pause_state_changed;//1 if pause state changed
+ boolean running; //1 while the program is capturing/paused/encoding
+ boolean paused; //1 while the program is paused
+ boolean aborted; //1 if we should abort
+ boolean pause_state_changed; //1 if pause state changed
#ifdef HAVE_LIBASOUND
snd_pcm_t *sound_handle;
Modified: trunk/recordmydesktop/src/capture_sound.c
===================================================================
--- trunk/recordmydesktop/src/capture_sound.c 2008-09-13 12:37:57 UTC (rev 529)
+++ trunk/recordmydesktop/src/capture_sound.c 2008-09-13 12:52:30 UTC (rev 530)
@@ -65,7 +65,7 @@
);
if(pdata->sound_handle==NULL){
fprintf(stderr,"Couldn't reopen sound device.Exiting\n");
- pdata->running=0;
+ pdata->running = FALSE;
errno=3;
pthread_exit(&errno);
}
@@ -81,7 +81,7 @@
pdata->args.frequency);
if(pdata->sound_handle<0){
fprintf(stderr,"Couldn't reopen sound device.Exiting\n");
- pdata->running=0;
+ pdata->running = FALSE;
errno=3;
pthread_exit(&errno);
}
Modified: trunk/recordmydesktop/src/encode_cache.c
===================================================================
--- trunk/recordmydesktop/src/encode_cache.c 2008-09-13 12:37:57 UTC (rev 529)
+++ trunk/recordmydesktop/src/encode_cache.c 2008-09-13 12:52:30 UTC (rev 530)
@@ -37,7 +37,7 @@
" (resuming will not be possible, but\n"
"any portion of the video, which is already encoded won't be deleted).\n"
"Please wait...\n");
- pdata->running=1;
+ pdata->running = TRUE;
InitEncoder(pdata,pdata->enc_data,1);
//load encoding and flushing threads
if(!pdata->args.nosound){
Modified: trunk/recordmydesktop/src/initialize_data.c
===================================================================
--- trunk/recordmydesktop/src/initialize_data.c 2008-09-13 12:37:57 UTC (rev 529)
+++ trunk/recordmydesktop/src/initialize_data.c 2008-09-13 12:52:30 UTC (rev 530)
@@ -109,10 +109,10 @@
pdata->th_encoding_clean=pdata->v_encoding_clean=1;
pdata->avd=0;
pdata->sound_buffer=NULL;
- pdata->running=1;
- pdata->paused=0;
- pdata->aborted=0;
- pdata->pause_state_changed=0;
+ pdata->running = TRUE;
+ pdata->paused = FALSE;
+ pdata->aborted = FALSE;
+ pdata->pause_state_changed = FALSE;
time_cond=&pdata->time_cond;
pause_cond=&pdata->pause_cond;
Modified: trunk/recordmydesktop/src/register_callbacks.c
===================================================================
--- trunk/recordmydesktop/src/register_callbacks.c 2008-09-13 12:37:57 UTC (rev 529)
+++ trunk/recordmydesktop/src/register_callbacks.c 2008-09-13 12:52:30 UTC (rev 530)
@@ -40,17 +40,17 @@
static void SetPaused(int signum) {
- *pdata_pause_state_changed = 1;
+ *pdata_pause_state_changed = TRUE;
}
static void SetRunning(int signum) {
if (!*pdata_paused) {
- *pdata_running = 0;
+ *pdata_running = FALSE;
if (signum == SIGABRT) {
- *pdata_aborted = 1;
+ *pdata_aborted = TRUE;
}
}
}
Modified: trunk/recordmydesktop/src/rmd_jack.c
===================================================================
--- trunk/recordmydesktop/src/rmd_jack.c 2008-09-13 12:37:57 UTC (rev 529)
+++ trunk/recordmydesktop/src/rmd_jack.c 2008-09-13 12:52:30 UTC (rev 530)
@@ -210,7 +210,7 @@
static void JackShutdown(void *jdata_t) {
JackData *jdata = (JackData *)jdata_t;
- jdata->pdata->running = 0;
+ jdata->pdata->running = FALSE;
fprintf (stderr, "JACK shutdown\n");
}
Modified: trunk/recordmydesktop/src/rmd_rescue.c
===================================================================
--- trunk/recordmydesktop/src/rmd_rescue.c 2008-09-13 12:37:57 UTC (rev 529)
+++ trunk/recordmydesktop/src/rmd_rescue.c 2008-09-13 12:52:30 UTC (rev 530)
@@ -110,8 +110,8 @@
pdata.th_encoding_clean=pdata.v_encoding_clean=1;
pdata.avd=0;
pdata.sound_buffer=NULL;
- pdata.running=1;
- pdata.aborted=0;
+ pdata.running = TRUE;
+ pdata.aborted = FALSE;
RegisterCallbacks(&pdata);
fprintf(stderr,"Restoring %s!!!\n",path);
Modified: trunk/recordmydesktop/src/rmd_timer.c
===================================================================
--- trunk/recordmydesktop/src/rmd_timer.c 2008-09-13 12:37:57 UTC (rev 529)
+++ trunk/recordmydesktop/src/rmd_timer.c 2008-09-13 12:52:30 UTC (rev 530)
@@ -44,14 +44,14 @@
while(pdata->timer_alive){
if (pdata->pause_state_changed) {
- pdata->pause_state_changed = 0;
+ pdata->pause_state_changed = FALSE;
if (!pdata->paused) {
- pdata->paused = 1;
+ pdata->paused = TRUE;
fprintf(stderr,"STATE:PAUSED\n");fflush(stderr);
}
else{
- pdata->paused = 0;
+ pdata->paused = FALSE;
fprintf(stderr,"STATE:RECORDING\n");fflush(stderr);
pthread_mutex_lock(&pause_mutex);
pthread_cond_broadcast(pause_cond);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-13 12:38:01
|
Revision: 529
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=529&view=rev
Author: enselic
Date: 2008-09-13 12:37:57 +0000 (Sat, 13 Sep 2008)
Log Message:
-----------
include/recordmydesktop.h: Remove the globals Paused, Aborted and
PauseStateChanged.
include/rmdtypes.h: Add the previous globals as members in ProgData.
src/rmd_jack.c
src/get_frame.c
src/rmd_timer.c
src/rmd_rescue.c
src/cache_audio.c
src/cache_frame.c
src/capture_sound.c
src/initialize_data.c
src/recordmydesktop.c
src/register_callbacks.c
src/encode_image_buffer.c
src/encode_sound_buffer.c: Adapt.
Modified Paths:
--------------
trunk/recordmydesktop/include/recordmydesktop.h
trunk/recordmydesktop/include/rmdtypes.h
trunk/recordmydesktop/src/cache_audio.c
trunk/recordmydesktop/src/cache_frame.c
trunk/recordmydesktop/src/capture_sound.c
trunk/recordmydesktop/src/encode_image_buffer.c
trunk/recordmydesktop/src/encode_sound_buffer.c
trunk/recordmydesktop/src/get_frame.c
trunk/recordmydesktop/src/initialize_data.c
trunk/recordmydesktop/src/recordmydesktop.c
trunk/recordmydesktop/src/register_callbacks.c
trunk/recordmydesktop/src/rmd_jack.c
trunk/recordmydesktop/src/rmd_rescue.c
trunk/recordmydesktop/src/rmd_timer.c
Modified: trunk/recordmydesktop/include/recordmydesktop.h
===================================================================
--- trunk/recordmydesktop/include/recordmydesktop.h 2008-09-13 11:39:35 UTC (rev 528)
+++ trunk/recordmydesktop/include/recordmydesktop.h 2008-09-13 12:37:57 UTC (rev 529)
@@ -50,7 +50,6 @@
/**Globals*/
//I've read somewhere that I'll go to hell for using globals...
-int Paused, Aborted, PauseStateChanged;
pthread_cond_t *time_cond,*pause_cond;
pthread_mutex_t pause_mutex,time_mutex;
unsigned char Yr[256],Yg[256],Yb[256],
Modified: trunk/recordmydesktop/include/rmdtypes.h
===================================================================
--- trunk/recordmydesktop/include/rmdtypes.h 2008-09-13 11:39:35 UTC (rev 528)
+++ trunk/recordmydesktop/include/rmdtypes.h 2008-09-13 12:37:57 UTC (rev 529)
@@ -331,7 +331,6 @@
int damage_event, //damage event base code
damage_error, //damage error base code
shm_opcode, //MIT-Shm opcode
- running, //1 while the program is capturing/paused/encoding
dummy_p_size, //dummy pointer size,initially 16x16,always square
th_encoding_clean, //thread exit inidcator
v_encoding_clean, // >> >>
@@ -342,6 +341,13 @@
//we have to close and reopen
avd, //syncronization among audio and video
sound_framesize; //size of each sound frame
+
+ /** Progam state vars */
+ int running; //1 while the program is capturing/paused/encoding
+ int paused; //1 while the program is paused
+ int aborted; //1 if we should abort
+ int pause_state_changed;//1 if pause state changed
+
#ifdef HAVE_LIBASOUND
snd_pcm_t *sound_handle;
snd_pcm_uframes_t periodsize;
Modified: trunk/recordmydesktop/src/cache_audio.c
===================================================================
--- trunk/recordmydesktop/src/cache_audio.c 2008-09-13 11:39:35 UTC (rev 528)
+++ trunk/recordmydesktop/src/cache_audio.c 2008-09-13 12:37:57 UTC (rev 529)
@@ -42,7 +42,7 @@
while((pdata->running)){
SndBuffer *buff=NULL;
- if(Paused){
+ if (pdata->paused) {
pthread_mutex_lock(&pause_mutex);
pthread_cond_wait(&pdata->pause_cond,&pause_mutex);
pthread_mutex_unlock(&pause_mutex);
Modified: trunk/recordmydesktop/src/cache_frame.c
===================================================================
--- trunk/recordmydesktop/src/cache_frame.c 2008-09-13 11:39:35 UTC (rev 528)
+++ trunk/recordmydesktop/src/cache_frame.c 2008-09-13 12:37:57 UTC (rev 529)
@@ -115,7 +115,7 @@
pthread_mutex_unlock(&pdata->img_buff_ready_mutex);
pdata->th_enc_thread_waiting=0;
- if(Paused){
+ if (pdata->paused) {
pthread_mutex_lock(&pause_mutex);
pthread_cond_wait(&pdata->pause_cond,&pause_mutex);
pthread_mutex_unlock(&pause_mutex);
Modified: trunk/recordmydesktop/src/capture_sound.c
===================================================================
--- trunk/recordmydesktop/src/capture_sound.c 2008-09-13 11:39:35 UTC (rev 528)
+++ trunk/recordmydesktop/src/capture_sound.c 2008-09-13 12:37:57 UTC (rev 529)
@@ -39,7 +39,7 @@
while(pdata->running){
int sret=0;
SndBuffer *newbuf,*tmp;
- if(Paused){
+ if (pdata->paused) {
#ifdef HAVE_LIBASOUND
if(!pdata->hard_pause){
snd_pcm_pause(pdata->sound_handle,1);
Modified: trunk/recordmydesktop/src/encode_image_buffer.c
===================================================================
--- trunk/recordmydesktop/src/encode_image_buffer.c 2008-09-13 11:39:35 UTC (rev 528)
+++ trunk/recordmydesktop/src/encode_image_buffer.c 2008-09-13 12:37:57 UTC (rev 529)
@@ -38,7 +38,7 @@
pthread_mutex_unlock(&pdata->img_buff_ready_mutex);
pdata->th_enc_thread_waiting=0;
encoder_busy=1;
- if(Paused){
+ if (pdata->paused) {
pthread_mutex_lock(&pause_mutex);
pthread_cond_wait(&pdata->pause_cond,&pause_mutex);
pthread_mutex_unlock(&pause_mutex);
Modified: trunk/recordmydesktop/src/encode_sound_buffer.c
===================================================================
--- trunk/recordmydesktop/src/encode_sound_buffer.c 2008-09-13 11:39:35 UTC (rev 528)
+++ trunk/recordmydesktop/src/encode_sound_buffer.c 2008-09-13 12:37:57 UTC (rev 529)
@@ -42,7 +42,7 @@
int count=0,i,j;
SndBuffer *buff=NULL;
- if(Paused){
+ if (pdata->paused) {
pthread_mutex_lock(&pause_mutex);
pthread_cond_wait(&pdata->pause_cond,&pause_mutex);
pthread_mutex_unlock(&pause_mutex);
Modified: trunk/recordmydesktop/src/get_frame.c
===================================================================
--- trunk/recordmydesktop/src/get_frame.c 2008-09-13 11:39:35 UTC (rev 528)
+++ trunk/recordmydesktop/src/get_frame.c 2008-09-13 12:37:57 UTC (rev 529)
@@ -393,7 +393,7 @@
pthread_mutex_lock(&time_mutex);
pthread_cond_wait(&pdata->time_cond,&time_mutex);
pthread_mutex_unlock(&time_mutex);
- if(Paused){
+ if (pdata->paused) {
//this is necessary since event loop processes
//the shortcuts which will unpause the program
EventLoop(pdata);
Modified: trunk/recordmydesktop/src/initialize_data.c
===================================================================
--- trunk/recordmydesktop/src/initialize_data.c 2008-09-13 11:39:35 UTC (rev 528)
+++ trunk/recordmydesktop/src/initialize_data.c 2008-09-13 12:37:57 UTC (rev 529)
@@ -107,12 +107,14 @@
pthread_cond_init(&pdata->theora_lib_clean,NULL);
pthread_cond_init(&pdata->vorbis_lib_clean,NULL);
pdata->th_encoding_clean=pdata->v_encoding_clean=1;
- Paused=Aborted=pdata->avd=0;
+ pdata->avd=0;
pdata->sound_buffer=NULL;
pdata->running=1;
+ pdata->paused=0;
+ pdata->aborted=0;
+ pdata->pause_state_changed=0;
time_cond=&pdata->time_cond;
pause_cond=&pdata->pause_cond;
- PauseStateChanged=0;
if(!pdata->args.nosound){
if(!pdata->args.use_jack){
Modified: trunk/recordmydesktop/src/recordmydesktop.c
===================================================================
--- trunk/recordmydesktop/src/recordmydesktop.c 2008-09-13 11:39:35 UTC (rev 528)
+++ trunk/recordmydesktop/src/recordmydesktop.c 2008-09-13 12:37:57 UTC (rev 529)
@@ -151,7 +151,7 @@
//encode and then cleanup cache
if(!pdata.args.encOnTheFly && !pdata.args.no_encode){
- if(!Aborted){
+ if (!pdata.aborted) {
EncodeCache(&pdata);
}
fprintf(stderr,"Cleanning up cache...\n");
@@ -162,7 +162,7 @@
}
- if(Aborted && pdata.args.encOnTheFly){
+ if (pdata.aborted && pdata.args.encOnTheFly) {
if(remove(pdata.args.filename)){
perror("Error while removing file:\n");
return 1;
Modified: trunk/recordmydesktop/src/register_callbacks.c
===================================================================
--- trunk/recordmydesktop/src/register_callbacks.c 2008-09-13 11:39:35 UTC (rev 528)
+++ trunk/recordmydesktop/src/register_callbacks.c 2008-09-13 12:37:57 UTC (rev 529)
@@ -32,36 +32,40 @@
// There seem to be no way of passing user data to the signal handler,
// so hack around not being able to pass ProgData to them
-static int *pdata_running = NULL;
+static int *pdata_running = NULL;
+static int *pdata_paused = NULL;
+static int *pdata_aborted = NULL;
+static int *pdata_pause_state_changed = NULL;
static void SetPaused(int signum) {
- PauseStateChanged = 1;
+ *pdata_pause_state_changed = 1;
}
static void SetRunning(int signum) {
-
- if (!Paused){
- if (pdata_running != NULL) {
- *pdata_running = 0;
- }
+ if (!*pdata_paused) {
+ *pdata_running = 0;
+
if (signum == SIGABRT) {
- Aborted = 1;
+ *pdata_aborted = 1;
}
}
}
-void RegisterCallbacks(ProgData *pata) {
+void RegisterCallbacks(ProgData *pdata) {
struct sigaction pause_act;
struct sigaction end_act;
- // Is there some way to pass pata to the signal handlers?
- pdata_running = &pata->running;
-
+ // Is there some way to pass pdata to the signal handlers?
+ pdata_running = &pdata->running;
+ pdata_paused = &pdata->paused;
+ pdata_aborted = &pdata->aborted;
+ pdata_pause_state_changed = &pdata->pause_state_changed;
+
// Setup pause_act
sigfillset(&pause_act.sa_mask);
pause_act.sa_flags = SA_RESTART;
Modified: trunk/recordmydesktop/src/rmd_jack.c
===================================================================
--- trunk/recordmydesktop/src/rmd_jack.c 2008-09-13 11:39:35 UTC (rev 528)
+++ trunk/recordmydesktop/src/rmd_jack.c 2008-09-13 12:37:57 UTC (rev 529)
@@ -91,7 +91,7 @@
int i=0;
JackData *jdata=(JackData *)jdata_t;
- if (!jdata->pdata->running || Paused || !jdata->capture_started) {
+ if (!jdata->pdata->running || jdata->pdata->paused || !jdata->capture_started) {
return 0;
}
Modified: trunk/recordmydesktop/src/rmd_rescue.c
===================================================================
--- trunk/recordmydesktop/src/rmd_rescue.c 2008-09-13 11:39:35 UTC (rev 528)
+++ trunk/recordmydesktop/src/rmd_rescue.c 2008-09-13 12:37:57 UTC (rev 529)
@@ -108,9 +108,10 @@
pthread_cond_init(&pdata.theora_lib_clean,NULL);
pthread_cond_init(&pdata.vorbis_lib_clean,NULL);
pdata.th_encoding_clean=pdata.v_encoding_clean=1;
- Aborted=pdata.avd=0;
+ pdata.avd=0;
pdata.sound_buffer=NULL;
pdata.running=1;
+ pdata.aborted=0;
RegisterCallbacks(&pdata);
fprintf(stderr,"Restoring %s!!!\n",path);
Modified: trunk/recordmydesktop/src/rmd_timer.c
===================================================================
--- trunk/recordmydesktop/src/rmd_timer.c 2008-09-13 11:39:35 UTC (rev 528)
+++ trunk/recordmydesktop/src/rmd_timer.c 2008-09-13 12:37:57 UTC (rev 529)
@@ -43,15 +43,15 @@
while(pdata->timer_alive){
- if(PauseStateChanged){
- PauseStateChanged=0;
+ if (pdata->pause_state_changed) {
+ pdata->pause_state_changed = 0;
- if(!Paused){
- Paused=1;
+ if (!pdata->paused) {
+ pdata->paused = 1;
fprintf(stderr,"STATE:PAUSED\n");fflush(stderr);
}
else{
- Paused=0;
+ pdata->paused = 0;
fprintf(stderr,"STATE:RECORDING\n");fflush(stderr);
pthread_mutex_lock(&pause_mutex);
pthread_cond_broadcast(pause_cond);
@@ -60,7 +60,7 @@
}
- if(!Paused){
+ if (!pdata->paused) {
frames_total++;
if(capture_busy){
frames_lost++;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-13 08:37:28
|
Revision: 526
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=526&view=rev
Author: enselic
Date: 2008-09-13 08:37:22 +0000 (Sat, 13 Sep 2008)
Log Message:
-----------
include/rmdfunc.h: Removed RegisterCallbacks().
src/Makefile.am
src/register_callbacks.h: New file declaring RegisterCallbacks().
src/rmd_rescue.c
src/rmdthreads.c
src/register_callbacks.c: Include register_callbacks.h
Modified Paths:
--------------
trunk/recordmydesktop/include/rmdfunc.h
trunk/recordmydesktop/src/Makefile.am
trunk/recordmydesktop/src/register_callbacks.c
trunk/recordmydesktop/src/rmd_rescue.c
trunk/recordmydesktop/src/rmdthreads.c
Added Paths:
-----------
trunk/recordmydesktop/src/register_callbacks.h
Modified: trunk/recordmydesktop/include/rmdfunc.h
===================================================================
--- trunk/recordmydesktop/include/rmdfunc.h 2008-09-13 08:29:41 UTC (rev 525)
+++ trunk/recordmydesktop/include/rmdfunc.h 2008-09-13 08:37:22 UTC (rev 526)
@@ -91,12 +91,6 @@
void ClearList(RectArea **root);
/**
-* Set up all callbacks and signal handlers
-* \param pdata ProgData struct containing all program data
-*/
-void RegisterCallbacks(ProgArgs *args);
-
-/**
* Retrieve and apply all changes, if xdamage is used.
*
* \param dpy Connection to the server
Modified: trunk/recordmydesktop/src/Makefile.am
===================================================================
--- trunk/recordmydesktop/src/Makefile.am 2008-09-13 08:29:41 UTC (rev 525)
+++ trunk/recordmydesktop/src/Makefile.am 2008-09-13 08:37:22 UTC (rev 526)
@@ -24,6 +24,7 @@
rectinsert.c \
rectinsert.h \
register_callbacks.c \
+ register_callbacks.h \
rmd_cache.c \
rmd_error.c \
rmd_frame.c \
Modified: trunk/recordmydesktop/src/register_callbacks.c
===================================================================
--- trunk/recordmydesktop/src/register_callbacks.c 2008-09-13 08:29:41 UTC (rev 525)
+++ trunk/recordmydesktop/src/register_callbacks.c 2008-09-13 08:37:22 UTC (rev 526)
@@ -27,6 +27,7 @@
#include <signal.h>
#include "recordmydesktop.h"
+#include "register_callbacks.h"
static void SetPaused(int signum) {
Added: trunk/recordmydesktop/src/register_callbacks.h
===================================================================
--- trunk/recordmydesktop/src/register_callbacks.h (rev 0)
+++ trunk/recordmydesktop/src/register_callbacks.h 2008-09-13 08:37:22 UTC (rev 526)
@@ -0,0 +1,41 @@
+/******************************************************************************
+* recordMyDesktop *
+*******************************************************************************
+* *
+* Copyright (C) 2006,2007,2008 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 joh...@gm... *
+******************************************************************************/
+
+#ifndef REGISTER_CALLBACKS_H
+#define REGISTER_CALLBACKS_H 1
+
+
+#include "rmdtypes.h"
+
+
+/**
+* Set up all callbacks and signal handlers
+* \param pdata ProgData struct containing all program data
+*/
+void RegisterCallbacks(ProgArgs *args);
+
+
+#endif
Modified: trunk/recordmydesktop/src/rmd_rescue.c
===================================================================
--- trunk/recordmydesktop/src/rmd_rescue.c 2008-09-13 08:29:41 UTC (rev 525)
+++ trunk/recordmydesktop/src/rmd_rescue.c 2008-09-13 08:37:22 UTC (rev 526)
@@ -24,9 +24,8 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-
-
#include "recordmydesktop.h"
+#include "register_callbacks.h"
int rmdRescue(const char *path){
Modified: trunk/recordmydesktop/src/rmdthreads.c
===================================================================
--- trunk/recordmydesktop/src/rmdthreads.c 2008-09-13 08:29:41 UTC (rev 525)
+++ trunk/recordmydesktop/src/rmdthreads.c 2008-09-13 08:37:22 UTC (rev 526)
@@ -24,7 +24,6 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -36,9 +35,9 @@
#include "rmdfunc.h"
#include "rmdtypes.h"
+#include "register_callbacks.h"
-
void rmdThreads(ProgData *pdata){
pthread_t image_capture_t,
image_encode_t,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-13 08:29:44
|
Revision: 525
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=525&view=rev
Author: enselic
Date: 2008-09-13 08:29:41 +0000 (Sat, 13 Sep 2008)
Log Message:
-----------
src/initialize_data.c: Revert previous accidental commit.
Modified Paths:
--------------
trunk/recordmydesktop/src/initialize_data.c
Modified: trunk/recordmydesktop/src/initialize_data.c
===================================================================
--- trunk/recordmydesktop/src/initialize_data.c 2008-09-13 08:27:57 UTC (rev 524)
+++ trunk/recordmydesktop/src/initialize_data.c 2008-09-13 08:29:41 UTC (rev 525)
@@ -112,6 +112,7 @@
pdata->running=1;
time_cond=&pdata->time_cond;
pause_cond=&pdata->pause_cond;
+ Running=&pdata->running;
PauseStateChanged=0;
if(!pdata->args.nosound){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-13 08:28:00
|
Revision: 524
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=524&view=rev
Author: enselic
Date: 2008-09-13 08:27:57 +0000 (Sat, 13 Sep 2008)
Log Message:
-----------
include/rmdtypes.h: No need to include <signal.h>
src/load_cache.c
src/cache_frame.c
src/poll_events.c
src/initialize_data.c
src/register_callbacks.c: Include <signal.h>
Modified Paths:
--------------
trunk/recordmydesktop/include/rmdtypes.h
trunk/recordmydesktop/src/cache_frame.c
trunk/recordmydesktop/src/initialize_data.c
trunk/recordmydesktop/src/load_cache.c
trunk/recordmydesktop/src/poll_events.c
trunk/recordmydesktop/src/register_callbacks.c
Modified: trunk/recordmydesktop/include/rmdtypes.h
===================================================================
--- trunk/recordmydesktop/include/rmdtypes.h 2008-09-13 07:38:24 UTC (rev 523)
+++ trunk/recordmydesktop/include/rmdtypes.h 2008-09-13 08:27:57 UTC (rev 524)
@@ -38,7 +38,6 @@
#include <unistd.h>
#include <fcntl.h>
#include <time.h>
-#include <signal.h>
#include <sys/time.h>
#include <sys/types.h>
#ifdef HAVE_MACHINE_ENDIAN_H
Modified: trunk/recordmydesktop/src/cache_frame.c
===================================================================
--- trunk/recordmydesktop/src/cache_frame.c 2008-09-13 07:38:24 UTC (rev 523)
+++ trunk/recordmydesktop/src/cache_frame.c 2008-09-13 08:27:57 UTC (rev 524)
@@ -24,9 +24,11 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-#include <recordmydesktop.h>
+#include <signal.h>
+#include "recordmydesktop.h"
+
//minimize hard disk access
#define CACHE_OUT_BUFFER_SIZE 4096
//500 mb file size
Modified: trunk/recordmydesktop/src/initialize_data.c
===================================================================
--- trunk/recordmydesktop/src/initialize_data.c 2008-09-13 07:38:24 UTC (rev 523)
+++ trunk/recordmydesktop/src/initialize_data.c 2008-09-13 08:27:57 UTC (rev 524)
@@ -112,7 +112,6 @@
pdata->running=1;
time_cond=&pdata->time_cond;
pause_cond=&pdata->pause_cond;
- Running=&pdata->running;
PauseStateChanged=0;
if(!pdata->args.nosound){
Modified: trunk/recordmydesktop/src/load_cache.c
===================================================================
--- trunk/recordmydesktop/src/load_cache.c 2008-09-13 07:38:24 UTC (rev 523)
+++ trunk/recordmydesktop/src/load_cache.c 2008-09-13 08:27:57 UTC (rev 524)
@@ -24,6 +24,7 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include <signal.h>
#include "recordmydesktop.h"
Modified: trunk/recordmydesktop/src/poll_events.c
===================================================================
--- trunk/recordmydesktop/src/poll_events.c 2008-09-13 07:38:24 UTC (rev 523)
+++ trunk/recordmydesktop/src/poll_events.c 2008-09-13 08:27:57 UTC (rev 524)
@@ -24,7 +24,6 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -34,6 +33,7 @@
#include <X11/Xlib.h>
#include <X11/Xlibint.h>
#include <X11/extensions/Xdamage.h>
+#include <signal.h>
#include <pthread.h>
#include "rmdfunc.h"
Modified: trunk/recordmydesktop/src/register_callbacks.c
===================================================================
--- trunk/recordmydesktop/src/register_callbacks.c 2008-09-13 07:38:24 UTC (rev 523)
+++ trunk/recordmydesktop/src/register_callbacks.c 2008-09-13 08:27:57 UTC (rev 524)
@@ -24,6 +24,7 @@
* For further information contact me at joh...@gm... *
******************************************************************************/
+#include <signal.h>
#include "recordmydesktop.h"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-13 06:47:18
|
Revision: 521
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=521&view=rev
Author: enselic
Date: 2008-09-13 06:47:16 +0000 (Sat, 13 Sep 2008)
Log Message:
-----------
include/rmdfunc.h: Removed ParseArgs() declaration.
src/Makefile.am
src/parseargs.h: Added.
src/recordmydesktop.c: Include parseargs.h which contains the
ParseArgs() declaration.
Modified Paths:
--------------
trunk/recordmydesktop/include/rmdfunc.h
trunk/recordmydesktop/src/Makefile.am
trunk/recordmydesktop/src/recordmydesktop.c
Added Paths:
-----------
trunk/recordmydesktop/src/parseargs.h
Modified: trunk/recordmydesktop/include/rmdfunc.h
===================================================================
--- trunk/recordmydesktop/include/rmdfunc.h 2008-09-13 06:21:43 UTC (rev 520)
+++ trunk/recordmydesktop/include/rmdfunc.h 2008-09-13 06:47:16 UTC (rev 521)
@@ -197,19 +197,6 @@
int height);
/**
-* Fill ProgArgs struct with arguments entered at execution
-*
-* \param argc argc as entered from main
-*
-* \param argv argv as entered from main
-*
-* \param arg_return ProgArgs struct to be filled with the options
-*
-* \returns 0 on Success 1 on Failure
-*/
-boolean ParseArgs(int argc, char **argv, ProgArgs *arg_return);
-
-/**
* Check if needed extensions are present
*
* \param dpy Connection to the server
Modified: trunk/recordmydesktop/src/Makefile.am
===================================================================
--- trunk/recordmydesktop/src/Makefile.am 2008-09-13 06:21:43 UTC (rev 520)
+++ trunk/recordmydesktop/src/Makefile.am 2008-09-13 06:47:16 UTC (rev 521)
@@ -17,6 +17,7 @@
make_dummy_pointer.c \
opendev.c \
parseargs.c \
+ parseargs.h \
poll_events.c \
queryextensions.c \
recordmydesktop.c \
Added: trunk/recordmydesktop/src/parseargs.h
===================================================================
--- trunk/recordmydesktop/src/parseargs.h (rev 0)
+++ trunk/recordmydesktop/src/parseargs.h 2008-09-13 06:47:16 UTC (rev 521)
@@ -0,0 +1,47 @@
+/******************************************************************************
+* recordMyDesktop *
+*******************************************************************************
+* *
+* Copyright (C) 2006,2007,2008 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 joh...@gm... *
+******************************************************************************/
+
+#ifndef PARSEARGS_H
+#define PARSEARGS_H 1
+
+#include "rmdtypes.h"
+
+
+/**
+* Fill ProgArgs struct with arguments entered at execution
+*
+* \param argc argc as entered from main
+*
+* \param argv argv as entered from main
+*
+* \param arg_return ProgArgs struct to be filled with the options
+*
+* \returns 0 on Success 1 on Failure
+*/
+boolean ParseArgs(int argc, char **argv, ProgArgs *arg_return);
+
+
+#endif
Modified: trunk/recordmydesktop/src/recordmydesktop.c
===================================================================
--- trunk/recordmydesktop/src/recordmydesktop.c 2008-09-13 06:21:43 UTC (rev 520)
+++ trunk/recordmydesktop/src/recordmydesktop.c 2008-09-13 06:47:16 UTC (rev 521)
@@ -26,6 +26,7 @@
#include "recordmydesktop.h"
+#include "parseargs.h"
int main(int argc,char **argv){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-13 06:21:45
|
Revision: 520
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=520&view=rev
Author: enselic
Date: 2008-09-13 06:21:43 +0000 (Sat, 13 Sep 2008)
Log Message:
-----------
src/rmd_jack.c
src/get_frame.c
src/parseargs.c
src/load_cache.c
src/cache_frame.c
src/flush_to_ogg.c
src/init_encoder.c
src/initialize_data.c
src/register_callbacks.c: Make file-local functions static.
Modified Paths:
--------------
trunk/recordmydesktop/src/cache_frame.c
trunk/recordmydesktop/src/flush_to_ogg.c
trunk/recordmydesktop/src/get_frame.c
trunk/recordmydesktop/src/init_encoder.c
trunk/recordmydesktop/src/initialize_data.c
trunk/recordmydesktop/src/load_cache.c
trunk/recordmydesktop/src/parseargs.c
trunk/recordmydesktop/src/register_callbacks.c
trunk/recordmydesktop/src/rmd_jack.c
Modified: trunk/recordmydesktop/src/cache_frame.c
===================================================================
--- trunk/recordmydesktop/src/cache_frame.c 2008-09-13 06:03:29 UTC (rev 519)
+++ trunk/recordmydesktop/src/cache_frame.c 2008-09-13 06:21:43 UTC (rev 520)
@@ -33,14 +33,14 @@
#define CACHE_FILE_SIZE_LIMIT (500*1<<20)
-int FlushBlock(unsigned char *buf,
- int blockno,
- int width,
- int height,
- int blockwidth,
- gzFile *fp,
- FILE *ucfp,
- int flush){
+static int FlushBlock(unsigned char *buf,
+ int blockno,
+ int width,
+ int height,
+ int blockwidth,
+ gzFile *fp,
+ FILE *ucfp,
+ int flush) {
int j,i,
bytes_written=0,
block_i=(!blockwidth)?0:(blockno/(width/blockwidth)),//place on the grid
Modified: trunk/recordmydesktop/src/flush_to_ogg.c
===================================================================
--- trunk/recordmydesktop/src/flush_to_ogg.c 2008-09-13 06:03:29 UTC (rev 519)
+++ trunk/recordmydesktop/src/flush_to_ogg.c 2008-09-13 06:21:43 UTC (rev 520)
@@ -30,7 +30,7 @@
//will invalidate it. But we must have pages from
//both streams at every time in
//order to do correct multiplexing
-void ogg_page_cp(ogg_page *new,ogg_page *old){
+static void ogg_page_cp(ogg_page *new, ogg_page *old) {
int i=0;
register unsigned char *newp,*oldp;
@@ -50,7 +50,7 @@
}
//free our copy
-void ogg_page_cp_free(ogg_page *pg){
+static void ogg_page_cp_free(ogg_page *pg) {
pg->header_len=pg->body_len=0;
free(pg->header);
free(pg->body);
Modified: trunk/recordmydesktop/src/get_frame.c
===================================================================
--- trunk/recordmydesktop/src/get_frame.c 2008-09-13 06:03:29 UTC (rev 519)
+++ trunk/recordmydesktop/src/get_frame.c 2008-09-13 06:21:43 UTC (rev 520)
@@ -148,8 +148,10 @@
//besides taking the first screenshot, this functions primary purpose is to
//initialize the structures and memory.
-int FirstFrame(ProgData *pdata,XImage **image,XShmSegmentInfo *shminfo,
- char **pxl_data){
+static int FirstFrame(ProgData *pdata,
+ XImage **image,
+ XShmSegmentInfo *shminfo,
+ char **pxl_data) {
if((pdata->args.noshared)){
@@ -216,7 +218,7 @@
}
//make a deep copy
-void BRWinCpy(BRWindow *target,BRWindow *source){
+static void BRWinCpy(BRWindow *target, BRWindow *source) {
target->geom.x=source->geom.x;
target->geom.y=source->geom.y;
@@ -233,11 +235,11 @@
//recenters the capture area to the mouse
//without exiting the display bounding box
-void MoveCaptureArea( BRWindow *brwin,
- int cursor_x,
- int cursor_y,
- int width,
- int height){
+static void MoveCaptureArea(BRWindow *brwin,
+ int cursor_x,
+ int cursor_y,
+ int width,
+ int height) {
int t_x=0,t_y=0;
t_x=cursor_x-brwin->rgeom.width/2;
@@ -263,11 +265,11 @@
*
* \param blocknum_y Height of image in blocks
*/
-void BlocksFromList (RectArea **root,
- unsigned int x_offset,
- unsigned int y_offset,
- unsigned int blocknum_x,
- unsigned int blocknum_y) {
+static void BlocksFromList (RectArea **root,
+ unsigned int x_offset,
+ unsigned int y_offset,
+ unsigned int blocknum_x,
+ unsigned int blocknum_y) {
RectArea *temp;
unsigned int i,
Modified: trunk/recordmydesktop/src/init_encoder.c
===================================================================
--- trunk/recordmydesktop/src/init_encoder.c 2008-09-13 06:03:29 UTC (rev 519)
+++ trunk/recordmydesktop/src/init_encoder.c 2008-09-13 06:21:43 UTC (rev 520)
@@ -31,7 +31,7 @@
#include "skeleton.h"
-void m_add_fishead_packet(ogg_stream_state *m_ogg_state){
+static void m_add_fishead_packet(ogg_stream_state *m_ogg_state) {
fishead_packet skel_fp;
@@ -44,7 +44,7 @@
}
-int IncrementalNaming(char **name){
+static int IncrementalNaming(char **name) {
struct stat buff;
char *base_name__;
int i=0,
Modified: trunk/recordmydesktop/src/initialize_data.c
===================================================================
--- trunk/recordmydesktop/src/initialize_data.c 2008-09-13 06:03:29 UTC (rev 519)
+++ trunk/recordmydesktop/src/initialize_data.c 2008-09-13 06:21:43 UTC (rev 520)
@@ -29,10 +29,10 @@
#ifdef HAVE_LIBASOUND
-void FixBufferSize(snd_pcm_uframes_t *buffsize){
+static void FixBufferSize(snd_pcm_uframes_t *buffsize) {
snd_pcm_uframes_t buffsize_t=*buffsize,
#else
-void FixBufferSize(u_int32_t *buffsize){
+static void FixBufferSize(u_int32_t *buffsize) {
u_int32_t buffsize_t=*buffsize,
#endif
buffsize_ret=1;
Modified: trunk/recordmydesktop/src/load_cache.c
===================================================================
--- trunk/recordmydesktop/src/load_cache.c 2008-09-13 06:03:29 UTC (rev 519)
+++ trunk/recordmydesktop/src/load_cache.c 2008-09-13 06:21:43 UTC (rev 520)
@@ -53,12 +53,12 @@
}CachedFrame;
-void LoadBlock(unsigned char *dest,
- unsigned char *source,
- int blockno,
- int width,
- int height,
- int blockwidth){
+static void LoadBlock(unsigned char *dest,
+ unsigned char *source,
+ int blockno,
+ int width,
+ int height,
+ int blockwidth) {
int j,
block_i=blockno/(width/blockwidth),//place on the grid
block_k=blockno%(width/blockwidth);
@@ -69,7 +69,7 @@
}
//returns number of bytes
-int ReadZF(void * buffer,size_t size,size_t nmemb,FILE *ucfp,gzFile *ifp){
+static int ReadZF(void * buffer, size_t size, size_t nmemb, FILE *ucfp, gzFile *ifp) {
if((ifp!=NULL && ucfp!=NULL)||
(ifp==NULL && ucfp==NULL))
return -1;
@@ -80,7 +80,7 @@
return gzread(ifp,buffer,size*nmemb);
}
-int ReadFrame(CachedFrame *frame,FILE *ucfp,gzFile *ifp){
+static int ReadFrame(CachedFrame *frame, FILE *ucfp, gzFile *ifp) {
int index_entry_size=sizeof(u_int32_t);
if(frame->header->Ynum>0){
if(ReadZF(frame->YBlocks,
Modified: trunk/recordmydesktop/src/parseargs.c
===================================================================
--- trunk/recordmydesktop/src/parseargs.c 2008-09-13 06:03:29 UTC (rev 519)
+++ trunk/recordmydesktop/src/parseargs.c 2008-09-13 06:21:43 UTC (rev 520)
@@ -28,7 +28,7 @@
#include "recordmydesktop.h"
-void PrintConfig(void){
+static void PrintConfig(void) {
fprintf(stderr,"\nrecordMyDesktop was compiled with"
" the following options:\n\n");
#ifdef HAVE_JACK_H
Modified: trunk/recordmydesktop/src/register_callbacks.c
===================================================================
--- trunk/recordmydesktop/src/register_callbacks.c 2008-09-13 06:03:29 UTC (rev 519)
+++ trunk/recordmydesktop/src/register_callbacks.c 2008-09-13 06:21:43 UTC (rev 520)
@@ -28,14 +28,14 @@
#include "recordmydesktop.h"
-void SetPaused(int signum){
+static void SetPaused(int signum) {
PauseStateChanged=1;
}
-void SetRunning(int signum){
+static void SetRunning(int signum) {
if(!Paused){
*Running=0;
Modified: trunk/recordmydesktop/src/rmd_jack.c
===================================================================
--- trunk/recordmydesktop/src/rmd_jack.c 2008-09-13 06:03:29 UTC (rev 519)
+++ trunk/recordmydesktop/src/rmd_jack.c 2008-09-13 06:21:43 UTC (rev 520)
@@ -205,7 +205,7 @@
//the program should stop recording,
//encode the result(if not on the fly)
//an exit cleanly.
-void JackShutdown(void *jdata_t){
+static void JackShutdown(void *jdata_t) {
fprintf (stderr, "JACK shutdown\n");
*Running=0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: svn c. f. r. <rec...@li...> - 2008-09-13 06:03:32
|
Revision: 519
http://recordmydesktop.svn.sourceforge.net/recordmydesktop/?rev=519&view=rev
Author: enselic
Date: 2008-09-13 06:03:29 +0000 (Sat, 13 Sep 2008)
Log Message:
-----------
src/load_cache.c: Expand the unnecessary INIT_FRAME()-macro.
Modified Paths:
--------------
trunk/recordmydesktop/src/load_cache.c
Modified: trunk/recordmydesktop/src/load_cache.c
===================================================================
--- trunk/recordmydesktop/src/load_cache.c 2008-09-13 05:52:26 UTC (rev 518)
+++ trunk/recordmydesktop/src/load_cache.c 2008-09-13 06:03:29 UTC (rev 519)
@@ -38,18 +38,7 @@
#define Y_UNIT_BYTES 0x0100
#define UV_UNIT_BYTES 0x0040
-#define INIT_FRAME(frame_t,fheader_t,yuv_t,\
- YBlocks_t,UBlocks_t,VBlocks_t){\
- (frame_t)->header=(fheader_t);\
- (frame_t)->YBlocks=YBlocks_t;\
- (frame_t)->UBlocks=UBlocks_t;\
- (frame_t)->VBlocks=VBlocks_t;\
- (frame_t)->YData=malloc((yuv_t)->y_width*(yuv_t)->y_height);\
- (frame_t)->UData=malloc((yuv_t)->uv_width*(yuv_t)->uv_height);\
- (frame_t)->VData=malloc((yuv_t)->uv_width*(yuv_t)->uv_height);\
-};
-
//The frame after retrieval.
//Based on the Header information
//we can read the correct amount of bytes.
@@ -175,9 +164,16 @@
u_int32_t YBlocks[(yuv->y_width*yuv->y_height)/Y_UNIT_BYTES],
UBlocks[(yuv->uv_width*yuv->uv_height)/UV_UNIT_BYTES],
VBlocks[(yuv->uv_width*yuv->uv_height)/UV_UNIT_BYTES];
- //we allocate the frame that we will use
- INIT_FRAME(&frame,&fheader,yuv,
- YBlocks,UBlocks,VBlocks);
+
+ // We allocate the frame that we will use
+ frame.header = &fheader;
+ frame.YBlocks = YBlocks;
+ frame.UBlocks = UBlocks;
+ frame.VBlocks = VBlocks;
+ frame.YData = malloc(yuv->y_width * yuv->y_height);
+ frame.UData = malloc(yuv->uv_width * yuv->uv_height);
+ frame.VData = malloc(yuv->uv_width * yuv->uv_height);
+
//and the we open our files
if(!pdata->args.zerocompression){
ifp=gzopen(pdata->cache_data->imgdata,"rb");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|