SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
PKG_CHECK_MODULES(pkgs REQUIRED dlog vconf fontconfig libxml-2.0 pkgmgr-info
- alarm-service capi-media-metadata-extractor aul json-glib-1.0 capi-appfw-app-manager
+ alarm-service aul json-glib-1.0 capi-appfw-app-manager
capi-appfw-package-manager capi-system-info glib-2.0)
INCLUDE_DIRECTORIES(${pkgs_INCLUDE_DIRS})
LINK_DIRECTORIES(${pkgs_LIBRARY_DIRS})
BuildRequires: pkgconfig(libtzplatform-config)
BuildRequires: pkgconfig(alarm-service)
BuildRequires: pkgconfig(uuid)
-BuildRequires: pkgconfig(capi-media-metadata-extractor)
BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(libsystemd)
BuildRequires: pkgconfig(json-glib-1.0)
#include <libgen.h>
#include <glib.h>
#include <vconf.h>
-#include <metadata_extractor.h>
#include "sst.h"
#include "sst_json.h"
#include "sst_vconf.h"
char *media_name;
} sst_file_info;
-static char* get_media_basename(const char *dir_path, const char *name)
+static char* get_media_basename(const char *name)
{
- RETV_IF(NULL == name, NULL);
- RETV_IF(NULL == dir_path, NULL);
-
- char path[PATH_MAX];
- snprintf(path, sizeof(path), "%s/%s", dir_path, name);
-
- metadata_extractor_h metadata = NULL;
- int ret = metadata_extractor_create(&metadata);
- if (ret != METADATA_EXTRACTOR_ERROR_NONE || NULL == metadata) {
- ERR("metadata_extractor_create() Fail(%d)", ret);
- return strdup(name);
- }
+ char *last_dot = NULL;
- ret = metadata_extractor_set_path(metadata, path);
- if (METADATA_EXTRACTOR_ERROR_NONE != ret) {
- ERR("metadata_extractor_set_path(%s) Fail(%d)", path, ret);
- metadata_extractor_destroy(metadata);
- return strdup(name);
- }
+ RETV_IF(NULL == name, NULL);
- char *title = NULL;
- ret = metadata_extractor_get_metadata(metadata, METADATA_TITLE, &title);
- metadata_extractor_destroy(metadata);
- if (title)
- return title;
+ last_dot = strrchr(name, '.');
+ if (last_dot)
+ return g_strndup(name, last_dot - name);
else
- return strdup(name);
+ return g_strdup(name);
}
static int _get_filelist_in_dir(const char *path, GList **file_list)
}
info->name = strdup(ent->d_name);
- info->media_name = get_media_basename(path, info->name);
+ info->media_name = get_media_basename(info->name);
*file_list = g_list_append(*file_list, info);
}