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);
+#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__ */
//int __mm_sound_mgr_ipc_create_focus_node(mm_ipc_msg_t *msg);
#ifdef SUPPORT_CONTAINER
-int __mm_sound_mgr_focus_ipc_register_focus(int client_pid, int handle_id, char* stream_type ,const char* container_name, int container_pid);
+int __mm_sound_mgr_focus_ipc_register_focus(int client_pid, int handle_id, const char* stream_type ,const char* container_name, int container_pid);
#else
-int __mm_sound_mgr_focus_ipc_register_focus(int client_pid, int handle_id, char* stream_type);
+int __mm_sound_mgr_focus_ipc_register_focus(int client_pid, int handle_id, const char* stream_type);
#endif
//int __mm_sound_mgr_ipc_destroy_focus_node(mm_ipc_msg_t *msg);
int __mm_sound_mgr_focus_ipc_unregister_focus(int pid, int handle_id);
#include "../include/mm_sound_common.h"
#include "../include/mm_sound_utils.h"
+#include "include/mm_sound_mgr_focus.h"
#include "include/mm_sound_mgr_focus_ipc.h"
#include "include/mm_sound_mgr_focus_dbus.h"
//__attribute__ ((destructor))
static void _exit_handler(int sig)
{
- int ret = MM_ERROR_NONE;
-
switch(sig)
{
case SIGINT:
*/
#include <stdio.h>
+#include <stdlib.h>
#include "include/mm_sound_mgr_focus.h"
#include "../include/mm_sound_common.h"
#include <fcntl.h>
#include "include/mm_sound_mgr_focus_ipc.h"
+#include "include/mm_sound_mgr_focus_dbus.h"
#include "../include/mm_sound_utils.h"
#include <sys/time.h>
#include <sys/stat.h>
return &node->container;
}
}
+ return NULL;
}
#endif /* SUPPORT_CONTAINER */
#ifdef SUPPORT_CONTAINER
container_info_t* container_info = __get_container_info(instance_id);
-
+ if (!container_info) {
+ debug_error ("__get_container_info failed");
+ return NULL;
+ }
if (instance_id == container_info->pid) {
debug_error ("This might be in the HOST(%s)[%d], let's form normal path",
container_info->name, instance_id);
}
static int _mm_sound_mgr_focus_do_watch_callback(focus_type_e focus_type, focus_command_e command,
- focus_node_t *my_node, _mm_sound_mgr_focus_param_t *param)
+ focus_node_t *my_node, const _mm_sound_mgr_focus_param_t *param)
{
char *filename = NULL;
char *filename2 = NULL;
GList *list = NULL;
focus_node_t *node = NULL;
-
- int i = 0;
-
focus_cb_data cb_data;
debug_fenter();
return -1;
}
-int _mm_sound_mgr_focus_do_callback(focus_command_e command, focus_node_t *victim_node, _mm_sound_mgr_focus_param_t *assaulter_param, const char *assaulter_stream_type)
+int _mm_sound_mgr_focus_do_callback(focus_command_e command, focus_node_t *victim_node, const _mm_sound_mgr_focus_param_t *assaulter_param, const char *assaulter_stream_type)
{
char *filename = NULL;
char *filename2 = NULL;
}
if(ret == victim_node->handle_id) {
/* return from client is success, ret will be its handle_id */
- victim_node->status = (command == FOCUS_COMMAND_RELEASE) ? (victim_node->status &= ~(cb_data.type)) : (victim_node->status |= cb_data.type);
+ victim_node->status = (command == FOCUS_COMMAND_RELEASE) ? (victim_node->status & ~(cb_data.type)) : (victim_node->status | cb_data.type);
} else {
victim_node->status = FOCUS_STATUS_DEACTIVATED;
}
}
#ifdef SUPPORT_CONTAINER
-void _mm_sound_mgr_focus_update_container_data(int pid,int handle, const char* container_name, int container_pid)
+void mm_sound_mgr_focus_update_container_data(int pid,int handle, const char* container_name, int container_pid)
{
__set_container_data(pid, handle, container_name, container_pid);
//__temp_print_list(NULL);
if (my_node->status == FOCUS_STATUS_DEACTIVATED) {
ret = MM_ERROR_SOUND_INVALID_STATE;
goto FINISH;
- } else if ((my_node->status != FOCUS_STATUS_ACTIVATED_BOTH) && (my_node->status != param->request_type)) {
+ } else if ((my_node->status != FOCUS_STATUS_ACTIVATED_BOTH) && (my_node->status != (focus_status_e)param->request_type)) {
ret = MM_ERROR_SOUND_INVALID_STATE;
goto FINISH;
}
return "org.tizen.multimedia.common.Unknown";
}
-
-static int mm_sound_mgr_focus_dbus_send_signal(int signal_type, GVariant *parameter)
-{
- int ret = MM_ERROR_NONE;
- GDBusConnection *conn = NULL;
- GError* err = NULL;
- gboolean emit_success = FALSE;
-
- if (signal_type < 0 || signal_type >= SIGNAL_MAX || !parameter) {
- debug_error("Invalid Argument");
- return MM_ERROR_SOUND_INTERNAL;
- }
-
- debug_log("Signal Emit : %s", signals[signal_type].info.name);
-
- if (!conn_g) {
- conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err);
- if (!conn && err) {
- debug_error ("g_bus_get_sync() error (%s) ", err->message);
- g_error_free (err);
- return MM_ERROR_SOUND_INTERNAL;
- }
- conn_g = conn;
- }
-/*
- if (!g_variant_is_of_type(parameter, G_VARIANT_TYPE(signals[signal_type].info.argument))) {
- debug_error("Invalid Signal Parameter");
- return MM_ERROR_INVALID_ARGUMENT;
- }
- */
-
- emit_success = g_dbus_connection_emit_signal(conn_g, NULL, OBJECT_FOCUS_SERVER, INTERFACE_FOCUS_SERVER,
- signals[signal_type].info.name, parameter, &err);
- if (!emit_success && err) {
- debug_error("Emit signal (%s) failed, (%s)", signals[signal_type].info.name, err->message);
- g_error_free(err);
- return MM_ERROR_SOUND_INTERNAL;
- }
-
- return ret;
-}
-
static int _get_sender_pid(GDBusMethodInvocation* invocation)
{
GVariant* value;
static void handle_method_register_focus(GDBusMethodInvocation* invocation)
{
int ret = MM_ERROR_NONE;
- int pid = 0, handle_id = 0;
+ int handle_id = 0;
const char* stream_type = NULL;
GVariant *params = NULL;
#ifdef SUPPORT_CONTAINER
#ifdef USE_SECURITY
GVariant* cookie_data;
#endif /* USE_SECURITY */
+#else
+ int pid = 0;
#endif /* SUPPORT_CONTAINER */
static void handle_method_watch_focus(GDBusMethodInvocation* invocation)
{
int ret = MM_ERROR_NONE;
- int pid = 0, handle_id = 0, focus_type = 0;
+ int handle_id = 0, focus_type = 0;
GVariant *params = NULL;
#ifdef SUPPORT_CONTAINER
int container_pid = -1;
#ifdef USE_SECURITY
GVariant* cookie_data;
#endif /* USE_SECURITY */
+#else
+ int pid = 0;
#endif /* SUPPORT_CONTAINER */
debug_fenter();
static void on_bus_acquired(GDBusConnection *connection, const gchar *name, gpointer user_data)
{
guint reg_id;
- guint subs_id;
debug_log("Bus Acquired (%s)", name);
conn_g = connection;
debug_error("Register object(%s) failed", OBJECT_FOCUS_SERVER);
return ;
}
-#if 0
- subs_id = g_dbus_connection_signal_subscribe(connection, NULL, INTERFACE_ASM, "EmergentExit", OBJECT_ASM, \
- NULL, G_DBUS_SIGNAL_FLAGS_NONE, handle_signal, NULL, NULL );
-
- if (!subs_id) {
- debug_error ("g_dbus_connection_signal_subscribe() failed ");
- return;
- }
-#endif
}
static void on_name_acquired(GDBusConnection *connection, const gchar *name, gpointer user_data)
GError *err = NULL;
int i = 0;
- g_type_init();
-
conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err);
if (!conn && err) {
LOGE("g_bus_get_sync() error (%s)", err->message);
#ifdef SUPPORT_CONTAINER
// method + add callback
-int __mm_sound_mgr_focus_ipc_register_focus(int client_pid, int handle_id, char* stream_type, const char* container_name, int container_pid)
+int __mm_sound_mgr_focus_ipc_register_focus(int client_pid, int handle_id, const char* stream_type, const char* container_name, int container_pid)
{
_mm_sound_mgr_focus_param_t param;
int ret = MM_ERROR_NONE;
ret = mm_sound_mgr_focus_create_node(¶m);
- _mm_sound_mgr_focus_update_container_data(client_pid, handle_id, container_name, container_pid);
+ mm_sound_mgr_focus_update_container_data(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, char* stream_type)
+int __mm_sound_mgr_focus_ipc_register_focus(int client_pid, int handle_id, const char* stream_type)
{
_mm_sound_mgr_focus_param_t param;
int ret = MM_ERROR_NONE;
param.request_type = focus_type;
ret = mm_sound_mgr_focus_set_watch_cb(¶m);
- _mm_sound_mgr_focus_update_container_data(pid, -1, container_name, container_pid);
+ mm_sound_mgr_focus_update_container_data(pid, -1, container_name, container_pid);
return ret;
}
}
if (is_focus_registered)
- param->skip_session == true;
+ param->skip_session = true;
if (param->skip_session == false) {
if(MM_ERROR_NONE != _mm_session_util_read_information(-1, &session_type, &session_options))
Name: libmm-sound
Summary: MMSound Package contains client lib and sound_server binary
-Version: 0.9.246
+Version: 0.9.247
Release: 0
Group: System/Libraries
License: Apache-2.0