INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs REQUIRED
- media-thumbnail
capi-content-media-content
drm-client
ui-gadget-1
int gl_db_free_cluster(gl_cluster *gcluster);\r
int _gl_data_get_item_by_fullpath(void *data, char *path, gl_media_s **mitem);\r
int _gl_data_delete_media(void *data, gl_media_s *media_item);\r
+int _gl_data_create_thumb(gl_item *gitem, media_thumbnail_completed_cb callback,\r
+ void *user_data);\r
\r
#ifdef _cplusplus\r
}\r
#ifdef _USE_ROTATE_BG
#define GL_STR_MORE dgettext("sys_string", "IDS_COM_BODY_MORE")
-#define GL_STR_ROTATE_LEFT _("Rotate left")
-#define GL_STR_ROTATE_RIGHT _("Rotate right")
+#define GL_STR_ROTATE_LEFT _("IDS_MEDIABR_OPT_ROTATE_LEFT")
+#define GL_STR_ROTATE_RIGHT _("IDS_MEDIABR_OPT_ROTATE_RIGHT")
#define GL_STR_ROTATING _("Rotating")
#define GL_STR_ROTATED _("Rotated")
#endif
#include "gallery.h"
#define GL_FILE_EXISTS(path) \
- ((1 == ecore_file_exists(path)) && (ecore_file_size(path) > 0))
+ (path && (1 == ecore_file_exists(path)) && (ecore_file_size(path) > 0))
#define GL_IF_DEL_TIMER(timer) if(timer){ecore_timer_del(timer); timer = NULL;}
#define GL_IF_DEL_IDLER(idler) if(idler){ecore_idler_del(idler); idler = NULL;}
int gl_play_vibration(void *data);
char *_gl_get_duration_string(unsigned int v_dur);
-int _gl_get_thumb(void *data, const char *file_path, char **thumb_path);
#endif /* _GL_UTIL_H_ */
Name: org.tizen.gallery
Summary: org.tizen.gallery UX
-Version: 1.1.30
+Version: 1.1.31
Release: 1
Group: Applications
License: Flora Software License
BuildRequires: cmake
BuildRequires: gettext-tools
BuildRequires: edje-tools
-BuildRequires: pkgconfig(media-thumbnail)
BuildRequires: pkgconfig(capi-content-media-content)
BuildRequires: pkgconfig(drm-client)
BuildRequires: pkgconfig(ui-gadget-1)
return ret;\r
}\r
\r
+/* Creates a thumbnail image for given the media, asynchronously */\r
+int _gl_data_create_thumb(gl_item *gitem, media_thumbnail_completed_cb callback,\r
+ void *user_data)\r
+{\r
+ GL_CHECK_VAL(gitem, -1);\r
+ GL_CHECK_VAL(gitem->item, -1);\r
+ GL_CHECK_VAL(gitem->item->media_h, -1);\r
+ int ret = -1;\r
+ gl_dbg("File[%s]", gitem->item->file_url);\r
+\r
+ ret = media_info_create_thumbnail(gitem->item->media_h, callback,\r
+ user_data);\r
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {\r
+ gl_dbgE("Failed to create thumbnail!");\r
+ return -1;\r
+ }\r
+ return 0;\r
+}\r
+\r
GL_CHECK_VAL(mitem, -1);\r
GL_CHECK_VAL(mitem->media_h, -1);\r
\r
- if (media_info_move_media_to_db(mitem->media_h, dst) != MEDIA_CONTENT_ERROR_NONE) {\r
+ if (media_info_move_to_db(mitem->media_h, dst) != MEDIA_CONTENT_ERROR_NONE) {\r
gl_dbgE("Move media thumbnail failed!");\r
return -1;\r
}\r
\r
- gl_dbgW("Checkme: use correct api!");\r
return 0;\r
}\r
\r
}
+static void __gl_grid_thumb_created_cb(media_content_error_e error,
+ const char *path, void *user_data)
+{
+ GL_CHECK(user_data);
+ gl_item *gitem = (gl_item *)user_data;
+ GL_CHECK(gitem->item);
+
+ if (GL_FILE_EXISTS(path)) {
+ gl_dbg("Update item with new thumb path[%s]", path);
+ /* Update thumb path */
+ if (gitem->item->thumb_url)
+ free(gitem->item->thumb_url);
+ gitem->item->thumb_url = strdup(path);
+ elm_gengrid_item_update(gitem->elm_item);
+ } else {
+ gl_dbgE("Invalid thumb path!");
+ }
+}
+
static Evas_Object *__gl_grid_get_content(void *data, Evas_Object *obj, const char *part)
{
GL_CHECK_NULL(part);
#endif
}
} else {
- int ret = -1;
- ret = _gl_get_thumb(ad, gitem->item->file_url,
- &gitem->item->thumb_url);
/* Use default image */
- if (ret < 0)
- path = GL_DEFAULT_THUMB_ICON;
- else
+ if (GL_FILE_EXISTS(gitem->item->thumb_url)) {
path = gitem->item->thumb_url;
+ } else {
+ path = GL_DEFAULT_THUMB_ICON;
+ if (GL_FILE_EXISTS(gitem->item->file_url))
+ _gl_data_create_thumb(gitem,
+ __gl_grid_thumb_created_cb,
+ gitem);
+ }
}
if (gitem->item->type == MEDIA_CONTENT_TYPE_VIDEO) {
gl_dbgE("Invalid item data!");
continue;
}
+
+ if (album->checked == state){
+ /* Get next item */
+ next_it = elm_gengrid_item_next_get(first_it);
+ first_it = next_it;
+ album = NULL;
+ continue;
+ }
+
/* Update checkbox state */
album->checked = state;
/* Update selected list */
}
album = NULL;
}
+ sel_all_cnt = item_cnt;
} else {
/* Get all medias count of current album */
item_cnt = ad->maininfo.medias_cnt;
#include <vconf-keys.h>
#include <errno.h>
#include <haptic.h>
-#include <media-thumbnail.h>
#include "gl-debug.h"
#include "gallery.h"
#include "gl-albums.h"
return dur_str;
}
-/* Fetch thumbnail from media-service, if it's invalid, generate new one */
-int _gl_get_thumb(void *data, const char *file_path, char **thumb_path)
-{
- GL_CHECK_VAL(thumb_path, -1);
- GL_CHECK_VAL(file_path, -1);
- GL_CHECK_VAL(data, -1);
- /* Return if thumbnail is valid */
- if (*thumb_path && ecore_file_exists(*thumb_path) &&
- (ecore_file_size(*thumb_path) > 0)) {
- return 0;
- }
-
- /* Free allocated memory first */
- if (*thumb_path) {
- gl_dbgW("Wrong thumb path[%s]", *thumb_path);
- free(*thumb_path);
- *thumb_path = NULL;
- }
- gl_dbg("File[%s]", file_path);
-
- char *new_path = calloc(1, GL_FILE_PATH_LEN_MAX);
- GL_CHECK_VAL(new_path, -1);
-
- /* Generate thumbnail via thumbnail-service */
- int ret = -1;
- ret = thumbnail_request_from_db(file_path, new_path,
- GL_FILE_PATH_LEN_MAX);
- if (ret < 0) {
- gl_dbgE("thumbnail_request_from_db failed!");
- return -1;
- }
-
- *thumb_path = new_path;
- gl_dbg("Request thumbnail[%s]", new_path);
- return 0;
-}
-
capi-appfw-application
capi-content-media-content
ui-gadget-1
- media-thumbnail
drm-client
)
int _ge_data_selected_list_finalize(void);\r
bool _ge_data_is_default_album(const char *match_folder, ge_album_s *mcluster);\r
bool _ge_data_is_root_path(const char *path);\r
+int _ge_data_create_thumb(ge_item *gitem, media_thumbnail_completed_cb callback,\r
+ void *user_data);\r
int _ge_data_init(ge_ugdata* ugd);\r
int _ge_data_finalize(ge_ugdata* ugd);\r
\r
#include "gallery-efl.h"
+#define GE_FILE_EXISTS(path) \
+ (path && (1 == ecore_file_exists(path)) && (ecore_file_size(path) > 0))
+
ge_item* _ge_get_current_item(void);
void _ge_set_current_item(ge_item* gitem);
int ge_reg_db_update_noti(ge_ugdata* ugd);
ge_cluster* _ge_get_current_album(void);
void _ge_set_current_album(ge_cluster* album_item);
bool _ge_is_image_valid(void *data, char *filepath);
-int _ge_get_thumb(const char *file_path, char **thumb_path);
char *_ge_get_duration_string(unsigned int v_dur);
#endif /* _GE_EXT_EXEC_H_ */
return false;\r
}\r
\r
+/* Creates a thumbnail image for given the media, asynchronously */\r
+int _ge_data_create_thumb(ge_item *gitem, media_thumbnail_completed_cb callback,\r
+ void *user_data)\r
+{\r
+ GE_CHECK_VAL(gitem, -1);\r
+ GE_CHECK_VAL(gitem->item, -1);\r
+ GE_CHECK_VAL(gitem->item->media_h, -1);\r
+ int ret = -1;\r
+ ge_dbg("File[%s]", gitem->item->file_url);\r
+\r
+ ret = media_info_create_thumbnail(gitem->item->media_h, callback,\r
+ user_data);\r
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {\r
+ ge_dbgE("Failed to create thumbnail!");\r
+ return -1;\r
+ }\r
+ return 0;\r
+}\r
+\r
int _ge_data_init(ge_ugdata* ugd)\r
{\r
ge_dbg("Connect to DB!");\r
}
}
+static void __ge_grid_thumb_created_cb(media_content_error_e error,
+ const char *path, void *user_data)
+{
+ GE_CHECK(user_data);
+ ge_item *gitem = (ge_item *)user_data;
+ GE_CHECK(gitem->item);
+
+ if (GE_FILE_EXISTS(path)) {
+ ge_dbg("Update item with new thumb path[%s]", path);
+ /* Update thumb path */
+ if (gitem->item->thumb_url)
+ free(gitem->item->thumb_url);
+ gitem->item->thumb_url = strdup(path);
+ elm_gengrid_item_update(gitem->elm_item);
+ } else {
+ ge_dbgE("Invalid thumb path!");
+ }
+}
+
static Evas_Object *__ge_grid_get_content(void *data, Evas_Object *obj, const char *part)
{
GE_CHECK_NULL(data);
#endif
}
} else {
- int ret = -1;
- ret = _ge_get_thumb(gitem->item->file_url,
- &gitem->item->thumb_url);
/* Use default image */
- if (ret < 0)
- path = GE_DEFAULT_THUMB_ICON;
- else
+ if (GE_FILE_EXISTS(gitem->item->thumb_url)) {
path = gitem->item->thumb_url;
+ } else {
+ path = GE_DEFAULT_THUMB_ICON;
+ if (GE_FILE_EXISTS(gitem->item->file_url))
+ _ge_data_create_thumb(gitem,
+ __ge_grid_thumb_created_cb,
+ gitem);
+ }
}
if(gitem->item->type == MEDIA_CONTENT_TYPE_VIDEO){
#include <vconf.h>
#include <vconf-keys.h>
#include <errno.h>
-#include <media-thumbnail.h>
#include "ge-debug.h"
#include "ge-albums.h"
#include "ge-gridview.h"
return true;
}
-/* Fetch thumbnail from media-service, if it's invalid, generate new one */
-int _ge_get_thumb(const char *file_path, char **thumb_path)
-{
- GE_CHECK_VAL(thumb_path, -1);
- GE_CHECK_VAL(file_path, -1);
- /* Return if thumbnail is valid */
- if (*thumb_path && ecore_file_exists(*thumb_path) &&
- (ecore_file_size(*thumb_path) > 0)) {
- return 0;
- }
-
- /* Free allocated memory first */
- if (*thumb_path) {
- ge_dbgW("Wrong thumb path[%s]", *thumb_path);
- free(*thumb_path);
- *thumb_path = NULL;
- }
- ge_dbg("File[%s]", file_path);
-
- char *new_path = calloc(1, GE_FILE_PATH_LEN_MAX);
- GE_CHECK_VAL(new_path, -1);
-
- /* Generate thumbnail via thumbnail-service */
- int ret = -1;
- ret = thumbnail_request_from_db(file_path, new_path,
- GE_FILE_PATH_LEN_MAX);
- if (ret < 0) {
- ge_dbgE("thumbnail_request_from_db failed!");
- return -1;
- }
-
- *thumb_path = new_path;
- ge_dbg("Request thumbnail[%s]", new_path);
- return 0;
-}
-
/* Change int to char * of video duration, caller need to free the allocated memory */
char *_ge_get_duration_string(unsigned int v_dur)
{