Add new API - audio_set_volume_ratio 45/204045/1
authorSangchul Lee <sc11.lee@samsung.com>
Wed, 17 Apr 2019 02:37:13 +0000 (11:37 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Wed, 17 Apr 2019 23:10:05 +0000 (08:10 +0900)
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.1
[Issue Type] New API

Change-Id: Id2d35aaef4a6db489e8fb27cb6c4affe10b81dd4
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/audio-hal-exynos9110.spec
tizen-audio-volume.c
tizen-audio.h

index 1f137ec..e9e1bca 100644 (file)
@@ -1,6 +1,6 @@
 Name:       audio-hal-exynos9110
 Summary:    TIZEN Audio HAL for Exynos9110(TW3)
-Version:    0.1.0
+Version:    0.1.1
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index 87c5523..449c28d 100644 (file)
@@ -413,3 +413,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
index 94efa03..f18afa4 100644 (file)
@@ -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);