diff options
author | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2007-01-29 05:49:07 +0000 |
---|---|---|
committer | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2007-01-29 05:49:07 +0000 |
commit | 46028c7ea0c7cd37d6c5e6c6196978afc950dce4 (patch) | |
tree | 94943bfa739d6611e17584383f84f72ec832b021 /recordmydesktop/include | |
parent | c1a890715d4791b75b9512c1d9b02cb691c5de39 (diff) |
Added support for compilation with OSS, instead of ALSA.
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@267 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/include')
-rw-r--r-- | recordmydesktop/include/rmdfunc.h | 22 | ||||
-rw-r--r-- | recordmydesktop/include/rmdmacro.h | 9 | ||||
-rw-r--r-- | recordmydesktop/include/rmdtypes.h | 17 |
3 files changed, 43 insertions, 5 deletions
diff --git a/recordmydesktop/include/rmdfunc.h b/recordmydesktop/include/rmdfunc.h index a4908d5..2f41c4d 100644 --- a/recordmydesktop/include/rmdfunc.h +++ b/recordmydesktop/include/rmdfunc.h @@ -283,9 +283,9 @@ void *CaptureSound(ProgData *pdata); * \param pdata ProgData struct containing all program data */ void *EncodeSoundBuffer(ProgData *pdata); - +#ifdef HAVE_LIBASOUND /** -* Try to open sound device, with the desired parameters, +* 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 @@ -314,6 +314,24 @@ snd_pcm_t *OpenDev( const char *pcm_dev, 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. * diff --git a/recordmydesktop/include/rmdmacro.h b/recordmydesktop/include/rmdmacro.h index c14785f..1fe06a4 100644 --- a/recordmydesktop/include/rmdmacro.h +++ b/recordmydesktop/include/rmdmacro.h @@ -99,6 +99,11 @@ #define Y_UNIT_BYTES 0x0100 #define UV_UNIT_BYTES 0x0040 +#ifdef HAVE_LIBASOUND + #define DEFAULT_AUDIO_DEVICE "hw:0,0" +#else + #define DEFAULT_AUDIO_DEVICE "/dev/dsp" +#endif #define CLIP_EVENT_AREA(e,brwin,wgeom){\ if(((e)->area.x<=(brwin)->rgeom.x)&&((e)->area.y<=(brwin)->rgeom.y)&&\ @@ -208,8 +213,8 @@ (args)->shared_thres=75;\ (args)->have_dummy_cursor=0;\ (args)->xfixes_cursor=1;\ - (args)->device=(char *)malloc(8);\ - strcpy((args)->device,"hw:0,0");\ + (args)->device=(char *)malloc(strlen(DEFAULT_AUDIO_DEVICE)+1);\ + strcpy((args)->device,DEFAULT_AUDIO_DEVICE);\ (args)->fps=15;\ (args)->channels=1;\ (args)->frequency=22050;\ diff --git a/recordmydesktop/include/rmdtypes.h b/recordmydesktop/include/rmdtypes.h index 7da30e9..5430ef4 100644 --- a/recordmydesktop/include/rmdtypes.h +++ b/recordmydesktop/include/rmdtypes.h @@ -60,7 +60,13 @@ #include <vorbis/codec.h> #include <vorbis/vorbisenc.h> #include <ogg/ogg.h> -#include <alsa/asoundlib.h> + +#ifdef HAVE_LIBASOUND + #include <alsa/asoundlib.h> +#else + #include <sys/ioctl.h> + #include <sys/soundcard.h> +#endif //this type exists only //for comparing the planes at caching. @@ -137,7 +143,11 @@ typedef struct _ProgArgs{ unsigned int frequency; //desired frequency (default 22050) unsigned int channels; //no of channels(default 2) char *device; //default sound device +#ifdef HAVE_LIBASOUND snd_pcm_uframes_t buffsize; //buffer size(in frames) for sound capturing +#else + u_int32_t buffsize; +#endif int nosound; //do not record sound(default 0) int noshared; //do not use shared memory extension(default 1) int nocondshared; //do not use shared memory on large image aquititions @@ -283,8 +293,13 @@ typedef struct _ProgData{ v_encoding_clean; int v_enc_thread_waiting, //these indicate a wait th_enc_thread_waiting; //condition on the above cond vars +#ifdef HAVE_LIBASOUND snd_pcm_t *sound_handle; snd_pcm_uframes_t periodsize; +#else + int sound_handle; + u_int32_t periodsize; +#endif }ProgData; |