int snd_pcm_poll_descriptors_count(snd_pcm_t *pcm)
{
assert(pcm);
- return 1;
+ if (pcm->ops->poll_descriptors_count)
+ return pcm->ops->poll_descriptors_count(pcm->op_arg);
+ return pcm->poll_fd_count;
}
int err;
assert(pcm && pfds);
+ if (pcm->ops->poll_descriptors)
+ return pcm->ops->poll_descriptors(pcm->op_arg, pfds, space);
if (pcm->fast_ops->poll_ask) {
err = pcm->fast_ops->poll_ask(pcm->fast_op_arg);
if (err < 0)
.dump = snd_pcm_adpcm_dump,
.nonblock = snd_pcm_generic_nonblock,
.async = snd_pcm_generic_async,
+ .poll_descriptors_count = snd_pcm_generic_poll_descriptors_count,
+ .poll_descriptors = snd_pcm_generic_poll_descriptors,
.poll_revents = snd_pcm_generic_poll_revents,
.mmap = snd_pcm_generic_mmap,
.munmap = snd_pcm_generic_munmap,
.dump = snd_pcm_alaw_dump,
.nonblock = snd_pcm_generic_nonblock,
.async = snd_pcm_generic_async,
+ .poll_descriptors_count = snd_pcm_generic_poll_descriptors_count,
+ .poll_descriptors = snd_pcm_generic_poll_descriptors,
.poll_revents = snd_pcm_generic_poll_revents,
.mmap = snd_pcm_generic_mmap,
.munmap = snd_pcm_generic_munmap,
.dump = snd_pcm_copy_dump,
.nonblock = snd_pcm_generic_nonblock,
.async = snd_pcm_generic_async,
+ .poll_descriptors_count = snd_pcm_generic_poll_descriptors_count,
+ .poll_descriptors = snd_pcm_generic_poll_descriptors,
.poll_revents = snd_pcm_generic_poll_revents,
.mmap = snd_pcm_generic_mmap,
.munmap = snd_pcm_generic_munmap,
.dump = snd_pcm_file_dump,
.nonblock = snd_pcm_generic_nonblock,
.async = snd_pcm_generic_async,
+ .poll_descriptors_count = snd_pcm_generic_poll_descriptors_count,
+ .poll_descriptors = snd_pcm_generic_poll_descriptors,
.poll_revents = snd_pcm_generic_poll_revents,
.mmap = snd_pcm_file_mmap,
.munmap = snd_pcm_file_munmap,
return snd_pcm_async(generic->slave, sig, pid);
}
+int snd_pcm_generic_poll_descriptors_count(snd_pcm_t *pcm)
+{
+ snd_pcm_generic_t *generic = pcm->private_data;
+ return snd_pcm_poll_descriptors_count(generic->slave);
+}
+
+int snd_pcm_generic_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space)
+{
+ snd_pcm_generic_t *generic = pcm->private_data;
+ return snd_pcm_poll_descriptors(generic->slave, pfds, space);
+}
+
int snd_pcm_generic_poll_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents)
{
snd_pcm_generic_t *generic = pcm->private_data;
int snd_pcm_generic_close(snd_pcm_t *pcm);
int snd_pcm_generic_nonblock(snd_pcm_t *pcm, int nonblock);
int snd_pcm_generic_async(snd_pcm_t *pcm, int sig, pid_t pid);
+int snd_pcm_generic_poll_descriptors_count(snd_pcm_t *pcm);
+int snd_pcm_generic_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space);
int snd_pcm_generic_poll_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
int snd_pcm_generic_info(snd_pcm_t *pcm, snd_pcm_info_t * info);
int snd_pcm_generic_hw_free(snd_pcm_t *pcm);
.dump = snd_pcm_hooks_dump,
.nonblock = snd_pcm_generic_nonblock,
.async = snd_pcm_generic_async,
+ .poll_descriptors_count = snd_pcm_generic_poll_descriptors_count,
+ .poll_descriptors = snd_pcm_generic_poll_descriptors,
+ .poll_revents = snd_pcm_generic_poll_revents,
.mmap = snd_pcm_generic_mmap,
.munmap = snd_pcm_generic_munmap,
};
.dump = snd_pcm_iec958_dump,
.nonblock = snd_pcm_generic_nonblock,
.async = snd_pcm_generic_async,
+ .poll_descriptors_count = snd_pcm_generic_poll_descriptors_count,
+ .poll_descriptors = snd_pcm_generic_poll_descriptors,
.poll_revents = snd_pcm_generic_poll_revents,
.mmap = snd_pcm_generic_mmap,
.munmap = snd_pcm_generic_munmap,
.dump = snd_pcm_ladspa_dump,
.nonblock = snd_pcm_generic_nonblock,
.async = snd_pcm_generic_async,
+ .poll_descriptors_count = snd_pcm_generic_poll_descriptors_count,
+ .poll_descriptors = snd_pcm_generic_poll_descriptors,
.poll_revents = snd_pcm_generic_poll_revents,
.mmap = snd_pcm_generic_mmap,
.munmap = snd_pcm_generic_munmap,
.dump = snd_pcm_lfloat_dump,
.nonblock = snd_pcm_generic_nonblock,
.async = snd_pcm_generic_async,
+ .poll_descriptors_count = snd_pcm_generic_poll_descriptors_count,
+ .poll_descriptors = snd_pcm_generic_poll_descriptors,
.poll_revents = snd_pcm_generic_poll_revents,
.mmap = snd_pcm_generic_mmap,
.munmap = snd_pcm_generic_munmap,
.dump = snd_pcm_linear_dump,
.nonblock = snd_pcm_generic_nonblock,
.async = snd_pcm_generic_async,
+ .poll_descriptors_count = snd_pcm_generic_poll_descriptors_count,
+ .poll_descriptors = snd_pcm_generic_poll_descriptors,
.poll_revents = snd_pcm_generic_poll_revents,
.mmap = snd_pcm_generic_mmap,
.munmap = snd_pcm_generic_munmap,
int (*close)(snd_pcm_t *pcm);
int (*nonblock)(snd_pcm_t *pcm, int nonblock);
int (*async)(snd_pcm_t *pcm, int sig, pid_t pid);
+ int (*poll_descriptors_count)(snd_pcm_t *pcm);
+ int (*poll_descriptors)(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space);
int (*poll_revents)(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
int (*info)(snd_pcm_t *pcm, snd_pcm_info_t *info);
int (*hw_refine)(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
.dump = snd_pcm_mulaw_dump,
.nonblock = snd_pcm_generic_nonblock,
.async = snd_pcm_generic_async,
+ .poll_descriptors_count = snd_pcm_generic_poll_descriptors_count,
+ .poll_descriptors = snd_pcm_generic_poll_descriptors,
.poll_revents = snd_pcm_generic_poll_revents,
.mmap = snd_pcm_generic_mmap,
.munmap = snd_pcm_generic_munmap,
return snd_pcm_async(slave_0, sig, pid);
}
+static int snd_pcm_multi_poll_descriptors_count(snd_pcm_t *pcm)
+{
+ snd_pcm_multi_t *multi = pcm->private_data;
+ snd_pcm_t *slave_0 = multi->slaves[multi->master_slave].pcm;
+ return snd_pcm_poll_descriptors_count(slave_0);
+}
+
+static int snd_pcm_multi_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space)
+{
+ snd_pcm_multi_t *multi = pcm->private_data;
+ snd_pcm_t *slave_0 = multi->slaves[multi->master_slave].pcm;
+ return snd_pcm_poll_descriptors(slave_0, pfds, space);
+}
+
+static int snd_pcm_multi_poll_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents)
+{
+ snd_pcm_multi_t *multi = pcm->private_data;
+ snd_pcm_t *slave_0 = multi->slaves[multi->master_slave].pcm;
+ return snd_pcm_poll_descriptors_revents(slave_0, pfds, nfds, revents);
+}
+
static int snd_pcm_multi_info(snd_pcm_t *pcm, snd_pcm_info_t *info)
{
snd_pcm_multi_t *multi = pcm->private_data;
.dump = snd_pcm_multi_dump,
.nonblock = snd_pcm_multi_nonblock,
.async = snd_pcm_multi_async,
+ .poll_descriptors_count = snd_pcm_multi_poll_descriptors_count,
+ .poll_descriptors = snd_pcm_multi_poll_descriptors,
+ .poll_revents = snd_pcm_multi_poll_revents,
.mmap = snd_pcm_multi_mmap,
.munmap = snd_pcm_multi_munmap,
};
.dump = snd_pcm_plug_dump,
.nonblock = snd_pcm_generic_nonblock,
.async = snd_pcm_generic_async,
+ .poll_descriptors_count = snd_pcm_generic_poll_descriptors_count,
+ .poll_descriptors = snd_pcm_generic_poll_descriptors,
.poll_revents = snd_pcm_generic_poll_revents,
.mmap = snd_pcm_plug_mmap,
.munmap = snd_pcm_plug_munmap,
.dump = snd_pcm_rate_dump,
.nonblock = snd_pcm_generic_nonblock,
.async = snd_pcm_generic_async,
+ .poll_descriptors_count = snd_pcm_generic_poll_descriptors_count,
+ .poll_descriptors = snd_pcm_generic_poll_descriptors,
.poll_revents = snd_pcm_generic_poll_revents,
.mmap = snd_pcm_generic_mmap,
.munmap = snd_pcm_generic_munmap,
.dump = snd_pcm_route_dump,
.nonblock = snd_pcm_generic_nonblock,
.async = snd_pcm_generic_async,
+ .poll_descriptors_count = snd_pcm_generic_poll_descriptors_count,
+ .poll_descriptors = snd_pcm_generic_poll_descriptors,
.poll_revents = snd_pcm_generic_poll_revents,
.mmap = snd_pcm_generic_mmap,
.munmap = snd_pcm_generic_munmap,
.dump = snd_pcm_softvol_dump,
.nonblock = snd_pcm_generic_nonblock,
.async = snd_pcm_generic_async,
+ .poll_descriptors_count = snd_pcm_generic_poll_descriptors_count,
+ .poll_descriptors = snd_pcm_generic_poll_descriptors,
.poll_revents = snd_pcm_generic_poll_revents,
.mmap = snd_pcm_generic_mmap,
.munmap = snd_pcm_generic_munmap,