diff options
author | Jaechul Lee <jcsing.lee@samsung.com> | 2021-02-05 11:28:26 +0900 |
---|---|---|
committer | Jaechul Lee <jcsing.lee@samsung.com> | 2021-02-05 11:28:26 +0900 |
commit | 2b94e88f8fb684c7ec4460a397d5ab0972e36183 (patch) | |
tree | 7beb47d6c2f1e43c6dc4bbccdbd869dce25f75a2 | |
parent | 58ad926b713565a914a1e13c9af2e54e900a8fee (diff) | |
download | audio-hal-sc7727-2b94e88f8fb684c7ec4460a397d5ab0972e36183.tar.gz audio-hal-sc7727-2b94e88f8fb684c7ec4460a397d5ab0972e36183.tar.bz2 audio-hal-sc7727-2b94e88f8fb684c7ec4460a397d5ab0972e36183.zip |
typdef postfix is changed to {enum}_e and {struct}_s
enum and structure are changed for better readability. In case of enum,
{enum}_t is changed to {enum}_'e', and {struct}_t is changed to
{struct}_'s'
[Version] 0.1.37
[Issue Type] Readability enhance
Change-Id: Icdf038f51a65387f1f11ef75f506b6b6d6ee9236
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
-rw-r--r-- | hal-backend-audio.c | 19 | ||||
-rw-r--r-- | packaging/audio-hal-sc7727.spec | 2 | ||||
-rw-r--r-- | tizen-audio-comm.c | 14 | ||||
-rw-r--r-- | tizen-audio-ctrl.c | 4 | ||||
-rw-r--r-- | tizen-audio-impl-ctrl.c | 14 | ||||
-rw-r--r-- | tizen-audio-impl-pcm.c | 40 | ||||
-rw-r--r-- | tizen-audio-impl-ucm.c | 16 | ||||
-rw-r--r-- | tizen-audio-impl.h | 42 | ||||
-rw-r--r-- | tizen-audio-internal.h | 76 | ||||
-rw-r--r-- | tizen-audio-modem.c | 18 | ||||
-rw-r--r-- | tizen-audio-pcm.c | 12 | ||||
-rw-r--r-- | tizen-audio-routing.c | 26 | ||||
-rw-r--r-- | tizen-audio-stream.c | 6 | ||||
-rw-r--r-- | tizen-audio-volume.c | 32 | ||||
-rw-r--r-- | tizen-audio.c | 6 |
15 files changed, 173 insertions, 154 deletions
diff --git a/hal-backend-audio.c b/hal-backend-audio.c index 60239b9..1fc2071 100644 --- a/hal-backend-audio.c +++ b/hal-backend-audio.c @@ -1,3 +1,22 @@ +/* + * 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> diff --git a/packaging/audio-hal-sc7727.spec b/packaging/audio-hal-sc7727.spec index ce064d2..c848119 100644 --- a/packaging/audio-hal-sc7727.spec +++ b/packaging/audio-hal-sc7727.spec @@ -1,6 +1,6 @@ Name: audio-hal-sc7727 Summary: TIZEN Audio HAL for SC7727 -Version: 0.1.36 +Version: 0.1.37 Release: 0 Group: System/Libraries License: Apache-2.0 diff --git a/tizen-audio-comm.c b/tizen-audio-comm.c index 50f7802..ed71126 100644 --- a/tizen-audio-comm.c +++ b/tizen-audio-comm.c @@ -22,7 +22,7 @@ #include "tizen-audio-internal.h" -static audio_return_e __set_message_callback(audio_hal_t *ah, message_cb callback, void *user_data) +static audio_return_e __set_message_callback(audio_hal_s *ah, message_cb callback, void *user_data) { audio_return_e audio_ret = AUDIO_RET_OK; @@ -37,7 +37,7 @@ static audio_return_e __set_message_callback(audio_hal_t *ah, message_cb callbac return audio_ret; } -static audio_return_e __unset_message_callback(audio_hal_t *ah) +static audio_return_e __unset_message_callback(audio_hal_s *ah) { audio_return_e audio_ret = AUDIO_RET_OK; @@ -51,7 +51,7 @@ static audio_return_e __unset_message_callback(audio_hal_t *ah) return audio_ret; } -audio_return_e _audio_comm_init(audio_hal_t *ah) +audio_return_e _audio_comm_init(audio_hal_s *ah) { audio_return_e audio_ret = AUDIO_RET_OK; @@ -63,7 +63,7 @@ audio_return_e _audio_comm_init(audio_hal_t *ah) return audio_ret; } -audio_return_e _audio_comm_deinit(audio_hal_t *ah) +audio_return_e _audio_comm_deinit(audio_hal_s *ah) { audio_return_e audio_ret = AUDIO_RET_OK; @@ -75,7 +75,7 @@ audio_return_e _audio_comm_deinit(audio_hal_t *ah) return audio_ret; } -audio_return_e _audio_comm_send_message(audio_hal_t *ah, const char *name, int value) +audio_return_e _audio_comm_send_message(audio_hal_s *ah, const char *name, int value) { audio_return_e audio_ret = AUDIO_RET_OK; @@ -99,7 +99,7 @@ audio_return_e audio_add_message_cb(void *audio_handle, message_cb callback, voi /* NOTE: Management of several callbacks could be implemented. But we do not care of it for now.*/ - ret = __set_message_callback((audio_hal_t *)audio_handle, callback, user_data); + ret = __set_message_callback((audio_hal_s *)audio_handle, callback, user_data); return ret; } @@ -111,7 +111,7 @@ audio_return_e audio_remove_message_cb(void *audio_handle, message_cb callback) AUDIO_RETURN_VAL_IF_FAIL(audio_handle, AUDIO_ERR_PARAMETER); AUDIO_RETURN_VAL_IF_FAIL(callback, AUDIO_ERR_PARAMETER); - ret = __unset_message_callback((audio_hal_t *)audio_handle); + ret = __unset_message_callback((audio_hal_s *)audio_handle); return ret; }
\ No newline at end of file diff --git a/tizen-audio-ctrl.c b/tizen-audio-ctrl.c index 40c5d6c..b6536d8 100644 --- a/tizen-audio-ctrl.c +++ b/tizen-audio-ctrl.c @@ -23,7 +23,7 @@ #include "tizen-audio-internal.h" #include "tizen-audio-impl.h" -audio_return_e _audio_ctrl_init(audio_hal_t *ah) +audio_return_e _audio_ctrl_init(audio_hal_s *ah) { audio_return_e audio_ret = AUDIO_RET_OK; @@ -34,7 +34,7 @@ audio_return_e _audio_ctrl_init(audio_hal_t *ah) return audio_ret; } -audio_return_e _audio_ctrl_deinit(audio_hal_t *ah) +audio_return_e _audio_ctrl_deinit(audio_hal_s *ah) { audio_return_e audio_ret = AUDIO_RET_OK; diff --git a/tizen-audio-impl-ctrl.c b/tizen-audio-impl-ctrl.c index 2c86a79..07a81a2 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_e _mixer_control_init(audio_hal_t *ah) +audio_return_e _mixer_control_init(audio_hal_s *ah) { AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); @@ -55,7 +55,7 @@ audio_return_e _mixer_control_init(audio_hal_t *ah) return AUDIO_RET_OK; } -audio_return_e _mixer_control_deinit(audio_hal_t *ah) +audio_return_e _mixer_control_deinit(audio_hal_s *ah) { AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); @@ -63,7 +63,7 @@ audio_return_e _mixer_control_deinit(audio_hal_t *ah) return AUDIO_RET_OK; } -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_e _mixer_control_set_param(audio_hal_s *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_e _mixer_control_set_param(audio_hal_t *ah, const char* ctl_name, s return AUDIO_RET_OK; } -audio_return_e _mixer_control_get_value(audio_hal_t *ah, const char *ctl_name, int *val) +audio_return_e _mixer_control_get_value(audio_hal_s *ah, const char *ctl_name, int *val) { snd_ctl_t *handle; snd_ctl_elem_value_t *control; @@ -153,7 +153,7 @@ close: return AUDIO_ERR_UNDEFINED; } -audio_return_e _mixer_control_set_value(audio_hal_t *ah, const char *ctl_name, int val) +audio_return_e _mixer_control_set_value(audio_hal_s *ah, const char *ctl_name, int val) { snd_ctl_t *handle; snd_ctl_elem_value_t *control; @@ -232,7 +232,7 @@ close: return AUDIO_ERR_UNDEFINED; } -audio_return_e _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_s *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); @@ -242,7 +242,7 @@ audio_return_e _mixer_control_set_value_string(audio_hal_t *ah, const char* ctl_ } -audio_return_e _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_s *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 ba9e7d0..668ab80 100644 --- a/tizen-audio-impl-pcm.c +++ b/tizen-audio-impl-pcm.c @@ -61,14 +61,14 @@ static const uint32_t g_format_convert_table[] = { }; #endif -static uint32_t __convert_format(audio_sample_format_t format) +static uint32_t __convert_format(audio_sample_format_s format) { return g_format_convert_table[format]; } /* #define DEBUG_TIMING */ -static int __voice_pcm_set_params(audio_hal_t *ah, snd_pcm_t *pcm) +static int __voice_pcm_set_params(audio_hal_s *ah, snd_pcm_t *pcm) { snd_pcm_hw_params_t *params = NULL; int err = 0; @@ -145,7 +145,7 @@ static int __parse_card_device_number(const char *card, const char *device, unsi return 0; } -static struct pcm *__tinyalsa_open_device(const char *card, const char *device, audio_pcm_sample_spec_t *ss, size_t period_size, size_t period_count, uint32_t direction) +static struct pcm *__tinyalsa_open_device(const char *card, const char *device, audio_pcm_sample_spec_s *ss, size_t period_size, size_t period_count, uint32_t direction) { struct pcm *pcm = NULL; struct pcm_config config; @@ -205,12 +205,12 @@ static int __tinyalsa_pcm_recover(struct pcm *pcm, int err) } #endif -audio_return_e _fmradio_pcm_open(audio_hal_t *ah) +audio_return_e _fmradio_pcm_open(audio_hal_s *ah) { audio_return_e audio_ret = AUDIO_RET_OK; int ret = 0; const char *device_name = NULL; - audio_pcm_sample_spec_t sample_spec; + audio_pcm_sample_spec_s sample_spec; uint8_t use_mmap = 0; sample_spec.rate = 44100; sample_spec.channels = 2; @@ -248,7 +248,7 @@ error_exit: return audio_ret; } -audio_return_e _fmradio_pcm_close(audio_hal_t *ah) +audio_return_e _fmradio_pcm_close(audio_hal_s *ah) { audio_return_e audio_ret = AUDIO_RET_OK; @@ -268,7 +268,7 @@ audio_return_e _fmradio_pcm_close(audio_hal_t *ah) return audio_ret; } -audio_return_e _voice_pcm_open(audio_hal_t *ah) +audio_return_e _voice_pcm_open(audio_hal_s *ah) { int err, ret = 0; @@ -301,7 +301,7 @@ audio_return_e _voice_pcm_open(audio_hal_t *ah) return (ret == 0 ? AUDIO_RET_OK : AUDIO_ERR_INTERNAL); } -audio_return_e _voice_pcm_close(audio_hal_t *ah, uint32_t direction) +audio_return_e _voice_pcm_close(audio_hal_s *ah, uint32_t direction) { audio_return_e audio_ret = AUDIO_RET_OK; @@ -328,7 +328,7 @@ audio_return_e _voice_pcm_close(audio_hal_t *ah, uint32_t direction) return audio_ret; } -audio_return_e _reset_pcm_devices(audio_hal_t *ah) +audio_return_e _reset_pcm_devices(audio_hal_s *ah) { audio_return_e audio_ret = AUDIO_RET_OK; @@ -381,10 +381,10 @@ audio_return_e _pcm_open(const char *card, const char *device, uint32_t directio AUDIO_LOG_INFO("card(%s) device(%s) direction(%u) period_size(%u) periods(%u)", card, device, direction, period_size, periods); #ifdef __USE_TINYALSA__ - audio_pcm_sample_spec_t *ss; + audio_pcm_sample_spec_s *ss; - ss = (audio_pcm_sample_spec_t *)sample_spec; - ss->format = __convert_format((audio_sample_format_t)ss->format); + ss = (audio_pcm_sample_spec_s *)sample_spec; + ss->format = __convert_format((audio_sample_format_s)ss->format); *pcm_handle = __tinyalsa_open_device(card, device, ss, (size_t)period_size, (size_t)periods, direction); if (*pcm_handle == NULL) { @@ -675,12 +675,12 @@ 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) { #ifdef __USE_TINYALSA__ - audio_pcm_sample_spec_t *ss; + audio_pcm_sample_spec_s *ss; unsigned int _period_size, _buffer_size, _periods, _format, _rate, _channels; unsigned int _start_threshold, _stop_threshold, _silence_threshold; struct pcm_config *config; - ss = (audio_pcm_sample_spec_t *)*sample_spec; + ss = (audio_pcm_sample_spec_s *)*sample_spec; /* we use an internal API of the tiny alsa library, so it causes warning message during compile */ _pcm_config(pcm_handle, &config); @@ -699,7 +699,7 @@ audio_return_e _pcm_get_params(void *pcm_handle, uint32_t direction, void **samp pcm_handle, config->format, config->rate, config->channels, config->period_size, config->period_count, _buffer_size); #else /* alsa-lib */ int err; - audio_pcm_sample_spec_t *ss; + audio_pcm_sample_spec_s *ss; int dir; snd_pcm_uframes_t _period_size, _buffer_size; snd_pcm_format_t _format; @@ -709,7 +709,7 @@ audio_return_e _pcm_get_params(void *pcm_handle, uint32_t direction, void **samp snd_pcm_hw_params_t *hwparams; snd_pcm_sw_params_t *swparams; - ss = (audio_pcm_sample_spec_t *)*sample_spec; + ss = (audio_pcm_sample_spec_s *)*sample_spec; snd_pcm_hw_params_alloca(&hwparams); snd_pcm_sw_params_alloca(&swparams); @@ -761,12 +761,12 @@ audio_return_e _pcm_set_params(void *pcm_handle, uint32_t direction, void *sampl AUDIO_LOG_DEBUG("_pcm_set_params"); #else /* alsa-lib */ int err; - audio_pcm_sample_spec_t ss; + audio_pcm_sample_spec_s ss; snd_pcm_uframes_t _buffer_size; snd_pcm_hw_params_t *hwparams; snd_pcm_sw_params_t *swparams; - ss = *(audio_pcm_sample_spec_t *)sample_spec; + ss = *(audio_pcm_sample_spec_s *)sample_spec; snd_pcm_hw_params_alloca(&hwparams); snd_pcm_sw_params_alloca(&swparams); @@ -787,7 +787,7 @@ audio_return_e _pcm_set_params(void *pcm_handle, uint32_t direction, void *sampl return AUDIO_ERR_PARAMETER; } - ss.format = __convert_format((audio_sample_format_t)ss.format); + ss.format = __convert_format((audio_sample_format_s)ss.format); if ((err = snd_pcm_hw_params_set_format(pcm_handle, hwparams, ss.format)) < 0) { AUDIO_LOG_ERROR("snd_pcm_hw_params_set_format() failed : %d", err); return AUDIO_ERR_PARAMETER; @@ -869,7 +869,7 @@ audio_return_e _pcm_set_params(void *pcm_handle, uint32_t direction, void *sampl } /* Generic snd pcm interface APIs */ -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_e _pcm_set_hw_params(snd_pcm_t *pcm, audio_pcm_sample_spec_s *sample_spec, uint8_t *use_mmap, snd_pcm_uframes_t *period_size, snd_pcm_uframes_t *buffer_size) { audio_return_e ret = AUDIO_RET_OK; snd_pcm_hw_params_t *hwparams; diff --git a/tizen-audio-impl-ucm.c b/tizen-audio-impl-ucm.c index 8212b0f..87db8db 100644 --- a/tizen-audio-impl-ucm.c +++ b/tizen-audio-impl-ucm.c @@ -97,7 +97,7 @@ static inline int __set_use_case_with_time(snd_use_case_mgr_t *uc_mgr, const cha } #endif -audio_return_e _ucm_init(audio_hal_t *ah) +audio_return_e _ucm_init(audio_hal_s *ah) { AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); @@ -110,7 +110,7 @@ audio_return_e _ucm_init(audio_hal_t *ah) return AUDIO_RET_OK; } -audio_return_e _ucm_deinit(audio_hal_t *ah) +audio_return_e _ucm_deinit(audio_hal_s *ah) { AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); AUDIO_RETURN_VAL_IF_FAIL(ah->ucm.uc_mgr, AUDIO_ERR_PARAMETER); @@ -123,7 +123,7 @@ audio_return_e _ucm_deinit(audio_hal_t *ah) return AUDIO_RET_OK; } -audio_return_e _ucm_get_device_name(audio_hal_t *ah, const char *use_case, audio_direction_e direction, const char **value) +audio_return_e _ucm_get_device_name(audio_hal_s *ah, const char *use_case, audio_direction_e direction, const char **value) { char identifier[70] = { 0, }; @@ -154,7 +154,7 @@ audio_return_e _ucm_get_device_name(audio_hal_t *ah, const char *use_case, audio 2) If verb is changed -> Reset, set new verb, enable devices & modifiers */ -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_use_case(audio_hal_s *ah, const char *verb, const char *devices[], const char *modifiers[]) { audio_return_e audio_ret = AUDIO_RET_OK; int is_verb_changed = 0, is_dev_changed = 0, is_mod_changed = 0; @@ -360,7 +360,7 @@ exit: return audio_ret; } -audio_return_e _ucm_set_devices(audio_hal_t *ah, const char *verb, const char *devices[]) +audio_return_e _ucm_set_devices(audio_hal_s *ah, const char *verb, const char *devices[]) { audio_return_e audio_ret = AUDIO_RET_OK; int is_verb_changed = 0, is_dev_changed = 0; @@ -503,7 +503,7 @@ exit: } -audio_return_e _ucm_set_modifiers(audio_hal_t *ah, const char *verb, const char *modifiers[]) +audio_return_e _ucm_set_modifiers(audio_hal_s *ah, const char *verb, const char *modifiers[]) { audio_return_e audio_ret = AUDIO_RET_OK; int is_verb_changed = 0, is_mod_changed = 0; @@ -632,7 +632,7 @@ exit: return audio_ret; } -audio_return_e _ucm_get_verb(audio_hal_t *ah, const char **value) +audio_return_e _ucm_get_verb(audio_hal_s *ah, const char **value) { audio_return_e ret = AUDIO_RET_OK; @@ -648,7 +648,7 @@ audio_return_e _ucm_get_verb(audio_hal_t *ah, const char **value) return ret; } -audio_return_e _ucm_reset_use_case(audio_hal_t *ah) +audio_return_e _ucm_reset_use_case(audio_hal_s *ah) { audio_return_e ret = AUDIO_RET_OK; diff --git a/tizen-audio-impl.h b/tizen-audio-impl.h index d4784c7..e4a445c 100644 --- a/tizen-audio-impl.h +++ b/tizen-audio-impl.h @@ -21,11 +21,11 @@ */ /* PCM */ -audio_return_e _fmradio_pcm_open(audio_hal_t *ah); -audio_return_e _fmradio_pcm_close(audio_hal_t *ah); -audio_return_e _voice_pcm_open(audio_hal_t *ah); -audio_return_e _voice_pcm_close(audio_hal_t *ah, uint32_t direction); -audio_return_e _reset_pcm_devices(audio_hal_t *ah); +audio_return_e _fmradio_pcm_open(audio_hal_s *ah); +audio_return_e _fmradio_pcm_close(audio_hal_s *ah); +audio_return_e _voice_pcm_open(audio_hal_s *ah); +audio_return_e _voice_pcm_close(audio_hal_s *ah, uint32_t direction); +audio_return_e _reset_pcm_devices(audio_hal_s *ah); 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); @@ -38,7 +38,7 @@ 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); +audio_return_e _pcm_set_hw_params(snd_pcm_t *pcm, audio_pcm_sample_spec_s *sample_spec, uint8_t *use_mmap, snd_pcm_uframes_t *period_size, snd_pcm_uframes_t *buffer_size); /* Control */ #define VBC_TD_CHANNELID 0 /* cp [3g] */ @@ -60,23 +60,23 @@ audio_return_e _pcm_set_hw_params(snd_pcm_t *pcm, audio_pcm_sample_spec_t *sampl #define MIXER_FMRADIO_MUTE "Digital FM Function" #define FMRADIO_MUTE_ON 0 #define FMRADIO_MUTE_OFF 1 -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); +audio_return_e _mixer_control_init(audio_hal_s *ah); +audio_return_e _mixer_control_deinit(audio_hal_s *ah); +audio_return_e _mixer_control_set_param(audio_hal_s *ah, const char* ctl_name, snd_ctl_elem_value_t* value, int size); +audio_return_e _mixer_control_set_value(audio_hal_s *ah, const char *ctl_name, int val); +audio_return_e _mixer_control_set_value_string(audio_hal_s *ah, const char* ctl_name, const char* value); +audio_return_e _mixer_control_get_value(audio_hal_s *ah, const char *ctl_name, int *val); +audio_return_e _mixer_control_get_element(audio_hal_s *ah, const char *ctl_name, snd_hctl_elem_t **elem); /* UCM */ -audio_return_e _ucm_init(audio_hal_t *ah); -audio_return_e _ucm_deinit(audio_hal_t *ah); -audio_return_e _ucm_get_device_name(audio_hal_t *ah, const char *use_case, audio_direction_e direction, const char **value); +audio_return_e _ucm_init(audio_hal_s *ah); +audio_return_e _ucm_deinit(audio_hal_s *ah); +audio_return_e _ucm_get_device_name(audio_hal_s *ah, const char *use_case, audio_direction_e direction, const char **value); #define _ucm_update_use_case _ucm_set_use_case -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); +audio_return_e _ucm_set_use_case(audio_hal_s *ah, const char *verb, const char *devices[], const char *modifiers[]); +audio_return_e _ucm_set_devices(audio_hal_s *ah, const char *verb, const char *devices[]); +audio_return_e _ucm_set_modifiers(audio_hal_s *ah, const char *verb, const char *modifiers[]); +audio_return_e _ucm_get_verb(audio_hal_s *ah, const char **value); +audio_return_e _ucm_reset_use_case(audio_hal_s *ah); #endif diff --git a/tizen-audio-internal.h b/tizen-audio-internal.h index e6a5f30..297377b 100644 --- a/tizen-audio-internal.h +++ b/tizen-audio-internal.h @@ -168,7 +168,7 @@ typedef struct { snd_pcm_format_t format; uint32_t rate; uint8_t channels; -} audio_pcm_sample_spec_t; +} audio_pcm_sample_spec_s; /* Routing */ typedef enum audio_route_mode { @@ -177,7 +177,7 @@ typedef enum audio_route_mode { VERB_VIDEOCALL, VERB_VOIP, VERB_RADIO -} audio_route_mode_t; +} audio_route_mode_e; typedef struct audio_hal_device { uint32_t active_in; @@ -189,11 +189,11 @@ typedef struct audio_hal_device { uint32_t pcm_count; device_info_s *init_call_devices; uint32_t num_of_call_devices; - audio_route_mode_t mode; + audio_route_mode_e mode; uint32_t is_radio_on; pthread_cond_t device_cond; pthread_mutex_t device_lock; -} audio_hal_device_t; +} audio_hal_device_s; /* Volume */ #define AUDIO_VOLUME_LEVEL_MAX 16 @@ -209,7 +209,7 @@ typedef enum audio_volume { AUDIO_VOLUME_TYPE_VOIP, /**< VOIP volume type */ AUDIO_VOLUME_TYPE_VOICE, /**< Voice volume type */ AUDIO_VOLUME_TYPE_MAX, /**< Volume type count */ -} audio_volume_t; +} audio_volume_e; typedef enum audio_gain { AUDIO_GAIN_TYPE_DEFAULT, @@ -224,12 +224,12 @@ typedef enum audio_gain { AUDIO_GAIN_TYPE_VIDEO, AUDIO_GAIN_TYPE_TTS, AUDIO_GAIN_TYPE_MAX, -} audio_gain_t; +} audio_gain_e; typedef struct audio_volume_value_table { double volume[AUDIO_VOLUME_TYPE_MAX][AUDIO_VOLUME_LEVEL_MAX]; double gain[AUDIO_GAIN_TYPE_MAX]; -} audio_volume_value_table_t; +} audio_volume_value_table_s; enum { AUDIO_VOLUME_DEVICE_DEFAULT, @@ -239,15 +239,15 @@ enum { typedef struct audio_hal_volume { uint32_t volume_level_max[AUDIO_VOLUME_LEVEL_MAX]; uint32_t volume_level[AUDIO_VOLUME_TYPE_MAX]; - audio_volume_value_table_t *volume_value_table; + audio_volume_value_table_s *volume_value_table; int32_t radio_volume_value_table[RADIO_VOLUME_LEVEL_MAX]; int32_t radio_volume_num_of_levels; -} audio_hal_volume_t; +} audio_hal_volume_s; /* UCM */ typedef struct audio_hal_ucm { snd_use_case_mgr_t* uc_mgr; -} audio_hal_ucm_t; +} audio_hal_ucm_s; /* Mixer */ typedef struct audio_hal_mixer { @@ -258,7 +258,7 @@ typedef struct audio_hal_mixer { snd_ctl_elem_id_t *id; snd_ctl_elem_info_t *info; } control; -} audio_hal_mixer_t; +} audio_hal_mixer_s; /* Audio format */ typedef enum audio_sample_format { @@ -277,7 +277,7 @@ typedef enum audio_sample_format { AUDIO_SAMPLE_S24_32BE, AUDIO_SAMPLE_MAX, AUDIO_SAMPLE_INVALID = -1 -} audio_sample_format_t; +} audio_sample_format_s; /* Modem */ typedef struct audio_hal_modem { @@ -307,36 +307,36 @@ typedef struct audio_hal_modem { typedef struct audio_hal_comm { message_cb msg_cb; void *user_data; -} audio_hal_comm_t; +} audio_hal_comm_s; /* Overall */ typedef struct audio_hal { - audio_hal_device_t device; - audio_hal_volume_t volume; - audio_hal_ucm_t ucm; - audio_hal_mixer_t mixer; + audio_hal_device_s device; + audio_hal_volume_s volume; + audio_hal_ucm_s ucm; + audio_hal_mixer_s mixer; audio_hal_modem_t modem; - audio_hal_comm_t comm; -} audio_hal_t; - -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_modem_init(audio_hal_t *ah); -audio_return_e _audio_modem_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_update_route_voicecall(audio_hal_t *ah, device_info_s *devices, int32_t num_of_devices); -int _audio_modem_is_call_connected(audio_hal_t *ah); -audio_return_e _audio_comm_send_message(audio_hal_t *ah, const char *name, int value); + audio_hal_comm_s comm; +} audio_hal_s; + +audio_return_e _audio_ctrl_init(audio_hal_s *ah); +audio_return_e _audio_ctrl_deinit(audio_hal_s *ah); +audio_return_e _audio_volume_init(audio_hal_s *ah); +audio_return_e _audio_volume_deinit(audio_hal_s *ah); +audio_return_e _audio_routing_init(audio_hal_s *ah); +audio_return_e _audio_routing_deinit(audio_hal_s *ah); +audio_return_e _audio_stream_init(audio_hal_s *ah); +audio_return_e _audio_stream_deinit(audio_hal_s *ah); +audio_return_e _audio_pcm_init(audio_hal_s *ah); +audio_return_e _audio_pcm_deinit(audio_hal_s *ah); +audio_return_e _audio_modem_init(audio_hal_s *ah); +audio_return_e _audio_modem_deinit(audio_hal_s *ah); +audio_return_e _audio_comm_init(audio_hal_s *ah); +audio_return_e _audio_comm_deinit(audio_hal_s *ah); + +audio_return_e _audio_update_route_voicecall(audio_hal_s *ah, device_info_s *devices, int32_t num_of_devices); +int _audio_modem_is_call_connected(audio_hal_s *ah); +audio_return_e _audio_comm_send_message(audio_hal_s *ah, const char *name, int value); typedef struct _dump_data { char *strbuf; diff --git a/tizen-audio-modem.c b/tizen-audio-modem.c index e08f562..4655790 100644 --- a/tizen-audio-modem.c +++ b/tizen-audio-modem.c @@ -87,7 +87,7 @@ typedef struct _vbc_parameters_head { typedef struct vbc_control_params { int vbchannel_id; - audio_hal_t *ah; + audio_hal_s *ah; } vbc_control_params_t; typedef struct { @@ -173,7 +173,7 @@ static int __vbc_write_response(int fd, unsigned int cmd, uint32_t paras_size) return 0; } -int _audio_modem_is_call_connected(audio_hal_t *ah) +int _audio_modem_is_call_connected(audio_hal_s *ah) { int val = -1; /* Mixer values 0 - cp [3g] ,1 - cp [2g] ,2 - ap */ @@ -183,7 +183,7 @@ int _audio_modem_is_call_connected(audio_hal_t *ah) return (val == VBC_TD_CHANNELID) ? 1 : 0; } -static void __i2s_pin_mux_sel(audio_hal_t *ah, int type) +static void __i2s_pin_mux_sel(audio_hal_s *ah, int type) { audio_return_e ret = AUDIO_RET_OK; audio_modem_t *modem; @@ -265,7 +265,7 @@ static void *__vbc_control_voice_thread_run(void *args) if (params == NULL) { return (void*)AUDIO_ERR_PARAMETER; } - audio_hal_t *ah = params->ah; + audio_hal_s *ah = params->ah; fd_set fds_read; struct timeval timeout = {5,0}; @@ -480,7 +480,7 @@ static void *__vbc_control_voip_thread_run(void *args) if (params == NULL) { return (void*)AUDIO_ERR_PARAMETER; } - audio_hal_t *ah = params->ah; + audio_hal_s *ah = params->ah; fd_set fds_read; struct timeval timeout = {5,0}; @@ -637,7 +637,7 @@ again: return (void*)0; } -static audio_return_e __vbc_control_open(audio_hal_t *ah) +static audio_return_e __vbc_control_open(audio_hal_s *ah) { vbc_control_params_t *params = (vbc_control_params_t*)malloc(sizeof(vbc_control_params_t)); audio_return_e ret = AUDIO_RET_OK; @@ -667,7 +667,7 @@ static audio_return_e __vbc_control_open(audio_hal_t *ah) return AUDIO_RET_OK; } -void __vbc_control_close(audio_hal_t *ah) +void __vbc_control_close(audio_hal_s *ah) { int ret; /* TODO. Make sure we always receive CLOSE command from modem and then close pcm device */ @@ -917,7 +917,7 @@ err_alloc: return NULL; } -audio_return_e _audio_modem_init(audio_hal_t *ah) +audio_return_e _audio_modem_init(audio_hal_s *ah) { audio_return_e audio_ret = AUDIO_RET_OK; @@ -949,7 +949,7 @@ exit: return audio_ret; } -audio_return_e _audio_modem_deinit(audio_hal_t *ah) +audio_return_e _audio_modem_deinit(audio_hal_s *ah) { AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); diff --git a/tizen-audio-pcm.c b/tizen-audio-pcm.c index 21fa107..74c062e 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_e _audio_pcm_init(audio_hal_t *ah) +audio_return_e _audio_pcm_init(audio_hal_s *ah) { AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); @@ -39,7 +39,7 @@ audio_return_e _audio_pcm_init(audio_hal_t *ah) return AUDIO_RET_OK; } -audio_return_e _audio_pcm_deinit(audio_hal_t *ah) +audio_return_e _audio_pcm_deinit(audio_hal_s *ah) { AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); @@ -54,7 +54,7 @@ audio_return_e audio_pcm_open(void *audio_handle, const char *card, const char * uint32_t period_size, uint32_t periods, void **pcm_handle) { audio_return_e audio_ret = AUDIO_RET_OK; - audio_hal_t *ah = NULL; + audio_hal_s *ah = NULL; AUDIO_RETURN_VAL_IF_FAIL(audio_handle, AUDIO_ERR_PARAMETER); AUDIO_RETURN_VAL_IF_FAIL(pcm_handle, AUDIO_ERR_PARAMETER); @@ -65,7 +65,7 @@ audio_return_e audio_pcm_open(void *audio_handle, const char *card, const char * if ((audio_ret = _pcm_open(card, device, direction, sample_spec, period_size, periods, pcm_handle))) return audio_ret; - ah = (audio_hal_t*)audio_handle; + ah = (audio_hal_s*)audio_handle; ah->device.pcm_count++; AUDIO_LOG_INFO("Opening PCM handle %p", *pcm_handle); @@ -99,7 +99,7 @@ audio_return_e audio_pcm_stop(void *audio_handle, void *pcm_handle) audio_return_e audio_pcm_close(void *audio_handle, void *pcm_handle) { audio_return_e audio_ret = AUDIO_RET_OK; - audio_hal_t *ah = NULL; + audio_hal_s *ah = NULL; AUDIO_RETURN_VAL_IF_FAIL(audio_handle, AUDIO_ERR_PARAMETER); AUDIO_RETURN_VAL_IF_FAIL(pcm_handle, AUDIO_ERR_PARAMETER); @@ -108,7 +108,7 @@ audio_return_e audio_pcm_close(void *audio_handle, void *pcm_handle) return audio_ret; pcm_handle = NULL; - ah = (audio_hal_t*)audio_handle; + ah = (audio_hal_s*)audio_handle; ah->device.pcm_count--; AUDIO_LOG_INFO("PCM handle close success (count:%d)", ah->device.pcm_count); diff --git a/tizen-audio-routing.c b/tizen-audio-routing.c index 54397ae..bb3e65e 100644 --- a/tizen-audio-routing.c +++ b/tizen-audio-routing.c @@ -81,7 +81,7 @@ static uint32_t __convert_device_string_to_enum(const char* device_str, uint32_t return device; } -static void __reset_voice_devices_info(audio_hal_t *ah) +static void __reset_voice_devices_info(audio_hal_s *ah) { AUDIO_RETURN_IF_FAIL(ah); @@ -95,7 +95,7 @@ static void __reset_voice_devices_info(audio_hal_t *ah) return; } -static audio_return_e __set_devices(audio_hal_t *ah, const char *verb, device_info_s *devices, uint32_t num_of_devices) +static audio_return_e __set_devices(audio_hal_s *ah, const char *verb, device_info_s *devices, uint32_t num_of_devices) { audio_return_e audio_ret = AUDIO_RET_OK; uint32_t new_device = 0; @@ -163,7 +163,7 @@ static audio_return_e __set_devices(audio_hal_t *ah, const char *verb, device_in return audio_ret; } -static audio_return_e __connect_fm_radio(audio_hal_t *ah) +static audio_return_e __connect_fm_radio(audio_hal_s *ah) { audio_return_e audio_ret = AUDIO_RET_OK; @@ -174,7 +174,7 @@ static audio_return_e __connect_fm_radio(audio_hal_t *ah) return audio_ret; } -static audio_return_e __update_route_ap_playback_capture(audio_hal_t *ah, audio_route_info_s *route_info) +static audio_return_e __update_route_ap_playback_capture(audio_hal_s *ah, audio_route_info_s *route_info) { audio_return_e audio_ret = AUDIO_RET_OK; device_info_s *devices = NULL; @@ -221,7 +221,7 @@ static audio_return_e __update_route_ap_playback_capture(audio_hal_t *ah, audio_ return audio_ret; } -static audio_return_e __update_route_voicecall(audio_hal_t *ah, device_info_s *devices, int32_t num_of_devices) +static audio_return_e __update_route_voicecall(audio_hal_s *ah, device_info_s *devices, int32_t num_of_devices) { audio_return_e audio_ret = AUDIO_RET_OK; const char *verb = mode_to_verb_str[VERB_VOICECALL]; @@ -249,7 +249,7 @@ static audio_return_e __update_route_voicecall(audio_hal_t *ah, device_info_s *d return audio_ret; } -static audio_return_e __update_route_voip(audio_hal_t *ah, device_info_s *devices, int32_t num_of_devices) +static audio_return_e __update_route_voip(audio_hal_s *ah, device_info_s *devices, int32_t num_of_devices) { audio_return_e audio_ret = AUDIO_RET_OK; const char *verb = mode_to_verb_str[VERB_NORMAL]; @@ -271,7 +271,7 @@ static audio_return_e __update_route_voip(audio_hal_t *ah, device_info_s *device return audio_ret; } -static audio_return_e __update_route_fmradio(audio_hal_t *ah, device_info_s *devices, int32_t num_of_devices) +static audio_return_e __update_route_fmradio(audio_hal_s *ah, device_info_s *devices, int32_t num_of_devices) { audio_return_e audio_ret = AUDIO_RET_OK; const char *verb = mode_to_verb_str[VERB_RADIO]; @@ -303,7 +303,7 @@ static audio_return_e __update_route_fmradio(audio_hal_t *ah, device_info_s *dev return audio_ret; } -static audio_return_e __update_route_reset(audio_hal_t *ah, uint32_t direction) +static audio_return_e __update_route_reset(audio_hal_s *ah, uint32_t direction) { audio_return_e audio_ret = AUDIO_RET_OK; const char *active_devices[MAX_DEVICES] = {NULL,}; @@ -360,12 +360,12 @@ static audio_return_e __update_route_reset(audio_hal_t *ah, uint32_t direction) return audio_ret; } -audio_return_e _audio_update_route_voicecall(audio_hal_t *ah, device_info_s *devices, int32_t num_of_devices) +audio_return_e _audio_update_route_voicecall(audio_hal_s *ah, device_info_s *devices, int32_t num_of_devices) { return __update_route_voicecall(ah, devices, num_of_devices); } -audio_return_e _audio_routing_init(audio_hal_t *ah) +audio_return_e _audio_routing_init(audio_hal_s *ah) { audio_return_e audio_ret = AUDIO_RET_OK; @@ -384,7 +384,7 @@ audio_return_e _audio_routing_init(audio_hal_t *ah) return audio_ret; } -audio_return_e _audio_routing_deinit(audio_hal_t *ah) +audio_return_e _audio_routing_deinit(audio_hal_s *ah) { audio_return_e audio_ret = AUDIO_RET_OK; @@ -399,7 +399,7 @@ audio_return_e _audio_routing_deinit(audio_hal_t *ah) audio_return_e audio_update_route(void *audio_handle, audio_route_info_s *info) { audio_return_e audio_ret = AUDIO_RET_OK; - audio_hal_t *ah = (audio_hal_t *)audio_handle; + audio_hal_s *ah = (audio_hal_s *)audio_handle; device_info_s *devices = NULL; uint32_t prev_size; int32_t i; @@ -492,7 +492,7 @@ ERROR: audio_return_e audio_update_route_option(void *audio_handle, audio_route_option_s *option) { audio_return_e audio_ret = AUDIO_RET_OK; - audio_hal_t *ah = (audio_hal_t *)audio_handle; + audio_hal_s *ah = (audio_hal_s *)audio_handle; AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); AUDIO_RETURN_VAL_IF_FAIL(option, AUDIO_ERR_PARAMETER); diff --git a/tizen-audio-stream.c b/tizen-audio-stream.c index 46ac018..d41ef98 100644 --- a/tizen-audio-stream.c +++ b/tizen-audio-stream.c @@ -23,14 +23,14 @@ #include "tizen-audio-internal.h" -audio_return_e _audio_stream_init(audio_hal_t *ah) +audio_return_e _audio_stream_init(audio_hal_s *ah) { AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); return AUDIO_RET_OK; } -audio_return_e _audio_stream_deinit(audio_hal_t *ah) +audio_return_e _audio_stream_deinit(audio_hal_s *ah) { AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); @@ -40,7 +40,7 @@ audio_return_e _audio_stream_deinit(audio_hal_t *ah) audio_return_e audio_notify_stream_connection_changed(void *audio_handle, audio_stream_info_s *info, uint32_t is_connected) { audio_return_e audio_ret = AUDIO_RET_OK; - audio_hal_t *ah = (audio_hal_t *)audio_handle; + audio_hal_s *ah = (audio_hal_s *)audio_handle; AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); AUDIO_RETURN_VAL_IF_FAIL(info, AUDIO_ERR_PARAMETER); diff --git a/tizen-audio-volume.c b/tizen-audio-volume.c index c9577a9..b1dcc60 100644 --- a/tizen-audio-volume.c +++ b/tizen-audio-volume.c @@ -109,9 +109,9 @@ static const char *__get_gain_type_string_by_idx(uint32_t gain_type_idx) } } -static void __dump_tb(audio_hal_t *ah) +static void __dump_tb(audio_hal_s *ah) { - audio_volume_value_table_t *volume_value_table = ah->volume.volume_value_table; + audio_volume_value_table_s *volume_value_table = ah->volume.volume_value_table; uint32_t vol_type_idx, vol_level_idx, gain_type_idx; const char *gain_type_str[] = { "def", /* AUDIO_GAIN_TYPE_DEFAULT */ @@ -181,11 +181,11 @@ static void __dump_tb(audio_hal_t *ah) } -static audio_return_e __load_volume_value_table_from_ini(audio_hal_t *ah) +static audio_return_e __load_volume_value_table_from_ini(audio_hal_s *ah) { dictionary * dict = NULL; uint32_t vol_type_idx, vol_level_idx, gain_type_idx; - audio_volume_value_table_t *volume_value_table = ah->volume.volume_value_table; + audio_volume_value_table_s *volume_value_table = ah->volume.volume_value_table; int size = 0; const char delimiter[] = ", "; const char *table_str = "volumes"; @@ -350,7 +350,7 @@ error: return ret; } -static audio_return_e _audio_volume_set_ratio_radio(audio_hal_t *ah, double ratio) +static audio_return_e _audio_volume_set_ratio_radio(audio_hal_s *ah, double ratio) { audio_return_e audio_ret = AUDIO_RET_OK; int new_value = 0; @@ -416,7 +416,7 @@ set_volume: return audio_ret; } -audio_return_e _audio_volume_init(audio_hal_t *ah) +audio_return_e _audio_volume_init(audio_hal_s *ah) { int i; int val = 0; @@ -441,7 +441,7 @@ audio_return_e _audio_volume_init(audio_hal_t *ah) ah->volume.volume_level[i] = val; } - if (!(ah->volume.volume_value_table = malloc(AUDIO_VOLUME_DEVICE_MAX * sizeof(audio_volume_value_table_t)))) { + if (!(ah->volume.volume_value_table = malloc(AUDIO_VOLUME_DEVICE_MAX * sizeof(audio_volume_value_table_s)))) { AUDIO_LOG_ERROR("volume_value_table malloc failed"); return AUDIO_ERR_RESOURCE; } @@ -467,7 +467,7 @@ audio_return_e _audio_volume_init(audio_hal_t *ah) return audio_ret; } -audio_return_e _audio_volume_deinit(audio_hal_t *ah) +audio_return_e _audio_volume_deinit(audio_hal_s *ah) { AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); @@ -481,7 +481,7 @@ audio_return_e _audio_volume_deinit(audio_hal_t *ah) 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; + audio_hal_s *ah = (audio_hal_s *)audio_handle; AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); AUDIO_RETURN_VAL_IF_FAIL(info, AUDIO_ERR_PARAMETER); @@ -497,7 +497,7 @@ audio_return_e audio_get_volume_level_max(void *audio_handle, audio_volume_info_ 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; + audio_hal_s *ah = (audio_hal_s *)audio_handle; AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); AUDIO_RETURN_VAL_IF_FAIL(info, AUDIO_ERR_PARAMETER); @@ -517,8 +517,8 @@ audio_return_e audio_get_volume_level(void *audio_handle, audio_volume_info_s *i 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; + audio_hal_s *ah = (audio_hal_s *)audio_handle; + audio_volume_value_table_s *volume_value_table; char dump_str[AUDIO_DUMP_STR_LEN] = {0,}; AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); @@ -542,7 +542,7 @@ audio_return_e audio_get_volume_value(void *audio_handle, audio_volume_info_s *i audio_return_e audio_set_volume_level(void *audio_handle, audio_volume_info_s *info, uint32_t level) { audio_return_e audio_ret = AUDIO_RET_OK; - audio_hal_t *ah = (audio_hal_t *)audio_handle; + audio_hal_s *ah = (audio_hal_s *)audio_handle; AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); AUDIO_RETURN_VAL_IF_FAIL(info, AUDIO_ERR_PARAMETER); @@ -562,7 +562,7 @@ audio_return_e audio_set_volume_level(void *audio_handle, audio_volume_info_s *i audio_return_e audio_get_volume_mute(void *audio_handle, audio_volume_info_s *info, uint32_t *mute) { audio_return_e audio_ret = AUDIO_RET_OK; - audio_hal_t *ah = (audio_hal_t *)audio_handle; + audio_hal_s *ah = (audio_hal_s *)audio_handle; AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); AUDIO_RETURN_VAL_IF_FAIL(info, AUDIO_ERR_PARAMETER); @@ -576,7 +576,7 @@ audio_return_e audio_get_volume_mute(void *audio_handle, audio_volume_info_s *in audio_return_e audio_set_volume_mute(void *audio_handle, audio_volume_info_s *info, uint32_t mute) { audio_return_e audio_ret = AUDIO_RET_OK; - audio_hal_t *ah = (audio_hal_t *)audio_handle; + audio_hal_s *ah = (audio_hal_s *)audio_handle; AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); AUDIO_RETURN_VAL_IF_FAIL(info, AUDIO_ERR_PARAMETER); @@ -589,7 +589,7 @@ audio_return_e audio_set_volume_mute(void *audio_handle, audio_volume_info_s *in audio_return_e audio_set_volume_ratio(void *audio_handle, audio_stream_info_s *info, double ratio) { audio_return_e audio_ret = AUDIO_RET_OK; - audio_hal_t *ah = (audio_hal_t *)audio_handle; + audio_hal_s *ah = (audio_hal_s *)audio_handle; AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); AUDIO_RETURN_VAL_IF_FAIL(info, AUDIO_ERR_PARAMETER); diff --git a/tizen-audio.c b/tizen-audio.c index d04b6b8..86fefb7 100644 --- a/tizen-audio.c +++ b/tizen-audio.c @@ -25,12 +25,12 @@ audio_return_e audio_init(void **audio_handle) { - audio_hal_t *ah; + audio_hal_s *ah; audio_return_e ret = AUDIO_RET_OK; AUDIO_RETURN_VAL_IF_FAIL(audio_handle, AUDIO_ERR_PARAMETER); - if (!(ah = calloc(1, sizeof(audio_hal_t)))) { + if (!(ah = calloc(1, sizeof(audio_hal_s)))) { AUDIO_LOG_ERROR("failed to alloc errno(%d)", errno); return AUDIO_ERR_RESOURCE; } @@ -76,7 +76,7 @@ error_exit: audio_return_e audio_deinit(void *audio_handle) { - audio_hal_t *ah = (audio_hal_t *)audio_handle; + audio_hal_s *ah = (audio_hal_s *)audio_handle; AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); |