summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaechul Lee <jcsing.lee@samsung.com>2021-02-03 17:14:24 +0900
committerJaechul Lee <jcsing.lee@samsung.com>2021-02-03 17:20:56 +0900
commit1e1868b1214277308f6a0334ad4f9c2d1882bbca (patch)
tree99dd129bbb6a4d695d9737d917c8b490d74f2180
parent056200eeee9cd9bbb08d98e51775cfb030a605f3 (diff)
downloadaudio-hal-exynos9110-1e1868b1214277308f6a0334ad4f9c2d1882bbca.tar.gz
audio-hal-exynos9110-1e1868b1214277308f6a0334ad4f9c2d1882bbca.tar.bz2
audio-hal-exynos9110-1e1868b1214277308f6a0334ad4f9c2d1882bbca.zip
hal interfaces were added. Besides, structure and enum names were changed for better readability. In case of enum, audio_return_t is changed to audio_return_'e', and device_info_t is changed to device_info_'s'. [Version] 0.1.4 [Issue Type] None Change-Id: Id5b6813bf3b0e1dede7d8a377b0cb9366063f61c Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
-rw-r--r--Makefile.am17
-rw-r--r--configure.ac4
-rw-r--r--hal-backend-audio.c77
-rw-r--r--packaging/audio-hal-exynos9110.spec10
-rw-r--r--tizen-audio-comm.c28
-rw-r--r--tizen-audio-ctrl.c8
-rw-r--r--tizen-audio-impl-ctrl.c14
-rw-r--r--tizen-audio-impl-pcm.c44
-rw-r--r--tizen-audio-impl-ucm.c24
-rw-r--r--tizen-audio-impl.h62
-rw-r--r--tizen-audio-internal.h28
-rw-r--r--tizen-audio-pcm.c48
-rw-r--r--tizen-audio-routing.c58
-rw-r--r--tizen-audio-stream.c8
-rw-r--r--tizen-audio-volume.c30
-rw-r--r--tizen-audio.c6
-rw-r--r--tizen-audio.h184
17 files changed, 313 insertions, 337 deletions
diff --git a/Makefile.am b/Makefile.am
index 98494e4..a191300 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
-lib_LTLIBRARIES = libtizen-audio.la
+lib_LTLIBRARIES = libhal-backend-audio.la
-libtizen_audio_la_SOURCES = tizen-audio.c \
+libhal_backend_audio_la_SOURCES = tizen-audio.c \
tizen-audio-volume.c \
tizen-audio-routing.c \
tizen-audio-stream.c \
@@ -10,12 +10,13 @@ libtizen_audio_la_SOURCES = tizen-audio.c \
tizen-audio-ctrl.c \
tizen-audio-impl-pcm.c \
tizen-audio-impl-ucm.c \
- tizen-audio-impl-ctrl.c
-libtizen_audio_la_LDFLAGS = $(AM_LDFLAGS) -disable-static -avoid-version
-libtizen_audio_la_LIBADD = $(AM_LDADD) $(ASOUNDLIB_LIBS) $(VCONF_LIBS) $(DLOG_LIBS) $(INIPARSER_LIBS) $(EXPAT_LIBS)
-libtizen_audio_la_CFLAGS = $(AM_CFLAGS) $(ASOUNDLIB_CFLAGS) $(VCONF_CFLAGS) $(DLOG_CFLAGS) $(INIPARSER_CFLAGS) $(EXPAT_CFLAGS) -DUSE_DLOG
+ tizen-audio-impl-ctrl.c \
+ hal-backend-audio.c
+libhal_backend_audio_la_LDFLAGS = $(AM_LDFLAGS) -disable-static -avoid-version
+libhal_backend_audio_la_LIBADD = $(AM_LDADD) $(ASOUNDLIB_LIBS) $(VCONF_LIBS) $(DLOG_LIBS) $(INIPARSER_LIBS) $(EXPAT_LIBS)
+libhal_backend_audio_la_CFLAGS = $(AM_CFLAGS) $(ASOUNDLIB_CFLAGS) $(VCONF_CFLAGS) $(DLOG_CFLAGS) $(INIPARSER_CFLAGS) $(EXPAT_CFLAGS) $(HALAPICOMMON) -DUSE_DLOG
if USE_TINYALSA
-libtizen_audio_la_LIBADD += $(TINYALSA_LIBS)
-libtizen_audio_la_CFLAGS += $(TINYALSA_CFLAGS) -D__USE_TINYALSA__
+libhal_backend_audio_la_LIBADD += $(TINYALSA_LIBS)
+libhal_backend_audio_la_CFLAGS += $(TINYALSA_CFLAGS) -D__USE_TINYALSA__
endif
diff --git a/configure.ac b/configure.ac
index abb8e4a..f0a667d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,6 +47,10 @@ PKG_CHECK_MODULES(DLOG, dlog)
AC_SUBST(DLOG_CFLAGS)
AC_SUBST(DLOG_LIBS)
+PKG_CHECK_MODULES(HALAPICOMMON, hal-api-common)
+AC_SUBST(HALAPICOMMON_CFLAGS)
+AC_SUBST(HALAPICOMMON_LIBS)
+
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
diff --git a/hal-backend-audio.c b/hal-backend-audio.c
new file mode 100644
index 0000000..9d5df23
--- /dev/null
+++ b/hal-backend-audio.c
@@ -0,0 +1,77 @@
+/*
+ * audio-hal
+ *
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <errno.h>
+#include <tizen-audio.h>
+#include <hal/hal-common-interface.h>
+
+static int audio_e9110_init(void **data)
+{
+ hal_backend_audio_funcs *funcs;
+
+ funcs = calloc(1, sizeof(hal_backend_audio_funcs));
+ if (!funcs)
+ return -ENOMEM;
+
+ funcs->init = audio_init;
+ funcs->deinit = audio_deinit;
+ funcs->get_volume_level_max = audio_get_volume_level_max;
+ funcs->set_volume_level = audio_set_volume_level;
+ funcs->get_volume_value = audio_get_volume_value;
+ funcs->get_volume_mute = audio_get_volume_mute;
+ funcs->set_volume_mute = audio_set_volume_mute;
+ funcs->set_volume_ratio = audio_set_volume_ratio;
+ funcs->update_route = audio_update_route;
+ funcs->update_route_option = audio_update_route_option;
+ funcs->notify_stream_connection_changed = audio_notify_stream_connection_changed;
+ funcs->pcm_open = audio_pcm_open;
+ funcs->pcm_start = audio_pcm_start;
+ funcs->pcm_stop = audio_pcm_stop;
+ funcs->pcm_close = audio_pcm_close;
+ funcs->pcm_avail = audio_pcm_avail;
+ funcs->pcm_write = audio_pcm_write;
+ funcs->pcm_read = audio_pcm_read;
+ funcs->pcm_get_fd = audio_pcm_get_fd;
+ funcs->pcm_recover = audio_pcm_recover;
+ funcs->pcm_get_params = audio_pcm_get_params;
+ funcs->pcm_set_params = audio_pcm_set_params;
+
+ *data = (void *)funcs;
+
+ return 0;
+}
+
+static void audio_e9110_exit(void *data)
+{
+ if (!data)
+ return;
+
+ free(data);
+}
+
+hal_backend hal_backend_audio_data = {
+ .name = "audio-e9110",
+ .vendor = "samsung",
+ .abi_version = HAL_ABI_VERSION_TIZEN_6_5,
+ .init = audio_e9110_init,
+ .exit = audio_e9110_exit,
+};
diff --git a/packaging/audio-hal-exynos9110.spec b/packaging/audio-hal-exynos9110.spec
index 5c17fa3..2a9ed2d 100644
--- a/packaging/audio-hal-exynos9110.spec
+++ b/packaging/audio-hal-exynos9110.spec
@@ -1,6 +1,6 @@
Name: audio-hal-exynos9110
Summary: TIZEN Audio HAL for Exynos9110(TW3)
-Version: 0.1.3
+Version: 0.1.4
Release: 0
Group: System/Libraries
License: Apache-2.0
@@ -10,8 +10,10 @@ BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(iniparser)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(alsa)
+BuildRequires: pkgconfig(hal-api-common)
+BuildRequires: pkgconfig(hal-api-audio)
#BuildRequires: pkgconfig(tinyalsa)
-Provides: libtizen-audio.so
+Provides: libhal-backend-audio.so
%description
TIZEN Audio HAL for Exynos9110(TW3)
@@ -27,7 +29,7 @@ export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
export USE_TINYALSA="0"
%autogen
-%configure
+./configure --libdir=%{_hal_libdir}
make %{?jobs:-j%jobs}
@@ -44,5 +46,5 @@ rm -rf %{buildroot}
%files
%manifest audio-hal-exynos9110.manifest
%defattr(-,root,root,-)
-%{_libdir}/libtizen-audio.so
+%{_hal_libdir}/libhal-backend-audio.so
%license LICENSE.Apache-2.0
diff --git a/tizen-audio-comm.c b/tizen-audio-comm.c
index 628e8d9..50f7802 100644
--- a/tizen-audio-comm.c
+++ b/tizen-audio-comm.c
@@ -22,9 +22,9 @@
#include "tizen-audio-internal.h"
-static audio_return_t __set_message_callback(audio_hal_t *ah, message_cb callback, void *user_data)
+static audio_return_e __set_message_callback(audio_hal_t *ah, message_cb callback, void *user_data)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(callback, AUDIO_ERR_PARAMETER);
@@ -37,9 +37,9 @@ static audio_return_t __set_message_callback(audio_hal_t *ah, message_cb callbac
return audio_ret;
}
-static audio_return_t __unset_message_callback(audio_hal_t *ah)
+static audio_return_e __unset_message_callback(audio_hal_t *ah)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -51,9 +51,9 @@ static audio_return_t __unset_message_callback(audio_hal_t *ah)
return audio_ret;
}
-audio_return_t _audio_comm_init(audio_hal_t *ah)
+audio_return_e _audio_comm_init(audio_hal_t *ah)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -63,9 +63,9 @@ audio_return_t _audio_comm_init(audio_hal_t *ah)
return audio_ret;
}
-audio_return_t _audio_comm_deinit(audio_hal_t *ah)
+audio_return_e _audio_comm_deinit(audio_hal_t *ah)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -75,9 +75,9 @@ audio_return_t _audio_comm_deinit(audio_hal_t *ah)
return audio_ret;
}
-audio_return_t _audio_comm_send_message(audio_hal_t *ah, const char *name, int value)
+audio_return_e _audio_comm_send_message(audio_hal_t *ah, const char *name, int value)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(name, AUDIO_ERR_PARAMETER);
@@ -90,9 +90,9 @@ audio_return_t _audio_comm_send_message(audio_hal_t *ah, const char *name, int v
return audio_ret;
}
-audio_return_t audio_add_message_cb(void *audio_handle, message_cb callback, void *user_data)
+audio_return_e audio_add_message_cb(void *audio_handle, message_cb callback, void *user_data)
{
- audio_return_t ret = AUDIO_RET_OK;
+ audio_return_e ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(audio_handle, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(callback, AUDIO_ERR_PARAMETER);
@@ -104,9 +104,9 @@ audio_return_t audio_add_message_cb(void *audio_handle, message_cb callback, voi
return ret;
}
-audio_return_t audio_remove_message_cb(void *audio_handle, message_cb callback)
+audio_return_e audio_remove_message_cb(void *audio_handle, message_cb callback)
{
- audio_return_t ret = AUDIO_RET_OK;
+ audio_return_e ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(audio_handle, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(callback, AUDIO_ERR_PARAMETER);
diff --git a/tizen-audio-ctrl.c b/tizen-audio-ctrl.c
index 2b9bacd..40c5d6c 100644
--- a/tizen-audio-ctrl.c
+++ b/tizen-audio-ctrl.c
@@ -23,9 +23,9 @@
#include "tizen-audio-internal.h"
#include "tizen-audio-impl.h"
-audio_return_t _audio_ctrl_init(audio_hal_t *ah)
+audio_return_e _audio_ctrl_init(audio_hal_t *ah)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -34,9 +34,9 @@ audio_return_t _audio_ctrl_init(audio_hal_t *ah)
return audio_ret;
}
-audio_return_t _audio_ctrl_deinit(audio_hal_t *ah)
+audio_return_e _audio_ctrl_deinit(audio_hal_t *ah)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
diff --git a/tizen-audio-impl-ctrl.c b/tizen-audio-impl-ctrl.c
index 1c54bc4..29c7dce 100644
--- a/tizen-audio-impl-ctrl.c
+++ b/tizen-audio-impl-ctrl.c
@@ -47,7 +47,7 @@ static void __dump_mixer_param(char *dump, long *param, int size)
}
#endif
-audio_return_t _mixer_control_init(audio_hal_t *ah)
+audio_return_e _mixer_control_init(audio_hal_t *ah)
{
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -55,7 +55,7 @@ audio_return_t _mixer_control_init(audio_hal_t *ah)
return AUDIO_RET_OK;
}
-audio_return_t _mixer_control_deinit(audio_hal_t *ah)
+audio_return_e _mixer_control_deinit(audio_hal_t *ah)
{
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -63,7 +63,7 @@ audio_return_t _mixer_control_deinit(audio_hal_t *ah)
return AUDIO_RET_OK;
}
-audio_return_t _mixer_control_set_param(audio_hal_t *ah, const char* ctl_name, snd_ctl_elem_value_t* param, int size)
+audio_return_e _mixer_control_set_param(audio_hal_t *ah, const char* ctl_name, snd_ctl_elem_value_t* param, int size)
{
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -71,7 +71,7 @@ audio_return_t _mixer_control_set_param(audio_hal_t *ah, const char* ctl_name, s
return AUDIO_RET_OK;
}
-audio_return_t _mixer_control_get_value(audio_hal_t *ah, const char *ctl_name, int *val)
+audio_return_e _mixer_control_get_value(audio_hal_t *ah, const char *ctl_name, int *val)
{
snd_ctl_t *handle;
snd_ctl_elem_value_t *control;
@@ -151,7 +151,7 @@ close:
return AUDIO_ERR_UNDEFINED;
}
-audio_return_t _mixer_control_set_value(audio_hal_t *ah, const char *ctl_name, int val)
+audio_return_e _mixer_control_set_value(audio_hal_t *ah, const char *ctl_name, int val)
{
snd_ctl_t *handle;
snd_ctl_elem_value_t *control;
@@ -230,7 +230,7 @@ close:
return AUDIO_ERR_UNDEFINED;
}
-audio_return_t _mixer_control_set_value_string(audio_hal_t *ah, const char* ctl_name, const char* value)
+audio_return_e _mixer_control_set_value_string(audio_hal_t *ah, const char* ctl_name, const char* value)
{
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(ctl_name, AUDIO_ERR_PARAMETER);
@@ -240,7 +240,7 @@ audio_return_t _mixer_control_set_value_string(audio_hal_t *ah, const char* ctl_
}
-audio_return_t _mixer_control_get_element(audio_hal_t *ah, const char *ctl_name, snd_hctl_elem_t **elem)
+audio_return_e _mixer_control_get_element(audio_hal_t *ah, const char *ctl_name, snd_hctl_elem_t **elem)
{
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(ctl_name, AUDIO_ERR_PARAMETER);
diff --git a/tizen-audio-impl-pcm.c b/tizen-audio-impl-pcm.c
index a859a1e..01c1bad 100644
--- a/tizen-audio-impl-pcm.c
+++ b/tizen-audio-impl-pcm.c
@@ -212,7 +212,7 @@ static int __tinyalsa_pcm_recover(struct pcm *pcm, int err)
}
#endif
-static audio_return_t __pcm_device_open(audio_hal_t *ah, audio_pcm_devices_t *pcm_devices, const char *device, uint32_t direction, uint32_t samplerate, uint32_t channels)
+static audio_return_e __pcm_device_open(audio_hal_t *ah, audio_pcm_devices_t *pcm_devices, const char *device, uint32_t direction, uint32_t samplerate, uint32_t channels)
{
int err, ret = 0;
@@ -271,7 +271,7 @@ error:
return ret;
}
-audio_return_t _voice_pcm_open_all(audio_hal_t *ah)
+audio_return_e _voice_pcm_open_all(audio_hal_t *ah)
{
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -279,7 +279,7 @@ audio_return_t _voice_pcm_open_all(audio_hal_t *ah)
AUDIO_DEVICE_DIRECTION_IN | AUDIO_DEVICE_DIRECTION_OUT, 48000, 2);
}
-audio_return_t _bt_pcm_open_all(audio_hal_t *ah)
+audio_return_e _bt_pcm_open_all(audio_hal_t *ah)
{
uint32_t samplerate;
@@ -311,9 +311,9 @@ bool _is_bt_pcm_opened_all(audio_hal_t *ah)
return false;
}
-audio_return_t _voice_pcm_close_all(audio_hal_t *ah)
+audio_return_e _voice_pcm_close_all(audio_hal_t *ah)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -339,9 +339,9 @@ audio_return_t _voice_pcm_close_all(audio_hal_t *ah)
return audio_ret;
}
-audio_return_t _bt_pcm_close_all(audio_hal_t *ah)
+audio_return_e _bt_pcm_close_all(audio_hal_t *ah)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -387,7 +387,7 @@ static int __make_alsa_device_name(const char *card, const char *device, char de
}
#endif
-audio_return_t _pcm_open(const char *card, const char *device, uint32_t direction, void *sample_spec,
+audio_return_e _pcm_open(const char *card, const char *device, uint32_t direction, void *sample_spec,
uint32_t period_size, uint32_t periods, void **pcm_handle)
{
int err;
@@ -417,7 +417,7 @@ audio_return_t _pcm_open(const char *card, const char *device, uint32_t directio
#else /* alsa-lib */
int mode;
- audio_return_t ret;
+ audio_return_e ret;
char device_name[DEVICE_NAME_MAX];
__make_alsa_device_name(card, device, device_name);
@@ -439,7 +439,7 @@ audio_return_t _pcm_open(const char *card, const char *device, uint32_t directio
return AUDIO_RET_OK;
}
-audio_return_t _pcm_start(void *pcm_handle)
+audio_return_e _pcm_start(void *pcm_handle)
{
int err;
@@ -459,7 +459,7 @@ audio_return_t _pcm_start(void *pcm_handle)
return AUDIO_RET_OK;
}
-audio_return_t _pcm_stop(void *pcm_handle)
+audio_return_e _pcm_stop(void *pcm_handle)
{
int err;
@@ -479,7 +479,7 @@ audio_return_t _pcm_stop(void *pcm_handle)
return AUDIO_RET_OK;
}
-audio_return_t _pcm_close(void *pcm_handle)
+audio_return_e _pcm_close(void *pcm_handle)
{
int err;
@@ -500,7 +500,7 @@ audio_return_t _pcm_close(void *pcm_handle)
return AUDIO_RET_OK;
}
-audio_return_t _pcm_avail(void *pcm_handle, uint32_t *avail)
+audio_return_e _pcm_avail(void *pcm_handle, uint32_t *avail)
{
#ifdef __USE_TINYALSA__
struct timespec tspec;
@@ -536,7 +536,7 @@ audio_return_t _pcm_avail(void *pcm_handle, uint32_t *avail)
return AUDIO_RET_OK;
}
-audio_return_t _pcm_write(void *pcm_handle, const void *buffer, uint32_t frames)
+audio_return_e _pcm_write(void *pcm_handle, const void *buffer, uint32_t frames)
{
#ifdef __USE_TINYALSA__
int err;
@@ -569,7 +569,7 @@ audio_return_t _pcm_write(void *pcm_handle, const void *buffer, uint32_t frames)
return AUDIO_RET_OK;
}
-audio_return_t _pcm_read(void *pcm_handle, void *buffer, uint32_t frames)
+audio_return_e _pcm_read(void *pcm_handle, void *buffer, uint32_t frames)
{
#ifdef __USE_TINYALSA__
int err;
@@ -600,7 +600,7 @@ audio_return_t _pcm_read(void *pcm_handle, void *buffer, uint32_t frames)
return AUDIO_RET_OK;
}
-audio_return_t _pcm_get_fd(void *pcm_handle, int *fd)
+audio_return_e _pcm_get_fd(void *pcm_handle, int *fd)
{
/* we use an internal API of the (tiny)alsa library, so it causes warning message during compile */
#ifdef __USE_TINYALSA__
@@ -611,7 +611,7 @@ audio_return_t _pcm_get_fd(void *pcm_handle, int *fd)
return AUDIO_RET_OK;
}
-audio_return_t _pcm_recover(void *pcm_handle, int revents)
+audio_return_e _pcm_recover(void *pcm_handle, int revents)
{
int state, err;
@@ -691,7 +691,7 @@ audio_return_t _pcm_recover(void *pcm_handle, int revents)
return AUDIO_RET_OK;
}
-audio_return_t _pcm_get_params(void *pcm_handle, uint32_t direction, void **sample_spec, uint32_t *period_size, uint32_t *periods)
+audio_return_e _pcm_get_params(void *pcm_handle, uint32_t direction, void **sample_spec, uint32_t *period_size, uint32_t *periods)
{
#ifdef __USE_TINYALSA__
audio_pcm_sample_spec_t *ss;
@@ -773,7 +773,7 @@ audio_return_t _pcm_get_params(void *pcm_handle, uint32_t direction, void **samp
return AUDIO_RET_OK;
}
-audio_return_t _pcm_set_params(void *pcm_handle, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods)
+audio_return_e _pcm_set_params(void *pcm_handle, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods)
{
#ifdef __USE_TINYALSA__
/* Parameters are only acceptable in pcm_open() function */
@@ -888,9 +888,9 @@ audio_return_t _pcm_set_params(void *pcm_handle, uint32_t direction, void *sampl
}
/* Generic snd pcm interface APIs */
-audio_return_t _pcm_set_hw_params(snd_pcm_t *pcm, audio_pcm_sample_spec_t *sample_spec, uint8_t *use_mmap, snd_pcm_uframes_t *period_size, snd_pcm_uframes_t *buffer_size)
+audio_return_e _pcm_set_hw_params(snd_pcm_t *pcm, audio_pcm_sample_spec_t *sample_spec, uint8_t *use_mmap, snd_pcm_uframes_t *period_size, snd_pcm_uframes_t *buffer_size)
{
- audio_return_t ret = AUDIO_RET_OK;
+ audio_return_e ret = AUDIO_RET_OK;
snd_pcm_hw_params_t *hwparams;
int err = 0;
int dir;
@@ -994,7 +994,7 @@ error:
return AUDIO_ERR_RESOURCE;
}
-audio_return_t _pcm_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min, uint8_t period_event)
+audio_return_e _pcm_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min, uint8_t period_event)
{
snd_pcm_sw_params_t *swparams;
snd_pcm_uframes_t boundary;
diff --git a/tizen-audio-impl-ucm.c b/tizen-audio-impl-ucm.c
index 7ff7cbc..f411637 100644
--- a/tizen-audio-impl-ucm.c
+++ b/tizen-audio-impl-ucm.c
@@ -96,7 +96,7 @@ static inline int __set_use_case_with_time(snd_use_case_mgr_t *uc_mgr, const cha
}
#endif
-audio_return_t _ucm_init(audio_hal_t *ah)
+audio_return_e _ucm_init(audio_hal_t *ah)
{
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -109,7 +109,7 @@ audio_return_t _ucm_init(audio_hal_t *ah)
return AUDIO_RET_OK;
}
-audio_return_t _ucm_deinit(audio_hal_t *ah)
+audio_return_e _ucm_deinit(audio_hal_t *ah)
{
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(ah->ucm.uc_mgr, AUDIO_ERR_PARAMETER);
@@ -135,9 +135,9 @@ audio_return_t _ucm_deinit(audio_hal_t *ah)
2) If verb is changed
-> Reset, set new verb, enable devices & modifiers
*/
-audio_return_t _ucm_set_use_case(audio_hal_t *ah, const char *verb, const char *devices[], const char *modifiers[])
+audio_return_e _ucm_set_use_case(audio_hal_t *ah, const char *verb, const char *devices[], const char *modifiers[])
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
int is_verb_changed = 0, is_dev_changed = 0, is_mod_changed = 0;
const char *old_verb = NULL, **old_dev_list = NULL, **old_mod_list = NULL;
int old_dev_count = 0, dev_count = 0;
@@ -349,9 +349,9 @@ exit:
return audio_ret;
}
-audio_return_t _ucm_set_devices(audio_hal_t *ah, const char *verb, const char *devices[])
+audio_return_e _ucm_set_devices(audio_hal_t *ah, const char *verb, const char *devices[])
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
int is_verb_changed = 0, is_dev_changed = 0;
const char *old_verb = NULL, **old_dev_list = NULL;
int old_dev_count = 0, dev_count = 0;
@@ -496,9 +496,9 @@ exit:
}
-audio_return_t _ucm_set_modifiers(audio_hal_t *ah, const char *verb, const char *modifiers[])
+audio_return_e _ucm_set_modifiers(audio_hal_t *ah, const char *verb, const char *modifiers[])
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
int is_verb_changed = 0, is_mod_changed = 0;
const char *old_verb = NULL, **old_mod_list = NULL;
int old_mod_count = 0, mod_count = 0;
@@ -629,9 +629,9 @@ exit:
return audio_ret;
}
-audio_return_t _ucm_get_verb(audio_hal_t *ah, const char **value)
+audio_return_e _ucm_get_verb(audio_hal_t *ah, const char **value)
{
- audio_return_t ret = AUDIO_RET_OK;
+ audio_return_e ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(ah->ucm.uc_mgr, AUDIO_ERR_PARAMETER);
@@ -645,9 +645,9 @@ audio_return_t _ucm_get_verb(audio_hal_t *ah, const char **value)
return ret;
}
-audio_return_t _ucm_reset_use_case(audio_hal_t *ah)
+audio_return_e _ucm_reset_use_case(audio_hal_t *ah)
{
- audio_return_t ret = AUDIO_RET_OK;
+ audio_return_e ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(ah->ucm.uc_mgr, AUDIO_ERR_PARAMETER);
diff --git a/tizen-audio-impl.h b/tizen-audio-impl.h
index 8218032..1c139a8 100644
--- a/tizen-audio-impl.h
+++ b/tizen-audio-impl.h
@@ -23,44 +23,44 @@
#include <stdbool.h>
/* PCM */
-audio_return_t _voice_pcm_open_all(audio_hal_t *ah);
-audio_return_t _voice_pcm_close_all(audio_hal_t *ah);
-audio_return_t _bt_pcm_open_all(audio_hal_t *ah);
-audio_return_t _bt_pcm_close_all(audio_hal_t *ah);
+audio_return_e _voice_pcm_open_all(audio_hal_t *ah);
+audio_return_e _voice_pcm_close_all(audio_hal_t *ah);
+audio_return_e _bt_pcm_open_all(audio_hal_t *ah);
+audio_return_e _bt_pcm_close_all(audio_hal_t *ah);
bool _is_voice_pcm_opened_all(audio_hal_t *ah);
bool _is_bt_pcm_opened_all(audio_hal_t *ah);
void _reset_pcm_devices(audio_hal_t *ah);
-audio_return_t _pcm_open(const char *card, const char *device, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods, void **pcm_handle);
-audio_return_t _pcm_start(void *pcm_handle);
-audio_return_t _pcm_stop(void *pcm_handle);
-audio_return_t _pcm_close(void *pcm_handle);
-audio_return_t _pcm_avail(void *pcm_handle, uint32_t *avail);
-audio_return_t _pcm_write(void *pcm_handle, const void *buffer, uint32_t frames);
-audio_return_t _pcm_read(void *pcm_handle, void *buffer, uint32_t frames);
-audio_return_t _pcm_get_fd(void *pcm_handle, int *fd);
-audio_return_t _pcm_recover(void *pcm_handle, int revents);
-audio_return_t _pcm_get_params(void *pcm_handle, uint32_t direction, void **sample_spec, uint32_t *period_size, uint32_t *periods);
-audio_return_t _pcm_set_params(void *pcm_handle, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods);
-audio_return_t _pcm_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min, uint8_t period_event);
-audio_return_t _pcm_set_hw_params(snd_pcm_t *pcm, audio_pcm_sample_spec_t *sample_spec, uint8_t *use_mmap, snd_pcm_uframes_t *period_size, snd_pcm_uframes_t *buffer_size);
+audio_return_e _pcm_open(const char *card, const char *device, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods, void **pcm_handle);
+audio_return_e _pcm_start(void *pcm_handle);
+audio_return_e _pcm_stop(void *pcm_handle);
+audio_return_e _pcm_close(void *pcm_handle);
+audio_return_e _pcm_avail(void *pcm_handle, uint32_t *avail);
+audio_return_e _pcm_write(void *pcm_handle, const void *buffer, uint32_t frames);
+audio_return_e _pcm_read(void *pcm_handle, void *buffer, uint32_t frames);
+audio_return_e _pcm_get_fd(void *pcm_handle, int *fd);
+audio_return_e _pcm_recover(void *pcm_handle, int revents);
+audio_return_e _pcm_get_params(void *pcm_handle, uint32_t direction, void **sample_spec, uint32_t *period_size, uint32_t *periods);
+audio_return_e _pcm_set_params(void *pcm_handle, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods);
+audio_return_e _pcm_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min, uint8_t period_event);
+audio_return_e _pcm_set_hw_params(snd_pcm_t *pcm, audio_pcm_sample_spec_t *sample_spec, uint8_t *use_mmap, snd_pcm_uframes_t *period_size, snd_pcm_uframes_t *buffer_size);
/* Control */
-audio_return_t _mixer_control_init(audio_hal_t *ah);
-audio_return_t _mixer_control_deinit(audio_hal_t *ah);
-audio_return_t _mixer_control_set_param(audio_hal_t *ah, const char* ctl_name, snd_ctl_elem_value_t* value, int size);
-audio_return_t _mixer_control_set_value(audio_hal_t *ah, const char *ctl_name, int val);
-audio_return_t _mixer_control_set_value_string(audio_hal_t *ah, const char* ctl_name, const char* value);
-audio_return_t _mixer_control_get_value(audio_hal_t *ah, const char *ctl_name, int *val);
-audio_return_t _mixer_control_get_element(audio_hal_t *ah, const char *ctl_name, snd_hctl_elem_t **elem);
+audio_return_e _mixer_control_init(audio_hal_t *ah);
+audio_return_e _mixer_control_deinit(audio_hal_t *ah);
+audio_return_e _mixer_control_set_param(audio_hal_t *ah, const char* ctl_name, snd_ctl_elem_value_t* value, int size);
+audio_return_e _mixer_control_set_value(audio_hal_t *ah, const char *ctl_name, int val);
+audio_return_e _mixer_control_set_value_string(audio_hal_t *ah, const char* ctl_name, const char* value);
+audio_return_e _mixer_control_get_value(audio_hal_t *ah, const char *ctl_name, int *val);
+audio_return_e _mixer_control_get_element(audio_hal_t *ah, const char *ctl_name, snd_hctl_elem_t **elem);
/* UCM */
-audio_return_t _ucm_init(audio_hal_t *ah);
-audio_return_t _ucm_deinit(audio_hal_t *ah);
+audio_return_e _ucm_init(audio_hal_t *ah);
+audio_return_e _ucm_deinit(audio_hal_t *ah);
#define _ucm_update_use_case _ucm_set_use_case
-audio_return_t _ucm_set_use_case(audio_hal_t *ah, const char *verb, const char *devices[], const char *modifiers[]);
-audio_return_t _ucm_set_devices(audio_hal_t *ah, const char *verb, const char *devices[]);
-audio_return_t _ucm_set_modifiers(audio_hal_t *ah, const char *verb, const char *modifiers[]);
-audio_return_t _ucm_get_verb(audio_hal_t *ah, const char **value);
-audio_return_t _ucm_reset_use_case(audio_hal_t *ah);
+audio_return_e _ucm_set_use_case(audio_hal_t *ah, const char *verb, const char *devices[], const char *modifiers[]);
+audio_return_e _ucm_set_devices(audio_hal_t *ah, const char *verb, const char *devices[]);
+audio_return_e _ucm_set_modifiers(audio_hal_t *ah, const char *verb, const char *modifiers[]);
+audio_return_e _ucm_get_verb(audio_hal_t *ah, const char **value);
+audio_return_e _ucm_reset_use_case(audio_hal_t *ah);
#endif
diff --git a/tizen-audio-internal.h b/tizen-audio-internal.h
index 5d3ab1d..8e0c03d 100644
--- a/tizen-audio-internal.h
+++ b/tizen-audio-internal.h
@@ -295,23 +295,23 @@ typedef struct audio_hal {
audio_hal_ucm_t ucm;
audio_hal_mixer_t mixer;
audio_hal_comm_t comm;
- audio_route_info_t *saved_route_infos[MAX_DIRECTION];
+ audio_route_info_s *saved_route_infos[MAX_DIRECTION];
bool call_wideband;
} audio_hal_t;
-audio_return_t _audio_ctrl_init(audio_hal_t *ah);
-audio_return_t _audio_ctrl_deinit(audio_hal_t *ah);
-audio_return_t _audio_volume_init(audio_hal_t *ah);
-audio_return_t _audio_volume_deinit(audio_hal_t *ah);
-audio_return_t _audio_routing_init(audio_hal_t *ah);
-audio_return_t _audio_routing_deinit(audio_hal_t *ah);
-audio_return_t _audio_stream_init(audio_hal_t *ah);
-audio_return_t _audio_stream_deinit(audio_hal_t *ah);
-audio_return_t _audio_pcm_init(audio_hal_t *ah);
-audio_return_t _audio_pcm_deinit(audio_hal_t *ah);
-audio_return_t _audio_comm_init(audio_hal_t *ah);
-audio_return_t _audio_comm_deinit(audio_hal_t *ah);
-audio_return_t _audio_comm_send_message(audio_hal_t *ah, const char *name, int value);
+audio_return_e _audio_ctrl_init(audio_hal_t *ah);
+audio_return_e _audio_ctrl_deinit(audio_hal_t *ah);
+audio_return_e _audio_volume_init(audio_hal_t *ah);
+audio_return_e _audio_volume_deinit(audio_hal_t *ah);
+audio_return_e _audio_routing_init(audio_hal_t *ah);
+audio_return_e _audio_routing_deinit(audio_hal_t *ah);
+audio_return_e _audio_stream_init(audio_hal_t *ah);
+audio_return_e _audio_stream_deinit(audio_hal_t *ah);
+audio_return_e _audio_pcm_init(audio_hal_t *ah);
+audio_return_e _audio_pcm_deinit(audio_hal_t *ah);
+audio_return_e _audio_comm_init(audio_hal_t *ah);
+audio_return_e _audio_comm_deinit(audio_hal_t *ah);
+audio_return_e _audio_comm_send_message(audio_hal_t *ah, const char *name, int value);
typedef struct _dump_data {
char *strbuf;
diff --git a/tizen-audio-pcm.c b/tizen-audio-pcm.c
index 556be06..0daad47 100644
--- a/tizen-audio-pcm.c
+++ b/tizen-audio-pcm.c
@@ -24,7 +24,7 @@
#include "tizen-audio-internal.h"
#include "tizen-audio-impl.h"
-audio_return_t _audio_pcm_init(audio_hal_t *ah)
+audio_return_e _audio_pcm_init(audio_hal_t *ah)
{
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -36,17 +36,17 @@ audio_return_t _audio_pcm_init(audio_hal_t *ah)
return AUDIO_RET_OK;
}
-audio_return_t _audio_pcm_deinit(audio_hal_t *ah)
+audio_return_e _audio_pcm_deinit(audio_hal_t *ah)
{
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
return AUDIO_RET_OK;
}
-audio_return_t audio_pcm_open(void *audio_handle, const char *card, const char *device, uint32_t direction, void *sample_spec,
+audio_return_e audio_pcm_open(void *audio_handle, const char *card, const char *device, uint32_t direction, void *sample_spec,
uint32_t period_size, uint32_t periods, void **pcm_handle)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(audio_handle, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(pcm_handle, AUDIO_ERR_PARAMETER);
@@ -62,9 +62,9 @@ audio_return_t audio_pcm_open(void *audio_handle, const char *card, const char *
return AUDIO_RET_OK;
}
-audio_return_t audio_pcm_start(void *audio_handle, void *pcm_handle)
+audio_return_e audio_pcm_start(void *audio_handle, void *pcm_handle)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(audio_handle, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(pcm_handle, AUDIO_ERR_PARAMETER);
@@ -74,9 +74,9 @@ audio_return_t audio_pcm_start(void *audio_handle, void *pcm_handle)
return audio_ret;
}
-audio_return_t audio_pcm_stop(void *audio_handle, void *pcm_handle)
+audio_return_e audio_pcm_stop(void *audio_handle, void *pcm_handle)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(audio_handle, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(pcm_handle, AUDIO_ERR_PARAMETER);
@@ -86,9 +86,9 @@ audio_return_t audio_pcm_stop(void *audio_handle, void *pcm_handle)
return audio_ret;
}
-audio_return_t audio_pcm_close(void *audio_handle, void *pcm_handle)
+audio_return_e audio_pcm_close(void *audio_handle, void *pcm_handle)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(audio_handle, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(pcm_handle, AUDIO_ERR_PARAMETER);
@@ -103,9 +103,9 @@ audio_return_t audio_pcm_close(void *audio_handle, void *pcm_handle)
return audio_ret;
}
-audio_return_t audio_pcm_avail(void *audio_handle, void *pcm_handle, uint32_t *avail)
+audio_return_e audio_pcm_avail(void *audio_handle, void *pcm_handle, uint32_t *avail)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(audio_handle, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(pcm_handle, AUDIO_ERR_PARAMETER);
@@ -116,9 +116,9 @@ audio_return_t audio_pcm_avail(void *audio_handle, void *pcm_handle, uint32_t *a
return audio_ret;
}
-audio_return_t audio_pcm_write(void *audio_handle, void *pcm_handle, const void *buffer, uint32_t frames)
+audio_return_e audio_pcm_write(void *audio_handle, void *pcm_handle, const void *buffer, uint32_t frames)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(audio_handle, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(pcm_handle, AUDIO_ERR_PARAMETER);
@@ -128,9 +128,9 @@ audio_return_t audio_pcm_write(void *audio_handle, void *pcm_handle, const void
return audio_ret;
}
-audio_return_t audio_pcm_read(void *audio_handle, void *pcm_handle, void *buffer, uint32_t frames)
+audio_return_e audio_pcm_read(void *audio_handle, void *pcm_handle, void *buffer, uint32_t frames)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(audio_handle, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(pcm_handle, AUDIO_ERR_PARAMETER);
@@ -140,9 +140,9 @@ audio_return_t audio_pcm_read(void *audio_handle, void *pcm_handle, void *buffer
return audio_ret;
}
-audio_return_t audio_pcm_get_fd(void *audio_handle, void *pcm_handle, int *fd)
+audio_return_e audio_pcm_get_fd(void *audio_handle, void *pcm_handle, int *fd)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(audio_handle, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(pcm_handle, AUDIO_ERR_PARAMETER);
@@ -153,9 +153,9 @@ audio_return_t audio_pcm_get_fd(void *audio_handle, void *pcm_handle, int *fd)
return audio_ret;
}
-audio_return_t audio_pcm_recover(void *audio_handle, void *pcm_handle, int revents)
+audio_return_e audio_pcm_recover(void *audio_handle, void *pcm_handle, int revents)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(audio_handle, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(pcm_handle, AUDIO_ERR_PARAMETER);
@@ -165,9 +165,9 @@ audio_return_t audio_pcm_recover(void *audio_handle, void *pcm_handle, int reven
return audio_ret;
}
-audio_return_t audio_pcm_get_params(void *audio_handle, void *pcm_handle, uint32_t direction, void **sample_spec, uint32_t *period_size, uint32_t *periods)
+audio_return_e audio_pcm_get_params(void *audio_handle, void *pcm_handle, uint32_t direction, void **sample_spec, uint32_t *period_size, uint32_t *periods)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(audio_handle, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(pcm_handle, AUDIO_ERR_PARAMETER);
@@ -180,9 +180,9 @@ audio_return_t audio_pcm_get_params(void *audio_handle, void *pcm_handle, uint32
return audio_ret;
}
-audio_return_t audio_pcm_set_params(void *audio_handle, void *pcm_handle, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods)
+audio_return_e audio_pcm_set_params(void *audio_handle, void *pcm_handle, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(audio_handle, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(pcm_handle, AUDIO_ERR_PARAMETER);
diff --git a/tizen-audio-routing.c b/tizen-audio-routing.c
index 96528f6..67cf98c 100644
--- a/tizen-audio-routing.c
+++ b/tizen-audio-routing.c
@@ -141,9 +141,9 @@ static uint32_t __convert_device_string_to_enum(audio_hal_t *ah, const char *ver
return device;
}
-static audio_return_t __set_devices(audio_hal_t *ah, const char *verb, device_info_t *devices, uint32_t num_of_devices)
+static audio_return_e __set_devices(audio_hal_t *ah, const char *verb, device_info_s *devices, uint32_t num_of_devices)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
uint32_t new_device = 0;
const char *active_devices[MAX_DEVICES] = {NULL,};
int i = 0, j = 0, dev_idx = 0;
@@ -209,7 +209,7 @@ static audio_return_t __set_devices(audio_hal_t *ah, const char *verb, device_in
return audio_ret;
}
-static audio_return_t __save_route_infos(audio_hal_t *ah, device_info_t *devices, int32_t num_of_devices)
+static audio_return_e __save_route_infos(audio_hal_t *ah, device_info_s *devices, int32_t num_of_devices)
{
int i = 0;
@@ -218,11 +218,11 @@ static audio_return_t __save_route_infos(audio_hal_t *ah, device_info_t *devices
for (i = 0; i < MAX_DIRECTION; i++) {
if (!ah->saved_route_infos[i]) {
- ah->saved_route_infos[i] = malloc(sizeof(audio_route_info_t));
- memset(ah->saved_route_infos[i], 0, sizeof(audio_route_info_t));
+ ah->saved_route_infos[i] = malloc(sizeof(audio_route_info_s));
+ memset(ah->saved_route_infos[i], 0, sizeof(audio_route_info_s));
- ah->saved_route_infos[i]->device_infos = malloc(sizeof(device_info_t));
- memcpy(ah->saved_route_infos[i]->device_infos, devices, sizeof(device_info_t));
+ ah->saved_route_infos[i]->device_infos = malloc(sizeof(device_info_s));
+ memcpy(ah->saved_route_infos[i]->device_infos, devices, sizeof(device_info_s));
ah->saved_route_infos[i]->num_of_devices = num_of_devices;
@@ -254,10 +254,10 @@ static void __reset_saved_route_infos(void *audio_handle)
}
}
-static audio_return_t __update_route_ap_playback_capture(audio_hal_t *ah, audio_route_info_t *route_info)
+static audio_return_e __update_route_ap_playback_capture(audio_hal_t *ah, audio_route_info_s *route_info)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
- device_info_t *devices = NULL;
+ audio_return_e audio_ret = AUDIO_RET_OK;
+ device_info_s *devices = NULL;
const char *verb = mode_to_verb_str[VERB_NORMAL];
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -281,9 +281,9 @@ static audio_return_t __update_route_ap_playback_capture(audio_hal_t *ah, audio_
return audio_ret;
}
-static audio_return_t __update_route_voicecall(audio_hal_t *ah, device_info_t *devices, int32_t num_of_devices)
+static audio_return_e __update_route_voicecall(audio_hal_t *ah, device_info_s *devices, int32_t num_of_devices)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
const char *verb = mode_to_verb_str[VERB_VOICECALL];
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -329,9 +329,9 @@ static audio_return_t __update_route_voicecall(audio_hal_t *ah, device_info_t *d
return audio_ret;
}
-static audio_return_t __update_route_voip(audio_hal_t *ah, device_info_t *devices, int32_t num_of_devices)
+static audio_return_e __update_route_voip(audio_hal_t *ah, device_info_s *devices, int32_t num_of_devices)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
const char *verb = mode_to_verb_str[VERB_NORMAL];
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -350,9 +350,9 @@ static audio_return_t __update_route_voip(audio_hal_t *ah, device_info_t *device
return audio_ret;
}
-static audio_return_t __update_route_voice_recognition(audio_hal_t *ah, device_info_t *devices, int32_t num_of_devices)
+static audio_return_e __update_route_voice_recognition(audio_hal_t *ah, device_info_s *devices, int32_t num_of_devices)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
const char *verb = mode_to_verb_str[VERB_NORMAL];
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -386,9 +386,9 @@ static audio_return_t __update_route_voice_recognition(audio_hal_t *ah, device_i
return audio_ret;
}
-static audio_return_t __update_route_voice_information(audio_hal_t *ah, device_info_t *devices, int32_t num_of_devices)
+static audio_return_e __update_route_voice_information(audio_hal_t *ah, device_info_s *devices, int32_t num_of_devices)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
const char *verb = mode_to_verb_str[VERB_NORMAL];
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -422,9 +422,9 @@ static audio_return_t __update_route_voice_information(audio_hal_t *ah, device_i
return audio_ret;
}
-static audio_return_t __update_route_reset(audio_hal_t *ah, uint32_t direction)
+static audio_return_e __update_route_reset(audio_hal_t *ah, uint32_t direction)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
const char *active_devices[MAX_DEVICES] = {NULL,};
int i = 0, dev_idx = 0;
@@ -489,9 +489,9 @@ static audio_return_t __update_route_reset(audio_hal_t *ah, uint32_t direction)
return audio_ret;
}
-audio_return_t _audio_routing_init(audio_hal_t *ah)
+audio_return_e _audio_routing_init(audio_hal_t *ah)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -505,9 +505,9 @@ audio_return_t _audio_routing_init(audio_hal_t *ah)
return audio_ret;
}
-audio_return_t _audio_routing_deinit(audio_hal_t *ah)
+audio_return_e _audio_routing_deinit(audio_hal_t *ah)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -517,11 +517,11 @@ audio_return_t _audio_routing_deinit(audio_hal_t *ah)
return audio_ret;
}
-audio_return_t audio_update_route(void *audio_handle, audio_route_info_t *info)
+audio_return_e audio_update_route(void *audio_handle, audio_route_info_s *info)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
audio_hal_t *ah = (audio_hal_t *)audio_handle;
- device_info_t *devices = NULL;
+ device_info_s *devices = NULL;
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(info, AUDIO_ERR_PARAMETER);
@@ -560,9 +560,9 @@ audio_return_t audio_update_route(void *audio_handle, audio_route_info_t *info)
return audio_ret;
}
-audio_return_t audio_update_route_option(void *audio_handle, audio_route_option_t *option)
+audio_return_e audio_update_route_option(void *audio_handle, audio_route_option_s *option)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
audio_hal_t *ah = (audio_hal_t *)audio_handle;
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
diff --git a/tizen-audio-stream.c b/tizen-audio-stream.c
index c60a443..918ea30 100644
--- a/tizen-audio-stream.c
+++ b/tizen-audio-stream.c
@@ -23,23 +23,23 @@
#include "tizen-audio-internal.h"
-audio_return_t _audio_stream_init(audio_hal_t *ah)
+audio_return_e _audio_stream_init(audio_hal_t *ah)
{
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
return AUDIO_RET_OK;
}
-audio_return_t _audio_stream_deinit(audio_hal_t *ah)
+audio_return_e _audio_stream_deinit(audio_hal_t *ah)
{
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
return AUDIO_RET_OK;
}
-audio_return_t audio_notify_stream_connection_changed(void *audio_handle, audio_stream_info_t *info, uint32_t is_connected)
+audio_return_e audio_notify_stream_connection_changed(void *audio_handle, audio_stream_info_s *info, uint32_t is_connected)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
audio_hal_t *ah = (audio_hal_t *)audio_handle;
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
diff --git a/tizen-audio-volume.c b/tizen-audio-volume.c
index 72d3abb..1eaa972 100644
--- a/tizen-audio-volume.c
+++ b/tizen-audio-volume.c
@@ -175,7 +175,7 @@ static void __dump_tb(audio_hal_t *ah)
}
-static audio_return_t __load_volume_value_table_from_ini(audio_hal_t *ah)
+static audio_return_e __load_volume_value_table_from_ini(audio_hal_t *ah)
{
dictionary * dict = NULL;
uint32_t vol_type_idx, vol_level_idx, gain_type_idx;
@@ -255,11 +255,11 @@ static audio_return_t __load_volume_value_table_from_ini(audio_hal_t *ah)
return AUDIO_RET_OK;
}
-audio_return_t _audio_volume_init(audio_hal_t *ah)
+audio_return_e _audio_volume_init(audio_hal_t *ah)
{
int i;
int val = 0;
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
int init_value[AUDIO_VOLUME_TYPE_MAX] = { 9, 11, 7, 11, 7, 4, 4, 7 };
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -293,7 +293,7 @@ audio_return_t _audio_volume_init(audio_hal_t *ah)
return audio_ret;
}
-audio_return_t _audio_volume_deinit(audio_hal_t *ah)
+audio_return_e _audio_volume_deinit(audio_hal_t *ah)
{
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -305,7 +305,7 @@ audio_return_t _audio_volume_deinit(audio_hal_t *ah)
return AUDIO_RET_OK;
}
-audio_return_t audio_get_volume_level_max(void *audio_handle, audio_volume_info_t *info, uint32_t *level)
+audio_return_e audio_get_volume_level_max(void *audio_handle, audio_volume_info_s *info, uint32_t *level)
{
audio_hal_t *ah = (audio_hal_t *)audio_handle;
@@ -321,7 +321,7 @@ audio_return_t audio_get_volume_level_max(void *audio_handle, audio_volume_info_
return AUDIO_RET_OK;
}
-audio_return_t audio_get_volume_level(void *audio_handle, audio_volume_info_t *info, uint32_t *level)
+audio_return_e audio_get_volume_level(void *audio_handle, audio_volume_info_s *info, uint32_t *level)
{
audio_hal_t *ah = (audio_hal_t *)audio_handle;
@@ -341,7 +341,7 @@ audio_return_t audio_get_volume_level(void *audio_handle, audio_volume_info_t *i
return AUDIO_RET_OK;
}
-audio_return_t audio_get_volume_value(void *audio_handle, audio_volume_info_t *info, uint32_t level, double *value)
+audio_return_e audio_get_volume_value(void *audio_handle, audio_volume_info_s *info, uint32_t level, double *value)
{
audio_hal_t *ah = (audio_hal_t *)audio_handle;
audio_volume_value_table_t *volume_value_table;
@@ -365,9 +365,9 @@ audio_return_t audio_get_volume_value(void *audio_handle, audio_volume_info_t *i
return AUDIO_RET_OK;
}
-audio_return_t audio_set_volume_level(void *audio_handle, audio_volume_info_t *info, uint32_t level)
+audio_return_e audio_set_volume_level(void *audio_handle, audio_volume_info_s *info, uint32_t level)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
audio_hal_t *ah = (audio_hal_t *)audio_handle;
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -387,9 +387,9 @@ audio_return_t audio_set_volume_level(void *audio_handle, audio_volume_info_t *i
return audio_ret;
}
-audio_return_t audio_get_volume_mute(void *audio_handle, audio_volume_info_t *info, uint32_t *mute)
+audio_return_e audio_get_volume_mute(void *audio_handle, audio_volume_info_s *info, uint32_t *mute)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
audio_hal_t *ah = (audio_hal_t *)audio_handle;
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -401,9 +401,9 @@ audio_return_t audio_get_volume_mute(void *audio_handle, audio_volume_info_t *in
return audio_ret;
}
-audio_return_t audio_set_volume_mute(void *audio_handle, audio_volume_info_t *info, uint32_t mute)
+audio_return_e audio_set_volume_mute(void *audio_handle, audio_volume_info_s *info, uint32_t mute)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
audio_hal_t *ah = (audio_hal_t *)audio_handle;
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
@@ -416,9 +416,9 @@ audio_return_t audio_set_volume_mute(void *audio_handle, audio_volume_info_t *in
#define COMPRESS_VOL_CTRL "ComprTx0 Volume"
#define MAX_VOL_VALUE (8192/4)
-audio_return_t audio_set_volume_ratio(void *audio_handle, audio_stream_info_t *info, double ratio)
+audio_return_e audio_set_volume_ratio(void *audio_handle, audio_stream_info_s *info, double ratio)
{
- audio_return_t audio_ret = AUDIO_RET_OK;
+ audio_return_e audio_ret = AUDIO_RET_OK;
audio_hal_t *ah = (audio_hal_t *)audio_handle;
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
diff --git a/tizen-audio.c b/tizen-audio.c
index 07f6f97..fa4893b 100644
--- a/tizen-audio.c
+++ b/tizen-audio.c
@@ -23,10 +23,10 @@
#include "tizen-audio-internal.h"
-audio_return_t audio_init(void **audio_handle)
+audio_return_e audio_init(void **audio_handle)
{
audio_hal_t *ah;
- audio_return_t ret = AUDIO_RET_OK;
+ audio_return_e ret = AUDIO_RET_OK;
AUDIO_RETURN_VAL_IF_FAIL(audio_handle, AUDIO_ERR_PARAMETER);
@@ -70,7 +70,7 @@ error_exit:
return ret;
}
-audio_return_t audio_deinit(void *audio_handle)
+audio_return_e audio_deinit(void *audio_handle)
{
audio_hal_t *ah = (audio_hal_t *)audio_handle;
diff --git a/tizen-audio.h b/tizen-audio.h
index f18afa4..5c662c4 100644
--- a/tizen-audio.h
+++ b/tizen-audio.h
@@ -21,6 +21,7 @@
#define footizenaudiofoo
#include <stdint.h>
+#include <hal/hal-audio-interface.h>
/**
* @file tizen-audio.h
@@ -33,128 +34,6 @@
*/
/**
- * @brief Enumeration for return codes.
- * @since_tizen 3.0
- */
-typedef enum audio_return {
- AUDIO_RET_OK = 0,
- AUDIO_ERR_UNDEFINED = (int32_t)0x80001000,
- AUDIO_ERR_RESOURCE = (int32_t)0x80001001,
- AUDIO_ERR_PARAMETER = (int32_t)0x80001002,
- AUDIO_ERR_IOCTL = (int32_t)0x80001003,
- AUDIO_ERR_INVALID_STATE = (int32_t)0x80001004,
- AUDIO_ERR_INTERNAL = (int32_t)0x80001005,
- /* add new enemerator here */
- AUDIO_ERR_NOT_IMPLEMENTED = (int32_t)0x80001100,
-} audio_return_t ;
-
-/**
- * @brief Enumeration for audio direction.
- * @since_tizen 3.0
- */
-typedef enum audio_direction {
- AUDIO_DIRECTION_IN, /**< Capture */
- AUDIO_DIRECTION_OUT, /**< Playback */
-} audio_direction_t;
-
-/**
- * @brief Device information including type, direction and id.
- * @since_tizen 3.0
- */
-typedef struct device_info {
- const char *type;
- uint32_t direction;
- uint32_t id;
-} device_info_t;
-
-/**
- * @brief Volume information including type, gain and direction.
- * @since_tizen 3.0
- */
-typedef struct audio_volume_info {
- const char *type;
- const char *gain;
- uint32_t direction;
-} audio_volume_info_t ;
-
-/**
- * @brief Route information including role and device.
- * @since_tizen 3.0
- */
-typedef struct audio_route_info {
- const char *role;
- device_info_t *device_infos;
- uint32_t num_of_devices;
-} audio_route_info_t;
-
-/**
- * @brief Route option including role, name and value.
- * @since_tizen 3.0
- */
-typedef struct audio_route_option {
- const char *role;
- const char *name;
- int32_t value;
-} audio_route_option_t;
-
-/**
- * @brief Stream information including role, direction and index.
- * @since_tizen 3.0
- */
-typedef struct audio_stream_info {
- const char *role;
- uint32_t direction;
- uint32_t idx;
-} audio_stream_info_t ;
-
-/**
- * @brief Called when audio hal implementation needs to send a message.
- * @since_tizen 3.0
- * @param[in] name The message name
- * @param[in] value The message value
- * @param[in] user_data The user data passed from the callback registration function
- *
- * @see audio_add_message_cb()
- * @see audio_remove_message_cb()
- */
-typedef void (*message_cb)(const char *name, int value, void *user_data);
-
-/* Overall */
-typedef struct audio_interface {
- /* Initialization & de-initialization */
- audio_return_t (*init)(void **audio_handle);
- audio_return_t (*deinit)(void *audio_handle);
- /* Volume */
- audio_return_t (*get_volume_level_max)(void *audio_handle, audio_volume_info_t *info, uint32_t *level);
- audio_return_t (*get_volume_level)(void *audio_handle, audio_volume_info_t *info, uint32_t *level);
- audio_return_t (*set_volume_level)(void *audio_handle, audio_volume_info_t *info, uint32_t level);
- audio_return_t (*get_volume_value)(void *audio_handle, audio_volume_info_t *info, uint32_t level, double *value);
- audio_return_t (*get_volume_mute)(void *audio_handle, audio_volume_info_t *info, uint32_t *mute);
- audio_return_t (*set_volume_mute)(void *audio_handle, audio_volume_info_t *info, uint32_t mute);
- audio_return_t (*set_volume_ratio)(void *audio_handle, audio_stream_info_t *info, double ratio);
- /* Routing */
- audio_return_t (*update_route)(void *audio_handle, audio_route_info_t *info);
- audio_return_t (*update_route_option)(void *audio_handle, audio_route_option_t *option);
- /* Stream */
- audio_return_t (*notify_stream_connection_changed)(void *audio_handle, audio_stream_info_t *info, uint32_t is_connected);
- /* PCM */
- audio_return_t (*pcm_open)(void *audio_handle, const char *card, const char *device, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods, void **pcm_handle);
- audio_return_t (*pcm_start)(void *audio_handle, void *pcm_handle);
- audio_return_t (*pcm_stop)(void *audio_handle, void *pcm_handle);
- audio_return_t (*pcm_close)(void *audio_handle, void *pcm_handle);
- audio_return_t (*pcm_avail)(void *audio_handle, void *pcm_handle, uint32_t *avail);
- audio_return_t (*pcm_write)(void *audio_handle, void *pcm_handle, const void *buffer, uint32_t frames);
- audio_return_t (*pcm_read)(void *audio_handle, void *pcm_handle, void *buffer, uint32_t frames);
- audio_return_t (*pcm_get_fd)(void *audio_handle, void *pcm_handle, int *fd);
- audio_return_t (*pcm_recover)(void *audio_handle, void *pcm_handle, int revents);
- audio_return_t (*pcm_get_params)(void *audio_handle, void *pcm_handle, uint32_t direction, void **sample_spec, uint32_t *period_size, uint32_t *periods);
- audio_return_t (*pcm_set_params)(void *audio_handle, void *pcm_handle, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods);
- /* Message callback */
- audio_return_t (*add_message_cb)(void *audio_handle, message_cb callback, void *user_data);
- audio_return_t (*remove_message_cb)(void *audio_handle, message_cb callback);
-} audio_interface_t;
-
-/**
* @brief Initializes audio hal.
* @since_tizen 3.0
* @param[out] audio_handle The audio hal handle
@@ -164,7 +43,7 @@ typedef struct audio_interface {
* @retval #AUDIO_RET_OK Success
* @see audio_deinit()
*/
-audio_return_t audio_init(void **audio_handle);
+audio_return_e audio_init(void **audio_handle);
/**
* @brief De-initializes audio hal.
@@ -176,7 +55,7 @@ audio_return_t audio_init(void **audio_handle);
* @retval #AUDIO_RET_OK Success
* @see audio_init()
*/
-audio_return_t audio_deinit(void *audio_handle);
+audio_return_e audio_deinit(void *audio_handle);
/**
* @brief Gets the maximum volume level supported for a particular volume information.
@@ -192,7 +71,7 @@ audio_return_t audio_deinit(void *audio_handle);
* @see audio_get_volume_level()
* @see audio_get_volume_value()
*/
-audio_return_t audio_get_volume_level_max(void *audio_handle, audio_volume_info_t *info, uint32_t *level);
+audio_return_e audio_get_volume_level_max(void *audio_handle, audio_volume_info_s *info, uint32_t *level);
/**
* @brief Gets the volume level specified for a particular volume information.
@@ -208,7 +87,7 @@ audio_return_t audio_get_volume_level_max(void *audio_handle, audio_volume_info_
* @see audio_get_volume_level_max()
* @see audio_get_volume_value()
*/
-audio_return_t audio_get_volume_level(void *audio_handle, audio_volume_info_t *info, uint32_t *level);
+audio_return_e audio_get_volume_level(void *audio_handle, audio_volume_info_s *info, uint32_t *level);
/**
* @brief Sets the volume level specified for a particular volume information.
@@ -224,7 +103,7 @@ audio_return_t audio_get_volume_level(void *audio_handle, audio_volume_info_t *i
* @see audio_get_volume_level_max()
* @see audio_get_volume_value()
*/
-audio_return_t audio_set_volume_level(void *audio_handle, audio_volume_info_t *info, uint32_t level);
+audio_return_e audio_set_volume_level(void *audio_handle, audio_volume_info_s *info, uint32_t level);
/**
* @brief Gets the volume value specified for a particular volume information and level.
@@ -241,7 +120,7 @@ audio_return_t audio_set_volume_level(void *audio_handle, audio_volume_info_t *i
* @see audio_get_volume_level()
* @see audio_get_volume_level_max()
*/
-audio_return_t audio_get_volume_value(void *audio_handle, audio_volume_info_t *info, uint32_t level, double *value);
+audio_return_e audio_get_volume_value(void *audio_handle, audio_volume_info_s *info, uint32_t level, double *value);
/**
* @brief Gets the volume mute specified for a particular volume information.
@@ -255,7 +134,7 @@ audio_return_t audio_get_volume_value(void *audio_handle, audio_volume_info_t *i
* @retval #AUDIO_RET_OK Success
* @see audio_set_volume_mute()
*/
-audio_return_t audio_get_volume_mute(void *audio_handle, audio_volume_info_t *info, uint32_t *mute);
+audio_return_e audio_get_volume_mute(void *audio_handle, audio_volume_info_s *info, uint32_t *mute);
/**
* @brief Sets the volume mute specified for a particular volume information.
@@ -269,7 +148,20 @@ audio_return_t audio_get_volume_mute(void *audio_handle, audio_volume_info_t *in
* @retval #AUDIO_RET_OK Success
* @see audio_get_volume_mute()
*/
-audio_return_t audio_set_volume_mute(void *audio_handle, audio_volume_info_t *info, uint32_t mute);
+audio_return_e audio_set_volume_mute(void *audio_handle, audio_volume_info_s *info, uint32_t mute);
+
+/**
+ * @brief Sets the volume ratio specified for a particular volume information. (optional)
+ * @since_tizen 5.5
+ * @param[in] audio_handle The audio hal handle
+ * @param[in] info The audio volume information
+ * @param[in] ratio The volume ratio to be set (Min.:0.0 ~ Max.:1.0, default:1.0)
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ */
+audio_return_e audio_set_volume_ratio(void *audio_handle, audio_stream_info_s *info, double ratio);
/**
* @brief Updates the audio routing according to audio route information.
@@ -282,7 +174,7 @@ audio_return_t audio_set_volume_mute(void *audio_handle, audio_volume_info_t *in
* @retval #AUDIO_RET_OK Success
* @see audio_update_route_option()
*/
-audio_return_t audio_update_route(void *audio_handle, audio_route_info_t *info);
+audio_return_e audio_update_route(void *audio_handle, audio_route_info_s *info);
/**
* @brief Updates audio routing option according to audio route option.
@@ -298,7 +190,7 @@ audio_return_t audio_update_route(void *audio_handle, audio_route_info_t *info);
* @retval #AUDIO_RET_OK Success
* @see audio_update_route()
*/
-audio_return_t audio_update_route_option(void *audio_handle, audio_route_option_t *option);
+audio_return_e audio_update_route_option(void *audio_handle, audio_route_option_s *option);
/**
* @brief Gets notified when a stream is connected and disconnected.
@@ -313,7 +205,7 @@ audio_return_t audio_update_route_option(void *audio_handle, audio_route_option_
* otherwise a negative error value
* @retval #AUDIO_RET_OK Success
*/
-audio_return_t audio_notify_stream_connection_changed(void *audio_handle, audio_stream_info_t *info, uint32_t is_connected);
+audio_return_e audio_notify_stream_connection_changed(void *audio_handle, audio_stream_info_s *info, uint32_t is_connected);
/**
* @brief Opens a PCM device.
@@ -332,7 +224,7 @@ audio_return_t audio_notify_stream_connection_changed(void *audio_handle, audio_
* @retval #AUDIO_RET_OK Success
* @see audio_pcm_close()
*/
-audio_return_t audio_pcm_open(void *audio_handle, const char *card, const char *device, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods, void **pcm_handle);
+audio_return_e audio_pcm_open(void *audio_handle, const char *card, const char *device, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods, void **pcm_handle);
/**
* @brief Starts a PCM device.
@@ -349,7 +241,7 @@ audio_return_t audio_pcm_open(void *audio_handle, const char *card, const char *
* @see audio_pcm_stop()
* @see audio_pcm_recover()
*/
-audio_return_t audio_pcm_start(void *audio_handle, void *pcm_handle);
+audio_return_e audio_pcm_start(void *audio_handle, void *pcm_handle);
/**
* @brief Stops a PCM device.
@@ -362,7 +254,7 @@ audio_return_t audio_pcm_start(void *audio_handle, void *pcm_handle);
* @retval #AUDIO_RET_OK Success
* @see audio_pcm_start()
*/
-audio_return_t audio_pcm_stop(void *audio_handle, void *pcm_handle);
+audio_return_e audio_pcm_stop(void *audio_handle, void *pcm_handle);
/**
* @brief Closes a PCM device.
@@ -375,7 +267,7 @@ audio_return_t audio_pcm_stop(void *audio_handle, void *pcm_handle);
* @retval #AUDIO_RET_OK Success
* @see audio_pcm_open()
*/
-audio_return_t audio_pcm_close(void *audio_handle, void *pcm_handle);
+audio_return_e audio_pcm_close(void *audio_handle, void *pcm_handle);
/**
* @brief Gets available number of frames.
@@ -390,7 +282,7 @@ audio_return_t audio_pcm_close(void *audio_handle, void *pcm_handle);
* @see audio_pcm_write()
* @see audio_pcm_read()
*/
-audio_return_t audio_pcm_avail(void *audio_handle, void *pcm_handle, uint32_t *avail);
+audio_return_e audio_pcm_avail(void *audio_handle, void *pcm_handle, uint32_t *avail);
/**
* @brief Writes frames to a PCM device.
@@ -406,7 +298,7 @@ audio_return_t audio_pcm_avail(void *audio_handle, void *pcm_handle, uint32_t *a
* @see audio_pcm_avail()
* @see audio_pcm_recover()
*/
-audio_return_t audio_pcm_write(void *audio_handle, void *pcm_handle, const void *buffer, uint32_t frames);
+audio_return_e audio_pcm_write(void *audio_handle, void *pcm_handle, const void *buffer, uint32_t frames);
/**
* @brief Reads frames from a PCM device.
@@ -422,7 +314,7 @@ audio_return_t audio_pcm_write(void *audio_handle, void *pcm_handle, const void
* @see audio_pcm_avail()
* @see audio_pcm_recover()
*/
-audio_return_t audio_pcm_read(void *audio_handle, void *pcm_handle, void *buffer, uint32_t frames);
+audio_return_e audio_pcm_read(void *audio_handle, void *pcm_handle, void *buffer, uint32_t frames);
/**
* @brief Gets poll descriptor for a PCM handle.
@@ -437,7 +329,7 @@ audio_return_t audio_pcm_read(void *audio_handle, void *pcm_handle, void *buffer
* @see audio_pcm_open()
* @see audio_pcm_recover()
*/
-audio_return_t audio_pcm_get_fd(void *audio_handle, void *pcm_handle, int *fd);
+audio_return_e audio_pcm_get_fd(void *audio_handle, void *pcm_handle, int *fd);
/**
* @brief Recovers the PCM state.
@@ -454,7 +346,7 @@ audio_return_t audio_pcm_get_fd(void *audio_handle, void *pcm_handle, int *fd);
* @see audio_pcm_read()
* @see audio_pcm_get_fd()
*/
-audio_return_t audio_pcm_recover(void *audio_handle, void *pcm_handle, int revents);
+audio_return_e audio_pcm_recover(void *audio_handle, void *pcm_handle, int revents);
/**
* @brief Gets parameters of a PCM device.
@@ -471,7 +363,7 @@ audio_return_t audio_pcm_recover(void *audio_handle, void *pcm_handle, int reven
* @retval #AUDIO_RET_OK Success
* @see audio_pcm_set_params()
*/
-audio_return_t audio_pcm_get_params(void *audio_handle, void *pcm_handle, uint32_t direction, void **sample_spec, uint32_t *period_size, uint32_t *periods);
+audio_return_e audio_pcm_get_params(void *audio_handle, void *pcm_handle, uint32_t direction, void **sample_spec, uint32_t *period_size, uint32_t *periods);
/**
* @brief Sets hardware and software parameters of a PCM device.
@@ -488,7 +380,7 @@ audio_return_t audio_pcm_get_params(void *audio_handle, void *pcm_handle, uint32
* @retval #AUDIO_RET_OK Success
* @see audio_pcm_set_params()
*/
-audio_return_t audio_pcm_set_params(void *audio_handle, void *pcm_handle, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods);
+audio_return_e audio_pcm_set_params(void *audio_handle, void *pcm_handle, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods);
/**
* @brief Adds the message callback function.
@@ -500,7 +392,7 @@ audio_return_t audio_pcm_set_params(void *audio_handle, void *pcm_handle, uint32
* @see message_cb()
* @see audio_remove_message_cb()
*/
-audio_return_t audio_add_message_cb(void *audio_handle, message_cb callback, void *user_data);
+audio_return_e audio_add_message_cb(void *audio_handle, message_cb callback, void *user_data);
/**
* @brief Removes the message callback function.
@@ -511,7 +403,7 @@ audio_return_t audio_add_message_cb(void *audio_handle, message_cb callback, voi
* @see message_cb()
* @see audio_add_message_cb()
*/
-audio_return_t audio_remove_message_cb(void *audio_handle, message_cb callback);
+audio_return_e audio_remove_message_cb(void *audio_handle, message_cb callback);
/**
* @}