int muse_core_msg_send_fd(int sock_fd, int *fds, const char *buf);
int muse_core_msg_recv_fd(int sock_fd, char *buf, int buf_len, int *out_fd);
char *muse_core_msg_new(int api, ...);
-bool muse_core_msg_deserialize(const char *key, char *buf, int *parse_len, muse_core_msg_parse_err_e *err, muse_core_msg_type_e m_type, void *data);
+bool muse_core_msg_deserialize(const char *key, char *buf, int *parse_len,
+ muse_core_msg_parse_err_e *err, muse_core_msg_type_e m_type, void *data);
void muse_core_msg_free(char *msg);
void *muse_core_msg_object_new(char *str, int *parse_len, muse_core_msg_parse_err_e *err);
bool muse_core_msg_object_get_value(const char *key, void *jobj, muse_core_msg_type_e m_type, void *data);
#include <unistd.h>
#include <iniparser.h>
-#define CONFFILE SYSCONFDIR"/multimedia/mused.conf"
-#define MUSE_HOST "muse:hosts"
+#define CONFFILE SYSCONFDIR"/multimedia/mused.conf"
+#define MUSE_HOST "muse:hosts"
#define INI_PARSER_COMMA ","
#define MUSE_DATA_ROOT_PATH TZ_SYS_DATA_PATH"/mused/"
-#define MUSE_DEFAULT_PIDFILE "/tmp/.muse-server.pid"
+#define MUSE_DEFAULT_PIDFILE "/tmp/.muse-server.pid"
#define MUSE_SOCK_FILE0 "/tmp/.muse_server_socket"
#define MUSE_SOCK_FILE1 "/tmp/.muse_server_data_socket"
#define MUSE_LOG_PATH "/var/log/mused"
#define MUSE_LOG_FILE MUSE_LOG_PATH"/muselog"
#define MUSE_USE_LOG "yes"
-#define READ 0x02
-#define PERSIST 0x10
+#define READ 0x02
+#define PERSIST 0x10
-#define MUSE_ERR -1
-#define SEND_FAIL -1
-#define RECV_FAIL -1
+#define MUSE_ERR -1
+#define SEND_FAIL -1
+#define RECV_FAIL -1
#define MUSE_PARAM_MAX 10
#define MUSE_LOG_MSG_NUM 10
-#define PARSE_ERROR -1
+#define PARSE_ERROR -1
/* message */
#define MUSE_MSG_LEN 32
/* dispatcher */
#define MUSE_DISPATCHER_MAX 512
-#define MSG_KEY_API "api"
-#define MSG_KEY_MODULE_INDEX "module"
+#define MSG_KEY_API "api"
+#define MSG_KEY_MODULE_INDEX "module"
#define MSG_KEY_MODULE_ADDR "module_addr"
-#define DISPATCHER "dispatcher"
+#define DISPATCHER "dispatcher"
#define DISPATCHER_PTR "dispatcher_pointer"
#define CMD_DISPATCHER "cmd_dispatcher"
-#define END_DELIM '}'
+#define END_DELIM '}'
#define END_DELIM_STR " }"
#define muse_return_if_fail(expr) \
return sndMsg;
}
-bool muse_core_msg_deserialize(const char *key, char *buf, int *parse_len, muse_core_msg_parse_err_e *err, muse_core_msg_type_e m_type, void *data)
+bool muse_core_msg_deserialize(const char *key, char *buf, int *parse_len,
+ muse_core_msg_parse_err_e *err, muse_core_msg_type_e m_type, void *data)
{
json_object *obj = NULL, *jobj = NULL;
bool ret = false;
Name: mused
Summary: A multimedia daemon
-Version: 0.3.99
+Version: 0.3.100
Release: 0
Group: System/Libraries
License: Apache-2.0
#include "muse_core_internal.h"
#include <iniparser.h>
-#define MUSE_LOG "muse:logfile"
-#define MUSE_LOCK "muse:lockfile"
+#define MUSE_LOG "muse:logfile"
+#define MUSE_LOCK "muse:lockfile"
#define MUSE_WATCHDOG_MIN_TIMEOUT "muse:min_timeout"
#define MUSE_WATCHDOG_MAX_TIMEOUT "muse:max_timeout"
#define MUSE_MEMORY_THRESHOLD "muse:memory_threshold"
#define MUSE_WATCH_EXTERNAL_STORAGE "muse:enable_watch_external_storage"
#define MUSE_ON_DEMAND_LAUNCH "muse:on_demand"
-#define MUSE_ON_DEMAND_MAX_IDLE_TIME "muse:on_demand_max_idle_time"
-#define MUSE_ON_DEMAND_MAX_IDLE_MEMORY "muse:on_demand_max_idle_memory"
-#define MUSE_GST "muse:gstparam"
-#define INI_PARSER_COLON ":"
-#define PATH "path"
-#define PRELOADED "preloaded"
-#define TIMEOUT "timeout"
+#define MUSE_ON_DEMAND_MAX_IDLE_TIME "muse:on_demand_max_idle_time"
+#define MUSE_ON_DEMAND_MAX_IDLE_MEMORY "muse:on_demand_max_idle_memory"
+#define MUSE_GST "muse:gstparam"
+#define INI_PARSER_COLON ":"
+#define PATH "path"
+#define PRELOADED "preloaded"
+#define TIMEOUT "timeout"
#define DISABLE_WATCHDOG_API_INDEX "disable_watchdog_api"
-#define MAX_INSTANCE "max_instance"
-#define CAUTION_INSTANCE "caution_instance"
+#define MAX_INSTANCE "max_instance"
+#define CAUTION_INSTANCE "caution_instance"
-#define DEFAULT_WATCHDOG_MIN_TIMEOUT 5
-#define DEFAULT_WATCHDOG_MAX_TIMEOUT 60
-#define DEFAULT_DISPATCH_WATCHDOG_TIMEOUT 10
-#define DEFAULT_MEMORY_LEAK_THRESHOLD 50000 /* 50MB */
-#define DEFAULT_WATCHDOG_DISABLED_API_INDEX -1 /* Watchdog is applied to all dispatcher functions */
+#define DEFAULT_WATCHDOG_MIN_TIMEOUT 5
+#define DEFAULT_WATCHDOG_MAX_TIMEOUT 60
+#define DEFAULT_DISPATCH_WATCHDOG_TIMEOUT 10
+#define DEFAULT_MEMORY_LEAK_THRESHOLD 50000 /* 50MB */
+#define DEFAULT_WATCHDOG_DISABLED_API_INDEX -1 /* Watchdog is applied to all dispatcher functions */
#define DEFAULT_MAX_INSTANCE -1 /* Unlimited */
#define DEFAULT_CAUTION_INSTANCE -1
-#define DEFAULT_ON_DEMAND_MAX_IDLE_TIME 600 /* 10 minutes */
-#define DEFAULT_ON_DEMAND_MAX_IDLE_MEMORY 30000 /* 30MB */
+#define DEFAULT_ON_DEMAND_MAX_IDLE_TIME 600 /* 10 minutes */
+#define DEFAULT_ON_DEMAND_MAX_IDLE_MEMORY 30000 /* 30MB */
typedef struct host_info {
#endif
#undef LOG_TAG
-#define LOG_TAG "MUSED_SERVER"
-#define MSG_KEY_PID "pid"
+#define LOG_TAG "MUSED_SERVER"
+#define MSG_KEY_PID "pid"
#define MS_TIMEOUT_SEC 1
#define MS_TIMEOUT_MSEC MS_TIMEOUT_SEC * 1000
-#define MS_RECV_TRY_COUNT_MAX 3
-#define MSG_DONE "DONE"
+#define MS_RECV_TRY_COUNT_MAX 3
+#define MSG_DONE "DONE"
gboolean ms_ipc_create_msg_dispatch_worker(muse_module_h m);
gboolean ms_ipc_create_data_dispatch_worker(muse_module_h m);
#define MS_POWER_DBUS_MSG "ChangeState"
#define MS_POWER_DBUS_PATH "/Org/Tizen/System/DeviceD/PowerOff"
-#define MS_POWER_DBUS_INTERFACE "org.tizen.system.deviced.PowerOff"
+#define MS_POWER_DBUS_INTERFACE "org.tizen.system.deviced.PowerOff"
#define MS_RM_DBUS_MSG "NameOwnerChanged"
#define MS_RM_DBUS_SENDER "org.tizen.MMResourceManager"
conf->max_idle_time = _ms_config_get_int(conf->muse_dict, MUSE_ON_DEMAND_MAX_IDLE_TIME, DEFAULT_ON_DEMAND_MAX_IDLE_TIME);
- conf->max_idle_memory = _ms_config_get_int(conf->muse_dict, MUSE_ON_DEMAND_MAX_IDLE_MEMORY, DEFAULT_ON_DEMAND_MAX_IDLE_MEMORY);
+ conf->max_idle_memory = _ms_config_get_int(conf->muse_dict,
+ MUSE_ON_DEMAND_MAX_IDLE_MEMORY, DEFAULT_ON_DEMAND_MAX_IDLE_MEMORY);
for (conf->gst_param_cnt = 0; conf->gst_param_cnt < MUSE_PARAM_MAX; conf->gst_param_cnt++) {
memset(gst_param_key, 0, MUSE_MSG_LEN_MAX);
snprintf(key, MUSE_MSG_LEN_MAX, "%s%s%s", host, INI_PARSER_COLON, TIMEOUT);
conf->host_infos[host_idx]->timeout = _ms_config_get_int(conf->muse_dict, key, DEFAULT_DISPATCH_WATCHDOG_TIMEOUT);
if (conf->host_infos[host_idx]->timeout < conf->min_timeout || conf->host_infos[host_idx]->timeout > conf->max_timeout) {
- LOGE("Error - set timeout value [%d] ( %d ~ %d s )", conf->host_infos[host_idx]->timeout, conf->min_timeout, conf->max_timeout);
+ LOGE("Error - set timeout value [%d] ( %d ~ %d s )",
+ conf->host_infos[host_idx]->timeout, conf->min_timeout, conf->max_timeout);
goto out;
}
/* disable_watchdog_api */
snprintf(key, MUSE_MSG_LEN_MAX, "%s%s%s", host, INI_PARSER_COLON, DISABLE_WATCHDOG_API_INDEX);
- conf->host_infos[host_idx]->disable_watchdog_api = _ms_config_get_int(conf->muse_dict, key, DEFAULT_WATCHDOG_DISABLED_API_INDEX);
+ conf->host_infos[host_idx]->disable_watchdog_api =
+ _ms_config_get_int(conf->muse_dict, key, DEFAULT_WATCHDOG_DISABLED_API_INDEX);
/* max instance */
snprintf(key, MUSE_MSG_LEN_MAX, "%s%s%s", host, INI_PARSER_COLON, MAX_INSTANCE);
{
int fd;
GQueue *queue;
- struct epoll_event event = {0};
+ struct epoll_event event = { 0 };
char err_msg[MUSE_MSG_LEN_MAX] = {'\0',};
ms_connection_t *connection = NULL;
if (max_instance == UNLIMITED_INSTANCE || created_module_instance_count < max_instance) {
return TRUE;
} else {
- LOGW("The number (%d) of created module instance is over the value of max instance (%d)", created_module_instance_count, max_instance);
+ LOGW("The number (%d) of created module instance is over the value of max instance (%d)",
+ created_module_instance_count, max_instance);
return FALSE;
}
}
enable_dispatch_timeout_callback = _ms_module_enable_dispatch_timeout_callback(api, m);
if (enable_dispatch_timeout_callback)
- id = g_timeout_add_seconds((guint)module->disp_timeout[api], (GSourceFunc)_ms_module_dispatch_timeout_callback, (gpointer)m);
+ id = g_timeout_add_seconds((guint)module->disp_timeout[api],
+ (GSourceFunc)_ms_module_dispatch_timeout_callback, (gpointer)m);
ret = dispatcher[api](m);