mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
improved stream linking and plugin code cleanups
- added link/unlink/link_fd fast_ops callbacks - moved code from snd_pcm_link to pcm_hw.c - moved "empty" routines pointing to slave to pcm_generic.c - introduced snd_pcm_generic_t
This commit is contained in:
parent
9501520606
commit
836987aa99
25 changed files with 767 additions and 957 deletions
|
|
@ -312,7 +312,7 @@ static int snd_pcm_mulaw_hw_refine(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
|||
snd_pcm_mulaw_hw_refine_cchange,
|
||||
snd_pcm_mulaw_hw_refine_sprepare,
|
||||
snd_pcm_mulaw_hw_refine_schange,
|
||||
snd_pcm_plugin_hw_refine_slave);
|
||||
snd_pcm_generic_hw_refine);
|
||||
}
|
||||
|
||||
static int snd_pcm_mulaw_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
|
||||
|
|
@ -323,7 +323,7 @@ static int snd_pcm_mulaw_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
|
|||
snd_pcm_mulaw_hw_refine_cchange,
|
||||
snd_pcm_mulaw_hw_refine_sprepare,
|
||||
snd_pcm_mulaw_hw_refine_schange,
|
||||
snd_pcm_plugin_hw_params_slave);
|
||||
snd_pcm_generic_hw_params);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
|
|
@ -401,23 +401,23 @@ static void snd_pcm_mulaw_dump(snd_pcm_t *pcm, snd_output_t *out)
|
|||
snd_pcm_dump_setup(pcm, out);
|
||||
}
|
||||
snd_output_printf(out, "Slave: ");
|
||||
snd_pcm_dump(mulaw->plug.slave, out);
|
||||
snd_pcm_dump(mulaw->plug.gen.slave, out);
|
||||
}
|
||||
|
||||
static snd_pcm_ops_t snd_pcm_mulaw_ops = {
|
||||
.close = snd_pcm_plugin_close,
|
||||
.info = snd_pcm_plugin_info,
|
||||
.close = snd_pcm_generic_close,
|
||||
.info = snd_pcm_generic_info,
|
||||
.hw_refine = snd_pcm_mulaw_hw_refine,
|
||||
.hw_params = snd_pcm_mulaw_hw_params,
|
||||
.hw_free = snd_pcm_plugin_hw_free,
|
||||
.sw_params = snd_pcm_plugin_sw_params,
|
||||
.channel_info = snd_pcm_plugin_channel_info,
|
||||
.hw_free = snd_pcm_generic_hw_free,
|
||||
.sw_params = snd_pcm_generic_sw_params,
|
||||
.channel_info = snd_pcm_generic_channel_info,
|
||||
.dump = snd_pcm_mulaw_dump,
|
||||
.nonblock = snd_pcm_plugin_nonblock,
|
||||
.async = snd_pcm_plugin_async,
|
||||
.poll_revents = snd_pcm_plugin_poll_revents,
|
||||
.mmap = snd_pcm_plugin_mmap,
|
||||
.munmap = snd_pcm_plugin_munmap,
|
||||
.nonblock = snd_pcm_generic_nonblock,
|
||||
.async = snd_pcm_generic_async,
|
||||
.poll_revents = snd_pcm_generic_poll_revents,
|
||||
.mmap = snd_pcm_generic_mmap,
|
||||
.munmap = snd_pcm_generic_munmap,
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -451,8 +451,8 @@ int snd_pcm_mulaw_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sfor
|
|||
mulaw->plug.write = snd_pcm_mulaw_write_areas;
|
||||
mulaw->plug.undo_read = snd_pcm_plugin_undo_read_generic;
|
||||
mulaw->plug.undo_write = snd_pcm_plugin_undo_write_generic;
|
||||
mulaw->plug.slave = slave;
|
||||
mulaw->plug.close_slave = close_slave;
|
||||
mulaw->plug.gen.slave = slave;
|
||||
mulaw->plug.gen.close_slave = close_slave;
|
||||
|
||||
err = snd_pcm_new(&pcm, SND_PCM_TYPE_MULAW, name, slave->stream, slave->mode);
|
||||
if (err < 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue