summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-error.h4
-rw-r--r--include/asm-log.h79
-rw-r--r--include/audio-session-manager-types.h305
-rw-r--r--include/audio-session-manager.h50
4 files changed, 210 insertions, 228 deletions
diff --git a/include/asm-error.h b/include/asm-error.h
index 9084444..f6d814d 100644
--- a/include/asm-error.h
+++ b/include/asm-error.h
@@ -1,9 +1,9 @@
/*
* audio-session-manager
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
*
- * Contact: Seungbae Shin <seungbae.shin@samsung.com>
+ * Contact: Seungbae Shin <seungbae.shin at samsung.com>, Sangchul Lee <sc11.lee at samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/include/asm-log.h b/include/asm-log.h
deleted file mode 100644
index e945238..0000000
--- a/include/asm-log.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * audio-session-manager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Seungbae Shin <seungbae.shin@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef __ASM_LOG_H__
-#define __ASM_LOG_H__
-
-#ifdef __DEBUG_MODE__
-#include <stdio.h>
-#ifdef __USE_LOGMANAGER__
-#include <mm_log.h>
-#endif
-#endif
-
-#ifdef __DEBUG_MODE__
-
-#ifdef __USE_LOGMANAGER__
-#define asm_info_r(msg, args...) log_print_rel((LOG_SESSIONMGR), (LOG_CLASS_INFO), (msg), ##args)
-#define asm_warning_r(msg, args...) log_print_rel((LOG_SESSIONMGR), (LOG_CLASS_WARNING), (msg), ##args)
-#define asm_error_r(msg, args...) log_print_rel((LOG_SESSIONMGR), (LOG_CLASS_ERR), (msg), ##args)
-#define asm_critical_r(msg, args...) log_print_rel((LOG_SESSIONMGR), (LOG_CLASS_CRITICAL), (msg), ##args)
-#define asm_assert_r(condition) log_assert_rel((condition))
-
-#define asm_info(msg, args...) log_print_dbg((LOG_SESSIONMGR), LOG_CLASS_INFO, (msg), ##args)
-#define asm_warning(msg, args...) log_print_dbg((LOG_SESSIONMGR), LOG_CLASS_WARNING, (msg), ##args)
-#define asm_error(msg, args...) log_print_dbg((LOG_SESSIONMGR), LOG_CLASS_ERR, (msg), ##args)
-#define asm_critical(msg, args...) log_print_dbg((LOG_SESSIONMGR), LOG_CLASS_CRITICAL, (msg), ##args)
-#define asm_assert(condition) log_assert_dbg((condition))
-
-#else //__USE_LOGMANAGER__
-
-#define asm_info_r(msg, args...) fprintf(stderr, msg, ##args)
-#define asm_warning_r(msg, args...) fprintf(stderr, msg, ##args)
-#define asm_error_r(msg, args...) fprintf(stderr, msg, ##args)
-#define asm_critical_r(msg, args...) fprintf(stderr, msg, ##args)
-#define asm_assert_r(condition) (condition)
-
-#define asm_info(msg, args...) fprintf(stderr, msg, ##args)
-#define asm_warning(msg, args...) fprintf(stderr, msg, ##args)
-#define asm_error(msg, args...) fprintf(stderr, msg, ##args)
-#define asm_critical(msg, args...) fprintf(stderr, msg, ##args)
-#define asm_assert(condition) (condition)
-
-#endif //__USE_LOGMANAGER__
-
-#else //__DEBUG_MODE__
-
-#define asm_info_r(msg, args...)
-#define asm_warning_r(msg, args...)
-#define asm_error_r(msg, args...)
-#define asm_critical_r(msg, args...)
-#define asm_assert_r(condition) (condition)
-
-#define asm_info(msg, args...)
-#define asm_warning(msg, args...)
-#define asm_error(msg, args...)
-#define asm_critical(msg, args...)
-#define asm_assert(condition) (condition)
-
-#endif // __DEBUG_MODE__
-
-#endif /* __ASM_LOG_H__ */
diff --git a/include/audio-session-manager-types.h b/include/audio-session-manager-types.h
index 1c4a17a..beb0c1b 100644
--- a/include/audio-session-manager-types.h
+++ b/include/audio-session-manager-types.h
@@ -1,9 +1,9 @@
/*
* audio-session-manager
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
*
- * Contact: Seungbae Shin <seungbae.shin@samsung.com>
+ * Contact: Seungbae Shin <seungbae.shin at samsung.com>, Sangchul Lee <sc11.lee at samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,30 +30,46 @@
#include <stdbool.h>
/* Error codes */
-#define ERR_ASM_THREAD_CREATE_ERROR 0x01
-#define ERR_ASM_THREAD_CANCEL_ERROR 0x02
-#define ERR_ASM_MSG_QUEUE_MSGID_GET_FAILED 0x03
-#define ERR_ASM_MSG_QUEUE_SND_ERROR 0x04
-#define ERR_ASM_MSG_QUEUE_RCV_ERROR 0x05
-#define ERR_ASM_ALREADY_REGISTERED 0x06
-#define ERR_ASM_ALREADY_UNREGISTERED 0x07
-#define ERR_ASM_EVENT_IS_INVALID 0x08
-#define ERR_ASM_EVENT_IS_FULL 0x09
-#define ERR_ASM_POLICY_CANNOT_PLAY 0x10
-#define ERR_ASM_POLICY_INVALID_HANDLE 0x11
-#define ERR_ASM_INVALID_PARAMETER 0x12
-#define ERR_ASM_VCONF_ERROR 0x13
-#define ERR_ASM_UNKNOWN_ERROR 0x0F
-#define ERR_ASM_HANDLE_IS_FULL 0x20
-#ifdef USE_SECURITY
-#define ERR_ASM_CHECK_PRIVILEGE_FAILED 0x30
-#define COOKIE_SIZE 20
-#endif
-
-
-#define ASM_PRIORITY_MATRIX_MIN (ASM_EVENT_MAX-1)//13
-#define ASM_SERVER_HANDLE_MAX 256
-
+#define ERR_ASM_ERROR_NONE 0x00
+#define ERR_ASM_THREAD_CREATE_ERROR 0x01
+#define ERR_ASM_THREAD_CANCEL_ERROR 0x02
+#define ERR_ASM_MSG_QUEUE_MSGID_GET_FAILED 0x03
+#define ERR_ASM_MSG_QUEUE_SND_ERROR 0x04
+#define ERR_ASM_MSG_QUEUE_RCV_ERROR 0x05
+#define ERR_ASM_ALREADY_REGISTERED 0x06
+#define ERR_ASM_ALREADY_UNREGISTERED 0x07
+#define ERR_ASM_EVENT_IS_INVALID 0x08
+#define ERR_ASM_LOCAL_HANDLE_IS_FULL 0x09
+#define ERR_ASM_LOCAL_HANDLE_IS_INVALID 0x0A
+#define ERR_ASM_POLICY_CANNOT_PLAY 0x10
+#define ERR_ASM_POLICY_CANNOT_PLAY_BY_CALL 0x11 /* CALL / VIDEOCALL / VOIP */
+#define ERR_ASM_POLICY_CANNOT_PLAY_BY_ALARM 0x12 /* ALARM */
+#define ERR_ASM_POLICY_CANNOT_PLAY_BY_PROFILE 0x13 /* blocked by sound profile */
+#define ERR_ASM_POLICY_CANNOT_PLAY_BY_CUSTOM 0x14 /* blocked by custom reason */
+#define ERR_ASM_INVALID_PARAMETER 0x20
+#define ERR_ASM_VCONF_ERROR 0x21
+#define ERR_ASM_NOT_SUPPORTED 0x22
+#define ERR_ASM_NO_OPERATION 0x23
+#define ERR_ASM_UNKNOWN_ERROR 0x2F
+#define ERR_ASM_SERVER_HANDLE_IS_FULL 0x30
+#define ERR_ASM_SERVER_HANDLE_IS_INVALID 0x31
+#define ERR_ASM_WATCH_ALREADY_REQUESTED 0x40
+#define ERR_ASM_WATCH_ALREADY_UNREQUESTED 0x41
+#define ERR_ASM_WATCH_NOT_SUPPORTED 0x42
+#define ERR_ASM_ADD_WATCH_LIST_FAILURE 0x43
+#define ERR_ASM_DEL_WATCH_LIST_FAILURE 0x44
+
+/* Session Option */
+#define ASM_SESSION_OPTION_PAUSE_OTHERS 0x0001
+#define ASM_SESSION_OPTION_UNINTERRUPTIBLE 0x0002
+#define ASM_SESSION_OPTION_RESUME_BY_MEDIA_PAUSED 0x0010
+#define ASM_SESSION_OPTION_RESUME_BY_MEDIA_STOPPED 0x0020
+
+
+#define ASM_PRIORITY_MATRIX_MIN (ASM_EVENT_MAX-1)
+#define ASM_PRIORITY_SUB_MATRIX_MIN (ASM_SUB_EVENT_MAX-1)
+#define ASM_SERVER_HANDLE_MAX 256
+#define ASM_HANDLE_INIT_VAL -1
#define SOUND_STATUS_KEY "memory/Sound/SoundStatus"
/**
@@ -61,7 +77,7 @@
*/
typedef enum
{
- ASM_REQUEST_REGISTER = 0,
+ ASM_REQUEST_REGISTER = 0,
ASM_REQUEST_UNREGISTER,
ASM_REQUEST_GETSTATE,
ASM_REQUEST_GETMYSTATE,
@@ -70,93 +86,121 @@ typedef enum
ASM_REQUEST_DUMP,
ASM_REQUEST_SET_SUBSESSION,
ASM_REQUEST_GET_SUBSESSION,
+ ASM_REQUEST_REGISTER_WATCHER,
+ ASM_REQUEST_UNREGISTER_WATCHER,
+ ASM_REQUEST_SET_SUBEVENT,
+ ASM_REQUEST_GET_SUBEVENT,
+ ASM_REQUEST_RESET_RESUME_TAG,
+ ASM_REQUEST_SET_SESSION_OPTIONS,
+ ASM_REQUEST_GET_SESSION_OPTIONS
} ASM_requests_t;
/**
* This enumeration defines sound event for Sound Scenario in Multimedia Resources Conflict Manager.
*/
-
typedef enum
{
- ASM_EVENT_NONE = -1, // [Notice] Don't use it in application (Never use it), it is internal sound event
- ASM_EVENT_SHARE_MMPLAYER = 0,
- ASM_EVENT_SHARE_MMCAMCORDER,
- ASM_EVENT_SHARE_MMSOUND,
- ASM_EVENT_SHARE_OPENAL,
- ASM_EVENT_SHARE_AVSYSTEM,
- ASM_EVENT_EXCLUSIVE_MMPLAYER,
- ASM_EVENT_EXCLUSIVE_MMCAMCORDER,
- ASM_EVENT_EXCLUSIVE_MMSOUND,
- ASM_EVENT_EXCLUSIVE_OPENAL,
- ASM_EVENT_EXCLUSIVE_AVSYSTEM,
+ ASM_EVENT_NONE = -1, // [Notice] Don't use it in application (Never use it), it is internal sound event
+ ASM_EVENT_MEDIA_MMPLAYER = 0,
+ ASM_EVENT_MEDIA_MMCAMCORDER,
+ ASM_EVENT_MEDIA_MMSOUND,
+ ASM_EVENT_MEDIA_OPENAL,
+ ASM_EVENT_MEDIA_FMRADIO,
+ ASM_EVENT_MEDIA_WEBKIT,
ASM_EVENT_NOTIFY,
- ASM_EVENT_CALL,
- ASM_EVENT_SHARE_FMRADIO,
- ASM_EVENT_EXCLUSIVE_FMRADIO,
- ASM_EVENT_EARJACK_UNPLUG,
ASM_EVENT_ALARM,
+ ASM_EVENT_EARJACK_UNPLUG,
+ ASM_EVENT_CALL,
ASM_EVENT_VIDEOCALL,
+ ASM_EVENT_VOIP,
ASM_EVENT_MONITOR,
- ASM_EVENT_RICH_CALL,
+ ASM_EVENT_EMERGENCY,
+ ASM_EVENT_EXCLUSIVE_RESOURCE,
+ ASM_EVENT_VOICE_RECOGNITION,
+ ASM_EVENT_MMCAMCORDER_AUDIO,
+ ASM_EVENT_MMCAMCORDER_VIDEO,
ASM_EVENT_MAX
} ASM_sound_events_t;
+typedef enum
+{
+ ASM_SUB_EVENT_NONE = 0,
+ ASM_SUB_EVENT_SHARE,
+ ASM_SUB_EVENT_EXCLUSIVE,
+ ASM_SUB_EVENT_MAX
+} ASM_sound_sub_events_t;
+
+typedef enum {
+ ASM_SUB_SESSION_TYPE_VOICE = 0,
+ ASM_SUB_SESSION_TYPE_RINGTONE,
+ ASM_SUB_SESSION_TYPE_MEDIA,
+ ASM_SUB_SESSION_TYPE_INIT,
+ ASM_SUB_SESSION_TYPE_VR_NORMAL,
+ ASM_SUB_SESSION_TYPE_VR_DRIVE,
+ ASM_SUB_SESSION_TYPE_RECORD_STEREO,
+ ASM_SUB_SESSION_TYPE_RECORD_MONO,
+ ASM_SUB_SESSION_TYPE_MAX
+} ASM_sound_sub_sessions_t;
+
/*
* This enumeration defines event source for sound conflict scenario
*/
typedef enum
{
- ASM_EVENT_SOURCE_OTHER_APP = 0,
+ ASM_EVENT_SOURCE_MEDIA = 0,
ASM_EVENT_SOURCE_CALL_START,
ASM_EVENT_SOURCE_CALL_END,
ASM_EVENT_SOURCE_EARJACK_UNPLUG,
ASM_EVENT_SOURCE_RESOURCE_CONFLICT,
ASM_EVENT_SOURCE_ALARM_START,
ASM_EVENT_SOURCE_ALARM_END,
+ ASM_EVENT_SOURCE_EMERGENCY_START,
+ ASM_EVENT_SOURCE_EMERGENCY_END,
ASM_EVENT_SOURCE_OTHER_PLAYER_APP,
+ ASM_EVENT_SOURCE_NOTIFY_START,
+ ASM_EVENT_SOURCE_NOTIFY_END
} ASM_event_sources_t;
/**
* This enumeration defines sound case between playing sound and request sound
- * ALTER_PLAY : DTMF tone
*/
typedef enum
{
- ASM_CASE_NONE = 0,
- ASM_CASE_1PLAY_2STOP = 1,
- ASM_CASE_1STOP_2PLAY = 5,
- ASM_CASE_1PAUSE_2PLAY = 6,
- ASM_CASE_1PLAY_2PLAY_MIX = 8
+ ASM_CASE_NONE = 0,
+ ASM_CASE_1PLAY_2STOP,
+ ASM_CASE_1STOP_2PLAY,
+ ASM_CASE_1PAUSE_2PLAY,
+ ASM_CASE_1PLAY_2PLAY_MIX,
+ ASM_CASE_RESOURCE_CHECK,
+ ASM_CASE_SUB_EVENT,
} ASM_sound_cases_t;
-
/*
* This enumeration defines Sound Playing Status Information
* Each bit is Sound Status Type( 0 : None , 1 : Playing)
*/
typedef enum
{
- ASM_STATUS_NONE = 0x00000000,
- ASM_STATUS_SHARE_MMPLAYER = 0x00000001,
- ASM_STATUS_SHARE_MMCAMCORDER = 0x00000002,
- ASM_STATUS_SHARE_MMSOUND = 0x00000004,
- ASM_STATUS_SHARE_OPENAL = 0x00000008,
- ASM_STATUS_SHARE_AVSYSTEM = 0x00000010,
- ASM_STATUS_EXCLUSIVE_MMPLAYER = 0x00000020,
- ASM_STATUS_EXCLUSIVE_MMCAMCORDER = 0x00000040,
- ASM_STATUS_EXCLUSIVE_MMSOUND = 0x00000080,
- ASM_STATUS_EXCLUSIVE_OPENAL = 0x00000100,
- ASM_STATUS_EXCLUSIVE_AVSYSTEM = 0x00000200,
- ASM_STATUS_NOTIFY = 0x00000400,
- ASM_STATUS_CALL = 0x10000000, //Watch out
- ASM_STATUS_SHARE_FMRADIO = 0x00000800,
- ASM_STATUS_EXCLUSIVE_FMRADIO = 0x00001000,
- ASM_STATUS_EARJACK_UNPLUG = 0x00002000,
- ASM_STATUS_ALARM = 0x00100000,
- ASM_STATUS_VIDEOCALL = 0x20000000, //Watch out
- ASM_STATUS_MONITOR = 0x80000000, //watch out
- ASM_STATUS_RICH_CALL = 0x40000000, //Watch out
+ ASM_STATUS_NONE = 0x00000000,
+ ASM_STATUS_MEDIA_MMPLAYER = 0x00000001,
+ ASM_STATUS_MEDIA_MMCAMCORDER = 0x00000002,
+ ASM_STATUS_MEDIA_MMSOUND = 0x00000004,
+ ASM_STATUS_MEDIA_OPENAL = 0x00000008,
+ ASM_STATUS_MEDIA_FMRADIO = 0x00000010,
+ ASM_STATUS_MEDIA_WEBKIT = 0x00000020,
+ ASM_STATUS_NOTIFY = 0x00000040,
+ ASM_STATUS_ALARM = 0x00000080,
+ ASM_STATUS_EARJACK_UNPLUG = 0x00001000,
+ ASM_STATUS_CALL = 0x10000000,
+ ASM_STATUS_VIDEOCALL = 0x20000000,
+ ASM_STATUS_VOIP = 0x40000000,
+ ASM_STATUS_MONITOR = 0x80000000,
+ ASM_STATUS_EMERGENCY = 0x00002000,
+ ASM_STATUS_EXCLUSIVE_RESOURCE = 0x00004000,
+ ASM_STATUS_VOICE_RECOGNITION = 0x00010000,
+ ASM_STATUS_MMCAMCORDER_AUDIO = 0x00020000,
+ ASM_STATUS_MMCAMCORDER_VIDEO = 0x00040000
} ASM_sound_status_t;
@@ -165,13 +209,11 @@ typedef enum
*/
typedef enum
{
- ASM_STATE_IGNORE = -1,
- ASM_STATE_NONE = 0,
- ASM_STATE_PLAYING = 1,
- ASM_STATE_WAITING = 2,
- ASM_STATE_STOP = 3,
- ASM_STATE_PAUSE = 4,
- ASM_STATE_PAUSE_BY_APP = 5,
+ ASM_STATE_NONE = 0,
+ ASM_STATE_PLAYING = 1,
+ ASM_STATE_WAITING = 2,
+ ASM_STATE_STOP = 3,
+ ASM_STATE_PAUSE = 4
} ASM_sound_states_t;
@@ -180,19 +222,19 @@ typedef enum
*/
typedef enum
{
- ASM_NEED_NOT_RESUME = 0,
- ASM_NEED_RESUME = 1,
+ ASM_NEED_NOT_RESUME = 0,
+ ASM_NEED_RESUME = 1
}ASM_resume_states_t;
/*
* This enumeration defines state return of client.
*/
typedef enum
{
- ASM_CB_RES_IGNORE = -1,
- ASM_CB_RES_NONE = 0,
- ASM_CB_RES_PLAYING = 1,
- ASM_CB_RES_STOP = 2,
- ASM_CB_RES_PAUSE = 3,
+ ASM_CB_RES_IGNORE = -1,
+ ASM_CB_RES_NONE = 0,
+ ASM_CB_RES_PLAYING = 1,
+ ASM_CB_RES_STOP = 2,
+ ASM_CB_RES_PAUSE = 3,
}ASM_cb_result_t;
/*
@@ -201,42 +243,38 @@ typedef enum
typedef enum
{
- ASM_RESOURCE_NONE = 0x0000,
- ASM_RESOURCE_CAMERA = 0x0001,
- ASM_RESOURCE_VIDEO_OVERLAY = 0x0002,
- ASM_RESOURCE_HW_DECORDER = 0x0100, //this should be removed. miss type
- ASM_RESOURCE_HW_ENCORDER = 0x0200, //this should be removed. miss type
- ASM_RESOURCE_HW_DECODER = 0x0100,
- ASM_RESOURCE_HW_ENCODER = 0x0200,
- ASM_RESOURCE_RADIO_TUNNER = 0x1000,
- ASM_RESOURCE_TV_TUNNER = 0x2000,
+ ASM_RESOURCE_NONE = 0x0000,
+ ASM_RESOURCE_CAMERA = 0x0001,
+ ASM_RESOURCE_VIDEO_OVERLAY = 0x0002,
+ ASM_RESOURCE_STREAMING = 0x0004,
+ ASM_RESOURCE_HW_DECODER = 0x0100,
+ ASM_RESOURCE_HW_ENCODER = 0x0200,
+ ASM_RESOURCE_RADIO_TUNNER = 0x1000,
+ ASM_RESOURCE_TV_TUNNER = 0x2000,
+ ASM_RESOURCE_VOICECONTROL = 0x10000,
}ASM_resource_t;
/* Sound command for applications */
typedef enum
{
- ASM_COMMAND_NONE = 0x0,
- ASM_COMMAND_PLAY = 0x2,
- ASM_COMMAND_STOP = 0x3,
- ASM_COMMAND_PAUSE = 0x4,
- ASM_COMMAND_RESUME = 0x5,
+ ASM_COMMAND_NONE = 0,
+ ASM_COMMAND_PLAY = 2,
+ ASM_COMMAND_STOP = 3,
+ ASM_COMMAND_PAUSE = 4,
+ ASM_COMMAND_RESUME = 5,
} ASM_sound_commands_t;
-
/**
* This structure defines the message data from library to conflict manager.
*/
typedef struct
{
- int handle;
+ int handle;
ASM_requests_t request_id;
ASM_sound_events_t sound_event;
ASM_sound_states_t sound_state;
ASM_resource_t system_resource;
-#ifdef USE_SECURITY
- unsigned char cookie [COOKIE_SIZE];
-#endif
} __ASM_msg_data_lib_to_asm_t;
/**
@@ -244,13 +282,13 @@ typedef struct
*/
typedef struct
{
- int alloc_handle;
- int cmd_handle;
- ASM_sound_commands_t result_sound_command;
+ int alloc_handle;
+ int cmd_handle;
+ ASM_sound_commands_t result_sound_command;
ASM_sound_states_t result_sound_state;
-#ifdef USE_SECURITY
- int check_privilege;
-#endif
+ ASM_requests_t source_request_id;
+ int option_flags;
+ int error_code;
} __ASM_msg_data_asm_to_lib_t;
/**
@@ -296,35 +334,29 @@ typedef struct
ASM_sound_status_t sound_status;
}ASM_sound_event_type_t;
-
static const ASM_sound_event_type_t ASM_sound_type[] = {
{ ASM_EVENT_NONE, ASM_STATUS_NONE },
- { ASM_EVENT_SHARE_MMPLAYER, ASM_STATUS_SHARE_MMPLAYER },
- { ASM_EVENT_SHARE_MMCAMCORDER, ASM_STATUS_SHARE_MMCAMCORDER },
- { ASM_EVENT_SHARE_MMSOUND, ASM_STATUS_SHARE_MMSOUND },
- { ASM_EVENT_SHARE_OPENAL, ASM_STATUS_SHARE_OPENAL },
- { ASM_EVENT_SHARE_AVSYSTEM, ASM_STATUS_SHARE_AVSYSTEM },
- { ASM_EVENT_EXCLUSIVE_MMPLAYER, ASM_STATUS_EXCLUSIVE_MMPLAYER },
- { ASM_EVENT_EXCLUSIVE_MMCAMCORDER, ASM_STATUS_EXCLUSIVE_MMCAMCORDER },
- { ASM_EVENT_EXCLUSIVE_MMSOUND, ASM_STATUS_EXCLUSIVE_MMSOUND },
- { ASM_EVENT_EXCLUSIVE_OPENAL, ASM_STATUS_EXCLUSIVE_OPENAL },
- { ASM_EVENT_EXCLUSIVE_AVSYSTEM, ASM_STATUS_EXCLUSIVE_AVSYSTEM },
+ { ASM_EVENT_MEDIA_MMPLAYER, ASM_STATUS_MEDIA_MMPLAYER },
+ { ASM_EVENT_MEDIA_MMCAMCORDER, ASM_STATUS_MEDIA_MMCAMCORDER },
+ { ASM_EVENT_MEDIA_MMSOUND, ASM_STATUS_MEDIA_MMSOUND },
+ { ASM_EVENT_MEDIA_OPENAL, ASM_STATUS_MEDIA_OPENAL },
+ { ASM_EVENT_MEDIA_FMRADIO, ASM_STATUS_MEDIA_FMRADIO },
+ { ASM_EVENT_MEDIA_WEBKIT, ASM_STATUS_MEDIA_WEBKIT },
{ ASM_EVENT_NOTIFY, ASM_STATUS_NOTIFY },
- { ASM_EVENT_CALL, ASM_STATUS_CALL },
- { ASM_EVENT_SHARE_FMRADIO, ASM_STATUS_SHARE_FMRADIO },
- { ASM_EVENT_EXCLUSIVE_FMRADIO, ASM_STATUS_EXCLUSIVE_FMRADIO },
- { ASM_EVENT_EARJACK_UNPLUG, ASM_STATUS_EARJACK_UNPLUG },
{ ASM_EVENT_ALARM, ASM_STATUS_ALARM },
- { ASM_EVENT_VIDEOCALL, ASM_STATUS_VIDEOCALL },
+ { ASM_EVENT_EARJACK_UNPLUG, ASM_STATUS_EARJACK_UNPLUG },
+ { ASM_EVENT_CALL, ASM_STATUS_CALL },
+ { ASM_EVENT_VIDEOCALL, ASM_STATUS_VIDEOCALL },
+ { ASM_EVENT_VOIP, ASM_STATUS_VOIP },
{ ASM_EVENT_MONITOR, ASM_STATUS_MONITOR },
- { ASM_EVENT_RICH_CALL, ASM_STATUS_RICH_CALL },
+ { ASM_EVENT_EMERGENCY, ASM_STATUS_EMERGENCY },
+ { ASM_EVENT_EXCLUSIVE_RESOURCE, ASM_STATUS_EXCLUSIVE_RESOURCE },
+ { ASM_EVENT_VOICE_RECOGNITION, ASM_STATUS_VOICE_RECOGNITION },
+ { ASM_EVENT_MMCAMCORDER_AUDIO, ASM_STATUS_MMCAMCORDER_AUDIO },
+ { ASM_EVENT_MMCAMCORDER_VIDEO, ASM_STATUS_MMCAMCORDER_VIDEO }
};
-
-
-
-
/**
* This callback function is called when sound status of other sound event is changed
*
@@ -333,4 +365,13 @@ static const ASM_sound_event_type_t ASM_sound_type[] = {
*/
typedef ASM_cb_result_t (*ASM_sound_cb_t) (int handle, ASM_event_sources_t event_source, ASM_sound_commands_t command, unsigned int sound_status, void* cb_data);
+
+/**
+ * This callback function is called when sound status of other sound event and state that you want to watch is changed
+ *
+ * @return No return value
+ * @param[in] sound_status Argument passed when callback was set
+ */
+typedef ASM_cb_result_t (*ASM_watch_cb_t) (int handle, ASM_sound_events_t sound_event, ASM_sound_states_t sound_state, void* cb_data);
+
#endif
diff --git a/include/audio-session-manager.h b/include/audio-session-manager.h
index b7434b2..35a98fc 100644
--- a/include/audio-session-manager.h
+++ b/include/audio-session-manager.h
@@ -1,9 +1,9 @@
/*
* audio-session-manager
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
*
- * Contact: Seungbae Shin <seungbae.shin@samsung.com>
+ * Contact: Seungbae Shin <seungbae.shin at samsung.com>, Sangchul Lee <sc11.lee at samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -68,7 +68,8 @@ ASM_register_sound_ex (const int application_pid, int *asm_handle, ASM_sound_eve
bool
ASM_unregister_sound(const int asm_handle, ASM_sound_events_t sound_event, int *error_code);
-bool ASM_unregister_sound_ex(const int asm_handle, ASM_sound_events_t sound_event, int *error_code, int (*func)(void*,void*));
+bool
+ASM_unregister_sound_ex(const int asm_handle, ASM_sound_events_t sound_event, int *error_code, int (*func)(void*,void*));
/**
@@ -109,6 +110,9 @@ ASM_get_sound_state(const int asm_handle, ASM_sound_events_t sound_event, ASM_so
bool
ASM_get_process_session_state(const int asm_handle, ASM_sound_states_t *sound_state, int *error_code);
+bool
+ASM_attach_callback(ASM_sound_events_t sound_event, ASM_sound_cb_t callback, void *user_data, int *error_code);
+
/**
* This function set sound state to ASM server.
*
@@ -122,22 +126,38 @@ ASM_get_process_session_state(const int asm_handle, ASM_sound_states_t *sound_st
bool
ASM_set_sound_state(const int asm_handle, ASM_sound_events_t sound_event, ASM_sound_states_t sound_state, ASM_resource_t mm_resource, int *error_code);
-bool ASM_set_sound_state_ex (const int asm_handle, ASM_sound_events_t sound_event, ASM_sound_states_t sound_state, ASM_resource_t mm_resource, int *error_code, int (*func)(void*,void*));
-
-/**
- * This function ask sound policy to ASM server.
- *
- * @return No return value
- * @param[in] playing_sound playing sound event
- * @param[in] request_sound request sound event
- * @param[out] sound_policy Return sound case between playing sound and request sound
- */
-void
-ASM_ask_sound_policy(ASM_sound_events_t playing_sound, ASM_sound_events_t request_sound, ASM_sound_cases_t *sound_policy) __attribute__((deprecated)) ;
+bool
+ASM_set_sound_state_ex (const int asm_handle, ASM_sound_events_t sound_event, ASM_sound_states_t sound_state, ASM_resource_t mm_resource, int *error_code, int (*func)(void*,void*));
bool
ASM_change_callback(const int asm_handle, ASM_sound_events_t sound_event, ASM_sound_cb_t callback, void* cb_data, int *error_code);
+bool
+ASM_set_watch_session (const int application_pid, ASM_sound_events_t interest_sound_event, ASM_sound_states_t interest_sound_state, ASM_watch_cb_t callback, void *user_data, int *error_code);
+
+bool
+ASM_unset_watch_session (ASM_sound_events_t interest_sound_event, ASM_sound_states_t interest_sound_state, int *error_code);
+
+bool
+ASM_reset_resumption_info(const int asm_handle, int *error_code);
+
+bool
+ASM_set_subevent (const int asm_handle, ASM_sound_sub_events_t subevent, int *error_code);
+
+bool
+ASM_get_subevent (const int asm_handle, ASM_sound_sub_events_t *subevent, int *error_code);
+
+bool
+ASM_set_subsession (const int asm_handle, ASM_sound_sub_sessions_t subsession, int resource, int *error_code);
+
+bool
+ASM_get_subsession (const int asm_handle, ASM_sound_sub_sessions_t *subsession, int *error_code);
+
+bool
+ASM_set_session_option (const int asm_handle, int option_flags, int *error_code);
+
+bool
+ASM_get_session_option (const int asm_handle, int *option_flags, int *error_code);
#ifdef __cplusplus