Add new API - audio_set_volume_ratio 23/203723/2 accepted/tizen/unified/20190508.234129 submit/tizen/20190507.083430 submit/tizen/20190508.004119 submit/tizen/20190508.075135 submit/tizen/20190508.112932 submit/tizen/20190509.053035
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:00:16 +0000 (08:00 +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.29
[Issue Type] New API

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

index 8fc978a..3eaddec 100644 (file)
@@ -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
index 12492c7..9fca5cc 100644 (file)
@@ -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
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);