summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAlfred E. Heggestad <alfred.heggestad@gmail.com>2017-03-22 12:52:14 +0100
committerGitHub <noreply@github.com>2017-03-22 12:52:14 +0100
commit4afc7980a64dcd4abd1bb79d048f7ea363e99cd1 (patch)
treebbcb5134490682b6157afbdaa68180a725f636ae /modules
parentc3edc6136aabada7fbbe04e038918b833c1c32c1 (diff)
Ausrc auplay reentrant (#227)
* ausrc: re-entrant api * fix ausrc api for linux * fix ccheck * auplay: make it re-entrant * auplay: update more modules
Diffstat (limited to 'modules')
-rw-r--r--modules/alsa/alsa.c6
-rw-r--r--modules/aubridge/aubridge.c5
-rw-r--r--modules/audiounit/audiounit.c6
-rw-r--r--modules/aufile/aufile.c3
-rw-r--r--modules/auloop/auloop.c6
-rw-r--r--modules/coreaudio/coreaudio.c6
-rw-r--r--modules/gst1/gst.c2
-rw-r--r--modules/jack/jack.c6
-rw-r--r--modules/menu/menu.c4
-rw-r--r--modules/opensles/opensles.c6
-rw-r--r--modules/oss/oss.c4
-rw-r--r--modules/portaudio/portaudio.c6
-rw-r--r--modules/pulse/pulse.c6
-rw-r--r--modules/rst/audio.c2
-rw-r--r--modules/sndio/sndio.c5
-rw-r--r--modules/winwave/winwave.c6
16 files changed, 50 insertions, 29 deletions
diff --git a/modules/alsa/alsa.c b/modules/alsa/alsa.c
index 11485b5..d695056 100644
--- a/modules/alsa/alsa.c
+++ b/modules/alsa/alsa.c
@@ -166,8 +166,10 @@ static int alsa_init(void)
aufmt_name(alsa_sample_format));
}
- err = ausrc_register(&ausrc, "alsa", alsa_src_alloc);
- err |= auplay_register(&auplay, "alsa", alsa_play_alloc);
+ err = ausrc_register(&ausrc, baresip_ausrcl(),
+ "alsa", alsa_src_alloc);
+ err |= auplay_register(&auplay, baresip_auplayl(),
+ "alsa", alsa_play_alloc);
return err;
}
diff --git a/modules/aubridge/aubridge.c b/modules/aubridge/aubridge.c
index f1fcfa3..13e0527 100644
--- a/modules/aubridge/aubridge.c
+++ b/modules/aubridge/aubridge.c
@@ -40,8 +40,9 @@ static int module_init(void)
if (err)
return err;
- err = ausrc_register(&ausrc, "aubridge", src_alloc);
- err |= auplay_register(&auplay, "aubridge", play_alloc);
+ err = ausrc_register(&ausrc, baresip_ausrcl(), "aubridge", src_alloc);
+ err |= auplay_register(&auplay, baresip_auplayl(),
+ "aubridge", play_alloc);
return err;
}
diff --git a/modules/audiounit/audiounit.c b/modules/audiounit/audiounit.c
index 74583fc..b03bcec 100644
--- a/modules/audiounit/audiounit.c
+++ b/modules/audiounit/audiounit.c
@@ -71,8 +71,10 @@ static int module_init(void)
return ENOENT;
}
- err = auplay_register(&auplay, "audiounit", audiounit_player_alloc);
- err |= ausrc_register(&ausrc, "audiounit", audiounit_recorder_alloc);
+ err = auplay_register(&auplay, baresip_auplayl(),
+ "audiounit", audiounit_player_alloc);
+ err |= ausrc_register(&ausrc, baresip_ausrcl(),
+ "audiounit", audiounit_recorder_alloc);
return 0;
}
diff --git a/modules/aufile/aufile.c b/modules/aufile/aufile.c
index 185feb9..3f9c77f 100644
--- a/modules/aufile/aufile.c
+++ b/modules/aufile/aufile.c
@@ -238,7 +238,8 @@ static int alloc_handler(struct ausrc_st **stp, const struct ausrc *as,
static int module_init(void)
{
- return ausrc_register(&ausrc, "aufile", alloc_handler);
+ return ausrc_register(&ausrc, baresip_ausrcl(),
+ "aufile", alloc_handler);
}
diff --git a/modules/auloop/auloop.c b/modules/auloop/auloop.c
index 328366f..22dd1b0 100644
--- a/modules/auloop/auloop.c
+++ b/modules/auloop/auloop.c
@@ -248,7 +248,8 @@ static int auloop_reset(struct audio_loop *al)
auplay_prm.srate = al->srate;
auplay_prm.ch = al->ch;
auplay_prm.ptime = PTIME;
- err = auplay_alloc(&al->auplay, cfg->audio.play_mod, &auplay_prm,
+ err = auplay_alloc(&al->auplay, baresip_auplayl(),
+ cfg->audio.play_mod, &auplay_prm,
cfg->audio.play_dev, write_handler, al);
if (err) {
warning("auloop: auplay %s,%s failed: %m\n",
@@ -260,7 +261,8 @@ static int auloop_reset(struct audio_loop *al)
ausrc_prm.srate = al->srate;
ausrc_prm.ch = al->ch;
ausrc_prm.ptime = PTIME;
- err = ausrc_alloc(&al->ausrc, NULL, cfg->audio.src_mod,
+ err = ausrc_alloc(&al->ausrc, baresip_ausrcl(),
+ NULL, cfg->audio.src_mod,
&ausrc_prm, cfg->audio.src_dev,
read_handler, error_handler, al);
if (err) {
diff --git a/modules/coreaudio/coreaudio.c b/modules/coreaudio/coreaudio.c
index 0168dbc..e1af629 100644
--- a/modules/coreaudio/coreaudio.c
+++ b/modules/coreaudio/coreaudio.c
@@ -85,8 +85,10 @@ static int module_init(void)
{
int err;
- err = auplay_register(&auplay, "coreaudio", coreaudio_player_alloc);
- err |= ausrc_register(&ausrc, "coreaudio", coreaudio_recorder_alloc);
+ err = auplay_register(&auplay, baresip_auplayl(),
+ "coreaudio", coreaudio_player_alloc);
+ err |= ausrc_register(&ausrc, baresip_ausrcl(),
+ "coreaudio", coreaudio_recorder_alloc);
return err;
}
diff --git a/modules/gst1/gst.c b/modules/gst1/gst.c
index 4eae356..6f704e5 100644
--- a/modules/gst1/gst.c
+++ b/modules/gst1/gst.c
@@ -438,7 +438,7 @@ static int mod_gst_init(void)
g_free(s);
- return ausrc_register(&ausrc, "gst", gst_alloc);
+ return ausrc_register(&ausrc, baresip_ausrcl(), "gst", gst_alloc);
}
diff --git a/modules/jack/jack.c b/modules/jack/jack.c
index 6a3fecf..5bf9a10 100644
--- a/modules/jack/jack.c
+++ b/modules/jack/jack.c
@@ -17,8 +17,10 @@ static int module_init(void)
{
int err = 0;
- err |= auplay_register(&auplay, "jack", jack_play_alloc);
- err |= ausrc_register(&ausrc, "jack", jack_src_alloc);
+ err |= auplay_register(&auplay, baresip_auplayl(),
+ "jack", jack_play_alloc);
+ err |= ausrc_register(&ausrc, baresip_ausrcl(),
+ "jack", jack_src_alloc);
return err;
}
diff --git a/modules/menu/menu.c b/modules/menu/menu.c
index 1765558..042db21 100644
--- a/modules/menu/menu.c
+++ b/modules/menu/menu.c
@@ -564,7 +564,7 @@ static int switch_audio_player(struct re_printf *pf, void *arg)
pl_strcpy(&pl_driver, driver, sizeof(driver));
pl_strcpy(&pl_device, device, sizeof(device));
- if (!auplay_find(driver)) {
+ if (!auplay_find(baresip_auplayl(), driver)) {
re_hprintf(pf, "no such audio-player: %s\n", driver);
return 0;
}
@@ -638,7 +638,7 @@ static int switch_audio_source(struct re_printf *pf, void *arg)
pl_strcpy(&pl_driver, driver, sizeof(driver));
pl_strcpy(&pl_device, device, sizeof(device));
- if (!ausrc_find(driver)) {
+ if (!ausrc_find(baresip_ausrcl(), driver)) {
re_hprintf(pf, "no such audio-source: %s\n", driver);
return 0;
}
diff --git a/modules/opensles/opensles.c b/modules/opensles/opensles.c
index 055f051..2201bf2 100644
--- a/modules/opensles/opensles.c
+++ b/modules/opensles/opensles.c
@@ -47,8 +47,10 @@ static int module_init(void)
if (SL_RESULT_SUCCESS != r)
return ENODEV;
- err = auplay_register(&auplay, "opensles", opensles_player_alloc);
- err |= ausrc_register(&ausrc, "opensles", opensles_recorder_alloc);
+ err = auplay_register(&auplay, baresip_auplayl(),
+ "opensles", opensles_player_alloc);
+ err |= ausrc_register(&ausrc, baresip_ausrcl(),
+ "opensles", opensles_recorder_alloc);
return err;
}
diff --git a/modules/oss/oss.c b/modules/oss/oss.c
index a6a8015..2fa8efe 100644
--- a/modules/oss/oss.c
+++ b/modules/oss/oss.c
@@ -337,8 +337,8 @@ static int module_init(void)
{
int err;
- err = ausrc_register(&ausrc, "oss", src_alloc);
- err |= auplay_register(&auplay, "oss", play_alloc);
+ err = ausrc_register(&ausrc, baresip_ausrcl(), "oss", src_alloc);
+ err |= auplay_register(&auplay, baresip_auplayl(), "oss", play_alloc);
return err;
}
diff --git a/modules/portaudio/portaudio.c b/modules/portaudio/portaudio.c
index 41c8efc..cd4b973 100644
--- a/modules/portaudio/portaudio.c
+++ b/modules/portaudio/portaudio.c
@@ -305,10 +305,12 @@ static int pa_init(void)
}
if (paNoDevice != Pa_GetDefaultInputDevice())
- err |= ausrc_register(&ausrc, "portaudio", src_alloc);
+ err |= ausrc_register(&ausrc, baresip_ausrcl(),
+ "portaudio", src_alloc);
if (paNoDevice != Pa_GetDefaultOutputDevice())
- err |= auplay_register(&auplay, "portaudio", play_alloc);
+ err |= auplay_register(&auplay, baresip_auplayl(),
+ "portaudio", play_alloc);
return err;
}
diff --git a/modules/pulse/pulse.c b/modules/pulse/pulse.c
index 450b917..01f6914 100644
--- a/modules/pulse/pulse.c
+++ b/modules/pulse/pulse.c
@@ -28,8 +28,10 @@ static int module_init(void)
{
int err;
- err = auplay_register(&auplay, "pulse", pulse_player_alloc);
- err |= ausrc_register(&ausrc, "pulse", pulse_recorder_alloc);
+ err = auplay_register(&auplay, baresip_auplayl(),
+ "pulse", pulse_player_alloc);
+ err |= ausrc_register(&ausrc, baresip_ausrcl(),
+ "pulse", pulse_recorder_alloc);
return err;
}
diff --git a/modules/rst/audio.c b/modules/rst/audio.c
index 8dc5175..666b09a 100644
--- a/modules/rst/audio.c
+++ b/modules/rst/audio.c
@@ -245,7 +245,7 @@ int rst_audio_init(void)
return ENODEV;
}
- return ausrc_register(&ausrc, "rst", alloc_handler);
+ return ausrc_register(&ausrc, baresip_ausrcl(), "rst", alloc_handler);
}
diff --git a/modules/sndio/sndio.c b/modules/sndio/sndio.c
index b20efe0..d3ca9d6 100644
--- a/modules/sndio/sndio.c
+++ b/modules/sndio/sndio.c
@@ -282,8 +282,9 @@ static int sndio_init(void)
{
int err = 0;
- err |= ausrc_register(&ausrc, "sndio", src_alloc);
- err |= auplay_register(&auplay, "sndio", play_alloc);
+ err |= ausrc_register(&ausrc, baresip_ausrcl(), "sndio", src_alloc);
+ err |= auplay_register(&auplay, baresip_auplayl(),
+ "sndio", play_alloc);
return err;
}
diff --git a/modules/winwave/winwave.c b/modules/winwave/winwave.c
index 597f9f1..469f709 100644
--- a/modules/winwave/winwave.c
+++ b/modules/winwave/winwave.c
@@ -34,8 +34,10 @@ static int ww_init(void)
info("winwave: output devices: %d, input devices: %d\n",
play_dev_count, src_dev_count);
- err = ausrc_register(&ausrc, "winwave", winwave_src_alloc);
- err |= auplay_register(&auplay, "winwave", winwave_play_alloc);
+ err = ausrc_register(&ausrc, baresip_ausrcl(),
+ "winwave", winwave_src_alloc);
+ err |= auplay_register(&auplay, baresip_auplayl(),
+ "winwave", winwave_play_alloc);
return err;
}