summaryrefslogtreecommitdiffstats
path: root/plugins/alsa/alsa-utils-bypath.c
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2019-01-23 16:46:45 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2019-01-24 11:45:09 +0100
commitd5cc09d1ef5c58bb8d34e3a47c391a10d8b48181 (patch)
tree36b65c43fb60ae0ac22b09c832677be2f5fada1e /plugins/alsa/alsa-utils-bypath.c
parent17ad00443eecdb2ed7b92da01c7be6f316e04b64 (diff)
Git submodule migration to separated libraries
- Replace controller binder functions definition with the binder ones. and remove the last used submodules to use the separated libraries. - Add liburcu as a project dependency in addition to the others ones. Bug-AGL: SPEC-2139 Change-Id: If46eed24018e28e58d1e62397f4355d2aa46a58e Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'plugins/alsa/alsa-utils-bypath.c')
-rw-r--r--plugins/alsa/alsa-utils-bypath.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/plugins/alsa/alsa-utils-bypath.c b/plugins/alsa/alsa-utils-bypath.c
index 3a8afb7..a1b5826 100644
--- a/plugins/alsa/alsa-utils-bypath.c
+++ b/plugins/alsa/alsa-utils-bypath.c
@@ -45,13 +45,13 @@ PUBLIC snd_ctl_card_info_t *AlsaByPathInfo(SoftMixerT *mixer, const char *devpat
open_dev = open(devpath, O_RDONLY);
if (open_dev < 0) {
- AFB_ApiError(mixer->api, "%s: Unable to open %s", __func__, devpath);
+ AFB_API_ERROR(mixer->api, "%s: Unable to open %s", __func__, devpath);
goto fail_cardinfo;
}
int rc = ioctl(open_dev, SNDRV_CTL_IOCTL_CARD_INFO(snd_ctl_card_info_sizeof()), cardInfo);
if (rc < 0) {
- AFB_ApiError(mixer->api, "%s: ioctl on %s failed", __func__, devpath);
+ AFB_API_ERROR(mixer->api, "%s: ioctl on %s failed", __func__, devpath);
goto fail_dev;
}
@@ -69,7 +69,7 @@ fail:
PUBLIC AlsaPcmCtlT * AlsaPcmCtlNew(SoftMixerT* mixer, const char * name) {
- AFB_ApiDebug(mixer->api, "%s: NEW %s",__func__, name);
+ AFB_API_DEBUG(mixer->api, "%s: NEW %s",__func__, name);
AlsaPcmCtlT *pcmCtl = calloc(1, sizeof (AlsaPcmCtlT));
if (pcmCtl == NULL) {
@@ -91,16 +91,16 @@ PUBLIC void AlsaPcmCtlDelete(SoftMixerT* mixer, void * arg) {
AlsaPcmCtlT * pcmCtl = (AlsaPcmCtlT *) arg;
- AFB_ApiDebug(mixer->api, "%s of %s (plug: %d)", __func__, pcmCtl->name, pcmCtl->isPcmPlug);
+ AFB_API_DEBUG(mixer->api, "%s of %s (plug: %d)", __func__, pcmCtl->name, pcmCtl->isPcmPlug);
if (!pcmCtl->closeAtDeletion)
goto done;
- AFB_ApiDebug(mixer->api, "%s: Closing %s", __func__, pcmCtl->cid.cardid);
+ AFB_API_DEBUG(mixer->api, "%s: Closing %s", __func__, pcmCtl->cid.cardid);
error = snd_pcm_close(pcmCtl->handle);
if (error) {
// It's safe to ignore this error. In case of ioplug PCM, the device may have already disappeared
- AFB_ApiDebug(mixer->api,
+ AFB_API_DEBUG(mixer->api,
"%s: failed to close capture PCM %s: err=%s", __func__, pcmCtl->cid.cardid, snd_strerror(error));
}
@@ -111,7 +111,7 @@ done:
free((char*) pcmCtl->cid.cardid);
free(pcmCtl);
- AFB_ApiDebug(mixer->api, "%s DONE", __func__);
+ AFB_API_DEBUG(mixer->api, "%s DONE", __func__);
}
@@ -169,13 +169,13 @@ PUBLIC AlsaPcmCtlT *AlsaByPathOpenPcmCtl(SoftMixerT *mixer, AlsaDevInfoT *pcmDev
if (pcmDev->pcmplug_params)
pcmCtl->isPcmPlug = true;
- AFB_ApiDebug(mixer->api,
+ AFB_API_DEBUG(mixer->api,
"%s OPEN PCM '%s', direction %s",
__func__, pcmDev->cardid, direction==SND_PCM_STREAM_PLAYBACK?"playback":"capture");
error = snd_pcm_open(&pcmCtl->handle, pcmCtl->cid.cardid, direction, SND_PCM_NONBLOCK);
if (error < 0) {
- AFB_ApiError(mixer->api, "%s: fail openpcm cardid=%s error=%s", __func__, pcmCtl->cid.cardid, snd_strerror(error));
+ AFB_API_ERROR(mixer->api, "%s: fail openpcm cardid=%s error=%s", __func__, pcmCtl->cid.cardid, snd_strerror(error));
goto fail_pcmctl;
}
@@ -196,19 +196,19 @@ PUBLIC snd_ctl_t *AlsaByPathOpenCtl(SoftMixerT *mixer, const char *uid, AlsaSndC
// get card info from /dev/snd/xxx if not use hw:x,x,x
snd_ctl_card_info_t *cardInfo = NULL;
- AFB_ApiDebug(mixer->api, "%s: devpath %s, cardid %s, plug %s", __func__, dev->cid.devpath, dev->cid.cardid, dev->cid.pcmplug_params);
+ AFB_API_DEBUG(mixer->api, "%s: devpath %s, cardid %s, plug %s", __func__, dev->cid.devpath, dev->cid.cardid, dev->cid.pcmplug_params);
if (dev->cid.devpath)
cardInfo = AlsaByPathInfo(mixer, dev->cid.devpath);
else if (dev->cid.cardid)
cardInfo = AlsaCtlGetCardInfo(mixer, dev->cid.cardid);
else if (dev->cid.pcmplug_params) {
- AFB_ApiDebug(mixer->api, "Get card info from plug params %s", dev->cid.pcmplug_params);
+ AFB_API_DEBUG(mixer->api, "Get card info from plug params %s", dev->cid.pcmplug_params);
cardInfo = AlsaCtlGetCardInfo(mixer, dev->cid.pcmplug_params);
}
if (!cardInfo) {
- AFB_ApiError(mixer->api,
+ AFB_API_ERROR(mixer->api,
"%s: uid=%s fail to find sndcard by path=%s id=%s",
__func__, uid, dev->cid.devpath, dev->cid.cardid);
goto fail;
@@ -235,13 +235,13 @@ PUBLIC snd_ctl_t *AlsaByPathOpenCtl(SoftMixerT *mixer, const char *uid, AlsaSndC
}
if ((err = snd_ctl_open(&handle, dev->cid.cardid, 0)) < 0) {
- AFB_ApiError(mixer->api,
+ AFB_API_ERROR(mixer->api,
"%s uid=%s sndcard open fail cardid=%s longname=%s error=%s",
__func__, uid, dev->cid.cardid, dev->cid.longname, snd_strerror(err));
goto fail_cardid;
}
- AFB_ApiNotice(mixer->api,
+ AFB_API_NOTICE(mixer->api,
"%s: uid=%s cardid=%s cardname=%s pcmplug %s",
__func__, uid, dev->cid.cardid, dev->cid.longname, dev->cid.pcmplug_params);
free(cardInfo);