bool mp_util_svc_get_video_id_by_video_url(const char *szPath,
char **szVideoID);
char *mp_util_svc_get_video_Thumbnail_by_video_url(const char *szMediaUri);
-unsigned int mp_util_svc_get_video_last_play_time_by_video_url(const char
- *szPath);
void mp_util_svc_set_video_last_played_time_by_url(char *szMediaUri,
unsigned int nPosition);
char *mp_util_svc_get_video_thumbnail(const int nVideoItemIndex);
char *mp_util_svc_get_video_title(const int nVideoItemIndex);
int mp_util_svc_get_video_duration_time(const int nVideoItemIndex);
-int mp_util_svc_get_video_last_played_pos(const int nVideoItemIndex);
unsigned long long mp_util_svc_get_video_item_size(const int
nVideoItemIndex);
bool vp_media_contents_update_db(const char *szMediaURL);
bool vp_media_contents_refresh_db(const char *szMediaID);
-bool vp_media_contents_set_played_position(const char *szFilePath,
- int nPosition);
-bool vp_media_contents_get_played_position(const char *szFilePath,
- int *nPosition);
-bool vp_media_contents_set_played_time(const char *szFilePath);
-
bool vp_media_contents_get_content_info(const char *szFilePath,
char **szTitle, int *nWidth,
int *nHeight, int *nDuration,
/**
*
- * @param szFilePath
- * @return
- */
-bool vp_media_contents_set_played_time(const char *szFilePath)
-{
- if (szFilePath == NULL) {
- VideoLogError("szFilePath is NULL");
- return FALSE;
- }
-
- vp_media_contents_connect();
-
- media_info_h pMediaHandle = NULL;
- filter_h pFilterHandle = NULL;
- video_meta_h pVideoHandle = NULL;
-
- int nRet = MEDIA_CONTENT_ERROR_NONE;
-
- char szTmpStr[4096] = { 0, };
- snprintf(szTmpStr, 4096,
- "MEDIA_TYPE = 1 AND (MEDIA_STORAGE_TYPE=0 OR MEDIA_STORAGE_TYPE=1 OR MEDIA_STORAGE_TYPE=101) AND MEDIA_PATH = \"%s\"",
- szFilePath);
-
- nRet = media_filter_create(&pFilterHandle);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("media_filter_create is fail : 0x%x", nRet);
- goto Exception;
- }
-
- if (pFilterHandle == NULL) {
- VideoLogError("Filter handle is NULL");
- goto Exception;
- }
-
- nRet =
- media_filter_set_condition(pFilterHandle, szTmpStr,
- MEDIA_CONTENT_COLLATE_DEFAULT);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("media_filter_set_condition is fail : 0x%x", nRet);
- goto Exception;
- }
-
- nRet =
- media_info_foreach_media_from_db(pFilterHandle,
- __vp_media_contents_info_cb,
- &pMediaHandle);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("media_info_foreach_media_from_db is fail : 0x%x",
- nRet);
- goto Exception;
- }
-
- if (pMediaHandle == NULL) {
- VideoLogError("media info handle is NULL");
- goto Exception;
- }
-
- nRet = media_info_get_video(pMediaHandle, &pVideoHandle);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("media_info_get_video is fail : 0x%x", nRet);
- goto Exception;
- }
-
- if (pVideoHandle == NULL) {
- VideoLogError("media info handle is NULL");
- goto Exception;
- }
-
- time_t tNowTime = 0;
- time(&tNowTime);
-
- nRet = video_meta_set_played_time(pVideoHandle, tNowTime);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError(" video_meta_set_played_time is fail : 0x%x", nRet);
- goto Exception;
- }
-
- nRet = video_meta_update_to_db(pVideoHandle);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("video_meta_update_to_db is fail : 0x%x", nRet);
- goto Exception;
- }
-
- nRet = video_meta_destroy(pVideoHandle);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("video_meta_destroy is fail : 0x%x", nRet);
- goto Exception;
- }
-
- nRet = media_info_destroy(pMediaHandle);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("media_info_destroy is fail : 0x%x", nRet);
- goto Exception;
- }
-
- nRet = media_filter_destroy(pFilterHandle);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("media_filter_destroy is fail : 0x%x", nRet);
- goto Exception;
- }
-
- return TRUE;
-
- Exception:
-
- if (pFilterHandle) {
- media_filter_destroy(pFilterHandle);
- pFilterHandle = NULL;
- }
-
- if (pMediaHandle) {
- media_info_destroy(pMediaHandle);
- pMediaHandle = NULL;
- }
-
- if (pVideoHandle) {
- video_meta_destroy(pVideoHandle);
- pVideoHandle = NULL;
- }
- return FALSE;
-}
-
-/**
- *
- * @param szFilePath
- * @param nPosition
- * @return
- */
-bool vp_media_contents_set_played_position(const char *szFilePath,
- int nPosition)
-{
- if (szFilePath == NULL) {
- VideoLogError("szFilePath is NULL");
- return FALSE;
- }
-
- vp_media_contents_connect();
-
- media_info_h pMediaHandle = NULL;
- filter_h pFilterHandle = NULL;
- video_meta_h pVideoHandle = NULL;
-
- int nRet = MEDIA_CONTENT_ERROR_NONE;
-
- char szTmpStr[4096] = { 0, };
- snprintf(szTmpStr, 4096,
- "MEDIA_TYPE = 1 AND (MEDIA_STORAGE_TYPE=0 OR MEDIA_STORAGE_TYPE=1 OR MEDIA_STORAGE_TYPE=101) AND MEDIA_PATH = \"%s\"",
- szFilePath);
-
- nRet = media_filter_create(&pFilterHandle);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("media_filter_create is fail : 0x%x", nRet);
- goto Exception;
- }
-
- if (pFilterHandle == NULL) {
- VideoLogError("Filter handle is NULL");
- goto Exception;
- }
-
- nRet =
- media_filter_set_condition(pFilterHandle, szTmpStr,
- MEDIA_CONTENT_COLLATE_DEFAULT);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("media_filter_set_condition is fail : 0x%x", nRet);
- goto Exception;
- }
-
- nRet =
- media_info_foreach_media_from_db(pFilterHandle,
- __vp_media_contents_info_cb,
- &pMediaHandle);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("media_info_foreach_media_from_db is fail : 0x%x",
- nRet);
- goto Exception;
- }
-
- if (pMediaHandle == NULL) {
- VideoLogError("media info handle is NULL");
- goto Exception;
- }
-
- nRet = media_info_get_video(pMediaHandle, &pVideoHandle);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("media_info_get_video is fail : 0x%x", nRet);
- goto Exception;
- }
-
- if (pVideoHandle == NULL) {
- VideoLogError("media info handle is NULL");
- goto Exception;
- }
-
- nRet = video_meta_set_played_position(pVideoHandle, nPosition);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError(" video_meta_set_played_position is fail : 0x%x",
- nRet);
- goto Exception;
- }
-
- nRet = video_meta_update_to_db(pVideoHandle);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("video_meta_update_to_db is fail : 0x%x", nRet);
- goto Exception;
- }
-
- nRet = video_meta_destroy(pVideoHandle);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("video_meta_destroy is fail : 0x%x", nRet);
- goto Exception;
- }
-
- nRet = media_info_destroy(pMediaHandle);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("media_info_destroy is fail : 0x%x", nRet);
- goto Exception;
- }
-
- nRet = media_filter_destroy(pFilterHandle);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("media_filter_destroy is fail : 0x%x", nRet);
- goto Exception;
- }
-
- return TRUE;
-
- Exception:
-
- if (pFilterHandle) {
- media_filter_destroy(pFilterHandle);
- pFilterHandle = NULL;
- }
-
- if (pMediaHandle) {
- media_info_destroy(pMediaHandle);
- pMediaHandle = NULL;
- }
-
- if (pVideoHandle) {
- video_meta_destroy(pVideoHandle);
- pVideoHandle = NULL;
- }
- return FALSE;
-}
-
-/**
- *
- * @param szFilePath
- * @param nPosition
- * @return
- */
-bool vp_media_contents_get_played_position(const char *szFilePath,
- int *nPosition)
-{
- if (szFilePath == NULL) {
- VideoLogError("szFilePath is NULL");
- return FALSE;
- }
-
- vp_media_contents_connect();
-
- media_info_h pMediaHandle = NULL;
- filter_h pFilterHandle = NULL;
- video_meta_h pVideoHandle = NULL;
-
- int nRet = MEDIA_CONTENT_ERROR_NONE;
-
- char szTmpStr[4096] = { 0, };
- snprintf(szTmpStr, 4096,
- "MEDIA_TYPE = 1 AND (MEDIA_STORAGE_TYPE=0 OR MEDIA_STORAGE_TYPE=1 OR MEDIA_STORAGE_TYPE=101) AND MEDIA_PATH = \"%s\"",
- szFilePath);
-
- nRet = media_filter_create(&pFilterHandle);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("media_filter_create is fail : 0x%x", nRet);
- goto Exception;
- }
-
- if (pFilterHandle == NULL) {
- VideoLogError("Filter handle is NULL");
- goto Exception;
- }
-
- nRet =
- media_filter_set_condition(pFilterHandle, szTmpStr,
- MEDIA_CONTENT_COLLATE_DEFAULT);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("media_filter_set_condition is fail : 0x%x", nRet);
- goto Exception;
- }
-
- nRet =
- media_info_foreach_media_from_db(pFilterHandle,
- __vp_media_contents_info_cb,
- &pMediaHandle);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("media_info_foreach_media_from_db is fail : 0x%x",
- nRet);
- goto Exception;
- }
-
- if (pMediaHandle == NULL) {
- VideoLogError("media info handle is NULL");
- goto Exception;
- }
-
- nRet = media_info_get_video(pMediaHandle, &pVideoHandle);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("media_info_get_video is fail : 0x%x", nRet);
- goto Exception;
- }
-
- if (pVideoHandle == NULL) {
- VideoLogError("media info handle is NULL");
- goto Exception;
- }
-
- nRet = video_meta_get_played_position(pVideoHandle, nPosition);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("video_meta_get_played_position is fail : 0x%x",
- nRet);
- goto Exception;
- }
-
- nRet = video_meta_destroy(pVideoHandle);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("video_meta_destroy is fail : 0x%x", nRet);
- goto Exception;
- }
-
- nRet = media_info_destroy(pMediaHandle);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("media_info_destroy is fail : 0x%x", nRet);
- goto Exception;
- }
-
- nRet = media_filter_destroy(pFilterHandle);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("media_filter_destroy is fail : 0x%x", nRet);
- goto Exception;
- }
-
- return TRUE;
-
- Exception:
-
- if (pFilterHandle) {
- media_filter_destroy(pFilterHandle);
- pFilterHandle = NULL;
- }
-
- if (pMediaHandle) {
- media_info_destroy(pMediaHandle);
- pMediaHandle = NULL;
- }
-
- if (pVideoHandle) {
- video_meta_destroy(pVideoHandle);
- pVideoHandle = NULL;
- }
- return FALSE;
-
-
-}
-
-/**
- *
* @param pMediaHandle
* @param szLastModified
* @return
VP_EVAS_DEL(pNormalView->pFlickJumpSeek);
#endif
- if (pNormalView->nLaunchingType != VIDEO_PLAY_TYPE_WEB &&
- pNormalView->nLaunchingType != VIDEO_PLAY_TYPE_PREVIEW &&
- pNormalView->nLaunchingType != VIDEO_PLAY_TYPE_MESSAGE &&
- pNormalView->nLaunchingType != VIDEO_PLAY_TYPE_EMAIL &&
- pNormalView->nLaunchingType != VIDEO_PLAY_TYPE_MULTI_PATH) {
- vp_media_contents_set_played_position(pNormalView->szMediaURL, 0);
- } else if (pNormalView->nLaunchingType == VIDEO_PLAY_TYPE_MULTI_PATH) {
+ if (pNormalView->nLaunchingType == VIDEO_PLAY_TYPE_MULTI_PATH) {
vp_multi_path_set_item_position(pNormalView->szMediaURL, 0,
pPlayView->pMultiPathList);
}
if (pNormalView->nLaunchingType == VIDEO_PLAY_TYPE_STORE ||
pNormalView->nLaunchingType == VIDEO_PLAY_TYPE_LIST ||
pNormalView->nLaunchingType == VIDEO_PLAY_TYPE_OTHER) {
- int nStartPos = 0;
- if (vp_media_contents_get_played_position
- (pNormalView->szMediaURL, &nStartPos)) {
- pNormalView->nStartPosition = nStartPos;
- }
+ pNormalView->nStartPosition = 0;
}
}
- if (pNormalView->nLaunchingType == VIDEO_PLAY_TYPE_STORE ||
- pNormalView->nLaunchingType == VIDEO_PLAY_TYPE_LIST ||
- pNormalView->nLaunchingType == VIDEO_PLAY_TYPE_OTHER) {
- vp_media_contents_set_played_time(pNormalView->szMediaURL);
- }
-
vp_play_subtitle_set_text(pNormalView->pSubtitle, NULL);
if (bCheckDRM) {
if (!vp_mm_player_get_position
(pNormalView->pPlayerHandle, &nPosition)) {
VideoLogError("vp_mm_player_get_position is fail");
- } else {
- if (nPosition == pNormalView->nDuration) {
- vp_media_contents_set_played_position(pNormalView->
- szMediaURL, 0);
-
- } else {
- vp_mm_player_state_t nState = VP_MM_PLAYER_STATE_NONE;
- if (!vp_mm_player_get_state
- (pNormalView->pPlayerHandle, &nState)) {
- VideoLogWarning("vp_mm_player_get_state is fail");
- }
-
- if (nState == VP_MM_PLAYER_STATE_PLAYING) {
- nPosition -= 5000;
- }
-
- if (nPosition < 0) {
- nPosition = 0;
- }
- vp_media_contents_set_played_position(pNormalView->
- szMediaURL,
- nPosition);
- }
}
} else if (pNormalView->nLaunchingType == VIDEO_PLAY_TYPE_MULTI_PATH) {
if (!vp_mm_player_get_position
}
/**
-* Get last played time of a video
-* @param szPath : path of video
-* @return last played time
-*/
-unsigned int mp_util_svc_get_video_last_play_time_by_video_url(const char
- *szPath)
-{
- if (!szPath) {
- VideoLogError("No exist video path.");
- return 0;
- }
-
- VideoLogInfo("szPath : %s", szPath);
-
- int nLastPlayedTime = 0;
- media_info_h pVideoItem = NULL;
- filter_h m_FilterHandle = NULL;
- char szTmpStr[STR_LEN_MAX] = { 0, };
-
- if (media_filter_create(&m_FilterHandle) != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogError("Fail to create media filter handle.");
- return FALSE;
- }
-
- snprintf(szTmpStr, STR_LEN_MAX,
- "MEDIA_TYPE = 1 AND (MEDIA_STORAGE_TYPE=0 OR MEDIA_STORAGE_TYPE=1 OR MEDIA_STORAGE_TYPE=101 OR MEDIA_STORAGE_TYPE=121) AND MEDIA_PATH = \"%s\"",
- szPath);
- 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);
- return FALSE;
- }
-
- if (media_info_foreach_media_from_db
- (m_FilterHandle, mp_util_svc_iterate_for_get_video_item_cb,
- &pVideoItem) != 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;
- }
-
- if (pVideoItem) {
- video_meta_h pVideoMetaHandle = NULL;
- if (media_info_get_video(pVideoItem, &pVideoMetaHandle) ==
- MEDIA_CONTENT_ERROR_NONE) {
- video_meta_get_played_position(pVideoMetaHandle,
- &nLastPlayedTime);
- VideoLogInfo("Last Played Time : %d", nLastPlayedTime);
- video_meta_destroy(pVideoMetaHandle);
- }
- media_info_destroy(pVideoItem);
- }
-
- return (unsigned int) nLastPlayedTime;
-}
-
-/**
* Get thumbnail of the video with specified url
* @param szMediaUri : path of video
* @return thumbnail path
VideoLogError("Fail to get pVideoMetaHandle.");
} else {
if (pVideoMetaHandle) {
- video_meta_set_played_position(pVideoMetaHandle,
- nLastPlayedTime);
video_meta_update_to_db(pVideoMetaHandle);
video_meta_destroy(pVideoMetaHandle);
} else {
}
/**
-* Get last played position
-* @param nVideoItemIndex : index of the video
-* @return last played position
-*/
-int mp_util_svc_get_video_last_played_pos(const int nVideoItemIndex)
-{
- if (!VideoItemList) {
- VideoLogError("Not exist video item list handle.");
- return 0;
- }
-
- int nLastPlayedTime = 0;
- media_info_h pVideoItem =
- (media_info_h) eina_list_nth(VideoItemList, nVideoItemIndex);
-
- if (pVideoItem) {
- video_meta_h pVideoMetaHandle = NULL;
- if (media_info_get_video(pVideoItem, &pVideoMetaHandle) ==
- MEDIA_CONTENT_ERROR_NONE) {
- video_meta_get_played_position(pVideoMetaHandle,
- &nLastPlayedTime);
-
- VideoLogInfo("nIndexGenlist : %d==%d", nLastPlayedTime,
- nVideoItemIndex);
- video_meta_destroy(pVideoMetaHandle);
- }
- }
-
- return (int) nLastPlayedTime;
-}
-
-/**
* Get video item size
* @param nVideoItemIndex : index of the video
* @return video file size
if (media_info_get_video(pVideoItem, &pVideoMetaHandle) ==
MEDIA_CONTENT_ERROR_NONE) {
//last played time
- int nLastPlayedTime = 0;
- video_meta_get_played_position(pVideoMetaHandle,
- &nLastPlayedTime);
- *nPlayedTime = (unsigned int) nLastPlayedTime;
+ *nPlayedTime = 0;
//Duratiom time
int duration = 0;
VideoLogError("Cannot get call list information for the sim");
return TRUE;
}
-
- ret = telephony_call_get_status(*call_list_sim, &status);
- if (ret != TELEPHONY_ERROR_NONE) {
- VideoLogError("getting call status failed");
- return TRUE;
+ if (call_list_sim) {
+ ret = telephony_call_get_status(*call_list_sim, &status);
+ if (ret != TELEPHONY_ERROR_NONE) {
+ VideoLogError("getting call status failed");
+ return TRUE;
+ }
}
VideoLogDebug("call status = %d", status);
return NULL;
}
- char *szVideoID = NULL;
char *szFileName = NULL;
- int nPosition = 0;
-
- nPosition =
- mp_util_svc_get_video_last_play_time_by_video_url(szFilePath);
- if (nPosition == 0) {
- szFileName =
- mp_util_svc_get_video_Thumbnail_by_video_url(szFilePath);
- return szFileName;
- }
-
- if (!mp_util_svc_get_video_id_by_video_url(szFilePath, &szVideoID)) {
- VideoLogError("mp_util_svc_get_video_id_by_video_url is Fail");
- MP_FREE_STRING(szVideoID);
- szFileName =
- mp_util_svc_get_video_Thumbnail_by_video_url(szFilePath);
- return szFileName;
- }
szFileName =
- g_strdup_printf("%s/%s.jpg", VIDEO_THUMB_DATA_DIR, szVideoID);
- if (!vp_file_exists(szFileName)) {
- MP_FREE_STRING(szVideoID);
- MP_FREE_STRING(szFileName);
- szFileName =
- mp_util_svc_get_video_Thumbnail_by_video_url(szFilePath);
- return szFileName;
- }
-
- MP_FREE_STRING(szVideoID);
-
+ mp_util_svc_get_video_Thumbnail_by_video_url(szFilePath);
return szFileName;
}
#include <metadata_extractor.h>
+#include <stdlib.h>
#include <mime_type.h>
#include <unicode/utmscale.h>
unsigned int nVideoInfoDuration =
mp_util_svc_get_video_duration_time(nVideoItemIndex);
- unsigned int nVideoInfoLastTime =
- mp_util_svc_get_video_last_played_pos(nVideoItemIndex);
+ unsigned int nVideoInfoLastTime = 0;
mp_util_convert_time(nVideoInfoDuration, szTmpStrDurationTime, FALSE);
mp_util_convert_time(nVideoInfoLastTime, szTmpStrLastPlayedPos, TRUE);
return pBg;
} else if (!strcmp(pPart, "elm.progressbar.icon")) {
- int nLastPlayedTime =
- mp_util_svc_get_video_last_played_pos(nVideoItemIndex);
- int nDurationTime =
- mp_util_svc_get_video_duration_time(nVideoItemIndex);
-
- if (nLastPlayedTime <= 0) {
return NULL;
- }
-
- double nRatio = 0.0;
-
- if (nDurationTime > 0) {
- nRatio = ((double) nLastPlayedTime) / ((double) nDurationTime);
- }
-
- if (nRatio < 0.05) {
- nRatio = 0.05;
- }
-
- Evas_Object *pProgressBar = elm_progressbar_add(pObject);
- elm_object_style_set(pProgressBar, "video/list_progress");
- elm_progressbar_horizontal_set(pProgressBar, EINA_TRUE);
- evas_object_size_hint_align_set(pProgressBar, EVAS_HINT_FILL,
- EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(pProgressBar, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- elm_progressbar_value_set(pProgressBar, nRatio);
- evas_object_show(pProgressBar);
-
- return pProgressBar;
} else if (!strcmp(pPart, "elm.lock.icon")) {
char *pVideoFile = mp_util_svc_get_video_url(nVideoItemIndex);
bool bRet = mp_util_check_video_personal_status((const char *)
unsigned int nVideoInfoDuration =
mp_util_svc_get_video_duration_time(nVideoItemIndex);
- unsigned int nVideoInfoLastTime =
- mp_util_svc_get_video_last_played_pos(nVideoItemIndex);
+ unsigned int nVideoInfoLastTime = 0;
mp_util_convert_time(nVideoInfoDuration, szTmpStrDurationTime, FALSE);
mp_util_convert_time(nVideoInfoLastTime, szTmpStrLastPlayedPos, TRUE);
return pBg;
} else if (!strcmp(pPart, "elm.progressbar.icon")) {
- int nLastPlayedTime =
- mp_util_svc_get_video_last_played_pos(nVideoItemIndex);
- int nDurationTime =
- mp_util_svc_get_video_duration_time(nVideoItemIndex);
-
- if (nLastPlayedTime <= 0) {
- return NULL;
- }
-
- double nRatio = 0.0;
- if (nDurationTime > 0) {
- nRatio = ((double) nLastPlayedTime) / ((double) nDurationTime);
- }
-
- if (nRatio < 0.05) {
- nRatio = 0.05;
- }
-
- Evas_Object *pProgressBar = elm_progressbar_add(pObject);
- elm_object_style_set(pProgressBar, "video/list_progress");
- elm_progressbar_horizontal_set(pProgressBar, EINA_TRUE);
- evas_object_size_hint_align_set(pProgressBar, EVAS_HINT_FILL,
- EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(pProgressBar, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- elm_progressbar_value_set(pProgressBar, nRatio);
- evas_object_show(pProgressBar);
-
- return pProgressBar;
+ return NULL;
} else if (!strcmp(pPart, "elm.lock.icon")) {
char *pVideoFile = mp_util_svc_get_video_url(nVideoItemIndex);
bool bRet =
MP_FREE_STRING(pThumbIconUri);
- int nLastPlayedTime =
- mp_util_svc_get_video_last_played_pos(nVideoItemIndex);
- int nDurationTime =
- mp_util_svc_get_video_duration_time(nVideoItemIndex);
-
- if (nLastPlayedTime > 0) {
- double nRatio = 0.0;
-
- if (nDurationTime > 0) {
- nRatio = ((double) nLastPlayedTime) /
- ((double) nDurationTime);
- }
-
- if (nRatio < 0.05) {
- nRatio = 0.05;
- }
-
- Evas_Object *pProgressBar = elm_progressbar_add(pLayout);
- elm_object_style_set(pProgressBar,
- "elm/progressbar/horizontal/default");
- elm_progressbar_horizontal_set(pProgressBar, EINA_TRUE);
- elm_progressbar_span_size_set(pProgressBar,
- VIDEO_LIST_PROGRESSBAR_LENGTH);
- evas_object_size_hint_align_set(pProgressBar, EVAS_HINT_FILL,
- EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(pProgressBar,
- EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- elm_progressbar_value_set(pProgressBar, nRatio);
- elm_layout_content_set(pLayout, "elm.progressbar.icon",
- pProgressBar);
-
- if (pProgressBar)
- evas_object_show(pProgressBar);
- }
-
if (!mp_util_create_video_sub_icon(pLayout, nVideoItemIndex)) {
VideoLogWarning("Local File or Create sub icon is failed.",
nVideoItemIndex);
unsigned int nVideoInfoDuration =
mp_util_svc_get_video_duration_time(nVideoItemIndex);
- unsigned int nVideoInfoLastTime =
- mp_util_svc_get_video_last_played_pos(nVideoItemIndex);
+ unsigned int nVideoInfoLastTime = 0;
mp_util_convert_time(nVideoInfoDuration, szTmpStrDurationTime, FALSE);
mp_util_convert_time(nVideoInfoLastTime, szTmpStrLastPlayedPos, TRUE);
return pBg;
} else if (!strcmp(pPart, "elm.progressbar.icon")) {
- int nLastPlayedTime =
- mp_util_svc_get_video_last_played_pos(nVideoItemIndex);
- int nDurationTime =
- mp_util_svc_get_video_duration_time(nVideoItemIndex);
-
- if (nLastPlayedTime <= 0) {
- return NULL;
- }
-
- double nRatio = 0.0;
- if (nDurationTime > 0) {
- nRatio = ((double) nLastPlayedTime) / ((double) nDurationTime);
- }
-
- if (nRatio < 0.05) {
- nRatio = 0.05;
- }
- Evas_Object *pProgressBar = elm_progressbar_add(pObject);
- elm_object_style_set(pProgressBar, "video/list_progress");
- elm_progressbar_horizontal_set(pProgressBar, EINA_TRUE);
- evas_object_size_hint_align_set(pProgressBar,
- EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(pProgressBar,
- EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- elm_progressbar_value_set(pProgressBar, nRatio);
- evas_object_show(pProgressBar);
-
- return pProgressBar;
+ return NULL;
} else if (!strcmp(pPart, "elm.lock.icon")) {
char *pVideoFile = mp_util_svc_get_video_url(nVideoItemIndex);
bool bRet = mp_util_check_video_personal_status((const char *)
MP_FREE_STRING(pThumbIconUri);
- int nLastPlayedTime =
- mp_util_svc_get_video_last_played_pos(nVideoItemIndex);
- int nDurationTime =
- mp_util_svc_get_video_duration_time(nVideoItemIndex);
-
- if (nLastPlayedTime > 0) {
- double nRatio = 0.0;
-
- if (nDurationTime > 0) {
- nRatio = ((double) nLastPlayedTime) /
- ((double) nDurationTime);
- }
-
- if (nRatio < 0.05) {
- nRatio = 0.05;
- }
- Evas_Object *pProgressBar = elm_progressbar_add(pLayout);
- elm_object_style_set(pProgressBar,
- "elm/progressbar/horizontal/default");
- elm_progressbar_horizontal_set(pProgressBar, EINA_TRUE);
- elm_progressbar_span_size_set(pProgressBar,
- VIDEO_LIST_PROGRESSBAR_LENGTH);
- evas_object_size_hint_align_set(pProgressBar,
- EVAS_HINT_FILL,
- EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(pProgressBar,
- EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- elm_progressbar_value_set(pProgressBar, nRatio);
- evas_object_show(pProgressBar);
-
- elm_layout_content_set(pLayout, "elm.progress.icon",
- pProgressBar);
- }
-
if (!mp_util_create_video_sub_icon(pLayout, nVideoItemIndex)) {
VideoLogWarning("Create sub icon is failed.", nVideoItemIndex);
}
MP_FREE_STRING(pThumbIconUri);
- int nLastPlayedTime =
- mp_util_svc_get_video_last_played_pos(nVideoItemIndex);
- int nDurationTime =
- mp_util_svc_get_video_duration_time(nVideoItemIndex);
-
- if (nLastPlayedTime > 0 && nDurationTime > 0) {
- double nRatio =
- ((double) nLastPlayedTime) / ((double) nDurationTime);
- if (nRatio < 0.05) {
- nRatio = 0.05;
- }
-
- Evas_Object *pProgressBar =
- mp_widget_ctrl_create_progressbar(pLayout, nRatio);
- elm_layout_content_set(pLayout, "elm.progressbar.icon",
- pProgressBar);
-
- if (pProgressBar) {
- evas_object_show(pProgressBar);
- }
- }
-
if (!mp_util_create_video_sub_icon(pLayout, nVideoItemIndex)) {
VideoLogWarning("Local File or Create sub icon is failed.",
nVideoItemIndex);
return thumb;
} else if (!strcmp(pPart, "elm.progressbar.icon")) {
- int nLastPlayedTime =
- mp_util_svc_get_video_last_played_pos(nVideoItemIndex);
- int nDurationTime =
- mp_util_svc_get_video_duration_time(nVideoItemIndex);
-
- if (nLastPlayedTime <= 0) {
- return NULL;
- }
-
- double nRatio = 0.0;
-
- if (nDurationTime > 0) {
- nRatio = ((double) nLastPlayedTime) / ((double) nDurationTime);
- }
-
- if (nRatio < 0.05) {
- nRatio = 0.05;
- }
-
- Evas_Object *pProgressBar = elm_progressbar_add(pObject);
- elm_object_style_set(pProgressBar, "video/list_progress");
- elm_progressbar_horizontal_set(pProgressBar, EINA_TRUE);
- evas_object_size_hint_align_set(pProgressBar, EVAS_HINT_FILL,
- EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(pProgressBar, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- elm_progressbar_value_set(pProgressBar, nRatio);
- evas_object_show(pProgressBar);
-
- return pProgressBar;
+ return NULL;
}
MP_DEL_OBJ(pLayout);
if (pTmpVideoGenlistItem) {
elm_genlist_item_selected_set(pTmpVideoGenlistItem,
EINA_FALSE);
- int nLastPlayedTime =
- mp_util_svc_get_video_last_played_pos(nGenItemIndex);
- int nDurationTime =
- mp_util_svc_get_video_duration_time(nGenItemIndex);
Evas_Object *pIconContent =
elm_object_item_part_content_get(pTmpVideoGenlistItem,
"elm.icon.1");
elm_layout_content_get(pIconContent,
"elm.progressbar.icon");
- if (nLastPlayedTime > 0 && nDurationTime > 0) {
- double nRatio =
- ((double) nLastPlayedTime) / ((double) nDurationTime);
- if (!pProgressbar) {
- elm_genlist_item_fields_update(pTmpVideoGenlistItem,
- "elm.icon.1",
- ELM_GENLIST_ITEM_FIELD_CONTENT);
- } else {
- elm_progressbar_value_set(pProgressbar, nRatio);
- }
- } else {
- if (pProgressbar) {
- elm_layout_content_unset(pIconContent,
- "elm.progressbar.icon");
- MP_DEL_OBJ(pProgressbar);
- }
+ if (pProgressbar) {
+ elm_layout_content_unset(pIconContent,
+ "elm.progressbar.icon");
+ MP_DEL_OBJ(pProgressbar);
}
elm_genlist_item_fields_update(pTmpVideoGenlistItem,
nVideoItemIndex);
if (pTmpVideoGenlistItem) {
elm_genlist_item_selected_set(pTmpVideoGenlistItem, EINA_FALSE);
- int nLastPlayedTime =
- mp_util_svc_get_video_last_played_pos(nVideoItemIndex);
- int nDurationTime =
- mp_util_svc_get_video_duration_time(nVideoItemIndex);
Evas_Object *pIconContent =
elm_object_item_part_content_get(pTmpVideoGenlistItem,
"elm.icon.1");
}
Evas_Object *pProgressbar =
elm_layout_content_get(pIconContent, "elm.progressbar.icon");
- if (nLastPlayedTime > 0) {
- double nRatio =
- ((double) nLastPlayedTime) / ((double) nDurationTime);
- if (nRatio < 0.05) {
- nRatio = 0.05;
- }
-
- if (!pProgressbar) {
- elm_genlist_item_fields_update(pTmpVideoGenlistItem,
- "elm.icon.1",
- ELM_GENLIST_ITEM_FIELD_CONTENT);
- } else {
- elm_progressbar_value_set(pProgressbar, nRatio);
- }
-
- } else {
- if (pProgressbar) {
- elm_layout_content_unset(pIconContent,
- "elm.progressbar.icon");
- MP_DEL_OBJ(pProgressbar);
- }
+ if (pProgressbar) {
+ elm_layout_content_unset(pIconContent,
+ "elm.progressbar.icon");
+ MP_DEL_OBJ(pProgressbar);
}
elm_genlist_item_fields_update(pTmpVideoGenlistItem,
MP_FREE_STRING(pThumbIconUri);
- int nLastPlayedTime =
- mp_util_svc_get_video_last_played_pos(nVideoItemIndex);
- int nDurationTime =
- mp_util_svc_get_video_duration_time(nVideoItemIndex);
-
- if (nLastPlayedTime > 0) {
- double nRatio =
- ((double) nLastPlayedTime) / ((double) nDurationTime);
- if (nRatio < 0.05) {
- nRatio = 0.05;
- }
-
- Evas_Object *pProgressBar =
- mp_widget_ctrl_create_progressbar(pLayout, nRatio);
- elm_layout_content_set(pLayout, "elm.progressbar.icon",
- pProgressBar);
-
- if (pProgressBar) {
- evas_object_show(pProgressBar);
- }
- }
-
if (!mp_util_create_video_sub_icon(pLayout, nVideoItemIndex)) {
VideoLogWarning("Local File or Create sub icon is failed.",
nVideoItemIndex);
MP_FREE_STRING(pThumbIconUri);
- int nLastPlayedTime =
- mp_util_svc_get_video_last_played_pos(nVideoItemIndex);
- int nDurationTime =
- mp_util_svc_get_video_duration_time(nVideoItemIndex);
-
- if (nLastPlayedTime > 0) {
- double nRatio =
- ((double) nLastPlayedTime) / ((double) nDurationTime);
- if (nRatio < 0.05) {
- nRatio = 0.05;
- }
-
- Evas_Object *pProgressBar = elm_progressbar_add(pLayout);
- elm_object_style_set(pProgressBar,
- "elm/progressbar/horizontal/default");
- elm_progressbar_horizontal_set(pProgressBar, EINA_TRUE);
- elm_progressbar_span_size_set(pProgressBar,
- VIDEO_LIST_PROGRESSBAR_LENGTH);
- evas_object_size_hint_align_set(pProgressBar, EVAS_HINT_FILL,
- EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(pProgressBar,
- EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- elm_progressbar_value_set(pProgressBar, nRatio);
- elm_layout_content_set(pLayout, "elm.progressbar.icon",
- pProgressBar);
-
- if (pProgressBar) {
- evas_object_show(pProgressBar);
- }
- }
-
if (!mp_util_create_video_sub_icon(pLayout, nVideoItemIndex)) {
VideoLogWarning("Local File or Create sub icon is failed.",
nVideoItemIndex);
return pBg;
} else if (!strcmp(pPart, "elm.progressbar.icon")) {
- int nLastPlayedTime =
- mp_util_svc_get_video_last_played_pos(nVideoItemIndex);
- int nDurationTime =
- mp_util_svc_get_video_duration_time(nVideoItemIndex);
-
- if (nLastPlayedTime <= 0) {
return NULL;
- }
-
- double nRatio = 0.0;
- if (nDurationTime > 0) {
- nRatio = ((double) nLastPlayedTime) / ((double) nDurationTime);
- }
-
- if (nRatio < 0.05) {
- nRatio = 0.05;
- }
-
- Evas_Object *pProgressBar = elm_progressbar_add(pObject);
- elm_object_style_set(pProgressBar, "video/list_progress");
- elm_progressbar_horizontal_set(pProgressBar, EINA_TRUE);
- evas_object_size_hint_align_set(pProgressBar, EVAS_HINT_FILL,
- EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(pProgressBar, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- elm_progressbar_value_set(pProgressBar, nRatio);
- evas_object_show(pProgressBar);
-
- return pProgressBar;
} else if (!strcmp(pPart, "elm.lock.icon")) {
char *pVideoFile = mp_util_svc_get_video_url(nVideoItemIndex);
bool bRet =
MP_FREE_STRING(pThumbIconUri);
return thumb;
} else if (!strcmp(pPart, "elm.progressbar.icon")) {
- int nLastPlayedTime =
- mp_util_svc_get_video_last_played_pos(nVideoItemIndex);
- int nDurationTime =
- mp_util_svc_get_video_duration_time(nVideoItemIndex);
-
- if (nLastPlayedTime <= 0) {
return NULL;
- }
-
- double nRatio = 0.0;
-
- if (nDurationTime > 0) {
- nRatio = ((double) nLastPlayedTime) / ((double) nDurationTime);
- }
-
- if (nRatio < 0.05) {
- nRatio = 0.05;
- }
- Evas_Object *pProgressBar = elm_progressbar_add(pObject);
- elm_object_style_set(pProgressBar, "video/list_progress");
- elm_progressbar_horizontal_set(pProgressBar, EINA_TRUE);
- evas_object_size_hint_align_set(pProgressBar, EVAS_HINT_FILL,
- EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(pProgressBar, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- elm_progressbar_value_set(pProgressBar, nRatio);
- evas_object_show(pProgressBar);
- return pProgressBar;
} else if (!strcmp(pPart, "elm.lock.icon")) {
char *pVideoFile = mp_util_svc_get_video_url(nVideoItemIndex);
bool bRet = mp_util_check_video_personal_status((const char *)
unsigned int nVideoInfoDuration =
mp_util_svc_get_video_duration_time(nVideoItemIndex);
- unsigned int nVideoInfoLastTime =
- mp_util_svc_get_video_last_played_pos(nVideoItemIndex);
+ unsigned int nVideoInfoLastTime = 0;
mp_util_convert_time(nVideoInfoDuration, szTmpStrDurationTime, FALSE);
mp_util_convert_time(nVideoInfoLastTime, szTmpStrLastPlayedPos, TRUE);
MP_FREE_STRING(pThumbIconUri);
- int nLastPlayedTime =
- mp_util_svc_get_video_last_played_pos(nVideoItemIndex);
- int nDurationTime =
- mp_util_svc_get_video_duration_time(nVideoItemIndex);
-
- if (nLastPlayedTime > 0) {
- double nRatio = 0.0;
-
- if (nDurationTime > 0) {
- nRatio = ((double) nLastPlayedTime) /
- ((double) nDurationTime);
- }
-
- if (nRatio < 0.05) {
- nRatio = 0.05;
- }
-
- Evas_Object *pProgressBar = elm_progressbar_add(pObject);
- elm_object_style_set(pProgressBar, "video/list_progress");
- elm_progressbar_horizontal_set(pProgressBar, EINA_TRUE);
- evas_object_size_hint_align_set(pProgressBar, EVAS_HINT_FILL,
- EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(pProgressBar,
- EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- elm_progressbar_value_set(pProgressBar, nRatio);
-
- if (!elm_layout_content_set
- (pLayout, "elm.progressbar.icon", pProgressBar))
- VideoLogError("elm_layout_content_set() is failed.");
-
- if (pProgressBar) {
- evas_object_show(pProgressBar);
- }
- }
-
if (!mp_util_create_video_sub_icon(pLayout, nVideoItemIndex)) {
VideoLogWarning("Local File or Create sub icon is failed.",
nVideoItemIndex);
nGenItemIndex);
if (pTmpVideoGenlistItem) {
elm_genlist_item_selected_set(pTmpVideoGenlistItem, EINA_FALSE);
- int nLastPlayedTime =
- mp_util_svc_get_video_last_played_pos(nPlayVideoIndex);
- int nDurationTime =
- mp_util_svc_get_video_duration_time(nPlayVideoIndex);
Evas_Object *pIconContent =
elm_object_item_part_content_get(pTmpVideoGenlistItem,
"elm.swallow.icon");
Evas_Object *pProgressbar =
elm_layout_content_get(pIconContent, "elm.progressbar.icon");
- if (nLastPlayedTime > 0) {
- double nRatio = 0.0;
-
- if (nDurationTime > 0) {
- nRatio = ((double) nLastPlayedTime) /
- ((double) nDurationTime);
- }
- if (nRatio < 0.05) {
- nRatio = 0.05;
- }
- if (!pProgressbar) {
- elm_genlist_item_fields_update(pTmpVideoGenlistItem,
- "elm.swallow.icon",
- ELM_GENLIST_ITEM_FIELD_CONTENT);
- } else {
- elm_progressbar_value_set(pProgressbar, nRatio);
- }
- } else {
- if (pProgressbar) {
- elm_layout_content_unset(pIconContent,
- "elm.progressbar.icon");
- MP_DEL_OBJ(pProgressbar);
- }
+ if (pProgressbar) {
+ elm_layout_content_unset(pIconContent,
+ "elm.progressbar.icon");
+ MP_DEL_OBJ(pProgressbar);
}
elm_genlist_item_fields_update(pTmpVideoGenlistItem,
return;
}
- int nLastPlayedTime =
- mp_util_svc_get_video_last_play_time_by_video_url(szFilePath);
-
char *szLocation = NULL;
szLocation =
g_strndup(szFilePath, strlen(szFilePath) - strlen(szFileName));
} else {
mp_util_svc_move_to_db(g_pRenameHandle->nVideoIndex,
szNewPath);
- mp_util_svc_set_video_last_played_time_by_url(szNewFile,
- nLastPlayedTime);
}
char *szMediaUrl = mp_util_config_get_preview();
if (szMediaUrl) {
if (!strcmp(szFilePath, szMediaUrl)) {
mp_util_config_set_preview(szNewFile);
- mp_util_svc_set_video_last_played_time_by_url(szNewFile,
- nLastPlayedTime);
}
}