EXPORT_API
int mm_session_init(int sessiontype)
{
- debug_fenter();
- return mm_session_init_ex(sessiontype, NULL, NULL);
- debug_fleave();
-}
-
-EXPORT_API
-int mm_session_init_ex(int sessiontype, session_callback_fn callback, void* user_param)
-{
int result = MM_ERROR_NONE;
int ltype = 0;
bool do_not_update_session_info = false;
}
}
- /* Monitor Callback */
- if (NULL == callback) {
- debug_warning("Null callback function");
- } else {
- debug_warning("It was deprecated, do not use monitor callback, callback(%p), user_param(%p)", callback, user_param);
- }
-
g_session_type = sessiontype;
if (!do_not_update_session_info) {
}
EXPORT_API
-int mm_session_add_watch_callback(int watchevent, int watchstate, watch_callback_fn callback, void* user_param)
-{
- debug_fenter();
-
- debug_fleave();
-
- return MM_ERROR_NOT_SUPPORT_API;
-}
-
-EXPORT_API
int mm_session_get_current_type(int *sessiontype)
{
int result = MM_ERROR_NONE;
}
EXPORT_API
-int mm_session_remove_watch_callback(int watchevent, int watchstate)
-{
- debug_fenter();
-
- debug_fleave();
-
- return MM_ERROR_NOT_SUPPORT_API;
-}
-
-EXPORT_API
-int mm_session_set_subsession(mm_subsession_t subsession, mm_subsession_option_t option)
-{
- debug_fenter();
-
- debug_fleave();
-
- return MM_ERROR_NOT_SUPPORT_API;
-}
-
-EXPORT_API
-int mm_session_get_subsession(mm_subsession_t *subsession)
-{
- debug_fenter();
-
- debug_fleave();
-
- return MM_ERROR_NOT_SUPPORT_API;
-}
-
-EXPORT_API
-int mm_session_set_subevent(mm_session_sub_t subevent)
-{
- debug_fenter();
-
- debug_fleave();
-
- return MM_ERROR_NOT_SUPPORT_API;
-}
-
-EXPORT_API
-int mm_session_get_subevent(mm_session_sub_t *subevent)
-{
- debug_fenter();
-
- debug_fleave();
-
- return MM_ERROR_NOT_SUPPORT_API;
-}
-
-EXPORT_API
-int mm_session_reset_resumption_info(void)
-{
- debug_fenter();
-
- debug_fleave();
-
- return MM_ERROR_NOT_SUPPORT_API;
-}
-
-EXPORT_API
int _mm_session_util_delete_information(int app_pid)
{
pid_t mypid;
MM_SESSION_UPDATE_TYPE_ADD,
MM_SESSION_UPDATE_TYPE_REMOVE,
MM_SESSION_UPDATE_TYPE_NUM
-}session_update_type_t;
+} session_update_type_t;
/**
* This define is for session options
#define MM_SESSION_OPTION_RESUME_BY_SYSTEM_OR_MEDIA_PAUSED 0x0010
/**
- * This enumeration defines session callback message type.
- */
-typedef enum {
- MM_SESSION_MSG_STOP, /**< Message Stop : this messages means that session of application has interrupted by policy.
- So application should stop it's multi-media context when this message has come */
- MM_SESSION_MSG_RESUME, /**< Message Stop : this messages means that session interrupt of application has ended.
- So application could resume it's multi-media context when this message has come */
- MM_SESSION_MSG_NUM
-}session_msg_t;
-
-typedef enum {
- MM_SESSION_EVENT_MEDIA = 0,
- MM_SESSION_EVENT_CALL,
- MM_SESSION_EVENT_ALARM,
- MM_SESSION_EVENT_EARJACK_UNPLUG,
- MM_SESSION_EVENT_RESOURCE_CONFLICT,
- MM_SESSION_EVENT_EMERGENCY,
- MM_SESSION_EVENT_NOTIFICATION,
-}session_event_t;
-
-typedef enum {
- MM_SESSION_WATCH_EVENT_IGNORE = -1,
- MM_SESSION_WATCH_EVENT_CALL = 0,
- MM_SESSION_WATCH_EVENT_VIDEO_CALL,
- MM_SESSION_WATCH_EVENT_ALARM,
- MM_SESSION_WATCH_EVENT_NUM
-}session_watch_event_t;
-
-typedef enum {
- MM_SESSION_WATCH_STATE_STOP = 0,
- MM_SESSION_WATCH_STATE_PLAYING,
- MM_SESSION_WATCH_STATE_NUM
-}session_watch_state_t;
-
-typedef void (*session_callback_fn) (session_msg_t msg, session_event_t event, void *user_param);
-typedef void (*watch_callback_fn) (session_watch_event_t event, session_watch_state_t state, void *user_param);
-
-/**
* This function defines application's Multimedia Session policy
*
* @param sessiontype [in] Multimedia Session type
*/
int mm_session_init(int sessiontype);
-
-
-
-/**
- * This function defines application's Multimedia Session policy
- *
- * @param sessiontype [in] Multimedia Session type
- * @param session_callback_fn [in] session message callback function pointer
- * @param user_param [in] callback function user parameter
- *
- * @return This function returns MM_ERROR_NONE on success, or negative value
- * with error code.
- * @remark Session type is unique for each application (each PID actually).
- * if application want to change session type, Finish session first and Init again
- * @pre There should be pre-initialized session type for caller application.
- * @post A session type of caller application will be defined process widely.
- * And session callback will be registered as given function pointer with given user_param
- * @see MMSessionType mm_session_finish
- * @since
- * @par Example
- * @code
-#include <mm_session.h>
-
-session_callback_fn session_cb(session_msg_t msg, session_event_t event, void *user_param)
-{
- struct appdata* ad = (struct appdata*) user_param;
-
- switch(msg)
- {
- case MM_SESSION_MSG_STOP:
- // Stop multi-media context here
- ...
- break;
- case MM_SESSION_MSG_RESUME:
- // Resume multi-media context here
- ...
- break;
- default:
- break;
- }
- ...
-}
-
-static int _create(void *data)
-{
- struct appdata* ad = (struct appdata*) data;
- int ret = 0;
-
- // Initialize Multimedia Session Type with callback
- ret = mm_session_init_ex(MM_SESSION_TYPE_MEDIA, session_cb, (void*)ad);
- if(ret < 0)
- {
- printf("Can not initialize session \n");
- }
- ...
-}
-
-static int _terminate(void* data)
-{
- int ret = 0;
-
- // Deinitialize Multimedia Session Type
- ret = mm_session_finish();
- if(ret < 0)
- {
- printf("Can not finish session\n");
- }
- ...
-}
-
-
-int main()
-{
- ...
- struct appcore_ops ops = {
- .create = _create,
- .terminate = _terminate,
- .pause = _pause,
- .resume = _resume,
- .reset = _reset,
- };
- ...
- return appcore_efl_main(PACKAGE, ..., &ops);
-}
-
- * @endcode
- */
-int mm_session_init_ex(int sessiontype, session_callback_fn callback, void* user_param);
-
-
-
/**
* This function finish application's Multimedia Session.
*
int mm_session_update_option(session_update_type_t update_type, int options);
/**
- * This function add a watch callback
- *
- * @param watchevent [in] The session type to be watched
- * @param watchstate [in] The session state of the session type of first argument to be watched
- * @param callback [in] The callback which will be called when the watched session state was activated
- * @param user_param [in] The user param passed from the callback registration function
- * @return This function returns MM_ERROR_NONE on success, or negative value
- * with error code.
- * @see
- * @since
- */
-int mm_session_add_watch_callback(int watchevent, int watchstate, watch_callback_fn callback, void* user_param);
-
-/**
- * This function removes a watch callback corresponding with two arguments
- *
- * @param watchevent [in] The session type to be removed
- * @param watchstate [in] The session state to be removed
- * @return This function returns MM_ERROR_NONE on success, or negative value
- * with error code.
- * @see
- * @since
- */
-int mm_session_remove_watch_callback(int watchevent, int watchstate);
-
-/**
- * This function initialize resumption of other ASM handles which were paused by this session
- * It can be used only when call series or voice recognition session is set
- *
- * @return This function returns MM_ERROR_NONE on success, or negative value
- * with error code.
- */
-int mm_session_reset_resumption_info(void);
-
-/**
@}
*/
*/
int _mm_session_util_read_information(int app_pid, int *session_type, int *flags);
-
-/**
- * This function set sub-session type
- *
- * @param subsession [in] subsession type
- * @param option [in] option of subsession type
- *
- * @return This function returns MM_ERROR_NONE on success, or negative value
- * with error code.
- * @remark This function is only for internal implementation do not use this at application
- * Session type is unique for each application.
- * @see mm_session_get_subsession
- * @since
- */
-int mm_session_set_subsession (mm_subsession_t subsession, mm_subsession_option_t option);
-
-/**
- * This function get current sub-session type
- *
- * @param subsession [out] subsession type
- *
- * @return This function returns MM_ERROR_NONE on success, or negative value
- * with error code.
- * @remark This function is only for internal implementation do not use this at application
- * Session type is unique for each application.
- * @see mm_session_set_subsession
- * @since
- */
-int mm_session_get_subsession (mm_subsession_t *subsession);
-
-/**
- * This function set sub-event type
- *
- * @param subevent [in] subevent type
- *
- * @return This function returns MM_ERROR_NONE on success, or negative value
- * with error code.
- * @remark This function is only for internal implementation do not use this at application
- * Session type is unique for each application.
- * @see mm_session_get_subevent
- * @since
- */
-int mm_session_set_subevent (mm_session_sub_t subevent);
-
-/**
- * This function get current sub-event type
- *
- * @param subevent [out] subevent type
- *
- * @return This function returns MM_ERROR_NONE on success, or negative value
- * with error code.
- * @remark This function is only for internal implementation do not use this at application
- * Session type is unique for each application.
- * @see mm_session_set_subsevnt
- * @since
- */
-int mm_session_get_subevent (mm_session_sub_t *subevent);
-
#ifdef __cplusplus
}
#endif