summaryrefslogtreecommitdiff
path: root/recordmydesktop/include/rmdmacro.h
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-02-07 18:44:02 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-02-07 18:44:02 +0000
commit9c05582a007788295d872172c5109ae9bccfcf68 (patch)
tree6c2275255f4c38d819b27da2978e7f74715c8050 /recordmydesktop/include/rmdmacro.h
parentf39f779f299cd78a574999830699e30f92932f06 (diff)
Added support for recording audio through jack.
libjack is dlopened so there's no runtime dependency on it. Ports must be connected at startup. New files: src/rmd_jack.c git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@273 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/include/rmdmacro.h')
-rw-r--r--recordmydesktop/include/rmdmacro.h43
1 files changed, 31 insertions, 12 deletions
diff --git a/recordmydesktop/include/rmdmacro.h b/recordmydesktop/include/rmdmacro.h
index 1fe06a4..982f986 100644
--- a/recordmydesktop/include/rmdmacro.h
+++ b/recordmydesktop/include/rmdmacro.h
@@ -105,6 +105,11 @@
#define DEFAULT_AUDIO_DEVICE "/dev/dsp"
#endif
+#ifdef HAVE_JACK_H
+ #define BUFFERS_IN_RING 0x0020
+#endif
+
+
#define CLIP_EVENT_AREA(e,brwin,wgeom){\
if(((e)->area.x<=(brwin)->rgeom.x)&&((e)->area.y<=(brwin)->rgeom.y)&&\
((e)->area.width>=(brwin)->rgeom.width)&&\
@@ -204,7 +209,10 @@
(args)->nowmcheck=\
(args)->dropframes=\
(args)->overwrite=\
+ (args)->use_jack=\
+ (args)->jack_nports=\
(args)->nocondshared=0;\
+ (args)->jack_port_names=NULL;\
(args)->no_quick_subsample=\
(args)->noshared=1;\
(args)->filename=(char *)malloc(8);\
@@ -251,13 +259,13 @@
t3=*datapi_next;\
t4=*(datapi_next+1);\
t_val=((((t1&0xff000000) +(t2&0xff000000)+\
- (t3&0xff000000)+(t4&0xff000000))/4)&0xff000000) \
- +((((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);\
+ (t3&0xff000000)+(t4&0xff000000))/4)&0xff000000)+\
+ ((((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 CALC_TVAL_AVG_16(t_val,datapi,datapi_next){\
@@ -267,11 +275,11 @@
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);\
+ (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 UPDATE_Y_PLANE(data,\
@@ -494,8 +502,19 @@
free((frame_t)->VData);\
};
+#ifdef HAVE_JACK_H
+#define CHECK_DLERRORS_FATAL(__error_p)\
+ if((__error_p=dlerror())!=NULL){\
+ fprintf(stderr,"%s\n",__error_p);\
+ return 1;\
+ }
+#define DLSYM_AND_CHECK(lib_handle,__call_name__,__error_p)\
+ __call_name__##_p=dlsym(lib_handle,#__call_name__);\
+ CHECK_DLERRORS_FATAL(__error_p)
+
+#endif
#endif
© All Rights Reserved