int __mm_sound_mgr_focus_ipc_release_focus(int pid, int handle_id, int focus_type, const char* name);
//int __mm_sound_mgr_ipc_set_focus_watch_cb(mm_ipc_msg_t *msg);
#ifdef SUPPORT_CONTAINER
-int __mm_sound_mgr_focus_ipc_watch_focus(int pid, int handle_id, int focus_type, const char* container_name, int container_pid);
+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);
#else
-int __mm_sound_mgr_focus_ipc_watch_focus(int pid, int handle_id, int focus_type);
+int __mm_sound_mgr_focus_ipc_watch_focus(int pid, int handle_id, int focus_type, bool is_for_session);
#endif
//int __mm_sound_mgr_ipc_unset_focus_watch_cb(mm_ipc_msg_t *msg);
int __mm_sound_mgr_focus_ipc_unwatch_focus(int pid, int handle_id);
GList *list = NULL;
focus_node_t *node = NULL;
- debug_log("========================================== focus watch node list : start =============================================\n");
+ debug_log("============================================= focus watch node list : start =================================================\n");
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]/watch on focus status[%s]\n", node->pid, node->handle_id, focus_status_str[node->status]);
+ debug_log("*** pid[%5d]/handle_id[%d]/watch on focus status[%s]/for_session[%d]\n", node->pid, node->handle_id, focus_status_str[node->status], node->is_for_session);
}
}
- debug_log("========================================== focus watch node list : end ===============================================\n");
+ debug_log("============================================= focus watch node list : end ===================================================\n");
return ret;
}
" <method name='UnregisterFocus'>"
" <arg name='pid' type='i' direction='in'/>"
" <arg name='handle_id' type='i' direction='in'/>"
+ " <arg name='is_for_session' type='b' direction='in'/>"
" </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='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='is_for_session' type='b' direction='in'/>"
" </method>"
" <method name='WatchFocus'>"
#ifdef SUPPORT_CONTAINER
" <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='is_for_session' type='b' direction='in'/>"
" </method>"
" <method name='UnwatchFocus'>"
" <arg name='pid' type='i' direction='in'/>"
" <arg name='handle_id' type='i' direction='in'/>"
+ " <arg name='is_for_session' type='b' direction='in'/>"
" </method>"
" <method name='EmergentExitFocus'>"
" <arg name='pid' type='i' direction='in'/>"
int ret = MM_ERROR_NONE;
int pid = 0, handle_id = 0;
+ gboolean is_for_session;
GVariant *params = NULL;
debug_fenter();
goto send_reply;
}
- g_variant_get(params, "(ii)", &pid, &handle_id);
- ret = __mm_sound_mgr_focus_ipc_unregister_focus(_get_sender_pid(invocation), handle_id);
+ g_variant_get(params, "(iib)", &pid, &handle_id, &is_for_session);
+ ret = __mm_sound_mgr_focus_ipc_unregister_focus((is_for_session) ? pid : _get_sender_pid(invocation), handle_id);
send_reply:
if (ret == MM_ERROR_NONE) {
int ret = MM_ERROR_NONE;
int pid = 0, handle_id = 0, focus_type = 0;
const char* name = NULL;
+ gboolean is_for_session;
GVariant *params = NULL;
debug_fenter();
goto send_reply;
}
- g_variant_get(params, "(iiis)", &pid, &handle_id, &focus_type, &name);
- ret = __mm_sound_mgr_focus_ipc_acquire_focus(_get_sender_pid(invocation), handle_id, focus_type, name);
+ 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);
send_reply:
if (ret == MM_ERROR_NONE) {
int ret = MM_ERROR_NONE;
int pid = 0, handle_id = 0, focus_type = 0;
const char* name = NULL;
+ gboolean is_for_session;
GVariant *params = NULL;
debug_fenter();
goto send_reply;
}
- g_variant_get(params, "(iiis)", &pid, &handle_id, &focus_type, &name);
- ret = __mm_sound_mgr_focus_ipc_release_focus(_get_sender_pid(invocation), handle_id, focus_type, name);
+ 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);
send_reply:
if (ret == MM_ERROR_NONE) {
{
int ret = MM_ERROR_NONE;
int handle_id = 0, focus_type = 0;
+ gboolean is_for_session;
GVariant *params = NULL;
#ifdef SUPPORT_CONTAINER
int container_pid = -1;
#ifdef SUPPORT_CONTAINER
#ifdef USE_SECURITY
- g_variant_get(params, "(@ayiii)", &cookie_data, &container_pid, &handle_id, &focus_type);
+ g_variant_get(params, "(@ayiiib)", &cookie_data, &container_pid, &handle_id, &focus_type, &is_for_session);
container = _get_container_from_cookie(cookie_data);
- ret = __mm_sound_mgr_focus_ipc_watch_focus(_get_sender_pid(invocation), handle_id, focus_type, container, container_pid);
+ ret = __mm_sound_mgr_focus_ipc_watch_focus(_get_sender_pid(invocation), handle_id, focus_type, is_for_session, container, container_pid);
if (container)
free(container);
#else /* USE_SECURITY */
- g_variant_get(params, "(siii)", &container, &container_pid, &handle_id, &focus_type);
- ret = __mm_sound_mgr_focus_ipc_watch_focus(_get_sender_pid(invocation), handle_id, focus_type, container, container_pid);
+ g_variant_get(params, "(siiib)", &container, &container_pid, &handle_id, &focus_type, &is_for_session);
+ ret = __mm_sound_mgr_focus_ipc_watch_focus(_get_sender_pid(invocation), handle_id, focus_type, is_for_session, container, container_pid);
#endif /* USE_SECURITY */
#else /* SUPPORT_CONTAINER */
- g_variant_get(params, "(iii)", &pid, &handle_id, &focus_type);
- ret = __mm_sound_mgr_focus_ipc_watch_focus(_get_sender_pid(invocation), handle_id, focus_type);
+ g_variant_get(params, "(iiib)", &pid, &handle_id, &focus_type, &is_for_session);
+ ret = __mm_sound_mgr_focus_ipc_watch_focus(_get_sender_pid(invocation), handle_id, focus_type, is_for_session);
#endif /* SUPPORT_CONTAINER */
int ret = MM_ERROR_NONE;
int pid = 0;
int handle_id = 0;
+ gboolean is_for_session;
GVariant *params = NULL;
debug_fenter();
goto send_reply;
}
- g_variant_get(params, "(ii)", &pid, &handle_id);
- ret = __mm_sound_mgr_focus_ipc_unwatch_focus(_get_sender_pid(invocation), handle_id);
+ g_variant_get(params, "(iib)", &pid, &handle_id, &is_for_session);
+ ret = __mm_sound_mgr_focus_ipc_unwatch_focus((is_for_session) ? pid : _get_sender_pid(invocation), handle_id);
send_reply:
if (ret == MM_ERROR_NONE) {
int ret = MM_ERROR_NONE;
memset(¶m, 0x00, sizeof(_mm_sound_mgr_focus_param_t));
- param.pid = client_pid;
+ 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;
memcpy(param.stream_type, stream_type, MAX_STREAM_TYPE_LEN);
ret = mm_sound_mgr_focus_create_node(¶m);
- mm_sound_mgr_focus_update_container_data(client_pid, handle_id, container_name, container_pid);
+ /* 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;
}
#ifdef SUPPORT_CONTAINER
// method + add callback
-int __mm_sound_mgr_focus_ipc_watch_focus(int pid, int handle_id, int focus_type, const char* container_name, int container_pid)
+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));
- param.pid = pid;
+ 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);
- mm_sound_mgr_focus_update_container_data(pid, -1, container_name, container_pid);
+
+ /* 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, int focus_type)
+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;
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);
int mm_sound_client_set_session_interrupt_callback(mm_sound_focus_session_interrupt_cb callback, void* user_data);
int mm_sound_client_unset_session_interrupt_callback(void);
int mm_sound_client_get_uniq_id(int *id);
-int mm_sound_client_register_focus(int id, const char *stream_type, mm_sound_focus_changed_cb callback, bool is_for_session, void* user_data);
+int mm_sound_client_register_focus(int id, int pid, const char *stream_type, mm_sound_focus_changed_cb callback, bool is_for_session, void* user_data);
int mm_sound_client_unregister_focus(int id);
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_set_focus_watch_callback(mm_sound_focus_type_e type, mm_sound_focus_changed_watch_cb callback, void* user_data, int *id);
+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
#ifdef USE_FOCUS
int mm_sound_client_dbus_set_session_interrupt_callback(mm_sound_focus_session_interrupt_cb callback, void* user_data);
int mm_sound_client_dbus_unset_session_interrupt_callback(void);
-int mm_sound_client_dbus_register_focus(int id, const char *stream_type, mm_sound_focus_changed_cb callback, bool is_for_session, void* user_data);
+int mm_sound_client_dbus_register_focus(int id, int pid, const char *stream_type, mm_sound_focus_changed_cb callback, bool is_for_session, void* user_data);
int mm_sound_client_dbus_unregister_focus(int id);
int mm_sound_client_dbus_acquire_focus(int id, mm_sound_focus_type_e type, const char *option);
int mm_sound_client_dbus_release_focus(int id, mm_sound_focus_type_e type, const char *option);
-int mm_sound_client_dbus_set_focus_watch_callback(mm_sound_focus_type_e type, mm_sound_focus_changed_watch_cb callback, void* user_data, int *id);
+int mm_sound_client_dbus_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_dbus_unset_focus_watch_callback(int id);
#endif
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);
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, 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_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);
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);
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);
typedef void (*mm_sound_focus_session_interrupt_cb) (mm_sound_focus_state_e state, const char *reason_for_change, bool is_wcb, void *user_data);
return ret;
}
-int mm_sound_client_register_focus(int id, const char *stream_type, mm_sound_focus_changed_cb callback, bool is_for_session, void* user_data)
+int mm_sound_client_register_focus(int id, int pid, const char *stream_type, mm_sound_focus_changed_cb callback, bool is_for_session, void* user_data)
{
int ret = MM_ERROR_NONE;
debug_fenter();
- ret = mm_sound_client_dbus_register_focus(id, stream_type, callback, is_for_session, user_data);
+ ret = mm_sound_client_dbus_register_focus(id, pid, stream_type, callback, is_for_session, user_data);
debug_fleave();
return ret;
return ret;
}
-int mm_sound_client_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_client_set_focus_watch_callback(int pid, mm_sound_focus_type_e focus_type, mm_sound_focus_changed_watch_cb callback, bool is_for_session, void* user_data, int *id)
{
int ret = MM_ERROR_NONE;
debug_fenter();
- ret = mm_sound_client_dbus_set_focus_watch_callback(focus_type, callback, user_data, id);
+ ret = mm_sound_client_dbus_set_focus_watch_callback(pid, focus_type, callback, is_for_session, user_data, id);
debug_fleave();
return ret;
GPollFD* g_poll_fd;
GSource* focus_src;
bool is_used;
+ bool is_for_session;
GMutex focus_lock;
mm_sound_focus_changed_cb focus_callback;
mm_sound_focus_changed_watch_cb watch_callback;
return MM_ERROR_NONE;
}
-int mm_sound_client_dbus_register_focus(int id, const char *stream_type, mm_sound_focus_changed_cb callback, bool is_for_session, void* user_data)
+int mm_sound_client_dbus_register_focus(int id, int pid, const char *stream_type, mm_sound_focus_changed_cb callback, bool is_for_session, void* user_data)
{
int ret = MM_ERROR_NONE;
int instance;
// pthread_mutex_lock(&g_thread_mutex2);
- instance = getpid();
+ instance = pid;
for (index = 0; index < FOCUS_HANDLE_MAX; index++) {
if (g_focus_sound_handle[index].is_used == false) {
g_focus_sound_handle[index].handle = id;
g_focus_sound_handle[index].focus_callback = callback;
g_focus_sound_handle[index].user_data = user_data;
+ g_focus_sound_handle[index].is_for_session = is_for_session;
#ifdef SUPPORT_CONTAINER
#ifdef USE_SECURITY
//pthread_mutex_lock(&g_thread_mutex2);
- instance = getpid();
index = _focus_find_index_by_handle(id);
+ instance = g_focus_sound_handle[index].focus_tid;
if (!g_mutex_trylock(&g_focus_sound_handle[index].focus_lock)) {
}
- params = g_variant_new("(ii)", instance, id);
+ params = g_variant_new("(iib)", instance, id, g_focus_sound_handle[index].is_for_session);
if (params) {
if ((ret = _dbus_method_call_to(DBUS_TO_FOCUS_SERVER, METHOD_CALL_UNREGISTER_FOCUS, params, &result)) != MM_ERROR_NONE) {
debug_error("dbus unregister focus failed");
{
int ret = MM_ERROR_NONE;
int instance;
+ int index = -1;
GVariant* params = NULL, *result = NULL;
debug_fenter();
//pthread_mutex_lock(&g_thread_mutex2);
- instance = getpid();
+ index = _focus_find_index_by_handle(id);
+ instance = g_focus_sound_handle[index].focus_tid;
+
- params = g_variant_new("(iiis)", instance, id, type, option);
+ params = g_variant_new("(iiisb)", instance, id, type, option, g_focus_sound_handle[index].is_for_session);
if (params) {
if ((ret = _dbus_method_call_to(DBUS_TO_FOCUS_SERVER, METHOD_CALL_ACQUIRE_FOCUS, params, &result)) != MM_ERROR_NONE) {
debug_error("dbus acquire focus failed");
{
int ret = MM_ERROR_NONE;
int instance;
+ int index = -1;
GVariant* params = NULL, *result = NULL;
debug_fenter();
//pthread_mutex_lock(&g_thread_mutex2);
- instance = getpid();;
+ index = _focus_find_index_by_handle(id);
+ instance = g_focus_sound_handle[index].focus_tid;
+
- params = g_variant_new("(iiis)", instance, id, type, option);
+ params = g_variant_new("(iiisb)", instance, id, type, option, g_focus_sound_handle[index].is_for_session);
if (params) {
if ((ret = _dbus_method_call_to(DBUS_TO_FOCUS_SERVER, METHOD_CALL_RELEASE_FOCUS, params, &result)) != MM_ERROR_NONE) {
debug_error("dbus release focus failed");
return ret;
}
-int mm_sound_client_dbus_set_focus_watch_callback(mm_sound_focus_type_e type, mm_sound_focus_changed_watch_cb callback, void* user_data, int *id)
+int mm_sound_client_dbus_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 ret = MM_ERROR_NONE;
int instance;
//pthread_mutex_lock(&g_thread_mutex2);
- instance = getpid();
+ instance = pid;
for (index = 0; index < FOCUS_HANDLE_MAX; index++) {
if (g_focus_sound_handle[index].is_used == false) {
g_focus_sound_handle[index].handle = index + 1;
g_focus_sound_handle[index].watch_callback = callback;
g_focus_sound_handle[index].user_data = user_data;
+ g_focus_sound_handle[index].is_for_session = is_for_session;
#ifdef SUPPORT_CONTAINER
#ifdef USE_SECURITY
- params = g_variant_new("(@ayiii)", _get_cookie_variant(), instance, g_focus_sound_handle[index].handle, type);
+ params = g_variant_new("(@ayiiib)", _get_cookie_variant(), instance, g_focus_sound_handle[index].handle, type, is_for_session);
#else /* USE_SECURITY */
gethostname(container, sizeof(container));
debug_error("container = %s", container);
- params = g_variant_new("(siii)", container, instance, g_focus_sound_handle[index].handle, type);
+ params = g_variant_new("(siiib)", container, instance, g_focus_sound_handle[index].handle, type, is_for_session);
#endif /* USE_SECURITY */
#else /* SUPPORT_CONTAINER */
- params = g_variant_new("(iii)", instance, g_focus_sound_handle[index].handle, type);
+ params = g_variant_new("(iiib)", instance, g_focus_sound_handle[index].handle, type, is_for_session);
#endif /* SUPPORT_CONTAINER */
g_mutex_lock(&g_focus_sound_handle[index].focus_lock);
- params = g_variant_new("(ii)", g_focus_sound_handle[index].focus_tid, g_focus_sound_handle[index].handle);
+ params = g_variant_new("(iib)", g_focus_sound_handle[index].focus_tid, g_focus_sound_handle[index].handle, g_focus_sound_handle[index].is_for_session);
if (params) {
if ((ret = _dbus_method_call_to(DBUS_TO_FOCUS_SERVER, METHOD_CALL_UNWATCH_FOCUS, params, &result)) != MM_ERROR_NONE) {
debug_error("dbus unset watch focus failed");
return MM_ERROR_INVALID_ARGUMENT;
}
- ret = mm_sound_client_register_focus(id, stream_type, callback, false, user_data);
+ ret = mm_sound_client_register_focus(id, getpid(), stream_type, callback, false, user_data);
if (ret) {
debug_error("Could not register focus, ret[0x%x]\n", ret);
}
}
EXPORT_API
-int mm_sound_register_focus_for_session(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 ret = MM_ERROR_NONE;
return MM_ERROR_INVALID_ARGUMENT;
}
- ret = mm_sound_client_register_focus(id, stream_type, callback, true, user_data);
+ ret = mm_sound_client_register_focus(id, pid, stream_type, callback, true, user_data);
if (ret) {
debug_error("Could not register focus for session, ret[0x%x]\n", ret);
}
debug_error("argument is not valid\n");
return MM_ERROR_INVALID_ARGUMENT;
}
- ret = mm_sound_client_set_focus_watch_callback(focus_type, callback, user_data, id);
+ ret = mm_sound_client_set_focus_watch_callback(getpid(), focus_type, callback, false, user_data, id);
+ if (ret) {
+ debug_error("Could not set focus watch callback, ret[0x%x]\n", ret);
+ }
+
+ debug_fleave();
+
+ return ret;
+}
+
+EXPORT_API
+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 ret = MM_ERROR_NONE;
+
+ debug_fenter();
+
+ if (callback == NULL || id == NULL) {
+ debug_error("argument is not valid\n");
+ return MM_ERROR_INVALID_ARGUMENT;
+ }
+ ret = mm_sound_client_set_focus_watch_callback(pid, focus_type, callback, true, user_data, id);
if (ret) {
debug_error("Could not set focus watch callback, ret[0x%x]\n", ret);
}
Name: libmm-sound
Summary: MMSound Package contains client lib and sound_server binary
-Version: 0.9.258
+Version: 0.9.259
Release: 0
Group: System/Libraries
License: Apache-2.0
g_print("AF : Acquire Focus\t");
g_print("RF : Release Focus\n");
g_print("WS : Set Focus Watch Callback\t");
+ g_print("WFS : Set Focus Watch Callback for session\t");
g_print("WU : Unset Focus Watch Callback\n");
g_print("==================================================================\n");
#endif
else if(flag_2 == '0') { stream_type = "voice-recognition"; }
else { stream_type = "media"; }
- ret = mm_sound_register_focus_for_session(id, stream_type, (id == 0)? focus_cb0 : focus_cb1, (void*)user_data);
+ ret = mm_sound_register_focus_for_session(id, getpid(), stream_type, (id == 0)? focus_cb0 : focus_cb1, (void*)user_data);
if (ret) {
g_print("failed to mm_sound_register_focus_for_session(), ret[0x%x]\n", ret);
} else {
}
}
+ else if(strncmp(cmd, "WFS", 3) ==0) {
+ int ret = 0;
+ char input_string[128];
+ char flag_1;
+ int type = 0;
+ const char *user_data = "this is user data for watch";
+
+ fflush(stdin);
+ g_print ("1. playback\n");
+ g_print ("2. recording\n");
+ g_print ("3. both\n");
+ g_print("> select interest focus type:");
+
+ if (fgets(input_string, sizeof(input_string)-1, stdin)) {
+ g_print ("### fgets return NULL\n");
+ }
+ flag_1 = input_string[0];
+
+ if(flag_1 == '1') { type = 1; }
+ else if(flag_1 == '2') { type = 2; }
+ else if(flag_1 == '3') { type = 3; }
+ else { type = 1; }
+ ret = mm_sound_set_focus_watch_callback_for_session(getpid(), type, focus_watch_cb, (void*)user_data, &g_focus_watch_index);
+ if (ret) {
+ g_print("failed to mm_sound_set_focus_watch_callback(), ret[0x%x]\n", ret);
+ } else {
+ g_print("index[%d], type[%d], callback fun[%p]\n", g_focus_watch_index, type, focus_watch_cb);
+ }
+ }
+
else if(strncmp(cmd, "WS", 2) ==0) {
int ret = 0;
char input_string[128];