diff options
author | Seungbae Shin <seungbae.shin@samsung.com> | 2021-02-10 12:32:22 +0900 |
---|---|---|
committer | Seungbae Shin <seungbae.shin@samsung.com> | 2021-02-18 11:20:04 +0900 |
commit | cf1d4f7947378e1f2b91141d377d647263df2a02 (patch) | |
tree | 3487c0f87946eceb95e3723a830212251e784ed0 | |
parent | 3c4a2b17fd950ca53b63cb013121d3cc1f16e150 (diff) | |
download | audio-hal-exynos9110-cf1d4f7947378e1f2b91141d377d647263df2a02.tar.gz audio-hal-exynos9110-cf1d4f7947378e1f2b91141d377d647263df2a02.tar.bz2 audio-hal-exynos9110-cf1d4f7947378e1f2b91141d377d647263df2a02.zip |
Add missing implementationssubmit/tizen/20210218.045157
[Version] 0.1.7
[Issue Type] Update
Change-Id: I3854e37f905af64da1960fc20ea7b953ef6ee765
-rw-r--r-- | hal-backend-audio.c | 9 | ||||
-rw-r--r-- | packaging/audio-hal-exynos9110.spec | 2 | ||||
-rw-r--r-- | tizen-audio-comm.c | 5 | ||||
-rw-r--r-- | tizen-audio-impl-ctrl.c | 7 | ||||
-rw-r--r-- | tizen-audio-volume.c | 17 | ||||
-rw-r--r-- | tizen-audio.h | 15 |
6 files changed, 47 insertions, 8 deletions
diff --git a/hal-backend-audio.c b/hal-backend-audio.c index 853dedb..9fdbb7b 100644 --- a/hal-backend-audio.c +++ b/hal-backend-audio.c @@ -34,15 +34,21 @@ static int audio_e9110_init(void **data) funcs->init = audio_init; funcs->deinit = audio_deinit; + funcs->get_volume_level_max = audio_get_volume_level_max; + funcs->get_volume_level = audio_get_volume_level; 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->notify_ducking_activation_changed = audio_notify_ducking_activation_changed; + 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; @@ -55,6 +61,9 @@ static int audio_e9110_init(void **data) funcs->pcm_get_params = audio_pcm_get_params; funcs->pcm_set_params = audio_pcm_set_params; + funcs->add_message_cb = audio_add_message_cb; + funcs->remove_message_cb = audio_remove_message_cb; + *data = (void *)funcs; return 0; diff --git a/packaging/audio-hal-exynos9110.spec b/packaging/audio-hal-exynos9110.spec index 9644890..413a585 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.6 +Version: 0.1.7 Release: 0 Group: System/Libraries License: Apache-2.0 diff --git a/tizen-audio-comm.c b/tizen-audio-comm.c index ed71126..aa3d6bc 100644 --- a/tizen-audio-comm.c +++ b/tizen-audio-comm.c @@ -83,9 +83,8 @@ audio_return_e _audio_comm_send_message(audio_hal_s *ah, const char *name, int v AUDIO_RETURN_VAL_IF_FAIL(name, AUDIO_ERR_PARAMETER); AUDIO_LOG_DEBUG("send message : name(%s), value(%d)", name, value); - if (ah->comm.msg_cb) { + if (ah->comm.msg_cb) ah->comm.msg_cb(name, value, ah->comm.user_data); - } return audio_ret; } @@ -114,4 +113,4 @@ audio_return_e audio_remove_message_cb(void *audio_handle, message_cb callback) ret = __unset_message_callback((audio_hal_s *)audio_handle); return ret; -}
\ No newline at end of file +} diff --git a/tizen-audio-impl-ctrl.c b/tizen-audio-impl-ctrl.c index 7eab333..49f6373 100644 --- a/tizen-audio-impl-ctrl.c +++ b/tizen-audio-impl-ctrl.c @@ -37,9 +37,8 @@ static void __dump_mixer_param(char *dump, long *param, int size) len = sprintf(dump, "%ld", *param); if (len > 0) dump += len; - if (i != size -1) { + if (i != size -1) *dump++ = ','; - } param++; } @@ -82,6 +81,8 @@ audio_return_e _mixer_control_get_value(audio_hal_s *ah, const char *ctl_name, i int ret = 0, count = 0, i = 0; AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); + AUDIO_RETURN_VAL_IF_FAIL(ctl_name, AUDIO_ERR_PARAMETER); + AUDIO_RETURN_VAL_IF_FAIL(val, AUDIO_ERR_PARAMETER); pthread_mutex_lock(&(ah->mixer.mutex)); @@ -248,4 +249,4 @@ audio_return_e _mixer_control_get_element(audio_hal_s *ah, const char *ctl_name, /* TODO. */ return AUDIO_RET_OK; -}
\ No newline at end of file +} diff --git a/tizen-audio-volume.c b/tizen-audio-volume.c index 5c1ae5d..b1d81ba 100644 --- a/tizen-audio-volume.c +++ b/tizen-audio-volume.c @@ -22,7 +22,6 @@ #include <stdio.h> #include <stdlib.h> -#include <stdbool.h> #include <string.h> #include <math.h> #include <vconf.h> @@ -441,3 +440,19 @@ audio_return_e audio_set_volume_ratio(void *audio_handle, audio_stream_info_s *i return audio_ret; } + +audio_return_e audio_notify_ducking_activation_changed(void *audio_handle, audio_ducking_info_s *info, uint32_t is_activated) +{ + audio_return_e audio_ret = AUDIO_RET_OK; + 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); + AUDIO_RETURN_VAL_IF_FAIL(info->target_role, AUDIO_ERR_PARAMETER); + + AUDIO_LOG_INFO("role:%s, duration:%u, ratio:%lf, is_activated:%u", info->target_role, info->duration, info->ratio, is_activated); + + /* TODO. Not implemented */ + + return audio_ret; +} diff --git a/tizen-audio.h b/tizen-audio.h index 5c662c4..52ed4cb 100644 --- a/tizen-audio.h +++ b/tizen-audio.h @@ -164,6 +164,21 @@ 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); /** + * @brief Gets notified when a ducking is activated and deactivated. + * @since_tizen 5.5 + * @param[in] audio_handle The audio hal handle + * @param[in] info The ducking information including target role, duration and ratio + * @param[in] is_activated The activation state (@c true = activated, @c false = deactivated) + * + * @remarks This information can be used for volume controls. + * + * @return @c 0 on success, + * otherwise a negative error value + * @retval #AUDIO_RET_OK Success + */ +audio_return_e audio_notify_ducking_activation_changed(void *audio_handle, audio_ducking_info_s *info, uint32_t is_activated); + +/** * @brief Updates the audio routing according to audio route information. * @since_tizen 3.0 * @param[in] audio_handle The audio hal handle |