Disable session backward compatibility with soundpool 62/159462/6 accepted/tizen/unified/20171115.061222 submit/tizen/20171114.113841
authoraravind.gara <aravind.gara@samsung.com>
Thu, 9 Nov 2017 05:33:22 +0000 (14:33 +0900)
committeraravind.gara <aravind.gara@samsung.com>
Tue, 14 Nov 2017 11:35:28 +0000 (20:35 +0900)
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 <aravind.gara@samsung.com>
CMakeLists.txt
include/internal/soundpool.h
packaging/capi-media-sound-pool.spec
src/sound_pool.c
src/soundpool.c

index 0555429..519bb7e 100644 (file)
@@ -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")
index fc987ce..c8b16ed 100644 (file)
@@ -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 */
index 34b0b57..73252a1 100644 (file)
@@ -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.
index 398da4e..b2d1c7e 100644 (file)
@@ -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);
index 6cb52b2..5034331 100644 (file)
  * @file soundpool.c
  * @brief This file include implementation of protected API for the SoundPool.
  */
+#include <unistd.h>
+#include <mm_session.h>
+#include <mm_sound.h>
+#include <mm_session_private.h>
 
 #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");
+}