Moved ring buffer pointers and added a mechanism to transfer them via shm

This commit is contained in:
Jaroslav Kysela 2002-04-23 15:51:29 +00:00
parent f063381430
commit c941c548f8
26 changed files with 469 additions and 171 deletions

View file

@ -47,12 +47,21 @@ typedef enum _snd_transport_type {
#define SND_PCM_IOCTL_ASYNC _IO ('A', 0xf6)
#define SND_PCM_IOCTL_CLOSE _IO ('A', 0xf7)
#define SND_PCM_IOCTL_POLL_DESCRIPTOR _IO ('A', 0xf8)
#define SND_PCM_IOCTL_HW_PTR_FD _IO ('A', 0xf9)
#define SND_PCM_IOCTL_APPL_PTR_FD _IO ('A', 0xfa)
typedef struct {
snd_pcm_uframes_t ptr;
int use_mmap;
off_t offset; /* for mmap */
int changed;
} snd_pcm_shm_rbptr_t;
typedef struct {
long result;
int cmd;
snd_pcm_uframes_t hw_ptr;
snd_pcm_uframes_t appl_ptr;
snd_pcm_shm_rbptr_t hw;
snd_pcm_shm_rbptr_t appl;
union {
struct {
int sig;
@ -80,6 +89,11 @@ typedef struct {
snd_pcm_uframes_t offset;
snd_pcm_uframes_t frames;
} mmap_commit;
struct {
char use_mmap;
int shmid;
off_t offset;
} rbptr;
} u;
char data[0];
} snd_pcm_shm_ctrl_t;

View file

@ -139,6 +139,7 @@ typedef enum _snd_set_mode {
size_t page_align(size_t size);
size_t page_size(void);
size_t page_ptr(size_t object_offset, size_t object_size, size_t *offset, size_t *mmap_offset);
int safe_strtol(const char *str, long *val);

View file

@ -827,8 +827,8 @@ int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int
snd_pcm_sframes_t snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes);
ssize_t snd_pcm_frames_to_bytes(snd_pcm_t *pcm, snd_pcm_sframes_t frames);
int snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes);
ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, int samples);
long snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes);
ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, long samples);
int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
unsigned int samples, snd_pcm_format_t format);