int mp_util_svc_get_video_list_size_for_checking_index(void);
int mp_util_svc_get_number_of_video_item_by_type(void);
-void mp_util_svc_print_list_info(void);
-int mp_util_svc_find_video_item_index_by_url(const char *szPath);
char *mp_util_svc_get_video_id_by_index(const int nVideoItemIndex);
MpMediaStorageType mp_util_svc_get_video_storage(const int
nVideoItemIndex);
bool mp_util_svc_is_cloud_storage(const int nVideoItemIndex);
-int mp_util_svc_get_cloud_total_from_video_list(void);
bool mp_util_svc_remove_item_from_db_by_list_index(int nVideoItemIndex);
// For folder list
///////////////////////////////////////////////////////
// For livebox list
-bool mp_util_svc_extract_last_played_item(void);
bool mp_util_svc_destory_last_played_item_list(void);
-char *mp_util_svc_get_last_played_video_item_thumbnail(const int
- nVideoItemIndex);
-
////////////////////////////////////////////////////////
// Util
-bool mp_util_svc_insert_file_to_media_content_db(const char *szFilePath);
bool mp_util_svc_set_update_db_cb_func(UpdateDatabaseCbFunc
pUpdateDbCbFunc);
char *mp_util_svc_get_duration_str_time(int nVideoItemIndex);
bool mp_util_svc_filter_drm_video_item_list(void);
-bool mp_util_svc_check_no_drm_video(void);
bool mp_util_svc_scan_file(const char *szFilePath);
/*need to free szTitle, output nWidth, nHeight, szTitle, nDuration, nPlayedTime*/
int nSortType,
int nItemType,
int nViewType);
-bool mp_util_svc_check_valid_personal(int nViewType);
-int mp_util_svc_move_from_db(const char *path);
void mp_util_svc_move_to_db(const int nVideoItemIndex,
const char *szVideoPath);
bool mp_util_svc_remove_list_item_from_list(int nVideoItemIndex);
bool mp_util_svc_is_device_storage(const int nVideoItemIndex);
-bool mp_util_svc_is_personal_data(const int nVideoItemIndex);
//sort by
-void mp_util_svc_ctrl_sort_list(int SortType);
bool mp_util_svc_get_frame_by_position(const char *szFilePath,
const char *szDestImage,
int nPosition, int nWidth,
int nHeight);
-int mp_util_svc_get_wall_video_index(void *pInvalidList);
-
//used for check videoid and folderid
bool mp_util_svc_check_valid_media_id(char *pMediaId, int style,
int *nMediaIndex);
-bool mp_util_folder_is_cloud_storage(const int nFolderIndex);
-
#endif // _MP_UTIL_DATABASE_
return nNumberOfVideoItemByType;
}
-void mp_util_svc_print_list_info(void)
-{
- if (!VideoItemList) {
- VideoLogError("Not exist video item list handle.");
- return;
- }
-
- VideoLogInfo("List size : %d",
- mp_util_svc_get_number_of_video_item_by_type());
-
- media_info_h pVideoItem = NULL;
- Eina_List *pIterateList = NULL;
- int nCounter = 0;
- EINA_LIST_FOREACH(VideoItemList, pIterateList, pVideoItem) {
- if (pVideoItem) {
- char *szTitle = NULL;
- media_info_get_display_name(pVideoItem, &szTitle);
- if (szTitle) {
- VideoLogInfo("%d - Print title of all list items : %s",
- nCounter, szTitle);
- free(szTitle);
- } else {
- VideoLogInfo("%d - Print title of all list items : NULL.",
- nCounter);
- }
- nCounter++;
- }
- }
-}
-
-int mp_util_svc_find_video_item_index_by_url(const char *szPath)
-{
- if (!VideoItemList || !szPath) {
- VideoLogError("[ERR] No exist VideoItemList or szPath.");
- return 99999;
- }
-
- unsigned int nCounter = 0;
-
- Eina_List *pCurList = NULL;
- media_info_h pVideoItem = NULL;
-
- EINA_LIST_FOREACH(VideoItemList, pCurList, pVideoItem) {
- if (pVideoItem) {
- char *szUrl = NULL;
- media_info_get_file_path(pVideoItem, &szUrl);
- if (szUrl && szPath) {
- if (!g_strcmp0(szUrl, szPath)) {
- VideoSecureLogDebug("Find same file url. index : %d",
- nCounter);
- free(szUrl);
- return nCounter;
- }
- }
- MP_FREE_STRING(szUrl);
- }
-
- nCounter++;
- }
-
- return 99999;
-}
-
bool mp_util_svc_extract_video_folder_list_by_type(int nSortType,
int nItemType)
{
return FALSE;
}
-bool mp_util_folder_is_cloud_storage(const int nFolderIndex)
-{
- VideoLogInfo("disable cloud module.");
- return FALSE;
-}
-
-
-int mp_util_svc_get_cloud_total_from_video_list(void)
-{
- VideoLogInfo("disable cloud module.");
- return 0;
-}
-
-bool mp_util_svc_insert_file_to_media_content_db(const char *szFilePath)
-{
- if (!szFilePath) {
- VideoLogError("No existed file path.");
- return FALSE;
- }
-
- media_info_h info = NULL;
- int nRet = MEDIA_CONTENT_ERROR_NONE;
- nRet = media_info_insert_to_db(szFilePath, &info);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError
- ("Fail to insert a download file into media-content database. : %d",
- nRet);
- if (info) {
- media_info_destroy(info);
- info = NULL;
- }
- return FALSE;
- }
-
- if (info) {
- media_info_destroy(info);
- info = NULL;
- }
-
- return TRUE;
-}
-
void mp_util_svc_update_database_cb(media_content_error_e nError, int nPid,
media_content_db_update_item_type_e
nUpdateItem,
return TRUE;
}
-bool mp_util_svc_extract_last_played_item(void)
-{
- if (RecentPlayedItemList) {
- mp_util_svc_destory_last_played_item_list();
- }
-
- filter_h m_FilterHandle = NULL;
-
- if (media_filter_create(&m_FilterHandle) != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("Fail to create media filter handle.");
- return FALSE;
- }
-
- if (media_filter_set_condition
- (m_FilterHandle,
- "MEDIA_TYPE = 1 AND (MEDIA_STORAGE_TYPE=0 OR MEDIA_STORAGE_TYPE=1 OR MEDIA_STORAGE_TYPE=101 OR MEDIA_STORAGE_TYPE=121)",
- MEDIA_CONTENT_COLLATE_DEFAULT) != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("Fail to set filter condition.");
- media_filter_destroy(m_FilterHandle);
- return FALSE;
- }
-
- if (media_filter_set_order
- (m_FilterHandle, MEDIA_CONTENT_ORDER_DESC, MEDIA_LAST_PLAYED_TIME,
- MEDIA_CONTENT_COLLATE_DEFAULT) != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("Fail to set order.");
- media_filter_destroy(m_FilterHandle);
- return FALSE;
- }
-
- if (media_info_foreach_media_from_db
- (m_FilterHandle, mp_util_svc_iterate_for_last_played_video_item_cb,
- &RecentPlayedItemList) != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError
- ("Fail to get video item list with filter condition.");
- media_filter_destroy(m_FilterHandle);
- return FALSE;
- }
-
- if (media_filter_destroy(m_FilterHandle) != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("Fail to destroy media filter handle.");
- return FALSE;
- }
-
- return TRUE;
-}
-
bool mp_util_svc_destory_last_played_item_list(void)
{
if (!RecentPlayedItemList) {
return TRUE;
}
-char *mp_util_svc_get_last_played_video_item_thumbnail(const int
- nVideoItemIndex)
-{
- if (!RecentPlayedItemList) {
- VideoLogError("Not exist video item list handle.");
- return NULL;
- }
-
- if (nVideoItemIndex < 0
- || nVideoItemIndex > (int) eina_list_count(RecentPlayedItemList)) {
- VideoLogError("Error number of list item.");
- return NULL;
- }
-
- char *szVideoItemThumbnailPath = NULL;
- media_info_h pVideoItem =
- (media_info_h) eina_list_nth(RecentPlayedItemList,
- nVideoItemIndex);
-
- if (pVideoItem) {
- media_info_get_thumbnail_path(pVideoItem,
- &szVideoItemThumbnailPath);
- VideoSecureLogInfo("szVideoItemThumbnailFilePath : %s",
- szVideoItemThumbnailPath);
- }
-
- return szVideoItemThumbnailPath;
-}
-
char *mp_util_svc_get_duration_str_time(int nVideoItemIndex)
{
return TRUE;
}
-bool mp_util_svc_check_valid_personal(int nViewType)
-{
- bool bRet = FALSE;
- bool bDeviceVideo = FALSE;
- char *pVideoFile = NULL;
-
- int nVideoListSize = mp_util_svc_get_number_of_video_item_by_type();
- if ((nVideoListSize < 1) || (mp_util_get_personal_status() == FALSE)) {
- return FALSE;
- }
-
- int nIndex = 0;
- for (nIndex = 0; nIndex < nVideoListSize; nIndex++) {
-
- bDeviceVideo = mp_util_svc_is_device_storage(nIndex);
- if (!bDeviceVideo) {
- continue;
- }
- pVideoFile = mp_util_svc_get_video_url(nIndex);
- bRet =
- mp_util_check_video_personal_status((const char *) pVideoFile);
- MP_FREE_STRING(pVideoFile);
- if (nViewType == 0) {
- if (!bRet) {
- return TRUE;
- }
- } else {
- if (bRet) {
- return TRUE;
- }
- }
- }
- return FALSE;
-}
-
-int mp_util_svc_move_from_db(const char *path)
-{
- if (!path) {
- return -1;
- }
- int res = MEDIA_CONTENT_ERROR_NONE;
- res = media_content_scan_file(path);
- return res;
-}
-
-
void mp_util_svc_move_to_db(const int nVideoItemIndex,
const char *szVideoPath)
{
}
#endif
-#ifdef ENABLE_DRM_FEATURE
-bool mp_util_svc_check_no_drm_video(void)
-{
- if (!VideoItemList) {
- VideoLogError("VideoItemList is empty already.");
- return FALSE;
- }
- char *szVideoItemFilePath = NULL;
- media_info_h pVideoItem = NULL;
- Eina_List *pIterateList = NULL;
- bool bDRMLock = FALSE;
-
-
- EINA_LIST_FOREACH(VideoItemList, pIterateList, pVideoItem) {
- if (pVideoItem) {
- media_info_get_file_path(pVideoItem, &szVideoItemFilePath);
- if (szVideoItemFilePath) {
- mp_util_check_drm_lock((const char *) szVideoItemFilePath,
- &bDRMLock);
- free(szVideoItemFilePath);
- szVideoItemFilePath = NULL;
- }
- if (!bDRMLock) {
- return TRUE;
- }
- }
- }
-
- return FALSE;
-}
-#endif
-
bool mp_util_svc_is_device_storage(const int nVideoItemIndex)
{
MpMediaStorageType storage_type =
return FALSE;
}
-bool mp_util_svc_is_personal_data(const int nVideoItemIndex)
-{
- bool bPersonalVideo = FALSE;
- char *szPath = mp_util_svc_get_video_url(nVideoItemIndex);
- if (szPath) {
- bPersonalVideo = mp_util_check_video_personal_status(szPath);
- free(szPath);
- szPath = NULL;
- }
-
- return bPersonalVideo;
-}
-
bool mp_util_svc_scan_file(const char *szFilePath)
{
if (!szFilePath) {
return result;
}
-void mp_util_svc_ctrl_sort_list(int SortType)
-{
- if (!VideoItemList) {
- VideoLogWarning("VideoItemList is NULL.");
- return;
- }
-
- Eina_Compare_Cb sort_func = NULL;
-
- switch (SortType) {
- case MP_MEDIA_SORT_BY_RECENTLY_VIEWED:
- case MP_MEDIA_SORT_BY_RECENTLY_ADDED:
- case MP_MEDIA_SORT_BY_NAME:
- sort_func = __mp_util_svc_sort_by_name;
- break;
- case MP_MEDIA_SORT_BY_SIZE:
- sort_func = __mp_util_svc_sort_by_size;
- break;
- case MP_MEDIA_SORT_BY_TYPE:
- sort_func = __mp_util_svc_sort_by_type;
- break;
- default:
- sort_func = __mp_util_svc_sort_by_name;
- break;
- }
- int nVideoTotal = mp_util_svc_get_number_of_video_item_by_type();
- VideoLogWarning("nVideoTotal is %d.", nVideoTotal);
- VideoItemList = eina_list_sort(VideoItemList, nVideoTotal, sort_func);
-}
-
bool mp_util_svc_get_frame_by_position(const char *szFilePath,
const char *szDestImage,
int nPosition, int nWidth,
}
-int mp_util_svc_get_wall_video_index(void *pInvalidList)
-{
- return -1;
-}
-
bool mp_util_svc_check_valid_media_id(char *pMediaId, int style,
int *nMediaIndex)
{