Make ASM handling external.
authorIsmo Puustinen <ismo.puustinen@intel.com>
Fri, 12 Oct 2012 13:46:31 +0000 (16:46 +0300)
committerIsmo Puustinen <ismo.puustinen@intel.com>
Mon, 11 Mar 2013 11:49:51 +0000 (13:49 +0200)
server/include/mm_sound_mgr_asm.h
server/mm_sound_mgr_codec.c
server/mm_sound_mgr_session.c
server/mm_sound_server.c

index 3bd9f94..35b154a 100644 (file)
@@ -30,6 +30,5 @@ int MMSoundMgrASMFini(void);
 
 int __asm_process_message (void *asm_rcv_msg, void *asm_ret_msg);
 
-
 #endif /* __MM_SOUND_MGR_ASM_H__ */
 
index 849de31..2dc6f7d 100644 (file)
@@ -241,8 +241,8 @@ int MMSoundMgrCodecPlay(int *slotid, const mmsound_mgr_codec_param_t *param)
         */
 
        if(param->session_type != ASM_EVENT_CALL && param->session_type != ASM_EVENT_VIDEOCALL) {
-               if(!ASM_register_sound_ex((int)param->param, &param->session_handle, param->session_type, ASM_STATE_PLAYING,
-                                                               sound_codec_asm_callback, (void*)*slotid, ASM_RESOURCE_NONE, &errorcode, __asm_process_message))        {
+               if(!ASM_register_sound((int)param->param, &param->session_handle, param->session_type, ASM_STATE_PLAYING,
+                                                               sound_codec_asm_callback, (void*)*slotid, ASM_RESOURCE_NONE, &errorcode))       {
                        debug_critical("ASM_register_sound() failed %d\n", errorcode);
                        pthread_mutex_unlock(&g_slot_mutex);
                        return MM_ERROR_POLICY_INTERNAL;
@@ -286,7 +286,7 @@ int MMSoundMgrCodecPlay(int *slotid, const mmsound_mgr_codec_param_t *param)
 
 cleanup:
        if(param->session_type != ASM_EVENT_CALL  && param->session_type != ASM_EVENT_VIDEOCALL && need_asm_unregister == 1) {
-               if(!ASM_unregister_sound_ex(param->session_handle, param->session_type, &errorcode,__asm_process_message)) {
+               if(!ASM_unregister_sound(param->session_handle, param->session_type, &errorcode)) {
                        debug_error("Unregister sound failed 0x%X\n", errorcode);
                        return MM_ERROR_POLICY_INTERNAL;
                }
@@ -358,8 +358,8 @@ int MMSoundMgrCodecPlayDtmf(int *slotid, const mmsound_mgr_codec_param_t *param)
        int need_asm_unregister = 0;
 
        if(param->session_type != ASM_EVENT_CALL && param->session_type != ASM_EVENT_VIDEOCALL) {
-               if(!ASM_register_sound_ex((int)param->param, &param->session_handle, param->session_type, ASM_STATE_PLAYING,
-                                                               sound_codec_asm_callback, (void*)*slotid, ASM_RESOURCE_NONE, &errorcode, __asm_process_message)) {
+               if(!ASM_register_sound((int)param->param, &param->session_handle, param->session_type, ASM_STATE_PLAYING,
+                                                               sound_codec_asm_callback, (void*)*slotid, ASM_RESOURCE_NONE, &errorcode)) {
                        debug_critical("ASM_register_sound() failed %d\n", errorcode);
                        pthread_mutex_unlock(&g_slot_mutex);
                        return MM_ERROR_POLICY_INTERNAL;
@@ -454,7 +454,7 @@ static int _MMSoundMgrCodecStopCallback(int param)
 
        if(g_slots[param].session_type != ASM_EVENT_CALL && g_slots[param].session_type != ASM_EVENT_VIDEOCALL) {
                debug_msg("[CODEC MGR] ASM unregister\n");
-               if(!ASM_unregister_sound_ex(g_slots[param].session_handle, g_slots[param].session_type, &errorcode, __asm_process_message)) {
+               if(!ASM_unregister_sound(g_slots[param].session_handle, g_slots[param].session_type, &errorcode)) {
                        debug_error("[CODEC MGR] Unregister sound failed 0x%X\n", errorcode);
                }
        }
index 404b623..b1f514d 100644 (file)
@@ -208,7 +208,7 @@ static bool _asm_register_for_headset (int * handle)
                return false;
        }
 
-       if (!ASM_register_sound_ex (-1, handle, ASM_EVENT_EARJACK_UNPLUG, ASM_STATE_NONE, NULL, NULL, ASM_RESOURCE_NONE, &asm_error, __asm_process_message)) {
+       if(!ASM_register_sound (-1, handle, ASM_EVENT_EARJACK_UNPLUG, ASM_STATE_NONE, NULL, NULL, ASM_RESOURCE_NONE, &asm_error)) {
                        debug_warning("earjack event register failed with 0x%x\n", asm_error);
                        return false;
        }
@@ -237,11 +237,11 @@ static void _asm_pause_process(int handle)
        //do pause
        debug_warning("Send earphone unplug event to Audio Session Manager Server for BT headset\n");
 
-       if (!ASM_set_sound_state_ex(handle, ASM_EVENT_EARJACK_UNPLUG, ASM_STATE_PLAYING, ASM_RESOURCE_NONE, &asm_error, __asm_process_message)) {
+       if(!ASM_set_sound_state(handle, ASM_EVENT_EARJACK_UNPLUG, ASM_STATE_PLAYING, ASM_RESOURCE_NONE, &asm_error)) {
                debug_error("earjack event set sound state to playing failed with 0x%x\n", asm_error);
        }
 
-       if (!ASM_set_sound_state_ex(handle, ASM_EVENT_EARJACK_UNPLUG, ASM_STATE_STOP, ASM_RESOURCE_NONE, &asm_error, __asm_process_message)) {
+       if(!ASM_set_sound_state(handle, ASM_EVENT_EARJACK_UNPLUG, ASM_STATE_STOP, ASM_RESOURCE_NONE, &asm_error)) {
                debug_error("earjack event set sound state to stop failed with 0x%x\n", asm_error);
        }
 
@@ -257,7 +257,7 @@ static bool _asm_unregister_for_headset (int *handle)
                return false;
        }
 
-       if (!ASM_unregister_sound_ex(*handle, ASM_EVENT_EARJACK_UNPLUG, &asm_error, __asm_process_message)) {
+       if(!ASM_unregister_sound(handle, ASM_EVENT_EARJACK_UNPLUG, &asm_error)) {
                debug_error("earjack event unregister failed with 0x%x\n", asm_error);
                return false;
        }
index 5a4c67d..e5f9df9 100644 (file)
@@ -221,9 +221,11 @@ int main(int argc, char **argv)
                        MMSoundMgrIpcInit();
 
                pulse_handle = MMSoundMgrPulseInit();
+#if 0
                MMSoundMgrASMInit();
                /* Wait for ASM Ready */
                __wait_for_asm_ready();
+#endif
                _mm_sound_mgr_device_init();
                MMSoundMgrHeadsetInit();
                MMSoundMgrDockInit();