}
gboolean
-__is_rtsp_streaming(mm_player_t* player)
+__is_rtsp_streaming(mm_player_t *player)
{
MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
}
gboolean
-__is_http_streaming(mm_player_t* player)
+__is_http_streaming(mm_player_t *player)
{
MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
}
gboolean
-__is_streaming(mm_player_t* player)
+__is_streaming(mm_player_t *player)
{
MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
}
gboolean
-__is_live_streaming(mm_player_t* player)
+__is_live_streaming(mm_player_t *player)
{
MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
}
gboolean
-__is_http_live_streaming(mm_player_t* player)
+__is_http_live_streaming(mm_player_t *player)
{
MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
}
gboolean
-__is_dash_streaming(mm_player_t* player)
+__is_dash_streaming(mm_player_t *player)
{
MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
}
gboolean
-__is_smooth_streaming(mm_player_t* player)
+__is_smooth_streaming(mm_player_t *player)
{
MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
}
gboolean
-__is_ms_buff_src(mm_player_t* player)
+__is_ms_buff_src(mm_player_t *player)
{
MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
}
gboolean
-__has_suffix(mm_player_t* player, const gchar* suffix)
+__has_suffix(mm_player_t *player, const gchar *suffix)
{
MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
MMPLAYER_RETURN_VAL_IF_FAIL(suffix, FALSE);
gboolean ret = FALSE;
- gchar* t_url = g_ascii_strdown(player->profile.uri, -1);
- gchar* t_suffix = g_ascii_strdown(suffix, -1);
+ gchar *t_url = g_ascii_strdown(player->profile.uri, -1);
+ gchar *t_suffix = g_ascii_strdown(suffix, -1);
if (g_str_has_suffix(player->profile.uri, suffix))
ret = TRUE;
}
gboolean
-__mmplayer_post_message(mm_player_t* player, enum MMMessageType msgtype, MMMessageParamType* param)
+__mmplayer_post_message(mm_player_t *player, enum MMMessageType msgtype, MMMessageParamType *param)
{
MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
if (!player->msg_cb)
return FALSE;
- //LOGD("Message (type : %d) will be posted using msg-cb(%p). \n", msgtype, player->msg_cb);
+ //LOGD("Message (type : %d) will be posted using msg-cb(%p).", msgtype, player->msg_cb);
player->msg_cb(msgtype, param, player->msg_cb_param);
}
gboolean
-__mmplayer_dump_pipeline_state(mm_player_t* player)
+__mmplayer_dump_pipeline_state(mm_player_t *player)
{
- GstIterator*iter = NULL;
+ GstIterator *iter = NULL;
gboolean done = FALSE;
GValue item = {0, };
GstState state = GST_STATE_VOID_PENDING;
GstState pending = GST_STATE_VOID_PENDING;
- GstClockTime time = 200*GST_MSECOND;
+ GstClockTime time = 200 * GST_MSECOND;
MMPLAYER_FENTER();
factory = gst_element_get_factory(element) ;
if (factory)
- LOGE("%s:%s : From:%s To:%s refcount : %d\n", GST_OBJECT_NAME(factory) , GST_ELEMENT_NAME(element) ,
+ LOGE("%s:%s : From:%s To:%s refcount : %d", GST_OBJECT_NAME(factory) , GST_ELEMENT_NAME(element) ,
gst_element_state_get_name(state), gst_element_state_get_name(pending) , GST_OBJECT_REFCOUNT_VALUE(element));
g_value_reset(&item);
break;
factory = gst_element_get_factory(element) ;
if (factory) {
- LOGE("%s:%s : From:%s To:%s refcount : %d\n",
+ LOGE("%s:%s : From:%s To:%s refcount : %d",
GST_OBJECT_NAME(factory),
GST_ELEMENT_NAME(element),
gst_element_state_get_name(state),
return FALSE;
}
-int util_exist_file_path(const char *file_path)
+int
+util_exist_file_path(const char *file_path)
{
int fd = 0;
struct stat stat_results = {0, };
return MM_ERROR_NONE;
}
-char**
+char **
util_get_cookie_list(const char *cookies)
{
char **cookie_list = NULL;
if (!cookies || !strlen(cookies))
return NULL;
- SECURE_LOGD("cookies : %zu[bytes] - %s \n", strlen(cookies), cookies);
+ SECURE_LOGD("cookies : %zu[bytes] - %s", strlen(cookies), cookies);
temp = g_strdup(cookies);
if (cookie_list[i]) {
if (strlen(cookie_list[i])) {
g_strstrip(cookie_list[i]);
- SECURE_LOGD("cookie_list[%d] : %zu[bytes] - %s \n", i, strlen(cookie_list[i]), cookie_list[i]);
+ SECURE_LOGD("cookie_list[%d] : %zu[bytes] - %s", i, strlen(cookie_list[i]), cookie_list[i]);
} else {
cookie_list[i][0] = '\0';
}
}
EXIT:
- if (temp)
- g_free(temp);
- temp = NULL;
+ MMPLAYER_FREEIF(temp);
return cookie_list;
}
util_is_sdp_file(const char *path)
{
gboolean ret = FALSE;
- gchar* uri = NULL;
+ gchar *uri = NULL;
MMPLAYER_FENTER();
/* strlen(".sdp") == 4 */
if (strlen(uri) <= 4) {
- LOGW("path is too short.\n");
- g_free(uri);
+ LOGW("path is too short.");
+ MMPLAYER_FREEIF(uri);
return ret;
}
/* FIXIT : do it soon */
LOGD("no suffix");
- g_free(uri);
- uri = NULL;
+ MMPLAYER_FREEIF(uri);
return ret;
}
-const char*
+const char *
util_get_charset(const char *file_path)
{
- UCharsetDetector* ucsd;
- const UCharsetMatch* ucm;
+ UCharsetDetector *ucsd;
+ const UCharsetMatch *ucm;
UErrorCode status = U_ZERO_ERROR;
- const char* charset = NULL;
+ const char *charset = NULL;
char *buf = NULL;
- FILE* fin = 0;
+ FILE *fin = 0;
size_t n_size = 0;
fin = fopen(file_path, "r");
if (!fin) {
- SECURE_LOGE("fail to open file %s\n", file_path);
+ SECURE_LOGE("fail to open file %s", file_path);
return NULL;
}
ucsd = ucsdet_open(&status);
if (U_FAILURE(status)) {
- LOGE("fail to ucsdet_open\n");
+ LOGE("fail to ucsdet_open");
goto done;
}
ucsdet_enableInputFilter(ucsd, TRUE);
- buf = g_malloc(1024*1024);
+ buf = g_try_malloc(1024 * 1024);
if (!buf) {
- LOGE("fail to alloc\n");
+ LOGE("fail to alloc");
goto done;
}
ucsdet_setText(ucsd, buf, strlen(buf), &status);
if (U_FAILURE(status)) {
- LOGE("fail to ucsdet_setText\n");
+ LOGE("fail to ucsdet_setText");
goto done;
}
ucm = ucsdet_detect(ucsd, &status);
if (U_FAILURE(status)) {
- LOGE("fail to ucsdet_detect\n");
+ LOGE("fail to ucsdet_detect");
goto done;
}
charset = ucsdet_getName(ucm, &status);
if (U_FAILURE(status)) {
- LOGE("fail to ucsdet_getName\n");
+ LOGE("fail to ucsdet_getName");
goto done;
}
if (ucsd)
ucsdet_close(ucsd);
- if (buf)
- g_free(buf);
+ MMPLAYER_FREEIF(buf);
return charset;
}
-int util_get_pixtype(unsigned int fourcc)
+int
+util_get_pixtype(unsigned int fourcc)
{
int pixtype = MM_PIXEL_FORMAT_INVALID;
/*
- char *pfourcc = (char*)&fourcc;
+ char *pfourcc = (char *)&fourcc;
LOGD("fourcc(%c%c%c%c)",
pfourcc[0], pfourcc[1], pfourcc[2], pfourcc[3]);
return pixtype;
}
-static int _util_storage_supported_cb(int storage_id, storage_type_e type,
+static int
+_util_storage_supported_cb(int storage_id, storage_type_e type,
storage_state_e state, const char *path, void *user_data)
{
MMPlayerStorageInfo *storage_info = (MMPlayerStorageInfo *)user_data;
return TRUE;
}
-bool util_get_storage_info(const char *path, MMPlayerStorageInfo *storage_info)
+bool
+util_get_storage_info(const char *path, MMPlayerStorageInfo *storage_info)
{
int ret = 0;
const char *file_path = path;
MMPLAYER_RETURN_VAL_IF_FAIL(file_path && storage_info, false);
if (strncmp(file_path, "file://", strlen("file://")) == 0)
- file_path = path+7; /* remove file prefix */
+ file_path = path + 7; /* remove file prefix */
if (strncmp(file_path, MEDIA_PATH_EXTERNAL, strlen(MEDIA_PATH_EXTERNAL)) == 0) {
storage_info->type = STORAGE_TYPE_EXTERNAL;