audio-io changed some focus & session APIs 21/47121/2 tizen_3.0.m1_mobile tizen_3.0.m1_tv accepted/tizen/mobile/20150914.120308 accepted/tizen/tv/20150914.120316 accepted/tizen/wearable/20150914.120328 submit/tizen/20150914.113702 submit/tizen_common/20151023.083358 submit/tizen_common/20151026.085049 tizen_3.0.m1_mobile_release tizen_3.0.m1_tv_release
authorKimJeongYeon <jeongyeon.kim@samsung.com>
Mon, 31 Aug 2015 04:21:25 +0000 (13:21 +0900)
committerJeongYeon Kim <jeongyeon.kim@samsung.com>
Mon, 31 Aug 2015 04:26:19 +0000 (21:26 -0700)
[Version] 0.3.16
[Profile] Common
[Issue Type] Feature
[Dependency module] NA
[Dependency commit] NA
[Comment]

related with:
https://review.tizen.org/gerrit/46776/
https://review.tizen.org/gerrit/46350/

Signed-off-by: KimJeongYeon <jeongyeon.kim@samsung.com>
Change-Id: Ia4f0c0c00024bc1ece92c6854f3df94559753e73

include/CAudioSessionHandler.h
packaging/capi-media-audio-io.spec
src/cpp/CAudioIO.cpp
src/cpp/CAudioSessionHandler.cpp

index f4a537d..9351ba7 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <mm_session.h>
 #include <mm_session_private.h>
-#include <audio-session-manager.h>
 #include <mm_sound.h>
 #include <mm_sound_focus.h>
 
index eb903aa..ef5b9a5 100644 (file)
@@ -1,6 +1,6 @@
 Name:           capi-media-audio-io
 Summary:        An Audio Input & Audio Output library in Tizen Native API
-Version:        0.3.15
+Version:        0.3.16
 Release:        0
 Group:          Multimedia/API
 License:        Apache-2.0
index ce48131..833fbe8 100644 (file)
@@ -18,7 +18,6 @@
 #include <mm.h>
 #include <pthread.h>
 #include <assert.h>
-#include <audio-session-manager.h>
 #include "CAudioIODef.h"
 
 #define AUDIO_IO_DEBUG
@@ -199,7 +198,7 @@ void CAudioIO::onInterrupt(CAudioSessionHandler* pHandler, int id, mm_sound_focu
         // Triggered by 'focus watch callback'
         ///////////////////////////////////////
 
-        if (session_option & (ASM_SESSION_OPTION_PAUSE_OTHERS | ASM_SESSION_OPTION_UNINTERRUPTIBLE)) {
+        if (session_option & (MM_SESSION_OPTION_PAUSE_OTHERS | MM_SESSION_OPTION_UNINTERRUPTIBLE)) {
             AUDIO_IO_LOGD("Session option is pausing others or uninterruptible, skip...");
             return;
         }
@@ -242,7 +241,7 @@ void CAudioIO::onInterrupt(CAudioSessionHandler* pHandler, int id, mm_sound_focu
             AUDIO_IO_LOGW("Id is different, why? [mId : %d]", pHandler->getId());
         }
 
-        if (session_option & ASM_SESSION_OPTION_UNINTERRUPTIBLE) {
+        if (session_option & MM_SESSION_OPTION_UNINTERRUPTIBLE) {
             AUDIO_IO_LOGD("Session option is uninterruptible, skip...");
             return;
         }
index 87bff45..73aa20a 100644 (file)
@@ -148,7 +148,7 @@ CAudioError CAudioSessionHandler::__getAsmInformation(MMSessionType *type, int *
 }
 
 bool CAudioSessionHandler::__isFocusRequired(MMSessionType type, int options) {
-    if ((options & ASM_SESSION_OPTION_PAUSE_OTHERS)
+    if ((options & MM_SESSION_OPTION_PAUSE_OTHERS)
         || ((type != MM_SESSION_TYPE_MEDIA) && (type != MM_SESSION_TYPE_MEDIA_RECORD)))
         return true;
     else
@@ -368,18 +368,18 @@ void CAudioSessionHandler::registerSound() throw (CAudioError) {
             }
 
             // Register focus callback
-            errorCode = mm_sound_register_focus(__mId,
+            errorCode = mm_sound_register_focus_for_session(__mId,
                                                 __mAudioSession == EAudioSessionType::AUDIO_SESSION_TYPE_CAPTURE ? __STREAM_TYPE_TABLE_IN[index].name : __STREAM_TYPE_TABLE_OUT[index].name,
                                                 __sound_pcm_focus_cb,
                                                 static_cast<void*>(this));
             if (errorCode != MM_ERROR_NONE) {
-                THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_POLICY_BLOCKED, "Failed mm_sound_register_focus() err:0x%x", errorCode);
+                THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_POLICY_BLOCKED, "Failed mm_sound_register_focus_for_session() err:0x%x", errorCode);
             }
 
             __focusIdCountInc();
 
             AUDIO_IO_LOGD("Focus callback registered successfully [id:%d]", __mId);
-        } else if (!(__mOptions & ASM_SESSION_OPTION_UNINTERRUPTIBLE)) {
+        } else if (!(__mOptions & MM_SESSION_OPTION_UNINTERRUPTIBLE)) {
             // Register focus watch callback
             errorCode = mm_sound_set_focus_watch_callback(FOCUS_FOR_BOTH, __sound_pcm_focus_watch_cb, static_cast<void*>(this), &__mId);
             if (errorCode < 0) {
@@ -416,7 +416,7 @@ void CAudioSessionHandler::unregisterSound() throw (CAudioError) {
 
             AUDIO_IO_LOGD("Focus callback unregistered successfully [id:%d]", __mId);
             __mId = -1;
-        } else if (!(__mOptions & ASM_SESSION_OPTION_UNINTERRUPTIBLE)) {
+        } else if (!(__mOptions & MM_SESSION_OPTION_UNINTERRUPTIBLE)) {
             // Unregister focus watch callback.
             errorCode = mm_sound_unset_focus_watch_callback(__mId);
             if (errorCode < 0) {