media_info_h *pAssignFolderItem = (media_info_h *) pUserData;
if (pVideoItem != NULL) {
- char *szTmpStr = NULL;
media_info_clone(pAssignFolderItem, pVideoItem);
- media_info_get_display_name(*pAssignFolderItem, &szTmpStr);
- MP_FREE_STRING(szTmpStr);
}
return FALSE;
}
if (pVideoItem) {
+ int ret = media_info_generate_thumbnail(pVideoItem);
+ if( ret != MEDIA_CONTENT_ERROR_NONE) {
+ VideoLogError("Failed to generate thumbnail: [Error Code: %d]", ret);
+ }
media_info_get_thumbnail_path(pVideoItem, &szThumbnailPath);
- VideoSecureLogInfo("Video thumbnail file path : %s",
- szThumbnailPath);
+ VideoSecureLogInfo("Video thumbnail file path : %s", szThumbnailPath);
media_info_destroy(pVideoItem);
}
if (pVideoItem) {
media_info_get_file_path(pVideoItem, &szVideoItemFilePath);
- VideoSecureLogInfo("szVideoItemFilePath : %s",
- szVideoItemFilePath);
+ VideoSecureLogInfo("szVideoItemFilePath : %s", szVideoItemFilePath);
}
return szVideoItemFilePath;
char *mp_util_svc_get_video_thumbnail(const int nVideoItemIndex)
{
if (!VideoItemList) {
- VideoLogError("Not exist video item list handle.");
+ VideoLogError("Videolist is null");
return NULL;
}
- if (nVideoItemIndex < 0
- || nVideoItemIndex >=
- mp_util_svc_get_video_list_size_for_checking_index()) {
- VideoLogError("Error number of list item.");
+ if (nVideoItemIndex < 0 || nVideoItemIndex >= mp_util_svc_get_video_list_size_for_checking_index()) {
+ VideoLogError("Index is invalid: [index: %d]", nVideoItemIndex);
return NULL;
}
char *szVideoItemThumbnailPath = NULL;
- media_info_h pVideoItem =
- (media_info_h) eina_list_nth(VideoItemList, nVideoItemIndex);
+ media_info_h pVideoItem = (media_info_h) eina_list_nth(VideoItemList, nVideoItemIndex);
if (pVideoItem) {
- media_info_get_thumbnail_path(pVideoItem,
- &szVideoItemThumbnailPath);
+ // this will only create thumbnail , when it is not created already
+ int ret = media_info_generate_thumbnail(pVideoItem);
+ if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ VideoLogError("Failed to generate thumbanil: [Error Code: %d]", ret);
+ }
+ media_info_get_thumbnail_path(pVideoItem, &szVideoItemThumbnailPath);
}
-
- VideoSecureLogInfo("pThumbIconUri = %s", szVideoItemThumbnailPath);
-
return szVideoItemThumbnailPath;
}
media_info_h pVideoItem = (media_info_h) eina_list_nth(VideoItemList, nVideoItemIndex);
if ( media_info_generate_thumbnail(pVideoItem) != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogWarning("media_info_generate_thumbnail Failed");
+ VideoLogWarning("media_info_generate_thumbnail failed");
}
}
return;
}
- media_info_h pVideoItem =
- (media_info_h) eina_list_nth(VideoItemList, nVideoItemIndex);
+ media_info_h pVideoItem = (media_info_h) eina_list_nth(VideoItemList, nVideoItemIndex);
- if (media_info_create_thumbnail
+ /// callback of media_info_create_thumbnail cause crash in application so
+ /// we have update this with sync thumbnail generation function "media_info_generate_thumbnail"
+ /// "media_info_create_thumbnail" is a marked deprecated function in tizen 5.0.
+ /// this function is not used in any active part of application now.
+ /*if (media_info_create_thumbnail
(pVideoItem, pUserCallbackFunc,
pUserData) != MEDIA_CONTENT_ERROR_NONE) {
VideoLogWarning("media_info_create_thumbnail is Fail");
+ }*/
+
+ int ret = media_info_generate_thumbnail(pVideoItem);
+ if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ VideoLogError("Failed to generate thumbnail");
+ }
+ media_thumbnail_completed_cb completed_cb = (media_thumbnail_completed_cb)pUserCallbackFunc;
+ if(completed_cb) {
+ char *path = NULL;
+ media_info_get_thumbnail_path(pVideoItem, &path);
+ completed_cb(ret, path, pUserData);
+ MP_FREE_STRING(path);
}
}
}
}
-void mp_util_svc_update_video_item(char *mediaUrl, int nVideoItemIndex)
-{
- if (!VideoItemList) {
- VideoLogError("Not exist video item list handle.");
- return;
- }
-
- char *szMediaUri = strdup(mediaUrl);
-
- if (!szMediaUri) {
- VideoLogError("No exist video path.");
- return;
- }
-
- VideoSecureLogInfo("szMediaUri : %s", szMediaUri);
-
- media_info_h pUpdatedVideoItem = NULL;
- filter_h m_FilterHandle = NULL;
- char szTmpStr[STR_LEN_MAX] = { 0, };
-
- if (media_filter_create(&m_FilterHandle) != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogInfo("Fail to create media filter handle.");
- return;
- }
-
- memset(szTmpStr, 0, STR_LEN_MAX);
- snprintf(szTmpStr, STR_LEN_MAX,
- "MEDIA_TYPE = 1 AND (MEDIA_STORAGE_TYPE=0 OR MEDIA_STORAGE_TYPE=1 OR MEDIA_STORAGE_TYPE=2 OR MEDIA_STORAGE_TYPE=101 OR MEDIA_STORAGE_TYPE=121) AND MEDIA_PATH = \"%s\"",
- szMediaUri);
- if (media_filter_set_condition
- (m_FilterHandle, szTmpStr,
- MEDIA_CONTENT_COLLATE_DEFAULT) != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("Fail to set filter condition.");
- media_filter_destroy(m_FilterHandle);
- if (szMediaUri) {
- free(szMediaUri);
- szMediaUri = NULL;
- }
- return;
- }
-
- if (media_info_foreach_media_from_db
- (m_FilterHandle, mp_util_svc_iterate_for_get_video_item_cb,
- &pUpdatedVideoItem) != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError
- ("Fail to get video item list with filter condition.");
- media_filter_destroy(m_FilterHandle);
- if (szMediaUri) {
- free(szMediaUri);
- szMediaUri = NULL;
- }
- return;
- }
-
- if (media_filter_destroy(m_FilterHandle) != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("Fail to destroy media filter handle.");
- if (szMediaUri) {
- free(szMediaUri);
- szMediaUri = NULL;
- }
- return;
- }
-
- if (pUpdatedVideoItem) {
- char *szTmpStr = NULL;
- media_info_get_thumbnail_path(pUpdatedVideoItem, &szTmpStr);
- VideoSecureLogDebug("pUpdatedVideoItem - thumbnail path : %s",
- szTmpStr);
- if (szTmpStr) {
- free(szTmpStr);
- szTmpStr = NULL;
- }
-
- media_info_get_display_name(pUpdatedVideoItem, &szTmpStr);
- VideoSecureLogDebug("pUpdatedVideoItem - title : %s", szTmpStr);
- if (szTmpStr) {
- free(szTmpStr);
- szTmpStr = NULL;
- }
-
- int nCounter = 0;
- Eina_List *pCurList = NULL;
- media_info_h pTmpVideoItem = NULL;
- EINA_LIST_FOREACH(VideoItemList, pCurList, pTmpVideoItem) {
- if (nCounter == nVideoItemIndex) {
- VideoLogError("nCounter : %d", nCounter);
- if (pTmpVideoItem) {
- media_info_destroy(pTmpVideoItem);
- }
- pCurList->data = pUpdatedVideoItem;
- break;
- }
- ++nCounter;
- }
- } else {
- VideoLogError("Fail to get video item from db..");
- }
-
- if (szMediaUri) {
- free(szMediaUri);
- szMediaUri = NULL;
- }
-}
-
/**
* Update thumbnail info to DB
* @param nVideoItemIndex : index of the video
(media_info_h) eina_list_nth(VideoItemList, nVideoItemIndex);
if (pVideoItem) {
- if (media_info_move_to_db(pVideoItem, szVideoPath) !=
- MEDIA_CONTENT_ERROR_NONE) {
+ if (media_info_move_to_db(pVideoItem, szVideoPath) !=MEDIA_CONTENT_ERROR_NONE) {
VideoLogError("Failed move to db");
}
}
elm_object_item_signal_emit(item_data->item, "elm,state,progess,show", "elm");
// Add progess bar
Evas_Object *progessbar = elm_layout_add(pObject);
- Eina_Bool ret = elm_layout_file_set(progessbar, edj_path, "videolist/progressbar");
- VideoLogInfo("layout file set %s %s",(ret? "Successful": "Failed"), pPart);
+ elm_layout_file_set(progessbar, edj_path, "videolist/progressbar");
evas_object_size_hint_weight_set(progessbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(progessbar, EVAS_HINT_FILL, EVAS_HINT_FILL);
edje_object_part_drag_value_set(elm_layout_edje_get(progessbar), "elm.cur.progressbar", 0.0, 0.0);
free(res_path);
Evas_Object *layout = elm_layout_add(parent);
- Eina_Bool ret = elm_layout_file_set(layout, path, "remove_view/title_content");
- VideoLogInfo("Layout File Set: %s", ret?"Successful": "Failed");
+ elm_layout_file_set(layout, path, "remove_view/title_content");
//evas_object_size_hint_min_set(layout, 372, 48);
elm_object_domain_part_text_translatable_set(layout, "cancel_text", VIDEOS_STRING, EINA_TRUE);
elm_object_item_signal_emit(item_data->item, "elm,state,progess,show", "elm");
// Add progess bar
Evas_Object *progessbar = elm_layout_add(pObject);
- Eina_Bool ret = elm_layout_file_set(progessbar, edj_path, "videolist/progressbar");
- VideoLogInfo("layout file set %s %s",(ret? "Successful": "Failed"), pPart);
+ elm_layout_file_set(progessbar, edj_path, "videolist/progressbar");
evas_object_size_hint_weight_set(progessbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(progessbar, EVAS_HINT_FILL, EVAS_HINT_FILL);
edje_object_part_drag_value_set(elm_layout_edje_get(progessbar), "elm.cur.progressbar", 0.0, 0.0);
free(res_path);
Evas_Object *layout = elm_layout_add(parent);
- Eina_Bool ret = elm_layout_file_set(layout, path, "remove_view/title_content");
- VideoLogInfo("Layout File Set: %s", ret?"Successful": "Failed");
+ elm_layout_file_set(layout, path, "remove_view/title_content");
//evas_object_size_hint_min_set(layout, 372, 48);
elm_object_domain_part_text_translatable_set(layout, "cancel_text", VIDEOS_STRING, EINA_TRUE);
}
vp_share_view_update_share_panel();
- stGengridItemData *item_data = elm_object_item_data_get((Elm_Object_Item *) pEventInfo);
- int nVideoItemIndex = item_data->videoIndex;
- VideoLogInfo("Select nVideoItemIndex: %d", nVideoItemIndex);
-
- if (nVideoItemIndex < 0 || nVideoItemIndex >= mp_util_svc_get_video_list_size_for_checking_index()) {
- VideoSecureLogError("nVideoItemIndex is invalid = %d", nVideoItemIndex);
- return;
- }
-
- int nVideoListSize = mp_util_svc_get_number_of_video_item_by_type();
- char *pThumbIconUri = mp_util_svc_get_video_thumbnail(nVideoItemIndex);
- VideoSecureLogInfo("pThumbIconUri = %s:%d", pThumbIconUri, nVideoItemIndex);
-
- if (!pThumbIconUri) {
- if (nVideoItemIndex < nVideoListSize - 1) {
- mp_util_svc_register_thumbnail_update_func(nVideoItemIndex, __mp_thumbnail_view_update_empty_cb, (void *)item_data);
- } else {
- mp_util_svc_register_thumbnail_update_func(nVideoItemIndex, (void *)__mp_thumbnail_view_update_cb, (void *)item_data);
- }
- } else {
- free(pThumbIconUri);
- pThumbIconUri = NULL;
- }
}
/**
// Add progess bar
Evas_Object *progessbar = elm_layout_add(pObject);
- Eina_Bool ret = elm_layout_file_set(progessbar, edj_path, "videolist/progressbar");
- VideoLogInfo("layout file set %s %s",(ret? "Successful": "Failed"), pPart);
+ elm_layout_file_set(progessbar, edj_path, "videolist/progressbar");
evas_object_size_hint_weight_set(progessbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(progessbar, EVAS_HINT_FILL, EVAS_HINT_FILL);
edje_object_part_drag_value_set(elm_layout_edje_get(progessbar), "elm.cur.progressbar", 0.0, 0.0);