Add mm_sound_is_stream_on_device_by_id() 60/199660/2 accepted/tizen/unified/20190215.055043 submit/tizen/20190214.074524
authorSangchul Lee <sc11.lee@samsung.com>
Wed, 13 Feb 2019 02:29:39 +0000 (11:29 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 14 Feb 2019 00:55:36 +0000 (09:55 +0900)
[Version] 0.12.37
[Issue Type] API

Change-Id: I897d2198ec9fb592a0f75b5905cfad8568514ae1
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
include/mm_sound.h
mm_sound_device.c
packaging/libmm-sound.spec

index 8fcdeec3e0ea098edf35a312ab6371cdf34bfb8d..360ded157a48a21576994fceedd5986e0e1952f2 100644 (file)
@@ -883,6 +883,7 @@ int mm_sound_remove_test_callback(unsigned int sub_id);
 void mm_sound_convert_volume_type_to_stream_type(int volume_type, char *stream_type);
 
 int mm_sound_is_stream_on_device(int stream_id, MMSoundDevice_t device_h, bool *is_on);
+int mm_sound_is_stream_on_device_by_id(int stream_id, int device_id, bool *is_on);
 int mm_sound_is_device_running(MMSoundDevice_t device_h, bool *is_running);
 
 #ifdef TIZEN_TV
index 55211fc6aeaf5ab18652fbcc8058dec14d885c38..c9ef5f01936fde1b5ba7c6829e36f48599154488 100644 (file)
@@ -530,6 +530,28 @@ int mm_sound_is_stream_on_device(int stream_id, MMSoundDevice_t device_h, bool *
        return ret;
 }
 
+EXPORT_API
+int mm_sound_is_stream_on_device_by_id(int stream_id, int device_id, bool *is_on)
+{
+       int ret = MM_ERROR_NONE;
+       bool _is_on = false;
+
+       if (!is_on) {
+               debug_error("invalid argument");
+               return MM_ERROR_INVALID_ARGUMENT;
+       }
+
+       if ((ret = mm_sound_client_is_stream_on_device(stream_id, device_id, &_is_on)) < 0) {
+               debug_error("Failed to query is stream on");
+               return MM_ERROR_SOUND_INTERNAL;
+       }
+
+       debug_log("device(%d) %s stream(%d)", device_id, _is_on ? "has" : "doesn't have", stream_id);
+       *is_on = _is_on;
+
+       return ret;
+}
+
 EXPORT_API
 int mm_sound_is_device_running(MMSoundDevice_t device_h, bool *is_running)
 {
index 1b55dd1b81cbfa21f41003c3471cb42d95061962..08e46e87b619298b0858cae184eb369cdd23a891 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-sound
 Summary:    MMSound Package contains client lib and sound_server binary
-Version:    0.12.36
+Version:    0.12.37
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0