int pid;
int handle_id;
char stream_type[MAX_STREAM_TYPE_LEN];
- char option[MM_SOUND_NAME_NUM];
+ char ext_info[MM_SOUND_NAME_NUM];
focus_type_e request_type;
+ int option;
void *callback;
void *cbdata;
bool reacquisition;
int priority;
bool is_for_watch;
char stream_type[MAX_STREAM_TYPE_LEN];
- char option[NUM_OF_STREAM_IO_TYPE][MM_SOUND_NAME_NUM];
+ char ext_info[NUM_OF_STREAM_IO_TYPE][MM_SOUND_NAME_NUM];
+ int option[NUM_OF_STREAM_IO_TYPE];
focus_status_e status;
_focus_taken_by_id_t taken_by_id[NUM_OF_STREAM_IO_TYPE];
_focus_taken_by_id_t taken_backup[NUM_OF_STREAM_IO_TYPE];
int mm_sound_mgr_focus_create_node (const _mm_sound_mgr_focus_param_t *param);
int mm_sound_mgr_focus_destroy_node (const _mm_sound_mgr_focus_param_t *param);
int mm_sound_mgr_focus_set_reacquisition (const _mm_sound_mgr_focus_param_t *param);
-int mm_sound_mgr_focus_get_stream_type_of_acquired_focus(focus_type_e focus_type, char **stream_type, char **additional_info);
+int mm_sound_mgr_focus_get_stream_type_of_acquired_focus(focus_type_e focus_type, char **stream_type, int *option, char **ext_info);
int mm_sound_mgr_focus_request_acquire (const _mm_sound_mgr_focus_param_t *param);
int mm_sound_mgr_focus_request_release (const _mm_sound_mgr_focus_param_t *param);
int mm_sound_mgr_focus_set_watch_cb (const _mm_sound_mgr_focus_param_t *param);
#include <stdbool.h>
int __mm_sound_mgr_focus_ipc_register_focus(int client_pid, int handle_id, const char* stream_type, bool is_for_session);
-int __mm_sound_mgr_focus_ipc_watch_focus(int pid, int handle_id, int focus_type, bool is_for_session);
int __mm_sound_mgr_focus_ipc_set_focus_reacquisition(int pid, int handle_id, bool reacquisition);
-int __mm_sound_mgr_focus_ipc_get_acquired_focus_stream_type(int focus_type, char **stream_type, char **additional_info);
-int __mm_sound_mgr_focus_ipc_acquire_focus(int pid, int handle_id, int focus_type, const char* name );
-int __mm_sound_mgr_focus_ipc_release_focus(int pid, int handle_id, int focus_type, const char* name);
+int __mm_sound_mgr_focus_ipc_get_acquired_focus_stream_type(int focus_type, char **stream_type, int *option, char **ext_info);
+int __mm_sound_mgr_focus_ipc_acquire_focus(int pid, int handle_id, int focus_type, int option, const char *ext_info);
+int __mm_sound_mgr_focus_ipc_release_focus(int pid, int handle_id, int focus_type, int option, const char *ext_info);
+int __mm_sound_mgr_focus_ipc_watch_focus(int pid, int handle_id, int focus_type, bool is_for_session);
int __mm_sound_mgr_focus_ipc_unwatch_focus(int pid, int handle_id);
int __mm_sound_mgr_focus_ipc_unregister_focus(int pid, int handle_id);
int __mm_sound_mgr_focus_ipc_emergent_exit(int pid);
int handle;
int type;
int state;
- char stream_type [MAX_STREAM_TYPE_LEN];
- char name [MM_SOUND_NAME_NUM];
+ char stream_type[MAX_STREAM_TYPE_LEN];
+ char ext_info[MM_SOUND_NAME_NUM];
+ int option;
} focus_cb_data;
#define CLEAR_DEAD_NODE_LIST(x) do { \
return ret;
}
-static int _mm_sound_mgr_focus_do_watch_callback(focus_type_e focus_type, focus_command_e command,
- focus_node_t *my_node, const _mm_sound_mgr_focus_param_t *param)
+static int _mm_sound_mgr_focus_do_watch_callback(focus_type_e focus_type, focus_command_e command, focus_node_t *my_node, const _mm_sound_mgr_focus_param_t *param)
{
char *filename = NULL;
char *filename2 = NULL;
cb_data.type = focus_type & node->status;
cb_data.state = (command == FOCUS_COMMAND_ACQUIRE) ? !FOCUS_STATUS_DEACTIVATED : FOCUS_STATUS_DEACTIVATED;
MMSOUND_STRNCPY(cb_data.stream_type, my_node->stream_type, MAX_STREAM_TYPE_LEN);
- MMSOUND_STRNCPY(cb_data.name, param->option, MM_SOUND_NAME_NUM);
+ MMSOUND_STRNCPY(cb_data.ext_info, param->ext_info, MM_SOUND_NAME_NUM);
/* Set start time */
gettimeofday(&time, NULL);
/* client will lost the acquired focus */
cb_data.type= assaulter_param->request_type & victim_node->status;
cb_data.state= FOCUS_STATUS_DEACTIVATED;
- /* remove additional info. */
+ /* remove ext info. */
for (i = 0; i < NUM_OF_STREAM_IO_TYPE; i++) {
- if (cb_data.type & (i+1))
- memset(victim_node->option[i], 0x0, MM_SOUND_NAME_NUM);
+ if (cb_data.type & (i+1)) {
+ memset(victim_node->ext_info[i], 0x0, MM_SOUND_NAME_NUM);
+ victim_node->option[i] = 0;
+ }
}
} else {
/* client will gain the lost focus */
}
cb_data.type = flag_for_focus_type & assaulter_param->request_type;
cb_data.state = !FOCUS_STATUS_DEACTIVATED;
- /* copy additional info. */
+ /* copy ext info. */
for (i = 0; i < NUM_OF_STREAM_IO_TYPE; i++) {
- if (cb_data.type & (i+1))
- MMSOUND_STRNCPY(victim_node->option[i], assaulter_param->option, MM_SOUND_NAME_NUM);
+ if (cb_data.type & (i+1)) {
+ MMSOUND_STRNCPY(victim_node->ext_info[i], assaulter_param->ext_info, MM_SOUND_NAME_NUM);
+ victim_node->option[i] = assaulter_param->option;
+ }
}
}
MMSOUND_STRNCPY(cb_data.stream_type, assaulter_stream_type, MAX_STREAM_TYPE_LEN);
- MMSOUND_STRNCPY(cb_data.name, assaulter_param->option, MM_SOUND_NAME_NUM);
+ MMSOUND_STRNCPY(cb_data.ext_info, assaulter_param->ext_info, MM_SOUND_NAME_NUM);
+ cb_data.option = assaulter_param->option;
/* Set start time */
gettimeofday(&time, NULL);
for (list = g_focus_node_list; list != NULL; list = list->next) {
node = (focus_node_t *)list->data;
if (node && !node->is_for_watch) {
- debug_log("*** pid[%5d]/handle_id[%d]/[%15s]:priority[%2d],status[%s],taken_by[P(%5d/%2d/%2d)C(%5d/%2d/%2d)],for_session[%d],add.info[%s/%s]\n",
+ debug_log("*** pid[%5d]/handle_id[%2d]/[%14s]:priority[%2d],status[%s],taken_by[P(%5d/%2d/%2d)C(%5d/%2d/%2d)],session[%d],option[0x%x/0x%x],ext_info[%s/%s]\n",
node->pid, node->handle_id, node->stream_type, node->priority, focus_status_str[node->status],
node->taken_by_id[0].pid, node->taken_by_id[0].handle_id, node->taken_by_id[0].by_session, node->taken_by_id[1].pid,
- node->taken_by_id[1].handle_id, node->taken_by_id[1].by_session, node->is_for_session, node->option[0], node->option[1]);
+ node->taken_by_id[1].handle_id, node->taken_by_id[1].by_session, node->is_for_session, node->option[0], node->option[1], node->ext_info[0], node->ext_info[1]);
}
}
debug_log("================================================ focus node list : end =====================================================\n");
return ret;
}
-int mm_sound_mgr_focus_get_stream_type_of_acquired_focus(focus_type_e focus_type, char **stream_type, char **additional_info)
+int mm_sound_mgr_focus_get_stream_type_of_acquired_focus(focus_type_e focus_type, char **stream_type, int *option, char **ext_info)
{
int ret = MM_ERROR_SOUND_NO_DATA;
GList *list = NULL;
for (list = g_focus_node_list; list != NULL; list = list->next) {
node = (focus_node_t *)list->data;
if (node && !node->is_for_watch && (node->status & focus_type)) {
- debug_msg("found a node : request_focus_type(%d), stream_type(%s)/additional info(%s) of acquired focus\n", focus_type, node->stream_type, node->option);
+ debug_msg("found a node : request_focus_type(%d), stream_type(%s)/ext info(%s) of acquired focus\n", focus_type, node->stream_type, node->ext_info);
*stream_type = node->stream_type;
- if (additional_info)
- *additional_info = node->option[focus_type-1];
+ *option = node->option[focus_type-1];
+ if (ext_info)
+ *ext_info = node->ext_info[focus_type-1];
ret = MM_ERROR_NONE;
break;
}
}
if (ret != MM_ERROR_POLICY_BLOCKED) {
- /* copy additional info. */
+ /* copy ext info. */
for (i = 0; i < NUM_OF_STREAM_IO_TYPE; i++) {
- if (param->request_type & (i+1))
- MMSOUND_STRNCPY(my_node->option[i], param->option, MM_SOUND_NAME_NUM);
+ if (param->request_type & (i+1)) {
+ MMSOUND_STRNCPY(my_node->ext_info[i], param->ext_info, MM_SOUND_NAME_NUM);
+ my_node->option[i] = param->option;
+ }
}
/* update status */
my_node->status |= param->request_type;
}
/* update status */
my_node->status &= ~(param->request_type);
- /* remove additional info. */
+ /* remove ext info. */
for (i = 0; i < NUM_OF_STREAM_IO_TYPE; i++) {
- if (!(my_node->status & (i+1)))
- memset(my_node->option[i], 0x0, MM_SOUND_NAME_NUM);
+ if (!(my_node->status & (i+1))) {
+ memset(my_node->ext_info[i], 0x0, MM_SOUND_NAME_NUM);
+ my_node->option[i] = 0;
+ }
}
/* do watch callback due to the status of mine */
if (need_to_trigger_watch_cb)
" <method name='GetAcquiredFocusStreamType'>"
" <arg name='focus_type' type='i' direction='in'/>"
" <arg name='stream_type' type='s' direction='out'/>"
- " <arg name='additional_info' type='s' direction='out'/>"
+ " <arg name='option' type='i' direction='out'/>"
+ " <arg name='ext_info' type='s' direction='out'/>"
" </method>"
" <method name='AcquireFocus'>"
" <arg name='pid' type='i' direction='in'/>"
" <arg name='handle_id' type='i' direction='in'/>"
" <arg name='focus_type' type='i' direction='in'/>"
- " <arg name='name' type='s' direction='in'/>"
+ " <arg name='option' type='i' direction='in'/>"
+ " <arg name='ext_info' type='s' direction='in'/>"
" <arg name='is_for_session' type='b' direction='in'/>"
" </method>"
" <method name='ReleaseFocus'>"
" <arg name='pid' type='i' direction='in'/>"
" <arg name='handle_id' type='i' direction='in'/>"
" <arg name='focus_type' type='i' direction='in'/>"
- " <arg name='name' type='s' direction='in'/>"
+ " <arg name='option' type='i' direction='in'/>"
+ " <arg name='ext_info' type='s' direction='in'/>"
" <arg name='is_for_session' type='b' direction='in'/>"
" </method>"
" <method name='WatchFocus'>"
int ret = MM_ERROR_NONE;
int focus_type = 0;
char *stream_type = NULL;
- char *additional_info = NULL;
+ int option = 0;
+ char *ext_info = NULL;
GVariant *params = NULL;
debug_fenter();
}
g_variant_get(params, "(i)", &focus_type);
- ret = __mm_sound_mgr_focus_ipc_get_acquired_focus_stream_type(focus_type, &stream_type, &additional_info);
+ ret = __mm_sound_mgr_focus_ipc_get_acquired_focus_stream_type(focus_type, &stream_type, &option, &ext_info);
send_reply:
if (ret == MM_ERROR_NONE) {
- _method_call_return_value(invocation, g_variant_new("(ss)", stream_type, additional_info));
+ _method_call_return_value(invocation, g_variant_new("(sis)", stream_type, option, ext_info));
} else {
_method_call_return_error(invocation, ret);
}
static void handle_method_acquire_focus(GDBusMethodInvocation* invocation)
{
int ret = MM_ERROR_NONE;
- int pid = 0, handle_id = 0, focus_type = 0;
- const char* name = NULL;
+ int pid = 0, handle_id = 0, focus_type = 0, option = 0;
+ const char* ext_info = NULL;
gboolean is_for_session;
GVariant *params = NULL;
goto send_reply;
}
- g_variant_get(params, "(iiisb)", &pid, &handle_id, &focus_type, &name, &is_for_session);
- ret = __mm_sound_mgr_focus_ipc_acquire_focus((is_for_session) ? pid : _get_sender_pid(invocation), handle_id, focus_type, name);
+ g_variant_get(params, "(iiiisb)", &pid, &handle_id, &focus_type, &option, &ext_info, &is_for_session);
+ ret = __mm_sound_mgr_focus_ipc_acquire_focus((is_for_session) ? pid : _get_sender_pid(invocation), handle_id, focus_type, option, ext_info);
send_reply:
if (ret == MM_ERROR_NONE) {
static void handle_method_release_focus(GDBusMethodInvocation* invocation)
{
int ret = MM_ERROR_NONE;
- int pid = 0, handle_id = 0, focus_type = 0;
- const char* name = NULL;
+ int pid = 0, handle_id = 0, focus_type = 0, option = 0;
+ const char* ext_info = NULL;
gboolean is_for_session;
GVariant *params = NULL;
goto send_reply;
}
- g_variant_get(params, "(iiisb)", &pid, &handle_id, &focus_type, &name, &is_for_session);
- ret = __mm_sound_mgr_focus_ipc_release_focus((is_for_session) ? pid : _get_sender_pid(invocation), handle_id, focus_type, name);
+ g_variant_get(params, "(iiiisb)", &pid, &handle_id, &focus_type, &option, &ext_info, &is_for_session);
+ ret = __mm_sound_mgr_focus_ipc_release_focus((is_for_session) ? pid : _get_sender_pid(invocation), handle_id, focus_type, option, ext_info);
send_reply:
if (ret == MM_ERROR_NONE) {
}
// method
-int __mm_sound_mgr_focus_ipc_get_acquired_focus_stream_type(int focus_type, char **stream_type, char **additional_info)
+int __mm_sound_mgr_focus_ipc_get_acquired_focus_stream_type(int focus_type, char **stream_type, int *option, char **ext_info)
{
int ret = MM_ERROR_NONE;
char *stream_type_str = NULL;
- char *additional_info_str = NULL;
+ char *ext_info_str = NULL;
if (!stream_type)
return MM_ERROR_INVALID_ARGUMENT;
- ret = mm_sound_mgr_focus_get_stream_type_of_acquired_focus(focus_type, &stream_type_str, &additional_info_str);
+ ret = mm_sound_mgr_focus_get_stream_type_of_acquired_focus(focus_type, &stream_type_str, option, &ext_info_str);
if (ret == MM_ERROR_NONE) {
*stream_type = stream_type_str;
- if (additional_info)
- *additional_info = additional_info_str;
+ if (ext_info)
+ *ext_info = ext_info_str;
}
return ret;
}
// method -> callback
-int __mm_sound_mgr_focus_ipc_acquire_focus(int pid, int handle_id, int focus_type, const char* name)
+int __mm_sound_mgr_focus_ipc_acquire_focus(int pid, int handle_id, int focus_type, int option, const char *ext_info)
{
_mm_sound_mgr_focus_param_t param;
int ret = MM_ERROR_NONE;
param.pid = pid;
param.handle_id = handle_id;
param.request_type = focus_type;
- MMSOUND_STRNCPY(param.option, name, MM_SOUND_NAME_NUM);
+ param.option = option;
+ MMSOUND_STRNCPY(param.ext_info, ext_info, MM_SOUND_NAME_NUM);
ret = mm_sound_mgr_focus_request_acquire(¶m);
}
// method -> callback
-int __mm_sound_mgr_focus_ipc_release_focus(int pid, int handle_id, int focus_type, const char* name)
+int __mm_sound_mgr_focus_ipc_release_focus(int pid, int handle_id, int focus_type, int option, const char *ext_info)
{
_mm_sound_mgr_focus_param_t param;
int ret = MM_ERROR_NONE;
param.pid = pid;
param.handle_id = handle_id;
param.request_type = focus_type;
- MMSOUND_STRNCPY(param.option, name, MM_SOUND_NAME_NUM);
+ param.option = option;
+ MMSOUND_STRNCPY(param.ext_info, ext_info, MM_SOUND_NAME_NUM);
ret = mm_sound_mgr_focus_request_release(¶m);
int mm_sound_client_unregister_focus(int id);
int mm_sound_client_set_focus_reacquisition(int id, bool reacquisition);
int mm_sound_client_get_focus_reacquisition(int id, bool *reacquisition);
-int mm_sound_client_get_acquired_focus_stream_type(int focus_type, char **stream_type, char **additional_info);
-int mm_sound_client_acquire_focus(int id, mm_sound_focus_type_e type, const char *option);
-int mm_sound_client_release_focus(int id, mm_sound_focus_type_e type, const char *option);
+int mm_sound_client_get_acquired_focus_stream_type(int focus_type, char **stream_type, int *option, char **ext_info);
+int mm_sound_client_acquire_focus(int id, mm_sound_focus_type_e type, int option, const char *ext_info);
+int mm_sound_client_release_focus(int id, mm_sound_focus_type_e type, int option, const char *ext_info);
int mm_sound_client_set_focus_watch_callback(int pid, mm_sound_focus_type_e type, mm_sound_focus_changed_watch_cb callback, bool is_for_session, void* user_data, int *id);
int mm_sound_client_unset_focus_watch_callback(int id);
#endif
int mm_sound_focus_get_id(int *id);
int mm_sound_focus_is_cb_thread(bool *result);
-typedef void (*mm_sound_focus_changed_cb) (int id, mm_sound_focus_type_e focus_type, mm_sound_focus_state_e state, const char *reason_for_change, const char *additional_info, void *user_data);
+typedef void (*mm_sound_focus_changed_cb) (int id, mm_sound_focus_type_e focus_type, mm_sound_focus_state_e state, const char *reason_for_change, int option, const char *ext_info, void *user_data);
int mm_sound_register_focus(int id, const char *stream_type, mm_sound_focus_changed_cb callback, void *user_data);
int mm_sound_register_focus_for_session(int id, int pid, const char *stream_type, mm_sound_focus_changed_cb callback, void *user_data);
int mm_sound_unregister_focus(int id);
int mm_sound_set_focus_reacquisition(int id, bool reacquisition);
int mm_sound_get_focus_reacquisition(int id, bool *reacquisition);
-int mm_sound_get_stream_type_of_acquired_focus(int focus_type, char **stream_type, char **additional_info);
-int mm_sound_acquire_focus(int id, mm_sound_focus_type_e focus_type, const char *additional_info);
-int mm_sound_release_focus(int id, mm_sound_focus_type_e focus_type, const char *additional_info);
+int mm_sound_get_stream_type_of_acquired_focus(int focus_type, char **stream_type, int *option, char **ext_info);
+int mm_sound_acquire_focus(int id, mm_sound_focus_type_e focus_type, const char *ext_info);
+int mm_sound_release_focus(int id, mm_sound_focus_type_e focus_type, const char *ext_info);
+int mm_sound_acquire_focus_with_option(int id, mm_sound_focus_type_e focus_type, int option, const char *ext_info);
+int mm_sound_release_focus_with_option(int id, mm_sound_focus_type_e focus_type, int option, const char *ext_info);
-typedef void (*mm_sound_focus_changed_watch_cb) (int id, mm_sound_focus_type_e focus_type, mm_sound_focus_state_e state, const char *reason_for_change, const char *additional_info, void *user_data);
+typedef void (*mm_sound_focus_changed_watch_cb) (int id, mm_sound_focus_type_e focus_type, mm_sound_focus_state_e state, const char *reason_for_change, const char *ext_info, void *user_data);
int mm_sound_set_focus_watch_callback(mm_sound_focus_type_e focus_type, mm_sound_focus_changed_watch_cb callback, void *user_data, int *id);
int mm_sound_set_focus_watch_callback_for_session(int pid, mm_sound_focus_type_e focus_type, mm_sound_focus_changed_watch_cb callback, void *user_data, int *id);
int mm_sound_unset_focus_watch_callback(int id);
int mm_sound_proxy_register_focus(int id, int instance, const char *stream_type, mm_sound_focus_changed_cb callback, bool is_for_session, void* user_data);
int mm_sound_proxy_unregister_focus(int instance, int id, bool is_for_session);
int mm_sound_proxy_set_foucs_reacquisition(int instance, int id, bool reacquisition);
-int mm_sound_proxy_get_acquired_focus_stream_type(int focus_type, char **stream_type, char **additional_info);
-int mm_sound_proxy_acquire_focus(int instance, int id, mm_sound_focus_type_e type, const char *option, bool is_for_session);
-int mm_sound_proxy_release_focus(int instance, int id, mm_sound_focus_type_e type, const char *option, bool is_for_session);
+int mm_sound_proxy_get_acquired_focus_stream_type(int focus_type, char **stream_type, int *option, char **ext_info);
+int mm_sound_proxy_acquire_focus(int instance, int id, mm_sound_focus_type_e type, int option, const char *ext_info, bool is_for_session);
+int mm_sound_proxy_release_focus(int instance, int id, mm_sound_focus_type_e type, int option, const char *ext_info, bool is_for_session);
int mm_sound_proxy_set_focus_watch_callback(int instance, int handle, mm_sound_focus_type_e type, mm_sound_focus_changed_watch_cb callback, bool is_for_session, void *user_data);
int mm_sound_proxy_unset_focus_watch_callback(int focus_tid, int handle, bool is_for_session);
#endif
int type;
int state;
char stream_type[MAX_STREAM_TYPE_LEN];
- char name[MM_SOUND_NAME_NUM];
+ char ext_info[MM_SOUND_NAME_NUM];
+ int option;
} focus_cb_data_lib;
typedef struct {
if (changed_state != -1) {
debug_error("Got and start CB : TID(%d), handle(%d), type(%d), state(%d,(DEACTIVATED(0)/ACTIVATED(1)), trigger(%s)", tid, cb_data.handle, cb_data.type, cb_data.state, cb_data.stream_type);
- if (g_focus_sound_handle[focus_index].focus_callback== NULL) {
+ if (g_focus_sound_handle[focus_index].focus_callback == NULL) {
debug_error("callback is null..");
g_mutex_unlock(&g_focus_sound_handle[focus_index].focus_lock);
return FALSE;
}
debug_error("[CALLBACK(%p) START]",g_focus_sound_handle[focus_index].focus_callback);
- (g_focus_sound_handle[focus_index].focus_callback)(cb_data.handle, cb_data.type, cb_data.state, cb_data.stream_type, cb_data.name, g_focus_sound_handle[focus_index].user_data);
+ (g_focus_sound_handle[focus_index].focus_callback)(cb_data.handle, cb_data.type, cb_data.state, cb_data.stream_type, cb_data.option, cb_data.ext_info, g_focus_sound_handle[focus_index].user_data);
debug_error("[CALLBACK END]");
if (g_focus_session_interrupt_info.user_cb) {
debug_error("sending session interrupt callback(%p)", g_focus_session_interrupt_info.user_cb);
debug_msg("callback is null..");
} else {
debug_msg("[CALLBACK(%p) START]",g_focus_sound_handle[focus_index].watch_callback);
- (g_focus_sound_handle[focus_index].watch_callback)(cb_data.handle, cb_data.type, cb_data.state, cb_data.stream_type, cb_data.name, g_focus_sound_handle[focus_index].user_data);
+ (g_focus_sound_handle[focus_index].watch_callback)(cb_data.handle, cb_data.type, cb_data.state, cb_data.stream_type, cb_data.ext_info, g_focus_sound_handle[focus_index].user_data);
debug_msg("[CALLBACK END]");
if (g_focus_session_interrupt_info.user_cb) {
debug_error("sending session interrupt callback(%p)", g_focus_session_interrupt_info.user_cb);
return ret;
}
-int mm_sound_client_get_acquired_focus_stream_type(int focus_type, char **stream_type, char **additional_info)
+int mm_sound_client_get_acquired_focus_stream_type(int focus_type, char **stream_type, int *option, char **ext_info)
{
int ret = MM_ERROR_NONE;
+ char *ext_str = NULL;
debug_fenter();
- ret = mm_sound_proxy_get_acquired_focus_stream_type(focus_type, stream_type, additional_info);
- if (ret == MM_ERROR_NONE)
- debug_msg("[Client] Success to get stream type of acquired focus, stream_type(%s), additional_info(%s)\n", *stream_type, *additional_info);
- else
+ ret = mm_sound_proxy_get_acquired_focus_stream_type(focus_type, stream_type, option, &ext_str);
+ if (ret == MM_ERROR_NONE) {
+ debug_msg("[Client] Success to get stream type of acquired focus, stream_type(%s), ext_info(%s)\n", *stream_type, ext_str);
+ *ext_info = strdup(ext_str);
+ g_free(ext_str);
+ } else {
debug_error("[Client] Error occurred : 0x%x \n",ret);
+ }
debug_fleave();
return ret;
}
-int mm_sound_client_acquire_focus(int id, mm_sound_focus_type_e type, const char *option)
+int mm_sound_client_acquire_focus(int id, mm_sound_focus_type_e type, int option, const char *ext_info)
{
int ret = MM_ERROR_NONE;
int instance;
}
instance = g_focus_sound_handle[index].focus_tid;
- ret = mm_sound_proxy_acquire_focus(instance, id, type, option, g_focus_sound_handle[index].is_for_session);
-
+ ret = mm_sound_proxy_acquire_focus(instance, id, type, option, ext_info, g_focus_sound_handle[index].is_for_session);
if (ret == MM_ERROR_NONE)
debug_msg("[Client] Success to acquire focus\n");
else
return ret;
}
-int mm_sound_client_release_focus(int id, mm_sound_focus_type_e type, const char *option)
+int mm_sound_client_release_focus(int id, mm_sound_focus_type_e type, int option, const char *ext_info)
{
int ret = MM_ERROR_NONE;
int instance;
}
instance = g_focus_sound_handle[index].focus_tid;
- ret = mm_sound_proxy_release_focus(instance, id, type, option, g_focus_sound_handle[index].is_for_session);
-
+ ret = mm_sound_proxy_release_focus(instance, id, type, option, ext_info, g_focus_sound_handle[index].is_for_session);
if (ret == MM_ERROR_NONE)
debug_msg("[Client] Success to release focus\n");
else
ret = mm_sound_client_is_focus_cb_thread(g_thread_self(), result);
if (!ret) {
if (*result)
- debug_error("it might be called in the thread of focus callback, it is not allowed\n");
+ debug_msg("it might be called in the thread of focus callback\n");
}
debug_fleave();
}
ret = mm_sound_client_get_focus_reacquisition(id, reacquisition);
-
if (ret) {
debug_error("Could not get focus reacquisition, ret[0x%x]\n", ret);
}
}
EXPORT_API
-int mm_sound_get_stream_type_of_acquired_focus(int focus_type, char **stream_type, char **additional_info)
+int mm_sound_get_stream_type_of_acquired_focus(int focus_type, char **stream_type, int *option, char **ext_info)
{
int ret = MM_ERROR_NONE;
return MM_ERROR_INVALID_ARGUMENT;
}
- ret = mm_sound_client_get_acquired_focus_stream_type(focus_type, stream_type, additional_info);
-
+ ret = mm_sound_client_get_acquired_focus_stream_type(focus_type, stream_type, option, ext_info);
if (ret) {
debug_error("Could not get acquired focus stream type, ret[0x%x]\n", ret);
}
}
EXPORT_API
-int mm_sound_acquire_focus(int id, mm_sound_focus_type_e focus_type, const char *additional_info)
+int mm_sound_acquire_focus(int id, mm_sound_focus_type_e focus_type, const char *ext_info)
{
int ret = MM_ERROR_NONE;
return MM_ERROR_INVALID_ARGUMENT;
}
- ret = mm_sound_client_acquire_focus(id, focus_type, additional_info);
+ ret = mm_sound_client_acquire_focus(id, focus_type, 0, ext_info);
if (ret) {
debug_error("Could not acquire focus, ret[0x%x]\n", ret);
}
}
EXPORT_API
-int mm_sound_release_focus(int id, mm_sound_focus_type_e focus_type, const char *additional_info)
+int mm_sound_release_focus(int id, mm_sound_focus_type_e focus_type, const char *ext_info)
{
int ret = MM_ERROR_NONE;
return MM_ERROR_INVALID_ARGUMENT;
}
- ret = mm_sound_client_release_focus(id, focus_type, additional_info);
+ ret = mm_sound_client_release_focus(id, focus_type, 0, ext_info);
+ if (ret) {
+ debug_error("Could not release focus, ret[0x%x]\n", ret);
+ }
+
+ debug_fleave();
+
+ return ret;
+}
+
+EXPORT_API
+int mm_sound_acquire_focus_with_option(int id, mm_sound_focus_type_e focus_type, int option, const char *ext_info)
+{
+ int ret = MM_ERROR_NONE;
+
+ debug_fenter();
+
+ RETURN_ERROR_IF_FOCUS_CB_THREAD(g_thread_self());
+
+ if (id < 0) {
+ debug_error("id is not valid\n");
+ return MM_ERROR_INVALID_ARGUMENT;
+ }
+
+ if (option < 0) {
+ debug_error("option is not valid\n");
+ return MM_ERROR_INVALID_ARGUMENT;
+ }
+
+ if (focus_type < FOCUS_FOR_PLAYBACK || focus_type > FOCUS_FOR_BOTH) {
+ debug_error("focus type is not valid\n");
+ return MM_ERROR_INVALID_ARGUMENT;
+ }
+
+ ret = mm_sound_client_acquire_focus(id, focus_type, option, ext_info);
+ if (ret) {
+ debug_error("Could not acquire focus, ret[0x%x]\n", ret);
+ }
+
+ debug_fleave();
+
+ return ret;
+}
+
+EXPORT_API
+int mm_sound_release_focus_with_option(int id, mm_sound_focus_type_e focus_type, int option, const char *ext_info)
+{
+ int ret = MM_ERROR_NONE;
+
+ debug_fenter();
+
+ RETURN_ERROR_IF_FOCUS_CB_THREAD(g_thread_self());
+
+ if (id < 0) {
+ debug_error("id is not valid\n");
+ return MM_ERROR_INVALID_ARGUMENT;
+ }
+
+ if (option < 0) {
+ debug_error("option is not valid\n");
+ return MM_ERROR_INVALID_ARGUMENT;
+ }
+
+ if (focus_type < FOCUS_FOR_PLAYBACK || focus_type > FOCUS_FOR_BOTH) {
+ debug_error("focus type is not valid\n");
+ return MM_ERROR_INVALID_ARGUMENT;
+ }
+
+ ret = mm_sound_client_release_focus(id, focus_type, option, ext_info);
if (ret) {
debug_error("Could not release focus, ret[0x%x]\n", ret);
}
return ret;
}
-int mm_sound_proxy_get_acquired_focus_stream_type(int focus_type, char **stream_type, char **additional_info)
+int mm_sound_proxy_get_acquired_focus_stream_type(int focus_type, char **stream_type, int *option, char **ext_info)
{
int ret = MM_ERROR_NONE;
GVariant *params = NULL, *result = NULL;
if ((ret = mm_sound_dbus_method_call_to(AUDIO_PROVIDER_FOCUS_SERVER, AUDIO_METHOD_GET_ACQUIRED_FOCUS_STREAM_TYPE, params, &result)) == MM_ERROR_NONE) {
if (result) {
- g_variant_get(result, "(ss)", stream_type, additional_info);
+ g_variant_get(result, "(sis)", stream_type, option, ext_info);
g_variant_unref(result);
}
} else {
return ret;
}
-int mm_sound_proxy_acquire_focus(int instance, int id, mm_sound_focus_type_e type, const char *option, bool is_for_session)
+int mm_sound_proxy_acquire_focus(int instance, int id, mm_sound_focus_type_e type, int option, const char *ext_info, bool is_for_session)
{
int ret = MM_ERROR_NONE;
GVariant *params = NULL, *result = NULL;
debug_fenter();
- params = g_variant_new("(iiisb)", instance, id, type, option ? option : "", is_for_session);
+ params = g_variant_new("(iiiisb)", instance, id, type, option, ext_info ? ext_info : "", is_for_session);
if (params) {
if ((ret = mm_sound_dbus_method_call_to(AUDIO_PROVIDER_FOCUS_SERVER, AUDIO_METHOD_ACQUIRE_FOCUS, params, &result)) != MM_ERROR_NONE) {
debug_error("dbus acquire focus failed");
return ret;
}
-int mm_sound_proxy_release_focus(int instance, int id, mm_sound_focus_type_e type, const char *option, bool is_for_session)
+int mm_sound_proxy_release_focus(int instance, int id, mm_sound_focus_type_e type, int option, const char *ext_info, bool is_for_session)
{
int ret = MM_ERROR_NONE;
GVariant *params = NULL, *result = NULL;
debug_fenter();
- params = g_variant_new("(iiisb)", instance, id, type, option ? option : "", is_for_session);
+ params = g_variant_new("(iiiisb)", instance, id, type, option, ext_info ? ext_info : "", is_for_session);
if (params) {
if ((ret = mm_sound_dbus_method_call_to(AUDIO_PROVIDER_FOCUS_SERVER, AUDIO_METHOD_RELEASE_FOCUS, params, &result)) != MM_ERROR_NONE) {
debug_error("dbus release focus failed");
Name: libmm-sound
Summary: MMSound Package contains client lib and sound_server binary
-Version: 0.10.51
+Version: 0.10.52
Release: 0
Group: System/Libraries
License: Apache-2.0
--- /dev/null
+/*
+ * libmm-sound
+ *
+ * Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Sangchul Lee <sc11.lee@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 __MM_SOUND_MGR_FOCUS_H__
+#define __MM_SOUND_MGR_FOCUS_H__
+
+#include "../include/mm_sound.h"
+#include "../include/mm_sound_focus.h"
+#include "../include/mm_sound_stream.h"
+#include "../include/mm_ipc.h"
+#include "mm_sound_mgr_focus_ipc.h"
+
+typedef enum
+{
+ FOCUS_COMMAND_RELEASE,
+ FOCUS_COMMAND_ACQUIRE,
+} focus_command_e;
+
+typedef enum
+{
+ FOCUS_TYPE_PLAYBACK = 1,
+ FOCUS_TYPE_CAPTURE,
+ FOCUS_TYPE_BOTH,
+} focus_type_e;
+
+typedef enum
+{
+ FOCUS_STATUS_DEACTIVATED,
+ FOCUS_STATUS_ACTIVATED_PLAYBACK,
+ FOCUS_STATUS_ACTIVATED_CAPTURE,
+ FOCUS_STATUS_ACTIVATED_BOTH,
+} focus_status_e;
+
+typedef struct {
+ int pid;
+ int handle_id;
+ char stream_type[MAX_STREAM_TYPE_LEN];
+ char option[MM_SOUND_NAME_NUM];
+ focus_type_e request_type;
+ void *callback;
+ void *cbdata;
+ bool reacquisition;
+
+ bool is_for_session; /* will be removed when the session concept is completely left out*/
+} _mm_sound_mgr_focus_param_t;
+
+typedef struct _taken_by_id
+{
+ int pid;
+ int handle_id;
+ bool by_session;
+} _focus_taken_by_id_t;
+
+typedef struct {
+ int pid;
+ int handle_id;
+ int priority;
+ bool is_for_watch;
+ char stream_type[MAX_STREAM_TYPE_LEN];
+ char option[NUM_OF_STREAM_IO_TYPE][MM_SOUND_NAME_NUM];
+ focus_status_e status;
+ _focus_taken_by_id_t taken_by_id[NUM_OF_STREAM_IO_TYPE];
+ _focus_taken_by_id_t taken_backup[NUM_OF_STREAM_IO_TYPE];
+ void *callback;
+ void *cbdata;
+ bool reacquisition;
+
+ bool is_for_session; /* will be removed when the session concept is completely left out*/
+
+#ifdef SUPPORT_CONTAINER
+ container_info_t container;
+#endif
+} focus_node_t;
+
+int MMSoundMgrFocusInit(void);
+int MMSoundMgrFocusFini(void);
+int mm_sound_mgr_focus_create_node (const _mm_sound_mgr_focus_param_t *param);
+int mm_sound_mgr_focus_destroy_node (const _mm_sound_mgr_focus_param_t *param);
+int mm_sound_mgr_focus_set_reacquisition (const _mm_sound_mgr_focus_param_t *param);
+int mm_sound_mgr_focus_get_stream_type_of_acquired_focus(focus_type_e focus_type, char **stream_type, int *option, char **additional_info);
+int mm_sound_mgr_focus_request_acquire (const _mm_sound_mgr_focus_param_t *param);
+int mm_sound_mgr_focus_request_release (const _mm_sound_mgr_focus_param_t *param);
+int mm_sound_mgr_focus_set_watch_cb (const _mm_sound_mgr_focus_param_t *param);
+int mm_sound_mgr_focus_unset_watch_cb (const _mm_sound_mgr_focus_param_t *param);
+int mm_sound_mgr_focus_emergent_exit(const _mm_sound_mgr_focus_param_t *param);
+#ifdef SUPPORT_CONTAINER
+void mm_sound_mgr_focus_update_container_data(int pid,int handle, const char* container_name, int container_pid);
+#endif
+
+
+#endif /* __MM_SOUND_MGR_FOCUS_H__ */
+
#ifdef FOCUS_INTEGRATION
-void sound_codec_focus_callback(int id, mm_sound_focus_type_e focus_type, mm_sound_focus_state_e focus_state, const char *reason_for_change, const char *additional_info, void *user_data)
+void sound_codec_focus_callback(int id, mm_sound_focus_type_e focus_type, mm_sound_focus_state_e focus_state, const char *reason_for_change, int option, const char *ext_info, void *user_data)
{
int slotid = (int)user_data;
return;
}
-void sound_codec_focus_watch_callback(int id, mm_sound_focus_type_e focus_type, mm_sound_focus_state_e focus_state, const char *reason_for_change, const char* additional_info, void *user_data)
+void sound_codec_focus_watch_callback(int id, mm_sound_focus_type_e focus_type, mm_sound_focus_state_e focus_state, const char *reason_for_change, const char* ext_info, void *user_data)
{
int slotid = (int)user_data;
int result = MM_ERROR_NONE;
--- /dev/null
+/*
+ * libmm-sound
+ *
+ * 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.
+ *
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "include/mm_sound_mgr_focus_ipc.h"
+#include "include/mm_sound_mgr_focus_dbus.h"
+
+#include "../include/mm_sound_common.h"
+#include "include/mm_sound_mgr_focus.h"
+#include <mm_debug.h>
+
+#ifdef USE_FOCUS
+
+#ifdef SUPPORT_CONTAINER
+// method + add callback
+int __mm_sound_mgr_focus_ipc_register_focus(int client_pid, int handle_id, const char* stream_type, bool is_for_session, const char* container_name, int container_pid)
+{
+ _mm_sound_mgr_focus_param_t param;
+ int ret = MM_ERROR_NONE;
+
+ memset(¶m, 0x00, sizeof(_mm_sound_mgr_focus_param_t));
+ if(is_for_session)
+ param.pid = container_pid;
+ else
+ param.pid = client_pid;
+ param.handle_id = handle_id;
+ param.is_for_session = is_for_session;
+ MMSOUND_STRNCPY(param.stream_type, stream_type, MAX_STREAM_TYPE_LEN);
+
+ ret = mm_sound_mgr_focus_create_node(¶m);
+
+ /* FIX ME : Notice that it needs to be improved by the time when mused and container actually work togeter */
+ mm_sound_mgr_focus_update_container_data((is_for_session) ? container_pid : client_pid, handle_id, container_name, container_pid);
+
+ return ret;
+}
+#else
+int __mm_sound_mgr_focus_ipc_register_focus(int client_pid, int handle_id, const char* stream_type, bool is_for_session)
+{
+ _mm_sound_mgr_focus_param_t param;
+ int ret = MM_ERROR_NONE;
+
+ memset(¶m, 0x00, sizeof(_mm_sound_mgr_focus_param_t));
+ param.pid = client_pid;
+ param.handle_id = handle_id;
+ param.is_for_session = is_for_session;
+ MMSOUND_STRNCPY(param.stream_type, stream_type, MAX_STREAM_TYPE_LEN);
+
+ ret = mm_sound_mgr_focus_create_node(¶m);
+
+ return ret;
+}
+#endif
+
+// method + remove callback
+int __mm_sound_mgr_focus_ipc_unregister_focus(int pid, int handle_id)
+{
+ _mm_sound_mgr_focus_param_t param;
+ int ret = MM_ERROR_NONE;
+
+ memset(¶m, 0x00, sizeof(_mm_sound_mgr_focus_param_t));
+ param.pid = pid;
+ param.handle_id = handle_id;
+
+ ret = mm_sound_mgr_focus_destroy_node(¶m);
+
+ return ret;
+}
+
+// method -> callback
+int __mm_sound_mgr_focus_ipc_set_focus_reacquisition(int pid, int handle_id, bool reacquisition)
+{
+ _mm_sound_mgr_focus_param_t param;
+ int ret = MM_ERROR_NONE;
+
+ memset(¶m, 0x00, sizeof(_mm_sound_mgr_focus_param_t));
+ param.pid = pid;
+ param.handle_id = handle_id;
+ param.reacquisition = reacquisition;
+
+ ret = mm_sound_mgr_focus_set_reacquisition(¶m);
+
+ return ret;
+}
+
+// method
+int __mm_sound_mgr_focus_ipc_get_acquired_focus_stream_type(int focus_type, char **stream_type, int *option, char **additional_info)
+{
+ int ret = MM_ERROR_NONE;
+ char *stream_type_str = NULL;
+ char *additional_info_str = NULL;
+
+ if (!stream_type)
+ return MM_ERROR_INVALID_ARGUMENT;
+
+ ret = mm_sound_mgr_focus_get_stream_type_of_acquired_focus(focus_type, &stream_type_str, option, &additional_info_str);
+ if (ret == MM_ERROR_NONE) {
+ *stream_type = stream_type_str;
+ if (additional_info)
+ *additional_info = additional_info_str;
+ }
+
+ return ret;
+}
+
+// method -> callback
+int __mm_sound_mgr_focus_ipc_acquire_focus(int pid, int handle_id, int focus_type, const char* name)
+{
+ _mm_sound_mgr_focus_param_t param;
+ int ret = MM_ERROR_NONE;
+
+ memset(¶m, 0x00, sizeof(_mm_sound_mgr_focus_param_t));
+ param.pid = pid;
+ param.handle_id = handle_id;
+ param.request_type = focus_type;
+ MMSOUND_STRNCPY(param.option, name, MM_SOUND_NAME_NUM);
+
+ ret = mm_sound_mgr_focus_request_acquire(¶m);
+
+ return ret;
+}
+
+// method -> callback
+int __mm_sound_mgr_focus_ipc_release_focus(int pid, int handle_id, int focus_type, const char* name)
+{
+ _mm_sound_mgr_focus_param_t param;
+ int ret = MM_ERROR_NONE;
+
+ memset(¶m, 0x00, sizeof(_mm_sound_mgr_focus_param_t));
+ param.pid = pid;
+ param.handle_id = handle_id;
+ param.request_type = focus_type;
+ MMSOUND_STRNCPY(param.option, name, MM_SOUND_NAME_NUM);
+
+ ret = mm_sound_mgr_focus_request_release(¶m);
+
+ return ret;
+}
+
+#ifdef SUPPORT_CONTAINER
+// method + add callback
+int __mm_sound_mgr_focus_ipc_watch_focus(int pid, int handle_id, int focus_type, bool is_for_session, const char* container_name, int container_pid)
+{
+ _mm_sound_mgr_focus_param_t param;
+ int ret = MM_ERROR_NONE;
+
+ memset(¶m, 0x00, sizeof(_mm_sound_mgr_focus_param_t));
+ if(is_for_session)
+ param.pid = container_pid;
+ else
+ param.pid = pid;
+ param.handle_id = handle_id;
+ param.request_type = focus_type;
+ param.is_for_session = is_for_session;
+
+ ret = mm_sound_mgr_focus_set_watch_cb(¶m);
+
+ /* FIX ME : Notice that it needs to be improved by the time when mused and container actually work togeter */
+ mm_sound_mgr_focus_update_container_data((is_for_session) ? container_pid : pid, handle_id, container_name, container_pid);
+
+ return ret;
+}
+#else
+int __mm_sound_mgr_focus_ipc_watch_focus(int pid, int handle_id, bool is_for_session, int focus_type)
+{
+ _mm_sound_mgr_focus_param_t param;
+ int ret = MM_ERROR_NONE;
+
+ memset(¶m, 0x00, sizeof(_mm_sound_mgr_focus_param_t));
+ param.pid = pid;
+ param.handle_id = handle_id;
+ param.request_type = focus_type;
+ param.is_for_session = is_for_session;
+
+ ret = mm_sound_mgr_focus_set_watch_cb(¶m);
+
+ return ret;
+}
+#endif
+
+// method + remove callback
+int __mm_sound_mgr_focus_ipc_unwatch_focus(int pid, int handle_id)
+{
+ _mm_sound_mgr_focus_param_t param;
+ int ret = MM_ERROR_NONE;
+
+ memset(¶m, 0x00, sizeof(_mm_sound_mgr_focus_param_t));
+ param.pid = pid;
+ param.handle_id = handle_id;
+
+ ret = mm_sound_mgr_focus_unset_watch_cb(¶m);
+
+ return ret;
+}
+
+int __mm_sound_mgr_focus_ipc_emergent_exit(int pid)
+{
+ _mm_sound_mgr_focus_param_t param;
+ int ret = MM_ERROR_NONE;
+
+ memset(¶m, 0x00, sizeof(_mm_sound_mgr_focus_param_t));
+ param.pid = pid;
+
+ ret = mm_sound_mgr_focus_emergent_exit(¶m);
+
+ return ret;
+}
+#endif
+
debug_log("*** --- type[%d], id[%d], io_direction[%d], state[%d], name[%s]\n", device_type, id, io_direction, state, name);
}
#ifdef USE_FOCUS
-void focus_cb0 (int index, mm_sound_focus_type_e type, mm_sound_focus_state_e state, const char *reason_for_change, const char *additional_info, void *user_data)
+void focus_cb0(int index, mm_sound_focus_type_e type, mm_sound_focus_state_e state, const char *reason_for_change, int option, const char *ext_info, void *user_data)
{
char *_state = NULL;
if (state == FOCUS_IS_RELEASED)
_state = "RELEASED";
else
_state = "ACQUIRED";
- debug_log("*** focus_cb0 is called, index[%d], focus_type[%d], state[%s], reason_for_change[%s], additional_info[%s], user_data[%s]\n",
- index, type, _state, reason_for_change, additional_info, (char*)user_data);
+ debug_log("*** focus_cb0 is called, index[%d], focus_type[%d], state[%s], reason_for_change[%s], option[0x%x], ext_info[%s], user_data[%s]\n",
+ index, type, _state, reason_for_change, option, ext_info, (char*)user_data);
}
-void focus_cb1 (int index, mm_sound_focus_type_e type, mm_sound_focus_state_e state, const char *reason_for_change, const char *additional_info, void *user_data)
+void focus_cb1(int index, mm_sound_focus_type_e type, mm_sound_focus_state_e state, const char *reason_for_change, int option, const char *ext_info, void *user_data)
{
char *_state = NULL;
if (state == FOCUS_IS_RELEASED)
_state = "RELEASED";
else
_state = "ACQUIRED";
- debug_log("*** focus_cb1 is called, index[%d], focus_type[%d], state[%s], reason_for_change[%s], additional_info[%s], user_data[%s]\n",
- index, type, _state, reason_for_change, additional_info, (char*)user_data);
+ debug_log("*** focus_cb1 is called, index[%d], focus_type[%d], state[%s], reason_for_change[%s], option[0x%x], ext_info[%s], user_data[%s]\n",
+ index, type, _state, reason_for_change, option, ext_info, (char*)user_data);
}
-void focus_watch_cb (int index, mm_sound_focus_type_e type, mm_sound_focus_state_e state, const char *reason_for_change, const char *additional_info, void *user_data)
+void focus_watch_cb(int index, mm_sound_focus_type_e type, mm_sound_focus_state_e state, const char *reason_for_change, const char *ext_info, void *user_data)
{
char *_state = NULL;
if (state == FOCUS_IS_RELEASED)
_state = "RELEASED";
else
_state = "ACQUIRED";
- debug_log("*** focus_watch_cb is called, index[%d], focus_type[%d], state[%s], reason_for_change[%s], additional_info[%s], user_data[%s]\n",
- index, type, _state, reason_for_change, additional_info, (char*)user_data);
+ debug_log("*** focus_watch_cb is called, index[%d], focus_type[%d], state[%s], reason_for_change[%s], ext_info[%s], user_data[%s]\n",
+ index, type, _state, reason_for_change, ext_info, (char*)user_data);
}
#endif
void quit_program()