From 0786984f147fa2c41c6c55e7f9edc0339d634aaf Mon Sep 17 00:00:00 2001 From: Sangchul Lee Date: Wed, 17 Apr 2019 11:37:13 +0900 Subject: [PATCH] Add new API - audio_set_volume_ratio This new API is to set the individual volume ratio of each stream. The parameters of this API consist of stream role, direction, index and its ratio. Because the stream role can differ among the streams which have same volume type, this new API could be used where the H/W volume has to be set for a specific stream role with distinguishing it from others. [Version] 0.1.29 [Issue Type] New API Change-Id: Id2d35aaef4a6db489e8fb27cb6c4affe10b81dd4 Signed-off-by: Sangchul Lee --- packaging/audio-hal-sc7727.spec | 2 +- tizen-audio-volume.c | 13 +++++++++++++ tizen-audio.h | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/packaging/audio-hal-sc7727.spec b/packaging/audio-hal-sc7727.spec index 8fc978a..3eaddec 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.28 +Version: 0.1.29 Release: 0 Group: System/Libraries License: Apache-2.0 diff --git a/tizen-audio-volume.c b/tizen-audio-volume.c index 12492c7..9fca5cc 100644 --- a/tizen-audio-volume.c +++ b/tizen-audio-volume.c @@ -562,3 +562,16 @@ audio_return_t audio_set_volume_mute(void *audio_handle, audio_volume_info_t *in return audio_ret; } + +audio_return_t audio_set_volume_ratio(void *audio_handle, audio_stream_info_t *info, double ratio) +{ + audio_return_t audio_ret = AUDIO_RET_OK; + audio_hal_t *ah = (audio_hal_t *)audio_handle; + + AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); + AUDIO_RETURN_VAL_IF_FAIL(info, AUDIO_ERR_PARAMETER); + + AUDIO_LOG_INFO("set [%s] volume_ratio: %f, direction(%u), index(%u)", info->role, ratio, info->direction, info->idx); + + return audio_ret; +} \ No newline at end of file diff --git a/tizen-audio.h b/tizen-audio.h index 94efa03..f18afa4 100644 --- a/tizen-audio.h +++ b/tizen-audio.h @@ -131,6 +131,7 @@ typedef struct audio_interface { 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); -- 2.7.4