From ba996fbcea6e85e2932d33ae0d0a64dce3588bd0 Mon Sep 17 00:00:00 2001 From: "aravind.gara" Date: Thu, 9 Nov 2017 14:33:22 +0900 Subject: [PATCH] Disable session backward compatibility with soundpool Disabling backward compatibility since stream information not integrated wih soundpool. [Version] 0.0.12 [Issue Type] Enhancement Change-Id: Ib16f17f1d8995f84f84c869b22820569f624890c Signed-off-by: aravind.gara --- CMakeLists.txt | 2 +- include/internal/soundpool.h | 2 ++ packaging/capi-media-sound-pool.spec | 4 +++- src/sound_pool.c | 7 ++++++- src/soundpool.c | 21 +++++++++++++++++++++ 5 files changed, 33 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0555429..519bb7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(INC_DIR include) INCLUDE_DIRECTORIES(${INC_DIR}) -SET(dependents "dlog glib-2.0 openal") +SET(dependents "dlog glib-2.0 openal mm-session") IF(DEFINED ENV{ENABLE_ALURE}) SET(dependents "${dependents} alure") diff --git a/include/internal/soundpool.h b/include/internal/soundpool.h index fc987ce..c8b16ed 100644 --- a/include/internal/soundpool.h +++ b/include/internal/soundpool.h @@ -77,6 +77,8 @@ sound_pool_error_e _sound_pool_set_callback(sound_pool_t *pool, sound_pool_error_e _sound_pool_unset_callback(sound_pool_t *pool); +void _sound_pool_disable_session_backward_compatibility(void); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/packaging/capi-media-sound-pool.spec b/packaging/capi-media-sound-pool.spec index 34b0b57..73252a1 100644 --- a/packaging/capi-media-sound-pool.spec +++ b/packaging/capi-media-sound-pool.spec @@ -1,5 +1,5 @@ Name: capi-media-sound-pool -Version: 0.0.11 +Version: 0.0.12 Summary: Tizen Sound Pool module Release: 0 Group: Multimedia/Framework @@ -13,6 +13,8 @@ BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(openal) #BuildRequires: pkgconfig(freealut) BuildRequires: pkgconfig(alure) +BuildRequires: pkgconfig(mm-session) +BuildRequires: pkgconfig(mm-sound) %description Tizen Sound Pool Module allowing sounds playing for audio resources. diff --git a/src/sound_pool.c b/src/sound_pool.c index 398da4e..b2d1c7e 100644 --- a/src/sound_pool.c +++ b/src/sound_pool.c @@ -27,6 +27,7 @@ #include "internal/stream.h" #include "internal/priority.h" + /* * Public Implementation */ @@ -45,7 +46,11 @@ sound_pool_error_e sound_pool_create(sound_pool_h *pool) SP_INST_CHECK(pool, SOUND_POOL_ERROR_INVALID_PARAMETER); sound_pool_t *_pool = NULL; - sound_pool_error_e ret = _sound_pool_create(&_pool); + sound_pool_error_e ret; + + _sound_pool_disable_session_backward_compatibility(); + + ret = _sound_pool_create(&_pool); SP_RETVM_IF(ret != SOUND_POOL_ERROR_NONE, ret, "Error while creating sound pool instance."); SP_INST_CHECK(pool, SOUND_POOL_ERROR_INVALID_OPERATION); diff --git a/src/soundpool.c b/src/soundpool.c index 6cb52b2..5034331 100644 --- a/src/soundpool.c +++ b/src/soundpool.c @@ -18,6 +18,10 @@ * @file soundpool.c * @brief This file include implementation of protected API for the SoundPool. */ +#include +#include +#include +#include #include "internal/soundpool.h" @@ -314,3 +318,20 @@ sound_pool_error_e _sound_pool_unset_callback(sound_pool_t *pool) SP_DEBUG_FLEAVE(); return SOUND_POOL_ERROR_NONE; } + +void _sound_pool_disable_session_backward_compatibility(void) +{ + int mm_ret = MM_ERROR_NONE; + int session_type = 0; + int session_options = 0; + + /* read session information */ + mm_ret = _mm_session_util_read_information(-1, &session_type, &session_options); + if (mm_ret == MM_ERROR_NONE) { + /* Session exists */ + SP_INFO(" Session exists:session_type %d, session_option %d", session_type, session_options); + } + + if ((_mm_session_util_write_information((int)getpid(), MM_SESSION_TYPE_REPLACED_BY_STREAM, 0))) + SP_INFO("failed to _mm_session_util_write_information for MM_SESSION_TYPE_REPLACED_BY_STREAM"); +} -- 2.7.4