From: Sangchul Lee Date: Tue, 13 Jun 2017 08:43:27 +0000 (+0900) Subject: Add new internal stream type - SOUND_STREAM_TYPE_VOICE_RECOGNITION_SERVICE X-Git-Tag: submit/tizen/20170614.045837~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F92%2F133892%2F1;p=platform%2Fcore%2Fapi%2Fsound-manager.git Add new internal stream type - SOUND_STREAM_TYPE_VOICE_RECOGNITION_SERVICE 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 --- diff --git a/include/sound_manager_internal.h b/include/sound_manager_internal.h index 3f0cdcc..93da0ef 100644 --- a/include/sound_manager_internal.h +++ b/include/sound_manager_internal.h @@ -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; /** diff --git a/packaging/capi-media-sound-manager.spec b/packaging/capi-media-sound-manager.spec index 2f6061a..6dff7a4 100644 --- a/packaging/capi-media-sound-manager.spec +++ b/packaging/capi-media-sound-manager.spec @@ -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 diff --git a/src/sound_manager_private.c b/src/sound_manager_private.c index b12b0ec..6d3a64b 100644 --- a/src/sound_manager_private.c +++ b/src/sound_manager_private.c @@ -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;