Add new internal stream type - SOUND_STREAM_TYPE_VOICE_RECOGNITION_SERVICE 92/133892/1
authorSangchul Lee <sc11.lee@samsung.com>
Tue, 13 Jun 2017 08:43:27 +0000 (17:43 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Wed, 14 Jun 2017 02:21:39 +0000 (11:21 +0900)
It is added to be used in a daemon process to provide voice recognition service.

[Version] 0.4.5
[Issue Type] New enum

Change-Id: I51cdb00e1216c0f90f02fb7fcb8ff9f716d4b327
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
include/sound_manager_internal.h
packaging/capi-media-sound-manager.spec
src/sound_manager_private.c

index 3f0cdccc46d782850a25ebf12d26c831b1499a8f..93da0ef05208d1ab92bcc82a38893b53528f39a5 100644 (file)
@@ -61,14 +61,15 @@ typedef enum {
  * @since_tizen 3.0
  */
 typedef enum {
-       SOUND_STREAM_TYPE_RINGTONE_CALL = 100, /**< Sound stream type for ringtone for call */
-       SOUND_STREAM_TYPE_RINGBACKTONE_CALL,   /**< Sound stream type for ringback tone for call */
-       SOUND_STREAM_TYPE_VOICE_CALL,          /**< Sound stream type for voice-call */
-       SOUND_STREAM_TYPE_VIDEO_CALL,          /**< Sound stream type for video-call */
-       SOUND_STREAM_TYPE_RADIO,               /**< Sound stream type for radio */
-       SOUND_STREAM_TYPE_LOOPBACK,            /**< Sound stream type for loopback */
-       SOUND_STREAM_TYPE_LOOPBACK_MIRRORING,  /**< Sound stream type for loopback-mirroring */
-       SOUND_STREAM_TYPE_SOLO,                /**< Sound stream type for solo */
+       SOUND_STREAM_TYPE_RINGTONE_CALL = 100,        /**< Sound stream type for ringtone for call */
+       SOUND_STREAM_TYPE_RINGBACKTONE_CALL,          /**< Sound stream type for ringback tone for call */
+       SOUND_STREAM_TYPE_VOICE_CALL,                 /**< Sound stream type for voice-call */
+       SOUND_STREAM_TYPE_VIDEO_CALL,                 /**< Sound stream type for video-call */
+       SOUND_STREAM_TYPE_RADIO,                      /**< Sound stream type for radio */
+       SOUND_STREAM_TYPE_LOOPBACK,                   /**< Sound stream type for loopback */
+       SOUND_STREAM_TYPE_LOOPBACK_MIRRORING,         /**< Sound stream type for loopback-mirroring */
+       SOUND_STREAM_TYPE_SOLO,                       /**< Sound stream type for solo */
+       SOUND_STREAM_TYPE_VOICE_RECOGNITION_SERVICE,  /**< Sound stream type for voice recognition by service (Since 4.0) */
 } sound_stream_type_internal_e;
 
 /**
index 2f6061a67caa01cd3e690ad16995a7062518ea27..6dff7a48b5e2431babbf9752176f9f48ddf7aaba 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-sound-manager
 Summary:    Sound Manager library
-Version:    0.4.4
+Version:    0.4.5
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index b12b0ec4fc2426a73c0a4b11216032f2f81015ba..6d3a64bfe1cb697208f3e46403ba70e0e1488370 100644 (file)
@@ -205,6 +205,9 @@ int _convert_stream_type_for_internal(sound_stream_type_internal_e stream_type_e
        case SOUND_STREAM_TYPE_SOLO:
                *stream_type = "solo";
                break;
+       case SOUND_STREAM_TYPE_VOICE_RECOGNITION_SERVICE:
+               *stream_type = "voice-recognition-service";
+               break;
        default:
                LOGE("could not find the stream_type[%d] in this switch case statement", stream_type_enum);
                ret = MM_ERROR_SOUND_INTERNAL;
@@ -256,7 +259,8 @@ int _convert_stream_type_to_change_reason(const char *stream_type, sound_stream_
        } else if (!strncmp(stream_type, "voice-information", SOUND_STREAM_TYPE_LEN)) {
                *change_reason = SOUND_STREAM_FOCUS_CHANGED_BY_VOICE_INFORMATION;
 
-       } else if (!strncmp(stream_type, "voice-recognition", SOUND_STREAM_TYPE_LEN)) {
+       } else if (!strncmp(stream_type, "voice-recognition", SOUND_STREAM_TYPE_LEN) ||
+                       !strncmp(stream_type, "voice-recognition-service", SOUND_STREAM_TYPE_LEN)) {
                *change_reason = SOUND_STREAM_FOCUS_CHANGED_BY_VOICE_RECOGNITION;
 
        } else if (!strncmp(stream_type, "ringtone-voip", SOUND_STREAM_TYPE_LEN) ||
@@ -291,6 +295,7 @@ static int _convert_stream_type_to_interrupt_reason(const char *stream_type, sou
                !strncmp(stream_type, "radio", SOUND_STREAM_TYPE_LEN) ||
                !strncmp(stream_type, "voice-information", SOUND_STREAM_TYPE_LEN) ||
                !strncmp(stream_type, "voice-recognition", SOUND_STREAM_TYPE_LEN) ||
+               !strncmp(stream_type, "voice-recognition-service", SOUND_STREAM_TYPE_LEN) ||
                !strncmp(stream_type, "loopback", SOUND_STREAM_TYPE_LEN) ||
                !strncmp(stream_type, "ext-media", SOUND_STREAM_TYPE_LEN)) {
                *change_reason = SOUND_SESSION_INTERRUPTED_BY_MEDIA;