3
0
Fork 0

Audio-RIL-Interface: Keep up with libsrs-client

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
This commit is contained in:
Paul Kocialkowski 2014-07-05 00:36:45 +02:00 committed by Wolfgang Wiedmeyer
parent edb07659ae
commit 7bf07b5b39
1 changed files with 13 additions and 9 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2013 Paul Kocialkowski * Copyright (C) 2013-2014 Paul Kocialkowski
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -34,7 +34,7 @@ int galaxys2_mic_mute(void *pdata, int mute)
int galaxys2_voice_volume(void *pdata, audio_devices_t device, float volume) int galaxys2_voice_volume(void *pdata, audio_devices_t device, float volume)
{ {
struct srs_client *client = NULL; struct srs_client *client = NULL;
struct srs_snd_call_volume call_volume; struct srs_snd_call_volume_data call_volume;
int rc; int rc;
ALOGD("%s(%d, %f)", __func__, device, volume); ALOGD("%s(%d, %f)", __func__, device, volume);
@ -80,7 +80,7 @@ int galaxys2_voice_volume(void *pdata, audio_devices_t device, float volume)
int galaxys2_route(void *pdata, audio_devices_t device) int galaxys2_route(void *pdata, audio_devices_t device)
{ {
struct srs_client *client; struct srs_client *client;
struct srs_snd_call_audio_path call_audio_path; struct srs_snd_call_audio_path_data call_audio_path;
int rc; int rc;
ALOGD("%s(%d)", __func__, device); ALOGD("%s(%d)", __func__, device);
@ -143,9 +143,11 @@ struct audio_ril_interface *audio_ril_interface_open(void)
ALOGD("%s()", __func__); ALOGD("%s()", __func__);
signal(SIGPIPE, SIG_IGN); client = srs_client_create();
if (client == NULL) {
srs_client_create(&client); ALOGE("%s: Failed to create SRS client", __func__);
return NULL;
}
rc = srs_client_open(client); rc = srs_client_open(client);
if (rc < 0) { if (rc < 0) {
@ -153,9 +155,9 @@ struct audio_ril_interface *audio_ril_interface_open(void)
return NULL; return NULL;
} }
rc = srs_client_ping(client); rc = srs_ping(client);
if (rc < 0) if (rc < 0)
ALOGE("%s: Failed to ping SRS client", __func__); ALOGE("%s: Failed to ping SRS", __func__);
galaxys2_interface.pdata = (void *) client; galaxys2_interface.pdata = (void *) client;
@ -178,5 +180,7 @@ void audio_ril_interface_close(struct audio_ril_interface *interface)
if (rc < 0) if (rc < 0)
ALOGE("%s: Failed to close SRS client", __func__); ALOGE("%s: Failed to close SRS client", __func__);
srs_client_destroy(client); rc = srs_client_destroy(client);
if (rc < 0)
ALOGE("%s: Failed to destroy SRS client", __func__);
} }