mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Remove poll_ask callback
Removed poll_ask callbacks. poll_ask function is merged to poll_descriptors callbacks.
This commit is contained in:
parent
e61d385993
commit
a6d3b9e4e0
18 changed files with 24 additions and 55 deletions
|
|
@ -1310,11 +1310,6 @@ int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int s
|
|||
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)
|
||||
return err;
|
||||
}
|
||||
if (pcm->poll_fd < 0) {
|
||||
SNDMSG("poll_fd < 0");
|
||||
return -EIO;
|
||||
|
|
|
|||
|
|
@ -675,7 +675,6 @@ static snd_pcm_fast_ops_t snd_pcm_dmix_fast_ops = {
|
|||
.rewind = snd_pcm_dmix_rewind,
|
||||
.forward = snd_pcm_dmix_forward,
|
||||
.resume = snd_pcm_dmix_resume,
|
||||
.poll_ask = NULL,
|
||||
.link_fd = NULL,
|
||||
.link = NULL,
|
||||
.unlink = NULL,
|
||||
|
|
|
|||
|
|
@ -493,7 +493,6 @@ static snd_pcm_fast_ops_t snd_pcm_dshare_fast_ops = {
|
|||
.rewind = snd_pcm_dshare_rewind,
|
||||
.forward = snd_pcm_dshare_forward,
|
||||
.resume = snd_pcm_dshare_resume,
|
||||
.poll_ask = NULL,
|
||||
.link_fd = NULL,
|
||||
.link = NULL,
|
||||
.unlink = NULL,
|
||||
|
|
|
|||
|
|
@ -459,7 +459,6 @@ static snd_pcm_fast_ops_t snd_pcm_dsnoop_fast_ops = {
|
|||
.rewind = snd_pcm_dsnoop_rewind,
|
||||
.forward = snd_pcm_dsnoop_forward,
|
||||
.resume = snd_pcm_dsnoop_resume,
|
||||
.poll_ask = NULL,
|
||||
.link_fd = NULL,
|
||||
.link = NULL,
|
||||
.unlink = NULL,
|
||||
|
|
|
|||
|
|
@ -368,7 +368,6 @@ static snd_pcm_fast_ops_t snd_pcm_file_fast_ops = {
|
|||
.rewind = snd_pcm_file_rewind,
|
||||
.forward = snd_pcm_file_forward,
|
||||
.resume = snd_pcm_generic_resume,
|
||||
.poll_ask = snd_pcm_generic_poll_ask,
|
||||
.link_fd = snd_pcm_generic_link_fd,
|
||||
.link = snd_pcm_generic_link,
|
||||
.unlink = snd_pcm_generic_unlink,
|
||||
|
|
|
|||
|
|
@ -193,14 +193,6 @@ snd_pcm_sframes_t snd_pcm_generic_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frame
|
|||
return snd_pcm_rewind(generic->slave, frames);
|
||||
}
|
||||
|
||||
int snd_pcm_generic_poll_ask(snd_pcm_t *pcm)
|
||||
{
|
||||
snd_pcm_generic_t *generic = pcm->private_data;
|
||||
if (generic->slave->fast_ops->poll_ask)
|
||||
return generic->slave->fast_ops->poll_ask(generic->slave->fast_op_arg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int snd_pcm_generic_link_fd(snd_pcm_t *pcm, int *fds, int count, int (**failed)(snd_pcm_t *, int))
|
||||
{
|
||||
snd_pcm_generic_t *generic = pcm->private_data;
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ int snd_pcm_generic_resume(snd_pcm_t *pcm);
|
|||
int snd_pcm_generic_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
|
||||
snd_pcm_sframes_t snd_pcm_generic_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
|
||||
snd_pcm_sframes_t snd_pcm_generic_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
|
||||
int snd_pcm_generic_poll_ask(snd_pcm_t *pcm);
|
||||
int snd_pcm_generic_link_fd(snd_pcm_t *pcm, int *fds, int count, int (**failed)(snd_pcm_t *, int));
|
||||
int snd_pcm_generic_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2);
|
||||
int snd_pcm_generic_link2(snd_pcm_t *pcm1, snd_pcm_t *pcm2);
|
||||
|
|
|
|||
|
|
@ -151,7 +151,6 @@ static snd_pcm_fast_ops_t snd_pcm_hooks_fast_ops = {
|
|||
.rewind = snd_pcm_generic_rewind,
|
||||
.forward = snd_pcm_generic_forward,
|
||||
.resume = snd_pcm_generic_resume,
|
||||
.poll_ask = snd_pcm_generic_poll_ask,
|
||||
.link_fd = snd_pcm_generic_link_fd,
|
||||
.link = snd_pcm_generic_link,
|
||||
.unlink = snd_pcm_generic_unlink,
|
||||
|
|
|
|||
|
|
@ -1021,7 +1021,6 @@ static snd_pcm_fast_ops_t snd_pcm_hw_fast_ops = {
|
|||
.rewind = snd_pcm_hw_rewind,
|
||||
.forward = snd_pcm_hw_forward,
|
||||
.resume = snd_pcm_hw_resume,
|
||||
.poll_ask = NULL,
|
||||
.link_fd = snd_pcm_hw_link_fd,
|
||||
.link = snd_pcm_hw_link,
|
||||
.unlink = snd_pcm_hw_unlink,
|
||||
|
|
|
|||
|
|
@ -738,7 +738,6 @@ static snd_pcm_fast_ops_t snd_pcm_ioplug_fast_ops = {
|
|||
.hwsync = snd_pcm_ioplug_hwsync,
|
||||
.delay = snd_pcm_ioplug_delay,
|
||||
.resume = snd_pcm_ioplug_resume,
|
||||
.poll_ask = NULL,
|
||||
.link_fd = NULL,
|
||||
.link = NULL,
|
||||
.unlink = NULL,
|
||||
|
|
|
|||
|
|
@ -158,7 +158,6 @@ typedef struct {
|
|||
int (*hwsync)(snd_pcm_t *pcm);
|
||||
int (*delay)(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
|
||||
int (*resume)(snd_pcm_t *pcm);
|
||||
int (*poll_ask)(snd_pcm_t *pcm);
|
||||
int (*link_fd)(snd_pcm_t *pcm, int *fds, int count, int (**failed)(snd_pcm_t *, int));
|
||||
int (*link)(snd_pcm_t *pcm1, snd_pcm_t *pcm2);
|
||||
int (*unlink)(snd_pcm_t *pcm);
|
||||
|
|
|
|||
|
|
@ -533,7 +533,6 @@ static snd_pcm_fast_ops_t snd_pcm_meter_fast_ops = {
|
|||
.rewind = snd_pcm_meter_rewind,
|
||||
.forward = snd_pcm_meter_forward,
|
||||
.resume = snd_pcm_generic_resume,
|
||||
.poll_ask = snd_pcm_generic_poll_ask,
|
||||
.writei = snd_pcm_mmap_writei,
|
||||
.writen = snd_pcm_mmap_writen,
|
||||
.readi = snd_pcm_mmap_readi,
|
||||
|
|
|
|||
|
|
@ -105,7 +105,20 @@ static int snd_pcm_multi_poll_descriptors_count(snd_pcm_t *pcm)
|
|||
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;
|
||||
snd_pcm_t *slave_0 = multi->slaves[multi->master_slave].pcm;
|
||||
int err;
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < multi->slaves_count; ++i) {
|
||||
slave = multi->slaves[i].pcm;
|
||||
if (slave == slave_0)
|
||||
continue;
|
||||
err = snd_pcm_poll_descriptors(slave, pfds, space);
|
||||
if (err < 0)
|
||||
return err;
|
||||
}
|
||||
/* finally overwrite with master's pfds */
|
||||
return snd_pcm_poll_descriptors(slave_0, pfds, space);
|
||||
}
|
||||
|
||||
|
|
@ -584,23 +597,6 @@ static int snd_pcm_multi_resume(snd_pcm_t *pcm)
|
|||
return err;
|
||||
}
|
||||
|
||||
static int snd_pcm_multi_poll_ask(snd_pcm_t *pcm)
|
||||
{
|
||||
snd_pcm_multi_t *multi = pcm->private_data;
|
||||
snd_pcm_t *slave;
|
||||
int err = 0;
|
||||
unsigned int i;
|
||||
for (i = 0; i < multi->slaves_count; ++i) {
|
||||
slave = multi->slaves[i].pcm;
|
||||
if (slave->fast_ops->poll_ask == NULL)
|
||||
continue;
|
||||
err = slave->fast_ops->poll_ask(slave->fast_op_arg);
|
||||
if (err < 0)
|
||||
return err;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int snd_pcm_multi_link_fd_failed(snd_pcm_t *pcm, int fd)
|
||||
{
|
||||
snd_pcm_multi_t *multi = pcm->private_data;
|
||||
|
|
@ -733,7 +729,6 @@ static snd_pcm_fast_ops_t snd_pcm_multi_fast_ops = {
|
|||
.rewind = snd_pcm_multi_rewind,
|
||||
.forward = snd_pcm_multi_forward,
|
||||
.resume = snd_pcm_multi_resume,
|
||||
.poll_ask = snd_pcm_multi_poll_ask,
|
||||
.link_fd = snd_pcm_multi_link_fd,
|
||||
.link = snd_pcm_generic_link2,
|
||||
.unlink = snd_pcm_multi_unlink,
|
||||
|
|
|
|||
|
|
@ -324,7 +324,6 @@ static snd_pcm_fast_ops_t snd_pcm_null_fast_ops = {
|
|||
.rewind = snd_pcm_null_rewind,
|
||||
.forward = snd_pcm_null_forward,
|
||||
.resume = snd_pcm_null_resume,
|
||||
.poll_ask = NULL,
|
||||
.writei = snd_pcm_null_writei,
|
||||
.writen = snd_pcm_null_writen,
|
||||
.readi = snd_pcm_null_readi,
|
||||
|
|
|
|||
|
|
@ -558,7 +558,6 @@ snd_pcm_fast_ops_t snd_pcm_plugin_fast_ops = {
|
|||
.rewind = snd_pcm_plugin_rewind,
|
||||
.forward = snd_pcm_plugin_forward,
|
||||
.resume = snd_pcm_generic_resume,
|
||||
.poll_ask = snd_pcm_generic_poll_ask,
|
||||
.link_fd = snd_pcm_generic_link_fd,
|
||||
.link = snd_pcm_generic_link,
|
||||
.unlink = snd_pcm_generic_unlink,
|
||||
|
|
|
|||
|
|
@ -948,17 +948,16 @@ static snd_pcm_sframes_t snd_pcm_rate_forward(snd_pcm_t *pcm, snd_pcm_uframes_t
|
|||
return n;
|
||||
}
|
||||
|
||||
static int snd_pcm_rate_poll_ask(snd_pcm_t *pcm)
|
||||
static int snd_pcm_rate_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space)
|
||||
{
|
||||
snd_pcm_rate_t *rate = pcm->private_data;
|
||||
snd_pcm_uframes_t avail_min;
|
||||
int err;
|
||||
int ret, err;
|
||||
|
||||
ret = snd_pcm_generic_poll_descriptors(pcm, pfds, space);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (rate->gen.slave->fast_ops->poll_ask) {
|
||||
err = rate->gen.slave->fast_ops->poll_ask(rate->gen.slave->fast_op_arg);
|
||||
if (err < 0)
|
||||
return err;
|
||||
}
|
||||
avail_min = rate->appl_ptr % pcm->period_size;
|
||||
if (avail_min > 0) {
|
||||
recalc(pcm, &avail_min);
|
||||
|
|
@ -973,9 +972,12 @@ static int snd_pcm_rate_poll_ask(snd_pcm_t *pcm)
|
|||
avail_min = rate->orig_avail_min;
|
||||
}
|
||||
if (rate->sw_params.avail_min == avail_min)
|
||||
return 0;
|
||||
return ret;
|
||||
rate->sw_params.avail_min = avail_min;
|
||||
return snd_pcm_sw_params(rate->gen.slave, &rate->sw_params);
|
||||
err = snd_pcm_sw_params(rate->gen.slave, &rate->sw_params);
|
||||
if (err < 0)
|
||||
return err;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int snd_pcm_rate_commit_area(snd_pcm_t *pcm, snd_pcm_rate_t *rate,
|
||||
|
|
@ -1357,7 +1359,6 @@ static snd_pcm_fast_ops_t snd_pcm_rate_fast_ops = {
|
|||
.rewind = snd_pcm_rate_rewind,
|
||||
.forward = snd_pcm_rate_forward,
|
||||
.resume = snd_pcm_generic_resume,
|
||||
.poll_ask = snd_pcm_rate_poll_ask,
|
||||
.writei = snd_pcm_mmap_writei,
|
||||
.writen = snd_pcm_mmap_writen,
|
||||
.readi = snd_pcm_mmap_readi,
|
||||
|
|
|
|||
|
|
@ -1320,7 +1320,6 @@ static snd_pcm_fast_ops_t snd_pcm_share_fast_ops = {
|
|||
.rewind = snd_pcm_share_rewind,
|
||||
.forward = snd_pcm_share_forward,
|
||||
.resume = snd_pcm_share_resume,
|
||||
.poll_ask = NULL, /* FIXME */
|
||||
.avail_update = snd_pcm_share_avail_update,
|
||||
.mmap_commit = snd_pcm_share_mmap_commit,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -602,7 +602,6 @@ static snd_pcm_fast_ops_t snd_pcm_shm_fast_ops = {
|
|||
.rewind = snd_pcm_shm_rewind,
|
||||
.forward = snd_pcm_shm_forward,
|
||||
.resume = snd_pcm_shm_resume,
|
||||
.poll_ask = NULL,
|
||||
.writei = snd_pcm_mmap_writei,
|
||||
.writen = snd_pcm_mmap_writen,
|
||||
.readi = snd_pcm_mmap_readi,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue