bool mp_util_svc_is_device_storage(const int nVideoItemIndex);
//sort by
-bool mp_util_svc_get_frame_by_position(const char *szFilePath,
- const char *szDestImage,
- int nPosition, int nWidth,
- int nHeight);
-
//used for check videoid and folderid
bool mp_util_svc_check_valid_media_id(char *pMediaId, int style,
int *nMediaIndex);
Evas_Object *mp_util_create_preload_image(Evas_Object * parent,
const char *path,
int nIconWidth);
-bool mp_util_save_preview_image(const char *szFilePath);
-
char *mp_util_get_preview_image_path(const char *szFilePath);
// progresss loading object
int ret = TELEPHONY_ERROR_NONE;
telephony_call_h *call_list_sim;
telephony_call_status_e status;
- telephony_call_type_e type;
telephony_error_e ret_sim;
unsigned int count_sim = 0;
#include <stdbool.h>
#include <glib.h>
-
-bool vp_image_util_image_resize_save(const char *szFilePath,
- const unsigned char *pSrcBuf,
- int nSrcW, int nSrcH, int nDestW,
- int nDestH, int nQuality);
-bool vp_image_util_image_save(const char *szFilePath,
- const unsigned char *pSrcBuf, int nSrcW,
- int nSrcH, int nQuality);
#include "vp-image-util.h"
#include "vp-util.h"
-/**
- *
- * @param szFilePath
- * @param pSrcBuf
- * @param nSrcW
- * @param nSrcH
- * @param nDestW
- * @param nDestH
- * @param nQuality
- * @return
- */
-bool vp_image_util_image_resize_save(const char *szFilePath,
- const unsigned char *pSrcBuf,
- int nSrcW, int nSrcH, int nDestW,
- int nDestH, int nQuality)
-{
- if (szFilePath == NULL) {
- VideoLogError("szFilePath is NULL");
- return FALSE;
- }
-
- if (pSrcBuf == NULL) {
- VideoLogError("pSrcBuf is NULL");
- return FALSE;
- }
-
- int nRet = IMAGE_UTIL_ERROR_NONE;
- unsigned char *pSaveBuf = NULL;
- unsigned int nResizBufSize = 0;
- int nResizeW = nDestW + (nDestW) % 2;
- int nResizeH = nDestH + (nDestH) % 2;
-
- nRet =
- image_util_calculate_buffer_size(nResizeW, nResizeH,
- IMAGE_UTIL_COLORSPACE_RGB888,
- &nResizBufSize);
- if (nRet != IMAGE_UTIL_ERROR_NONE) {
- VideoLogWarning
- ("image_util_calculate_buffer_size is fail : [0x%x]", nRet);
- }
-
- pSaveBuf = calloc(1, sizeof(unsigned char) * nResizBufSize);
- if (pSaveBuf == NULL) {
- VideoLogWarning("pSaveBuf alloc fail");
- return FALSE;
- }
-
- nRet =
- vp_util_image_resize(pSaveBuf, &nResizeW, &nResizeH, pSrcBuf,
- nSrcW, nSrcH, IMAGE_UTIL_COLORSPACE_RGB888);
- if (nRet != IMAGE_UTIL_ERROR_NONE) {
- VideoLogWarning("vp_util_image_resize is fail : [0x%x]", nRet);
- VP_FREE(pSaveBuf);
- return FALSE;
- }
-
- nRet =
- image_util_encode_jpeg(pSaveBuf, nResizeW, nResizeH,
- IMAGE_UTIL_COLORSPACE_RGB888, nQuality,
- szFilePath);
- if (nRet != IMAGE_UTIL_ERROR_NONE) {
- VideoLogWarning("image_util_encode_jpeg is fail : [0x%x]", nRet);
- VP_FREE(pSaveBuf);
- return FALSE;
- }
-
- VP_FREE(pSaveBuf);
-
- return TRUE;
-}
-
-/**
- *
- * @param szFilePath
- * @param pSrcBuf
- * @param nSrcW
- * @param nSrcH
- * @param nQuality
- * @return
- */
-bool vp_image_util_image_save(const char *szFilePath,
- const unsigned char *pSrcBuf, int nSrcW,
- int nSrcH, int nQuality)
-{
- if (szFilePath == NULL) {
- VideoLogError("szFilePath is NULL");
- return FALSE;
- }
-
- if (pSrcBuf == NULL) {
- VideoLogError("pSrcBuf is NULL");
- return FALSE;
- }
-
- int nRet = IMAGE_UTIL_ERROR_NONE;
-
- nRet =
- image_util_encode_jpeg(pSrcBuf, nSrcW, nSrcH,
- IMAGE_UTIL_COLORSPACE_RGB888, nQuality,
- szFilePath);
- if (nRet != IMAGE_UTIL_ERROR_NONE) {
- VideoLogWarning("image_util_encode_jpeg is fail : [0x%x]", nRet);
- return FALSE;
- }
- return TRUE;
-}
#else
if (pSubtitleInfo->pTextColorHex && bActivation) {
- szColor = g_strdup_printf(pSubtitleInfo->pTextColorHex);
+ szColor = strdup(pSubtitleInfo->pTextColorHex);
} else {
szColor = g_strdup_printf("#00000000");
}
pNormalView);
static void _vp_play_normal_view_on_sound_path_popup(NormalView *
pNormalView);
-static void _vp_play_normal_view_on_audio_track_popup(NormalView *
- pNormalView);
static void _vp_play_normal_view_on_subtitle_popup(NormalView *
pNormalView);
static void _vp_play_normal_view_on_subtitle_sync_popup(NormalView *
pNormalView);
#endif
-static void _vp_play_normal_view_on_setting_popup(NormalView *
- pNormalView);
static void _vp_play_normal_view_on_detail_popup(NormalView * pNormalView);
-static void _vp_play_normal_view_on_capture_popup(NormalView *
- pNormalView);
static void _vp_play_normal_view_on_play_speed_popup(NormalView *
pNormalView);
static void _vp_play_normal_view_on_play_speed_popup_cb(void *data,
static void _vp_normal_view_speed_for_steps(NormalView * pNormalView,
bool bSpeedFF);
-static vp_mm_player_state_t pState = VP_MM_PLAYER_STATE_NONE;
static NormalView *curr_Handle = NULL;
#ifdef SUBTITLE_K_FEATURE
}
-/**
- *
- * @param nType
- * @param bPause
- * @param pUserData
- */
-static void __vp_normal_setting_popup_close_cb(int nType, bool bPause,
- void *pUserData)
-{
- if (!pUserData) {
- VideoLogError("pUserData is NULL");
- return;
- }
-
- NormalView *pNormalView = (NormalView *) pUserData;
- PlayView *pPlayView = pNormalView->pPlayView;
- if (!pPlayView) {
- VideoLogError("pPlayView is NULL");
- }
- vp_setting_destroy(pNormalView->pSettingHandle);
- pNormalView->pSettingHandle = NULL;
- pNormalView->bIsPopupShow = FALSE;
-
- if (_vp_is_current_focus_available() != 0) {
- VideoLogInfo("Cannot acquire focus. Setting video to pause state");
- pNormalView->bManualPause = TRUE;
- }
-
- if (nType == VP_SETTING_MODE_NONE
- || nType == VP_SETTING_MODE_PLAY_SPEED) {
- if (bPause) {
- if (!vp_mm_player_pause(pNormalView->pPlayerHandle)) {
- VideoLogWarning("Pause Fail");
- }
- if (pPlayView && pPlayView->win_minicon) {
- vp_minicontroller_update_control(pPlayView);
- }
- if (pPlayView && pPlayView->win_lockmini) {
- vp_lockscreenmini_update_control(pPlayView);
- }
- _vp_play_normal_view_set_play_state(pNormalView);
- _vp_play_normal_view_on_capture_mode(pNormalView);
- } else {
- if (pNormalView->bManualPause == FALSE) {
- if (!vp_mm_player_play(pNormalView->pPlayerHandle)) {
- VideoLogWarning("Pause Fail");
- }
- if (pPlayView && pPlayView->win_minicon) {
- vp_minicontroller_update_control(pPlayView);
- }
- if (pPlayView && pPlayView->win_lockmini) {
- vp_lockscreenmini_update_control(pPlayView);
- }
- _vp_play_normal_view_set_play_state(pNormalView);
- _vp_play_normal_view_on_capture_mode(pNormalView);
- _vp_play_normal_view_create_layout_hide_timer(pNormalView);
- }
- }
- }
-
- switch (nType) {
- case VP_SETTING_MODE_PLAY_SPEED:
- _vp_play_normal_view_on_play_speed_popup(pNormalView);
- break;
- case VP_SETTING_MODE_SOUND_ALIVE:
- _vp_play_normal_view_on_sound_alive_popup(pNormalView);
- break;
- case VP_SETTING_MODE_AUDIO_TRACK:
- _vp_play_normal_view_on_audio_track_popup(pNormalView);
- break;
- case VP_SETTING_MODE_CAPTURE:
- _vp_play_normal_view_on_capture_popup(pNormalView);
- break;
- }
-}
-
-/**
- *
- * @param nType
- * @param bPause
- * @param pUserData
- */
-static void __vp_normal_capture_popup_close_cb(int nType, bool bPause,
- void *pUserData)
-{
- if (!pUserData) {
- VideoLogError("pUserData is NULL");
- return;
- }
-
- NormalView *pNormalView = (NormalView *) pUserData;
- PlayView *pPlayView = pNormalView->pPlayView;
- if (!pPlayView) {
- VideoLogError("pPlayView is NULL");
- }
- if (nType != -1) {
- pNormalView->bCaptureMode = (bool) nType;
- }
- vp_play_preference_set_capture_on_key(pNormalView->bCaptureMode);
-
- vp_capture_popup_destroy(pNormalView->pCapturePopup);
- pNormalView->pCapturePopup = NULL;
- pNormalView->bIsPopupShow = FALSE;
-
- if (_vp_is_current_focus_available() != 0) {
- VideoLogInfo("Cannot acquire focus. Setting video to pause state");
- pNormalView->bManualPause = TRUE;
- }
-
- if (bPause) {
- if (!vp_mm_player_pause(pNormalView->pPlayerHandle)) {
- VideoLogWarning("Pause Fail");
- }
- if (pPlayView && pPlayView->win_minicon) {
- vp_minicontroller_update_control(pPlayView);
- }
- if (pPlayView && pPlayView->win_lockmini) {
- vp_lockscreenmini_update_control(pPlayView);
- }
- _vp_play_normal_view_set_play_state(pNormalView);
- _vp_play_normal_view_on_capture_mode(pNormalView);
- }
- if (pNormalView->bManualPause == FALSE) {
- if (!vp_mm_player_play(pNormalView->pPlayerHandle)) {
- VideoLogWarning("Pause Fail");
- }
- if (pPlayView && pPlayView->win_minicon) {
- vp_minicontroller_update_control(pPlayView);
- }
- if (pPlayView && pPlayView->win_lockmini) {
- vp_lockscreenmini_update_control(pPlayView);
- }
- _vp_play_normal_view_set_play_state(pNormalView);
- _vp_play_normal_view_on_capture_mode(pNormalView);
- _vp_play_normal_view_create_layout_hide_timer(pNormalView);
- }
-
- _vp_play_normal_view_on_capture_mode(pNormalView);
-}
/**
*
}
-/**
- *
- * @param nType
- * @param bPause
- * @param pUserData
- */
-static void __vp_normal_audio_track_popup_close_cb(int nType, bool bPause,
- void *pUserData)
-{
- if (!pUserData) {
- VideoLogError("pUserData is NULL");
- return;
- }
-
- NormalView *pNormalView = (NormalView *) pUserData;
- PlayView *pPlayView = pNormalView->pPlayView;
- if (!pPlayView) {
- VideoLogError("pPlayView is NULL");
- }
-
- if (_vp_is_current_focus_available() != 0) {
- VideoLogInfo("Cannot acquire focus. Setting video to pause state");
- pNormalView->bManualPause = TRUE;
- }
-
- if (bPause) {
- if (!vp_mm_player_pause(pNormalView->pPlayerHandle)) {
- VideoLogWarning("Pause Fail");
- }
- if (pPlayView && pPlayView->win_minicon) {
- vp_minicontroller_update_control(pPlayView);
- }
- if (pPlayView && pPlayView->win_lockmini) {
- vp_lockscreenmini_update_control(pPlayView);
- }
- _vp_play_normal_view_set_play_state(pNormalView);
- _vp_play_normal_view_on_capture_mode(pNormalView);
- } else {
- if (pNormalView->bManualPause == FALSE) {
- if (!vp_mm_player_play(pNormalView->pPlayerHandle)) {
- VideoLogWarning("Pause Fail");
- }
- if (pPlayView && pPlayView->win_minicon) {
- vp_minicontroller_update_control(pPlayView);
- }
- if (pPlayView && pPlayView->win_lockmini) {
- vp_lockscreenmini_update_control(pPlayView);
- }
- _vp_play_normal_view_set_play_state(pNormalView);
- _vp_play_normal_view_on_capture_mode(pNormalView);
- _vp_play_normal_view_create_layout_hide_timer(pNormalView);
- }
- }
-
- vp_audio_track_destroy(pNormalView->pAudioTrackHandle);
- pNormalView->pAudioTrackHandle = NULL;
- pNormalView->bIsPopupShow = FALSE;
-
- if (bPause) {
- if (!vp_mm_player_pause(pNormalView->pPlayerHandle)) {
- VideoLogWarning("Pause Fail");
- }
- if (pPlayView && pPlayView->win_minicon) {
- vp_minicontroller_update_control(pPlayView);
- }
- if (pPlayView && pPlayView->win_lockmini) {
- vp_lockscreenmini_update_control(pPlayView);
- }
- _vp_play_normal_view_set_play_state(pNormalView);
- _vp_play_normal_view_on_capture_mode(pNormalView);
- } else {
- _vp_play_normal_view_create_layout_hide_timer(pNormalView);
- }
- if (nType != -1) {
- pNormalView->nDefaultAudioTrackIndex = nType;
-
- vp_mm_player_set_audio_track(pNormalView->pPlayerHandle,
- pNormalView->nDefaultAudioTrackIndex);
- }
-
-}
/**
*
*
* @param pNormalView
*/
-static void _vp_play_normal_view_on_audio_track_popup(NormalView *
- pNormalView)
-{
- if (!pNormalView) {
- VideoLogError("pNormalView is NULL");
- return;
- }
-
- PlayView *pPlayView = pNormalView->pPlayView;
-
- if (!pPlayView) {
- VideoLogError("pPlayView is NULL");
- return;
- }
- 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 (pNormalView->bVideoOnlyMode == FALSE
- && nState == VP_MM_PLAYER_STATE_PLAYING) {
- if (!vp_mm_player_pause(pNormalView->pPlayerHandle)) {
- VideoLogError("Pause Fail");
- }
- if (pPlayView->win_minicon) {
- vp_minicontroller_update_control(pPlayView);
- }
- if (pPlayView->win_lockmini) {
- vp_lockscreenmini_update_control(pPlayView);
- }
- _vp_play_normal_view_set_play_state(pNormalView);
-
- }
-
- vp_audio_track_destroy(pNormalView->pAudioTrackHandle);
- pNormalView->pAudioTrackHandle = NULL;
-
- pNormalView->pAudioTrackHandle = vp_audio_track_create(pPlayView->pWin,
- __vp_normal_audio_track_popup_close_cb,
- pNormalView->
- nDefaultAudioTrackIndex);
- if (!pNormalView->pAudioTrackHandle) {
- VideoLogError("vp_audio_track_create fail");
- return;
- }
-
- if (!vp_audio_track_set_user_data
- (pNormalView->pAudioTrackHandle, (void *) pNormalView)) {
- VideoLogWarning("vp_audio_track_set_user_data is fail");
- }
-
- int nCount = 0;
- if (vp_mm_player_get_audio_track_count
- (pNormalView->pPlayerHandle, &nCount)) {
- if (nCount > 1) {
- int nIdx = 0;
- for (nIdx = 0; nIdx < nCount; nIdx++) {
- char *szCode = NULL;
-
- if (vp_mm_player_get_audio_track_language_code
- (pNormalView->pPlayerHandle, nIdx, &szCode)) {
- vp_audio_track_add_Item(pNormalView->pAudioTrackHandle,
- szCode, nIdx);
- } else {
- vp_audio_track_add_Item(pNormalView->pAudioTrackHandle,
- VP_PLAY_STRING_COM_UNKNOWN,
- nIdx);
- }
- VP_FREE(szCode);
- }
- } else {
- char *szTrack =
- g_strdup_printf("%s %d", VP_PLAY_STRING_AUDIO_TRACK, 0);
- vp_audio_track_add_Item(pNormalView->pAudioTrackHandle,
- szTrack, 0);
- VP_FREE(szTrack);
- }
- } else {
- char *szTrack =
- g_strdup_printf("%s %d", VP_PLAY_STRING_AUDIO_TRACK, 0);
- vp_audio_track_add_Item(pNormalView->pAudioTrackHandle, szTrack,
- 0);
- VP_FREE(szTrack);
- }
-
- if (!vp_audio_track_realize(pNormalView->pAudioTrackHandle)) {
- VideoLogWarning("vp_audio_track_realize is fail");
- }
- pNormalView->bIsPopupShow = TRUE;
-
- VP_EVAS_TIMER_DEL(pNormalView->pHideTimer);
- VP_EVAS_TIMER_DEL(pNormalView->pHideFinishTimer);
-
-}
-
-/**
- *
- * @param pNormalView
- */
static void _vp_play_normal_view_on_subtitle_popup(NormalView *
pNormalView)
{
/**
*
- * @param pNormalView
- */
-static void _vp_play_normal_view_on_capture_popup(NormalView * pNormalView)
-{
- if (!pNormalView) {
- VideoLogError("pNormalView is NULL");
- return;
- }
-
- vp_capture_popup_destroy(pNormalView->pCapturePopup);
- pNormalView->pCapturePopup = NULL;
-
- PlayView *pPlayView = pNormalView->pPlayView;
- if (!pPlayView) {
- VideoLogError("pPlayView is NULL");
- return;
- }
-
- vp_play_preference_get_capture_on_key(&pNormalView->bCaptureMode);
-
- pNormalView->pCapturePopup = vp_capture_popup_create(pPlayView->pWin,
- pNormalView->
- bCaptureMode,
- __vp_normal_capture_popup_close_cb);
- if (!pNormalView->pCapturePopup) {
- VideoLogError("vp_capture_popup_create fail");
- return;
- }
- if (!vp_capture_popup_set_user_data
- (pNormalView->pCapturePopup, (void *) pNormalView)) {
- VideoLogWarning("vp_capture_popup_set_user_data is fail");
- }
-
- if (!vp_capture_popup_realize(pNormalView->pCapturePopup)) {
- VideoLogWarning("vp_capture_popup_realize is fail");
- }
- pNormalView->bIsPopupShow = TRUE;
-
- VP_EVAS_TIMER_DEL(pNormalView->pHideTimer);
- VP_EVAS_TIMER_DEL(pNormalView->pHideFinishTimer);
-
-}
-
-/**
- *
* @param data
* @param obj
* @param emission
*
* @param pNormalView
*/
-static void _vp_play_normal_view_on_setting_popup(NormalView * pNormalView)
-{
- if (!pNormalView) {
- VideoLogError("pNormalView is NULL");
- return;
- }
-
- vp_setting_destroy(pNormalView->pSettingHandle);
- pNormalView->pSettingHandle = NULL;
-
- PlayView *pPlayView = pNormalView->pPlayView;
- if (!pPlayView) {
- VideoLogError("pPlayView is NULL");
- return;
- }
-
- 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 (pNormalView->bVideoOnlyMode == FALSE
- && nState == VP_MM_PLAYER_STATE_PLAYING) {
- if (!vp_mm_player_pause(pNormalView->pPlayerHandle)) {
- VideoLogError("Pause Fail");
- }
- _vp_play_normal_view_set_play_state(pNormalView);
- }
-
- if (!vp_play_preference_get_sound_alive_status
- (&pNormalView->nSoundAlive)) {
- VideoLogError("vp_play_preference_get_sound_alive_status failed");
- }
- bool bEarjack =
- vp_sound_device_is_enable(VP_SOUND_DEVICE_EARJACK,
- pNormalView->pPlayView);
- if (bEarjack == FALSE && pNormalView->nSoundAlive == VIDEO_SA_7_1_CH) {
- pNormalView->nSoundAlive = VIDEO_SA_NORMAL;
- if (!vp_play_preference_set_sound_alive_status
- (pNormalView->nSoundAlive)) {
- VideoLogError
- ("vp_play_preference_set_sound_alive_status failed");
- }
- if (!vp_mm_player_set_sound_filter
- (pNormalView->pPlayerHandle, VP_MM_PLAYER_FILTER_NONE)) {
- VideoLogWarning("vp_mm_player_set_sound_filter is fail");
- }
- }
-
- SettingInfo *pSettingInfo = NULL;
- pSettingInfo = calloc(1, sizeof(SettingInfo));
- if (!pSettingInfo) {
- VideoLogError("failed to allocate memory");
- return;
- }
-
- char *szDir = NULL;
- szDir = vp_play_util_get_folder_from_path(pNormalView->szMediaURL);
-
- pSettingInfo->fSpeed = pNormalView->fPlaySpeed;
- pSettingInfo->nSoundAlive = pNormalView->nSoundAlive;
- pSettingInfo->nRepeatMode = pNormalView->nRepeatMode;
- pSettingInfo->bExternalMode = pNormalView->bVideoOnlyMode;
- if (pNormalView->bIsExistSubtitle == FALSE) {
- pSettingInfo->bSelectSubtitle =
- vp_play_util_is_exist_subtitle_from_path(szDir);
- } else {
- pSettingInfo->bSelectSubtitle = TRUE;
- }
-
- VP_FREE(szDir);
-
- pSettingInfo->bStreaming = FALSE;
-
- if (pNormalView->nLaunchingType == VIDEO_PLAY_TYPE_WEB ||
- pNormalView->nLaunchingType == VIDEO_PLAY_TYPE_MULTI_PATH) {
- pSettingInfo->bStreaming = TRUE;
- }
-#ifdef ENABLE_DRM_FEATURE
- vp_drm_is_drm_file(pNormalView->szMediaURL, &(pSettingInfo->bDrm));
-#endif
- char *szCode = NULL;
- int nCount = 0;
- if (vp_mm_player_get_audio_track_count
- (pNormalView->pPlayerHandle, &nCount)) {
- if (nCount > 1) {
- if (vp_mm_player_get_audio_track_language_code
- (pNormalView->pPlayerHandle,
- pNormalView->nDefaultAudioTrackIndex, &szCode)) {
- vp_audio_track_get_name(szCode,
- &(pSettingInfo->szAudioTrack));
- } else {
- pSettingInfo->szAudioTrack =
- g_strdup_printf("%s", VP_PLAY_STRING_COM_UNKNOWN);
- }
- } else {
- pSettingInfo->szAudioTrack =
- g_strdup_printf("%s %d", VP_PLAY_STRING_AUDIO_TRACK, 0);
- }
- } else {
- pSettingInfo->szAudioTrack =
- g_strdup_printf("%s %d", VP_PLAY_STRING_AUDIO_TRACK, 0);
- }
- VP_FREE(szCode);
-
- vp_play_preference_get_capture_on_key(&pSettingInfo->bCapture);
-
- pNormalView->pSettingHandle =
- vp_setting_create(pPlayView->pWin, pSettingInfo,
- __vp_normal_setting_popup_close_cb);
- if (!pNormalView->pSettingHandle) {
- VideoLogError("vp_setting_create fail");
-
- VP_FREE(pSettingInfo->szAudioTrack);
- VP_FREE(pSettingInfo);
- return;
- }
-
- VP_FREE(pSettingInfo->szAudioTrack);
- VP_FREE(pSettingInfo);
-
- if (!vp_setting_set_user_data
- (pNormalView->pSettingHandle, (void *) pNormalView)) {
- VideoLogWarning("vp_setting_set_user_data is fail");
- }
-
- if (!vp_setting_realize(pNormalView->pSettingHandle)) {
- VideoLogWarning("vp_setting_realize is fail");
- }
- pNormalView->bIsPopupShow = TRUE;
-
- VP_EVAS_TIMER_DEL(pNormalView->pHideTimer);
- VP_EVAS_TIMER_DEL(pNormalView->pHideFinishTimer);
-}
-
-/**
- *
- * @param pNormalView
- */
static void _vp_play_normal_view_on_detail_popup(NormalView * pNormalView)
{
if (!pNormalView) {
VideoLogError("nVolume = %d:", nVolume);
- if ((nVolume == 0)) {
+ if (nVolume == 0) {
pIcon =
vp_button_create_icon(pNormalView->pVolumeBtn, edj_path,
VP_PLAY_NORMAL_RES_MUTE);
/**
*
- * @param pUserData
- * @return
- */
-static Eina_Bool _vp_lockscreenmini_hide_video_mini_controller(void
- *pUserData)
-{
- if (!pUserData) {
- VideoLogError("pUserData is NULL");
- return EINA_FALSE;
- }
-
- PlayView *pPlayView = (PlayView *) pUserData;
-
- if (pPlayView->lockmini_visible) {
- vp_lockscreenmini_hide(pPlayView);
- }
- pPlayView->lockmini_idle_timer = NULL;
- return EINA_FALSE;
-}
-
-/**
- *
* @param key
* @param pUserData
*/
/**
*
- * @return
- */
-static bool _vp_minicontroller_is_long_press()
-{
- bool result = false;
- VideoLogDebug("press time is %s", ctime(&press_time));
- VideoLogDebug("release time is %s", ctime(&release_time));
- if (difftime(release_time, press_time) > 1.0) {
- result = true;
- }
-
- memset(&release_time, 0, sizeof(time_t));
- memset(&press_time, 0, sizeof(time_t));
-
- VideoLogDebug("is %s long press", result ? "" : "not");
- return result;
-}
-
-/**
- *
* @param pPlayView
* @param angle
* @return
/**
*
- * @param pMediaItem
- * @param pUserData
- * @return
- */
-static bool mp_util_svc_iterate_for_last_played_video_item_cb(media_info_h
- pMediaItem,
- void
- *pUserData)
-{
- media_info_h pAssignMediaItem = NULL;
- media_content_type_e nMediaType = MEDIA_CONTENT_TYPE_OTHERS;
-
- if (!pMediaItem) {
- return TRUE;
- }
-
- media_info_get_media_type(pMediaItem, &nMediaType);
-
- if (nMediaType == MEDIA_CONTENT_TYPE_VIDEO) {
- char *szTmpItemFilePath = NULL;
- char szItemFilePath[STR_LEN_MAX] = { 0, };
-
- media_info_get_file_path(pMediaItem, &szTmpItemFilePath);
-
- if (szTmpItemFilePath == NULL) {
- VideoLogError("Fail to get file path of media item.");
- return TRUE;
- }
- strncpy(szItemFilePath, szTmpItemFilePath, STR_LEN_MAX - 1);
-
- free(szTmpItemFilePath);
- szTmpItemFilePath = NULL;
-
- media_info_clone(&pAssignMediaItem, pMediaItem);
- Eina_List **pList = (Eina_List **) pUserData;
- *pList = eina_list_append(*pList, pAssignMediaItem);
-
- if (eina_list_count(*pList) > RECENTLY_PLAYED_VIDEO_ITEM_MAX) {
- VideoLogError
- ("Break extract video item about recentl played item.");
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-/**
- *
* @return
*/
bool mp_util_svc_destory_last_played_item_list(void)
{
char szTmpStr[STR_LEN_MAX] = { 0, };
char szTmpStrDurationTime[STR_LEN_MAX] = { 0, };
- char szTmpStrLastPlayedPos[STR_LEN_MAX] = { 0, };
unsigned int nVideoInfoDuration =
mp_util_svc_get_video_duration_time(nVideoItemIndex);
- unsigned int nVideoInfoLastTime =
- mp_util_svc_get_video_last_played_pos(nVideoItemIndex);
if (nVideoInfoDuration > 0) {
/*----------------sort video list-----------------------------*/
-/**
- *
- * @param d1
- * @param d2
- * @return
- */
-static int __mp_util_svc_sort_by_type(const void *d1, const void *d2)
-{
- if (d1 == NULL) {
- return (1);
- }
- if (d2 == NULL) {
- return (-1);
- }
-
- char *szMime_1 = NULL;
- char *szMime_2 = NULL;
- int nRet = MEDIA_CONTENT_ERROR_NONE;
- int result = 0;
-
- media_info_h pVideoItem_1 = (media_info_h) d1;
- media_info_h pVideoItem_2 = (media_info_h) d2;
-
- nRet = media_info_get_mime_type(pVideoItem_1, &szMime_1);
- if (nRet != MEDIA_CONTENT_ERROR_NONE || szMime_1 == NULL) {
- VideoLogError("[ERR] Fail to get item title. - 0x%x", nRet);
- MP_FREE_STRING(szMime_1);
- return (1);
- }
- nRet = media_info_get_mime_type(pVideoItem_2, &szMime_2);
- if (nRet != MEDIA_CONTENT_ERROR_NONE || szMime_2 == NULL) {
- VideoLogError("[ERR] Fail to get item title. - 0x%x", nRet);
- MP_FREE_STRING(szMime_1);
- MP_FREE_STRING(szMime_2);
- return (-1);
- }
-
- result = strcasecmp(szMime_1, szMime_2);
-
- MP_FREE_STRING(szMime_1);
- MP_FREE_STRING(szMime_2);
-
- if (result > 0) {
- return (1);
- } else {
- return (-1);
- }
-
- return result;
-}
-
-/**
- *
- * @param d1
- * @param d2
- * @return
- */
-static int __mp_util_svc_sort_by_name(const void *d1, const void *d2)
-{
- if (d1 == NULL) {
- return (1);
- }
- if (d2 == NULL) {
- return (-1);
- }
-
- char *szTitle_1 = NULL;
- char *szTitle_2 = NULL;
- int nRet = MEDIA_CONTENT_ERROR_NONE;
- int result = 0;
-
- media_info_h pVideoItem_1 = (media_info_h) d1;
- media_info_h pVideoItem_2 = (media_info_h) d2;
- nRet = media_info_get_display_name(pVideoItem_1, &szTitle_1);
- if (nRet != MEDIA_CONTENT_ERROR_NONE || szTitle_1 == NULL) {
- VideoLogError("[ERR] Fail to get item title. - 0x%x", nRet);
- MP_FREE_STRING(szTitle_1);
- return (1);
- }
-
- nRet = media_info_get_display_name(pVideoItem_2, &szTitle_2);
- if (nRet != MEDIA_CONTENT_ERROR_NONE || szTitle_2 == NULL) {
- MP_FREE_STRING(szTitle_1);
- MP_FREE_STRING(szTitle_2);
- VideoLogError("[ERR] Fail to get item title. - 0x%x", nRet);
- return (-1);
- }
-
- result = strcasecmp(szTitle_1, szTitle_2);
-
- MP_FREE_STRING(szTitle_1);
- MP_FREE_STRING(szTitle_2);
-
- if (result > 0) {
- return (1);
- } else {
- return (-1);
- }
- return result;
-}
-
-/**
- *
- * @param d1
- * @param d2
- * @return
- */
-static int __mp_util_svc_sort_by_size(const void *d1, const void *d2)
-{
- if (d1 == NULL) {
- return (1);
- }
- if (d2 == NULL) {
- return (-1);
- }
-
- unsigned long long nFileSize1 = 0;
- unsigned long long nFileSize2 = 0;
- int nRet = MEDIA_CONTENT_ERROR_NONE;
- int result = 0;
-
- media_info_h pVideoItem_1 = (media_info_h) d1;
- media_info_h pVideoItem_2 = (media_info_h) d2;
-
-
- nRet = media_info_get_size(pVideoItem_1, &nFileSize1);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogInfo("[ERR] Fail to get item size. - 0x%x", nRet);
- return (1);
- }
-
-
- nRet = media_info_get_size(pVideoItem_2, &nFileSize2);
- if (nRet != MEDIA_CONTENT_ERROR_NONE) {
- VideoLogInfo("[ERR] Fail to get item size. - 0x%x", nRet);
- return (-1);
- }
-
- if (nFileSize1 < nFileSize2) {
- result = 1;
- } else if (nFileSize1 > nFileSize2) {
- result = -1;
- } else {
- result = 0;
- }
-
- return result;
-}
-
-/**
- *
- * @param szFilePath
- * @param szDestImage
- * @param nPosition
- * @param nWidth
- * @param nHeight
- * @return
- */
-bool mp_util_svc_get_frame_by_position(const char *szFilePath,
- const char *szDestImage,
- int nPosition, int nWidth,
- int nHeight)
-{
- if (!szFilePath || !szDestImage) {
- VideoLogInfo("[ERR] No exist szFilePath or szDestImage.");
- return FALSE;
- }
-
- metadata_extractor_h pMetadata;
- int nRet = 0;
- void *pFrame = NULL;
- int nFrameSize = 0;
- char *szVal = NULL;
- int nRotate = 0;
- unsigned char *pRotBuf = NULL;
-
- if (metadata_extractor_create(&pMetadata) !=
- METADATA_EXTRACTOR_ERROR_NONE) {
- VideoLogInfo("[ERR] - metadata_extractor_create()");
- goto Execption;
- }
-
- if (metadata_extractor_set_path(pMetadata, szFilePath) !=
- METADATA_EXTRACTOR_ERROR_NONE) {
- VideoLogInfo("[ERR] - metadata_extractor_set_path()");
- goto Execption;
- }
-
- if (metadata_extractor_get_metadata(pMetadata, METADATA_ROTATE, &szVal)
- != METADATA_EXTRACTOR_ERROR_NONE) {
- VideoLogInfo("[ERR] - metadata_extractor_get_metadata()");
- goto Execption;
- }
-
- if (szVal == NULL) {
- nRotate = 0;
- } else {
- nRotate = atoi(szVal);
- MP_FREE_STRING(szVal);
- }
-
- if (metadata_extractor_get_frame_at_time
- (pMetadata, nPosition, TRUE, &pFrame,
- &nFrameSize) != METADATA_EXTRACTOR_ERROR_NONE) {
- VideoLogInfo("[ERR] - metadata_extractor_get_frame_at_time()");
- goto Execption;
- }
-
- if (pFrame == NULL) {
- VideoLogInfo("pFrame is NULL");
- goto Execption;
- }
-
- if (nRotate != 0) {
- image_util_rotation_e nRot = IMAGE_UTIL_ROTATION_NONE;
- if (nRotate == 90) {
- nRot = IMAGE_UTIL_ROTATION_90;
- } else if (nRotate == 180) {
- nRot = IMAGE_UTIL_ROTATION_180;
- } else if (nRotate == 270) {
- nRot = IMAGE_UTIL_ROTATION_270;
- }
-
- if (nRot != IMAGE_UTIL_ROTATION_NONE) {
- unsigned int nResizBufSize = 0;
- int nSrcW = nWidth;
- int nSrcH = nHeight;
- if (image_util_calculate_buffer_size
- (nWidth, nHeight, IMAGE_UTIL_COLORSPACE_RGB888,
- &nResizBufSize) != IMAGE_UTIL_ERROR_NONE) {
- VideoLogInfo
- ("image_util_calculate_buffer_size is fail : [0x%x]",
- nRet);
- goto Execption;
- }
-
- pRotBuf = calloc(1, sizeof(unsigned char) * nResizBufSize);
- if (pRotBuf == NULL) {
- VideoLogInfo("pRotBuf alloc fail");
- goto Execption;
- } else {
- VideoLogInfo("ResizeBuf Size : %d", nResizBufSize);
- if (vp_util_image_rotate
- (pRotBuf, &nWidth, &nHeight, nRot, pFrame, nSrcW,
- nSrcH,
- IMAGE_UTIL_COLORSPACE_RGB888) !=
- IMAGE_UTIL_ERROR_NONE) {
- VideoLogInfo("vp_util_image_rotate is fail : [0x%x]",
- nRet);
- goto Execption;
- }
- }
- }
- }
- if (pRotBuf) {
- if (image_util_encode_jpeg
- (pRotBuf, nWidth, nHeight, IMAGE_UTIL_COLORSPACE_RGB888, 100,
- szDestImage) != IMAGE_UTIL_ERROR_NONE) {
- VideoLogInfo("image_util_encode_jpeg is fail : [0x%x]", nRet);
- goto Execption;
- }
- } else {
- if (image_util_encode_jpeg
- (pFrame, nWidth, nHeight, IMAGE_UTIL_COLORSPACE_RGB888, 100,
- szDestImage) != IMAGE_UTIL_ERROR_NONE) {
- VideoLogInfo("image_util_encode_jpeg is fail : [0x%x]", nRet);
- goto Execption;
- }
- }
-
- if (pMetadata) {
- metadata_extractor_destroy(pMetadata);
- pMetadata = NULL;
- }
-
- MP_FREE_STRING(pFrame);
- MP_FREE_STRING(pRotBuf);
-
- return TRUE;
- Execption:
-
- MP_FREE_STRING(pFrame);
- MP_FREE_STRING(pRotBuf);
-
- if (pMetadata) {
- metadata_extractor_destroy(pMetadata);
- pMetadata = NULL;
- }
- return FALSE;
-}
/**
*
telephony_handle_list_s tel_list;
telephony_call_h *call_list_sim;
telephony_call_status_e status = TELEPHONY_CALL_STATE_IDLE;
- telephony_call_type_e type;
unsigned int count_sim[2] = {0};
int ret = TELEPHONY_ERROR_NONE;
/**
*
- * @param szFilePath
- * @return
- */
-bool mp_util_save_preview_image(const char *szFilePath)
-{
- if (!szFilePath) {
- VideoLogError("[ERR] No exist szFilePath.");
- return FALSE;
- }
-
- char *szVideoID = NULL;
- char *szFileName = NULL;
- unsigned int nPosition = 0;
- int nWidth = 0;
- int nHeight = 0;
- unsigned int nDuration = 0;
- char *szTitle = NULL;
- mp_util_svc_get_video_detail_by_video_url(szFilePath, &nWidth,
- &nHeight, &szTitle,
- &nDuration, &nPosition);
- MP_FREE_STRING(szTitle);
-
- if (nPosition == 0) {
- return FALSE;
- }
-
- if (!mp_util_svc_get_video_id_by_video_url(szFilePath, &szVideoID)) {
- MP_FREE_STRING(szVideoID);
- VideoLogError("mp_util_svc_get_video_id_by_video_url is Fail");
- return FALSE;
- }
-
- if (!vp_is_dir(VIDEO_THUMB_DATA_DIR)) {
- if (!vp_mkpath(VIDEO_THUMB_DATA_DIR)) {
- MP_FREE_STRING(szVideoID);
- return FALSE;
- }
- }
-
- szFileName =
- g_strdup_printf("%s/%s.jpg", VIDEO_THUMB_DATA_DIR, szVideoID);
-
- mp_util_svc_get_frame_by_position(szFilePath, szFileName, nPosition,
- nWidth, nHeight);
- VideoLogInfo("szFileName %s", szFileName);
-
- MP_FREE_STRING(szVideoID);
- MP_FREE_STRING(szFileName);
-
- return TRUE;
-}
-
-/**
- *
* @param data
* @param e
* @param obj
* @param filePath
* @return
*/
-static bool __mp_util_check_if_in_same_folder(char *sourcePath,
+static bool __mp_util_check_if_in_same_folder(const char *sourcePath,
char *filePath)
{
}
int nIndex = 0;
- int nCounter = 0;
bool bValidMedia = FALSE;
VideoLogInfo("OldEditList ===%d nVideoListSize :%d", nTotal, nVideoListSize);
*/
void vp_share_view_update_share_panel(void)
{
- MpMediaType eMediaType = MEDIA_TYPE_FILE;
bool bValidMedia = FALSE;
- int i, nCounter;
+ int i;
if (g_pServiceShare && g_bSharePanelLaunched == TRUE) {
VideoLogInfo("");
- int nErr = 0;
int nCounter = 0;
int nTotalVideoItem = 0;
int nTotalAppendedItem = 0;
g_nShareListSize = 0;
- char *pOperation = VIDEO_SHARE_OPERATION_SINGLE;
char *szFileUrlForServiceSetUri = NULL;
char **szFileUrlArrayForServiceExtraData = NULL;
VideoLogInfo("Launching share panel.");
- ERROR_EXCEPTION:
if (szFileUrlForServiceSetUri) {
free(szFileUrlForServiceSetUri);
szFileUrlForServiceSetUri = NULL;
char szTmpStr[STR_LEN_MAX] = { 0, };
char szTmpStrDurationTime[STR_LEN_MAX] = { 0, };
- char szTmpStrLastPlayedPos[STR_LEN_MAX] = { 0, };
unsigned int nVideoInfoDuration =
mp_util_svc_get_video_duration_time(nVideoItemIndex);
- unsigned int nVideoInfoLastTime =
- mp_util_svc_get_video_last_played_pos(nVideoItemIndex);
mp_util_convert_time(nVideoInfoDuration, szTmpStrDurationTime, FALSE);
snprintf(szTmpStr, STR_LEN_MAX, "%s", szTmpStrDurationTime);
mp_thumbnail_view_destroy();
}
}
- __mp_list_view_result_user_cb(MP_LIST_VIEW_ALL);
+ __mp_list_view_result_user_cb(LIST_UPDATE_TYPE_ALL);
}
/**
} else {
elm_naviframe_item_pop(g_pSelectHandle->pNaviFrameHandle);
}
- g_pSelectHandle->pChangeViewUserCbFunc(MP_LIST_VIEW_ALL);
+ g_pSelectHandle->pChangeViewUserCbFunc(LIST_UPDATE_TYPE_ALL);
elm_naviframe_item_pop_to(g_pSelectHandle->pPreNaviItem);
}
}
}
mp_rename_ctrl_focus_out_cb();
- g_pSelectHandle->pChangeViewUserCbFunc(MP_LIST_VIEW_ALL);
+ g_pSelectHandle->pChangeViewUserCbFunc(LIST_UPDATE_TYPE_ALL);
elm_naviframe_item_pop_to(g_pSelectHandle->pPreNaviItem);
}
return;
}
if (g_pSelectHandle->bRename && g_pSelectHandle->pChangeViewUserCbFunc) {
- g_pSelectHandle->pChangeViewUserCbFunc(MP_LIST_VIEW_ALL);
+ g_pSelectHandle->pChangeViewUserCbFunc(LIST_UPDATE_TYPE_ALL);
}
mp_util_hide_indicator();