2 * Copyright (c) [2012] Samsung Electronics Co., Ltd.
4 * Licensed under the Flora License, Version 1.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
24 #include <syspopup_caller.h>
27 #include "mp-video-log.h"
28 #include "mp-external-ug.h"
29 #include "mp-video-view-mgr.h"
30 #include "mp-video-type-define.h"
31 #include "mp-util-media-service.h"
32 #include "mp-video-display-view.h"
33 #include "mp-video-string-define.h"
34 #include "mp-video-streaming-view.h"
35 #include "mp-video-service-ctrl.h"
36 #include "mp-video-volume-ctrl.h"
38 #define MULTIMEDIA_KEY_LONG_PRESS_INTERVAL 4.0
39 #define DETAIL_POPUP_STR_LEN_MAX 20
40 #define LAYOUT_VISIBLE_OFF_TIMER_INTERVAL 1.0
43 static Evas_Object *pMainLayout = NULL;
44 static Evas_Object *pBackGround = NULL;
45 static Evas_Object *pNaviFrame = NULL;
46 static Evas_Object *pConformant = NULL;
47 static Evas_Object *pGesture = NULL;
48 static Evas_Object *pEventRect = NULL;
49 static Evas_Object *pDisplayViewVolume = NULL;
51 static MpVideoRotateType nVideoRotateType = VIDEO_ROTATE_PORTRAIT_NORMAL;
53 static Ecore_Event_Handler *pHWKeyEventDownHandler = NULL;
54 static Ecore_Event_Handler *pHWKeyEventUpHandler = NULL;
56 static bool bIsLongPressForward = FALSE;
57 static bool bIsKeyCancle = FALSE;
58 static bool bShowLayout = FALSE;
60 static Ecore_Timer *pLongPressSpeedPlayingTimer = NULL;
61 static Ecore_Timer *pLongPressVolumeKeyTimer = NULL;
62 static Ecore_Timer *pLayoutVisibleOffTimer = NULL;
64 static void MpVideoVideoViewCtrlLongpressSpeedKeyUp(void *pUserData);
65 static void MpVideoVideoViewCtrlLongpressSpeedKeyDown(void *pUserData);
66 static void MpVideoViewCtrlChangeViewCb(int nChangePlayerView, void *pUserData);
71 static Eina_Bool MpVideoViewCtrlLayoutVisibleOffTimerCb(void *pUserData)
75 VideoLogInfo("[ERR]");
81 if(pLayoutVisibleOffTimer)
83 ecore_timer_del(pLayoutVisibleOffTimer);
84 pLayoutVisibleOffTimer = NULL;
87 VideoAppData *pAppData = (VideoAppData *)pUserData;
89 MpUtilLayoutVisibleOff(pAppData->pMainWindow);
94 static Eina_Bool MpVideoViewCtrlVolumeKeyDownTimerCb(void *pUserData)
98 VideoLogInfo("[ERR]");
104 MpVideoViewCtrlShowVolume();
106 nVol = MpVideoVolumeCtrlGetVolume() - 1;
107 MpVideoVolumeCtrlSetVolume(nVol);
112 static Eina_Bool MpVideoViewCtrlVolumeKeyUpTimerCb(void *pUserData)
116 VideoLogInfo("[ERR]");
122 MpVideoViewCtrlShowVolume();
124 nVol = MpVideoVolumeCtrlGetVolume() + 1;
125 MpVideoVolumeCtrlSetVolume(nVol);
131 static Eina_Bool MpVideoViewCtrlHardkeyDownCb(void *pUserData, int nType, void *pEvent)
135 VideoLogInfo("[ERR]");
141 Ecore_Event_Key *pKeyEvent = (Ecore_Event_Key *) pEvent;
142 VideoAppData *pAppData = (VideoAppData *)pUserData;
144 VideoLogInfo("Key down : %s", pKeyEvent->keyname);
146 if(!strcmp(pKeyEvent->keyname, END_KEY))
148 VideoLogInfo("Back(End) key");
150 else if(!strcmp(pKeyEvent->keyname, HOME_KEY))
152 VideoLogInfo("Home key");
154 else if(!strcmp(pKeyEvent->keyname, VOLUME_DOWN_KEY))
156 MpVideoViewCtrlShowVolume();
158 nVol = MpVideoVolumeCtrlGetVolume() - 1;
159 MpVideoVolumeCtrlSetVolume(nVol);
161 if(pLongPressVolumeKeyTimer)
163 ecore_timer_del(pLongPressVolumeKeyTimer);
164 pLongPressVolumeKeyTimer = NULL;
166 pLongPressVolumeKeyTimer = ecore_timer_add(0.3, MpVideoViewCtrlVolumeKeyDownTimerCb, (void *)pAppData);
168 else if(!strcmp(pKeyEvent->keyname, VOLUME_UP_KEY))
170 MpVideoViewCtrlShowVolume();
172 nVol = MpVideoVolumeCtrlGetVolume() + 1;
173 MpVideoVolumeCtrlSetVolume(nVol);
175 if(pLongPressVolumeKeyTimer)
177 ecore_timer_del(pLongPressVolumeKeyTimer);
178 pLongPressVolumeKeyTimer = NULL;
181 pLongPressVolumeKeyTimer = ecore_timer_add(0.3, MpVideoViewCtrlVolumeKeyUpTimerCb, (void *)pAppData);
183 else if(!strcmp(pKeyEvent->keyname, POWER_KEY))
185 VideoLogInfo("Power key");
187 MpUtilLcdOffForPowerButton();
189 else if(!strcmp(pKeyEvent->keyname, PAUSE_KEY))
191 VideoLogInfo("Pause key down");
193 else if(!strcmp(pKeyEvent->keyname, PLAY_KEY))
195 VideoLogInfo("Play key down");
197 else if(!strcmp(pKeyEvent->keyname, STOP_KEY))
199 VideoLogInfo("Stop key down");
201 else if(!strcmp(pKeyEvent->keyname, NEXT_KEY))
203 VideoLogInfo("Next key down");
205 else if(!strcmp(pKeyEvent->keyname, PREV_KEY))
207 VideoLogInfo("Prev key down");
209 else if(!strcmp(pKeyEvent->keyname, FORWARD_KEY))
211 VideoLogInfo("Forward key down");
212 bIsLongPressForward = TRUE;
213 MpVideoVideoViewCtrlLongpressSpeedKeyDown(pUserData);
215 else if(!strcmp(pKeyEvent->keyname, REWIND_KEY))
217 VideoLogInfo("Rewind key down");
218 bIsLongPressForward = FALSE;
219 MpVideoVideoViewCtrlLongpressSpeedKeyDown(pUserData);
221 else if(!strcmp(pKeyEvent->keyname, KEY_CANCLE))
223 VideoLogInfo("Cancel key down");
230 static Eina_Bool MpVideoViewCtrlHardkeyUpCb(void *pUserData, int nType, void *pEvent)
234 VideoLogInfo("[ERR]");
240 Ecore_Event_Key *pKeyEvent = (Ecore_Event_Key *) pEvent;
242 VideoAppData *pAppData = (VideoAppData *)pUserData;
244 VideoLogInfo("Key Up : %s", pKeyEvent->keyname);
248 VideoLogInfo("KEY CANCLE.");
249 if(pLongPressVolumeKeyTimer)
251 ecore_timer_del(pLongPressVolumeKeyTimer);
252 pLongPressVolumeKeyTimer = NULL;
254 bIsKeyCancle = FALSE;
258 if(!strcmp(pKeyEvent->keyname, END_KEY))
260 VideoLogInfo("End key up");
261 pAppData->VideoAppCtrlCallbackFunc.VideoAppCtrlExit(pAppData);
263 else if(!strcmp(pKeyEvent->keyname, VOLUME_DOWN_KEY))
265 if(pLongPressVolumeKeyTimer)
267 ecore_timer_del(pLongPressVolumeKeyTimer);
268 pLongPressVolumeKeyTimer = NULL;
271 else if(!strcmp(pKeyEvent->keyname, VOLUME_UP_KEY))
273 if(pLongPressVolumeKeyTimer)
275 ecore_timer_del(pLongPressVolumeKeyTimer);
276 pLongPressVolumeKeyTimer = NULL;
279 else if(!strcmp(pKeyEvent->keyname, HOME_KEY))
281 VideoLogInfo("Home key up");
283 int nTmpPlayerType = MpVideoServiceCtrlGetPlayerType();
284 if(nTmpPlayerType == MP_VIDEO_PLAYER ||
285 nTmpPlayerType == MP_VIDEO_PLAYER_SIMPLE ||
286 nTmpPlayerType == MP_VIDEO_PLAYER_GALLERY ||
287 nTmpPlayerType == MP_VIDEO_PLAYER_EMAIL ||
288 nTmpPlayerType == MP_VIDEO_PLAYER_MMS)
290 pAppData->VideoAppCtrlCallbackFunc.VideoAppCtrlExit(pAppData);
293 MpVideoServiceCtrlSetPrevPlayerType(MpVideoServiceCtrlGetPlayerType());
295 else if(!strcmp(pKeyEvent->keyname, POWER_KEY))
297 VideoLogInfo("Power key up");
299 else if(!strcmp(pKeyEvent->keyname, PAUSE_KEY))
301 VideoLogInfo("Pause key up");
302 if(pAppData->nCurPlayerState == MP_PLAYER_STATE_PLAY || pAppData->nCurPlayerState == MP_PLAYER_STATE_RESUME)
304 pAppData->VideoAppCtrlCallbackFunc.VideoAppCtrlPause(pAppData);
306 else if(pAppData->nCurPlayerState == MP_PLAYER_STATE_PAUSE)
308 pAppData->VideoAppCtrlCallbackFunc.VideoAppCtrlResume(pAppData);
311 else if(!strcmp(pKeyEvent->keyname, PLAY_KEY))
313 VideoLogInfo("Play key up");
314 if(pAppData->nCurPlayerState == MP_PLAYER_STATE_PLAY || pAppData->nCurPlayerState == MP_PLAYER_STATE_RESUME)
316 pAppData->VideoAppCtrlCallbackFunc.VideoAppCtrlPause(pAppData);
318 else if(pAppData->nCurPlayerState == MP_PLAYER_STATE_PAUSE)
320 pAppData->VideoAppCtrlCallbackFunc.VideoAppCtrlResume(pAppData);
323 else if(!strcmp(pKeyEvent->keyname, STOP_KEY))
325 VideoLogInfo("Stop key up");
326 pAppData->VideoAppCtrlCallbackFunc.VideoAppCtrlPause(pAppData);
328 else if(!strcmp(pKeyEvent->keyname, NEXT_KEY))
330 VideoLogInfo("Next key up");
332 else if(!strcmp(pKeyEvent->keyname, PREV_KEY))
334 VideoLogInfo("Prev key up");
336 else if(!strcmp(pKeyEvent->keyname, FORWARD_KEY))
338 VideoLogInfo("Forward key up");
339 MpVideoVideoViewCtrlLongpressSpeedKeyUp(pUserData);
341 else if(!strcmp(pKeyEvent->keyname, REWIND_KEY))
343 VideoLogInfo("Rewind key up");
344 MpVideoVideoViewCtrlLongpressSpeedKeyUp(pUserData);
353 static Evas_Event_Flags MpVideoViewCtrlGestureNTabStartCb(void *pUserData , void *pEventInfo)
357 return EVAS_EVENT_FLAG_NONE;
361 static Evas_Event_Flags MpVideoViewCtrlGestureNTabEndCb(void *pUserData , void *pEventInfo)
365 Elm_Gesture_Taps_Info *p = (Elm_Gesture_Taps_Info *) pEventInfo;
367 VideoAppData *pAppData = (VideoAppData *)pUserData;
375 evas_object_geometry_get(pMainLayout, NULL, NULL, &nWidth, &nHeight);
377 if(MpUtilGetRotationState() == VIDEO_ROTATE_PORTRAIT_NORMAL ||
378 MpUtilGetRotationState() == VIDEO_ROTATE_PORTRAIT_REVERSE)
380 nMinY = (elm_config_scale_get() * 223);
381 nMaxY = nHeight - ( elm_config_scale_get() * 215);
385 nMinY = (elm_config_scale_get() * 223);
386 nMaxY = nHeight - ( elm_config_scale_get() * 204);
389 if(p->y > nMinY && p->y < nMaxY)
391 pAppData->VideoAppCtrlCallbackFunc.VideoAppCtrlHideLayout(pAppData);
394 pAppData->VideoAppCtrlCallbackFunc.VideoAppCtrlShowLayout(pAppData);
398 return EVAS_EVENT_FLAG_NONE;
402 static Evas_Event_Flags MpVideoViewCtrlGestureNTabAbortCb(void *pUserData , void *pEventInfo)
406 return EVAS_EVENT_FLAG_NONE;
412 static void MpVideoViewCtrlScreenRotationInit(int nRotateMode, void *pUserData)
416 VideoLogInfo("[ERR] No exist pUserData.");
422 VideoAppData *pAppData = (VideoAppData *)pUserData;
424 MpUtilRotateWindow(nRotateMode, pAppData->pMainWindow);
425 nVideoRotateType = nRotateMode;
426 MpVideoViewCtrlSetRotation(nVideoRotateType, FALSE, pUserData);
429 static Evas_Object *MpVideoViewCtrlCreateBg(Evas_Object *pWindow)
433 VideoLogError("[ERR]");
442 void* MpVideoViewCtrlCreateConformant(void *pParent)
446 VideoLogInfo("[ERR]");
452 Evas_Object *pTmpConform = NULL;
454 pTmpConform = elm_conformant_add(pParent);
455 evas_object_size_hint_weight_set(pTmpConform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
456 elm_win_conformant_set(pParent, EINA_TRUE);
457 elm_win_resize_object_add(pParent, pTmpConform);
458 evas_object_show(pTmpConform);
460 pConformant = pTmpConform;
465 static Evas_Object *MpVideoViewCtrlCreateMainLayout(Evas_Object *pParent)
469 VideoLogInfo("[ERR]");
477 evas_object_del(pMainLayout);
481 pMainLayout = elm_layout_add(pParent);
483 elm_layout_theme_set(pMainLayout, "layout", "application", "video_no_indicator");
484 evas_object_size_hint_weight_set(pMainLayout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
485 elm_object_content_set(pParent, pMainLayout);
486 pBackGround = MpVideoViewCtrlCreateBg(pParent);
487 evas_object_show(pMainLayout);
492 static void MpVideoViewCtrlCreateEventRect(void *pUserData, Evas_Object *pParent)
496 VideoLogInfo("[ERR]");
502 VideoLogInfo("[ERR]");
508 pEventRect = evas_object_rectangle_add(evas_object_evas_get(pParent));
509 evas_object_color_set(pEventRect, 0, 0, 0, 0);
511 elm_object_part_content_set(pParent, "elm.swallow.event", pEventRect);
513 pGesture = elm_gesture_layer_add(pEventRect);
515 elm_gesture_layer_cb_set(pGesture, ELM_GESTURE_N_TAPS, ELM_GESTURE_STATE_START, MpVideoViewCtrlGestureNTabStartCb, pUserData);
516 elm_gesture_layer_cb_set(pGesture, ELM_GESTURE_N_TAPS, ELM_GESTURE_STATE_END, MpVideoViewCtrlGestureNTabEndCb, pUserData);
517 elm_gesture_layer_cb_set(pGesture, ELM_GESTURE_N_TAPS, ELM_GESTURE_STATE_ABORT, MpVideoViewCtrlGestureNTabAbortCb, pUserData);
519 evas_object_repeat_events_set(pEventRect, EINA_TRUE);
521 elm_gesture_layer_attach(pGesture, pEventRect);
523 evas_object_show(pEventRect);
527 static Evas_Object *MpVideoViewCtrlCreateVolume(void *pUserData, Evas_Object *pParent)
531 VideoLogInfo("[ERR]");
537 if(pDisplayViewVolume)
539 evas_object_del(pDisplayViewVolume);
540 pDisplayViewVolume = NULL;
543 pDisplayViewVolume = MpVideoVolumeCtrlInit(pParent, pUserData);
545 return pDisplayViewVolume;
548 static void MpVideoViewCtrlShowNaviFrame(void)
554 elm_object_part_content_set(pMainLayout, "elm.swallow.content", pNaviFrame);
555 evas_object_show(pNaviFrame);
559 static Evas_Object *MpVideoViewCtrlCreateNaviFrame(Evas_Object *pParent, void* pUserData)
563 VideoLogInfo("[ERR]");
571 evas_object_del(pNaviFrame);
575 pNaviFrame = elm_naviframe_add(pParent);
577 elm_object_part_content_set(pParent, "elm.swallow.content", pNaviFrame);
579 elm_naviframe_prev_btn_auto_pushed_set(pNaviFrame, EINA_FALSE);
581 evas_object_show(pNaviFrame);
586 static void MpVideoViewCtrlSetVideoViews(VideoAppData *pAppData, int nPlayerType)
588 VideoLogInfo("%p",pAppData);
590 MpVideoServiceCtrlSetPlayerType(nPlayerType);
594 case MP_VIDEO_PLAYER:
595 VideoLogInfo("MP_VIDEO_PLAYER");
596 MpUtilMultimediaVolumeKeyGrab();
597 MpVideoDisplayViewPush((void *)pNaviFrame, nPlayerType, (void *)pAppData, MpVideoViewCtrlChangeViewCb);
600 case MP_VIDEO_PLAYER_SIMPLE:
601 VideoLogInfo("MP_VIDEO_PLAYER_SIMPLE");
602 MpUtilMultimediaVolumeKeyGrab();
603 MpVideoDisplayViewPush((void *)pNaviFrame, nPlayerType, (void *)pAppData, MpVideoViewCtrlChangeViewCb);
606 case MP_VIDEO_PLAYER_EMAIL:
607 VideoLogInfo("MP_VIDEO_PLAYER_EMAIL");
608 MpUtilMultimediaVolumeKeyGrab();
609 MpVideoDisplayViewPush((void *)pNaviFrame, nPlayerType, (void *)pAppData, MpVideoViewCtrlChangeViewCb);
612 case MP_VIDEO_PLAYER_MMS:
613 VideoLogInfo("MP_VIDEO_PLAYER_MMS");
614 MpUtilMultimediaVolumeKeyGrab();
615 MpVideoDisplayViewPush((void *)pNaviFrame, nPlayerType, (void *)pAppData, MpVideoViewCtrlChangeViewCb);
618 case MP_VIDEO_PLAYER_GALLERY:
619 VideoLogInfo("MP_VIDEO_PLAYER_GALLERY");
620 MpUtilMultimediaVolumeKeyGrab();
621 MpVideoDisplayViewPush((void *)pNaviFrame, nPlayerType, (void *)pAppData, MpVideoViewCtrlChangeViewCb);
624 case MP_STREAMING_PLAYER:
625 VideoLogInfo("MP_STREAMING_PLAYER");
626 MpUtilMultimediaVolumeKeyGrab();
627 MpVideoStreamingViewPush((void *)pNaviFrame, nPlayerType, (void *)pAppData, MpVideoViewCtrlChangeViewCb);
631 VideoLogInfo("[ERR] No exist player tpye.");
632 pAppData->VideoAppCtrlCallbackFunc.VideoAppCtrlExit(pAppData);
636 static Eina_Bool MpVideoVideoViewCtrlSpeedKeyLongPressCb(void *pUserData)
640 VideoLogInfo("[ERR]");
646 VideoAppData *pAppData = (VideoAppData *)pUserData;
648 if(pAppData->nPlayingSpeed > MP_PLAYING_SPEED_MAX)
650 if(pLongPressSpeedPlayingTimer)
652 ecore_timer_del(pLongPressSpeedPlayingTimer);
653 pLongPressSpeedPlayingTimer = NULL;
659 ++pAppData->nPlayingSpeed;
661 if(bIsLongPressForward)
663 pAppData->VideoAppCtrlCallbackFunc.VideoAppCtrlSpeedFF(pAppData);
667 pAppData->VideoAppCtrlCallbackFunc.VideoAppCtrlSpeedRew(pAppData);
673 static void MpVideoVideoViewCtrlLongpressSpeedKeyDown(void *pUserData)
677 VideoLogInfo("No exist pUserData.");
683 VideoAppData *pAppData = (VideoAppData *)pUserData;
685 pAppData->nPlayingSpeed = MP_PLAYING_SPEED_2X;
687 if(bIsLongPressForward)
689 pAppData->VideoAppCtrlCallbackFunc.VideoAppCtrlSpeedFF(pAppData);
693 pAppData->VideoAppCtrlCallbackFunc.VideoAppCtrlSpeedRew(pAppData);
696 if(pLongPressSpeedPlayingTimer)
698 ecore_timer_del(pLongPressSpeedPlayingTimer);
699 pLongPressSpeedPlayingTimer = NULL;
702 pLongPressSpeedPlayingTimer = ecore_timer_add(MULTIMEDIA_KEY_LONG_PRESS_INTERVAL, MpVideoVideoViewCtrlSpeedKeyLongPressCb, (void *)pAppData);
705 static void MpVideoVideoViewCtrlLongpressSpeedKeyUp(void *pUserData)
709 VideoLogInfo("No exist pUserData.");
715 VideoAppData *pAppData = (VideoAppData *)pUserData;
717 bIsLongPressForward = FALSE;
719 pAppData->VideoAppCtrlCallbackFunc.VideoAppCtrlSpeedReset(pAppData);
721 if(pLongPressSpeedPlayingTimer)
723 ecore_timer_del(pLongPressSpeedPlayingTimer);
724 pLongPressSpeedPlayingTimer = NULL;
728 static void MpVideoViewCtrlChangeViewCb(int nChangePlayerView, void *pUserData)
732 VideoLogInfo("[ERR]");
738 VideoAppData *pAppData = (VideoAppData *)pUserData;
740 MpVideoViewCtrlHideVolume();
742 MpVideoViewCtrlSetVideoViews((VideoAppData*)pUserData, nChangePlayerView);
744 pAppData->VideoAppCtrlCallbackFunc.VideoAppCtrlReLaunching(pAppData);
750 bool MpVideoViewCtrlInit(VideoAppData *pAppData)
754 VideoLogInfo("[ERR]");
760 if(pHWKeyEventDownHandler)
762 ecore_event_handler_del(pHWKeyEventDownHandler);
763 pHWKeyEventDownHandler = NULL;
766 if(pHWKeyEventUpHandler)
768 ecore_event_handler_del(pHWKeyEventUpHandler);
769 pHWKeyEventUpHandler = NULL;
772 pHWKeyEventDownHandler = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, (void *)MpVideoViewCtrlHardkeyDownCb, (void *)pAppData);
773 pHWKeyEventUpHandler = ecore_event_handler_add(ECORE_EVENT_KEY_UP, (void *)MpVideoViewCtrlHardkeyUpCb, (void *)pAppData);
775 elm_win_indicator_mode_set(pAppData->pMainWindow, ELM_WIN_INDICATOR_SHOW);
777 MpVideoViewCtrlCreateConformant(pAppData->pMainWindow);
778 MpVideoViewCtrlCreateMainLayout(pConformant);
779 MpVideoViewCtrlCreateEventRect((void *)pAppData, pMainLayout);
780 MpVideoViewCtrlCreateVolume(pAppData, pMainLayout);
781 MpVideoViewCtrlCreateNaviFrame(pMainLayout, (void*)pAppData);
782 MpVideoViewCtrlSetVideoViews(pAppData, MpVideoServiceCtrlGetPlayerType());
783 MpVideoViewCtrlScreenRotationInit(MpUtilGetRotationState(), (void *)pAppData);
788 void MpVideoViewCtrlDestroy(void *pUserData)
792 VideoLogInfo("[ERR]");
798 MpExternalUgUnload();
800 MpVideoVolumeCtrlDestroy();
802 int nTmpPlayerType = MpVideoServiceCtrlGetPlayerType();
804 if(nTmpPlayerType == MP_VIDEO_PLAYER ||
805 nTmpPlayerType == MP_VIDEO_PLAYER_SIMPLE ||
806 nTmpPlayerType == MP_VIDEO_PLAYER_GALLERY ||
807 nTmpPlayerType == MP_VIDEO_PLAYER_EMAIL ||
808 nTmpPlayerType == MP_VIDEO_PLAYER_MMS)
810 MpVideoDisplayViewDestroy(pUserData);
812 else if(nTmpPlayerType == MP_STREAMING_PLAYER)
814 MpVideoStreamingViewDestroy(pUserData);
819 evas_object_del(pGesture);
825 evas_object_del(pEventRect);
829 if(pHWKeyEventDownHandler)
831 ecore_event_handler_del(pHWKeyEventDownHandler);
832 pHWKeyEventDownHandler = NULL;
835 if(pHWKeyEventUpHandler)
837 ecore_event_handler_del(pHWKeyEventUpHandler);
838 pHWKeyEventUpHandler = NULL;
843 evas_object_del(pMainLayout);
847 if(pLongPressSpeedPlayingTimer)
849 ecore_timer_del(pLongPressSpeedPlayingTimer);
850 pLongPressSpeedPlayingTimer = NULL;
853 if(pLongPressVolumeKeyTimer)
855 ecore_timer_del(pLongPressVolumeKeyTimer);
856 pLongPressVolumeKeyTimer = NULL;
859 if(pLayoutVisibleOffTimer)
861 ecore_timer_del(pLayoutVisibleOffTimer);
862 pLayoutVisibleOffTimer = NULL;
865 if(pDisplayViewVolume)
867 evas_object_del(pDisplayViewVolume);
868 pDisplayViewVolume = NULL;
873 evas_object_del(pBackGround);
877 bIsLongPressForward = FALSE;
878 bIsKeyCancle = FALSE;
880 nVideoRotateType = VIDEO_ROTATE_PORTRAIT_NORMAL;
883 void MpVideoViewCtrlSetRotation(int nRotateMode, bool bLayoutHide, void *pUserData)
887 VideoLogInfo("[ERR] No exist pUserData.");
893 VideoAppData *pAppData = (VideoAppData *)pUserData;
895 if(nRotateMode == VIDEO_ROTATE_UNKNOWN)
897 nRotateMode = MpUtilGetRotationState();
900 nVideoRotateType = nRotateMode;
902 MpUtilSetRotationState(nVideoRotateType);
904 if(MpVideoVolumeCtrlGetShowStatus())
906 MpVideoViewCtrlHideVolume();
909 if(nVideoRotateType == VIDEO_ROTATE_PORTRAIT_NORMAL || nVideoRotateType == VIDEO_ROTATE_PORTRAIT_REVERSE)
911 edje_object_signal_emit(_EDJ(pMainLayout), SIGNAL_VOLUME_PORTRAIT_MODE, "*");
913 else if(nVideoRotateType == VIDEO_ROTATE_LANDSCAPE_NORMAL || nVideoRotateType == VIDEO_ROTATE_LANDSCAPE_REVERSE)
915 edje_object_signal_emit(_EDJ(pMainLayout), SIGNAL_VOLUME_LANDSCAPE_MODE, "*");
918 int nTmpPlayerType = MpVideoServiceCtrlGetPlayerType();
920 if(nTmpPlayerType == MP_VIDEO_PLAYER ||
921 nTmpPlayerType == MP_VIDEO_PLAYER_SIMPLE ||
922 nTmpPlayerType == MP_VIDEO_PLAYER_GALLERY ||
923 nTmpPlayerType == MP_VIDEO_PLAYER_EMAIL ||
924 nTmpPlayerType == MP_VIDEO_PLAYER_MMS)
926 if(nVideoRotateType == VIDEO_ROTATE_PORTRAIT_NORMAL || nVideoRotateType == VIDEO_ROTATE_PORTRAIT_REVERSE)
928 MpVideoDisplayViewPortrate(bLayoutHide, pUserData);
930 else if(nVideoRotateType == VIDEO_ROTATE_LANDSCAPE_NORMAL || nVideoRotateType == VIDEO_ROTATE_LANDSCAPE_REVERSE)
932 MpVideoDisplayViewLandscape(bLayoutHide, pUserData);
935 else if(nTmpPlayerType == MP_STREAMING_PLAYER)
937 MpVideoStreamingViewRotation((void *)pAppData, nVideoRotateType, bLayoutHide);
940 MpUtilRotateWindow(nVideoRotateType, pAppData->pMainWindow);
942 pAppData->VideoAppCtrlCallbackFunc.VideoAppCtrlRotateScreen(pAppData, nVideoRotateType);
945 void MpVideoViewCtrlInitAfterBeginOfStream(void *pUserData)
949 VideoLogInfo("[ERR]");
955 int nTmpPlayerType = MpVideoServiceCtrlGetPlayerType();
957 if(nTmpPlayerType == MP_VIDEO_PLAYER ||
958 nTmpPlayerType == MP_VIDEO_PLAYER_SIMPLE ||
959 nTmpPlayerType == MP_VIDEO_PLAYER_GALLERY ||
960 nTmpPlayerType == MP_VIDEO_PLAYER_EMAIL ||
961 nTmpPlayerType == MP_VIDEO_PLAYER_MMS)
963 MpVideoDisplayViewInitAfterBeginOfStream(pUserData);
965 else if(nTmpPlayerType == MP_STREAMING_PLAYER)
967 MpVideoStreamingViewInitAfterBeginOfStream(pUserData);
971 void MpVideoViewCtrlPause(void *pUserData)
975 VideoLogInfo("[ERR]");
981 int nTmpPlayerType = MpVideoServiceCtrlGetPlayerType();
983 if(nTmpPlayerType == MP_VIDEO_PLAYER ||
984 nTmpPlayerType == MP_VIDEO_PLAYER_SIMPLE ||
985 nTmpPlayerType == MP_VIDEO_PLAYER_GALLERY ||
986 nTmpPlayerType == MP_VIDEO_PLAYER_EMAIL ||
987 nTmpPlayerType == MP_VIDEO_PLAYER_MMS)
989 MpVideoDisplayViewUpdatePauseKey();
991 else if(nTmpPlayerType == MP_STREAMING_PLAYER)
993 MpVideoStreamingViewUpdatePauseKey();
997 void MpVideoViewCtrlResume(void *pUserData)
1001 VideoLogInfo("[ERR]");
1007 int nTmpPlayerType = MpVideoServiceCtrlGetPlayerType();
1009 if(nTmpPlayerType == MP_VIDEO_PLAYER ||
1010 nTmpPlayerType == MP_VIDEO_PLAYER_SIMPLE ||
1011 nTmpPlayerType == MP_VIDEO_PLAYER_GALLERY ||
1012 nTmpPlayerType == MP_VIDEO_PLAYER_EMAIL ||
1013 nTmpPlayerType == MP_VIDEO_PLAYER_MMS)
1015 MpVideoDisplayViewUpdateResumeKey();
1017 else if(nTmpPlayerType == MP_STREAMING_PLAYER)
1019 MpVideoStreamingViewUpdateResumeKey();
1023 void MpVideoViewShowLayout(void *pUserData)
1027 VideoLogInfo("[ERR]");
1033 VideoAppData *pAppData = (VideoAppData *)pUserData;
1035 if(pLayoutVisibleOffTimer)
1037 ecore_timer_del(pLayoutVisibleOffTimer);
1038 pLayoutVisibleOffTimer = NULL;
1041 int nTmpPlayerType = MpVideoServiceCtrlGetPlayerType();
1043 if(nTmpPlayerType == MP_VIDEO_PLAYER ||
1044 nTmpPlayerType == MP_VIDEO_PLAYER_SIMPLE ||
1045 nTmpPlayerType == MP_VIDEO_PLAYER_GALLERY ||
1046 nTmpPlayerType == MP_VIDEO_PLAYER_EMAIL ||
1047 nTmpPlayerType == MP_VIDEO_PLAYER_MMS)
1049 edje_object_signal_emit(_EDJ(pMainLayout), SIGNAL_LAYOUT_INDICATOR_SHOW, "*");
1050 elm_win_indicator_mode_set(pAppData->pMainWindow, ELM_WIN_INDICATOR_SHOW);
1051 MpVideoViewCtrlShowNaviFrame();
1054 MpVideoDisplayViewActivate();
1055 MpVideoDisplayViewShowControlPanel(pUserData);
1057 else if(nTmpPlayerType == MP_STREAMING_PLAYER)
1059 edje_object_signal_emit(_EDJ(pMainLayout), SIGNAL_LAYOUT_INDICATOR_SHOW, "*");
1060 elm_win_indicator_mode_set(pAppData->pMainWindow, ELM_WIN_INDICATOR_SHOW);
1061 MpVideoViewCtrlShowNaviFrame();
1064 MpVideoStreamingViewActivate();
1065 MpVideoStreamingViewShowControlPanel(pUserData);
1069 void MpVideoViewHideLayout(void *pUserData)
1073 VideoLogInfo("[ERR]");
1079 VideoAppData *pAppData = (VideoAppData *)pUserData;
1081 int nTmpPlayerType = MpVideoServiceCtrlGetPlayerType();
1083 if(nTmpPlayerType == MP_STREAMING_PLAYER)
1085 if(MpVideoStreamingViewGetBufferingState())
1087 VideoLogInfo("skip for Buffering");
1092 edje_object_signal_emit(_EDJ(pMainLayout), SIGNAL_LAYOUT_INDICATOR_HIDE, "*");
1093 elm_win_indicator_mode_set(pAppData->pMainWindow, ELM_WIN_INDICATOR_HIDE);
1095 bShowLayout = FALSE;
1097 if(nTmpPlayerType == MP_VIDEO_PLAYER ||
1098 nTmpPlayerType == MP_VIDEO_PLAYER_SIMPLE ||
1099 nTmpPlayerType == MP_VIDEO_PLAYER_GALLERY ||
1100 nTmpPlayerType == MP_VIDEO_PLAYER_EMAIL ||
1101 nTmpPlayerType == MP_VIDEO_PLAYER_MMS)
1103 MpVideoDisplayViewHideControlPanel(pUserData);
1105 else if(nTmpPlayerType == MP_STREAMING_PLAYER)
1107 MpVideoStreamingViewHideControlPanel(pUserData);
1110 void MpVideoViewCtrlShowFinish(void *pUserData)
1116 void MpVideoViewCtrlHideFinish(void *pUserData, bool bLayoutOff)
1120 VideoLogError("[ERR]");
1126 VideoAppData *pAppData = (VideoAppData *)pUserData;
1130 elm_object_part_content_unset(pMainLayout, "elm.swallow.content");
1131 evas_object_hide(pNaviFrame);
1134 if(pLayoutVisibleOffTimer)
1136 ecore_timer_del(pLayoutVisibleOffTimer);
1137 pLayoutVisibleOffTimer = NULL;
1142 pLayoutVisibleOffTimer = ecore_timer_add(LAYOUT_VISIBLE_OFF_TIMER_INTERVAL, MpVideoViewCtrlLayoutVisibleOffTimerCb, (void *)pAppData);
1148 void MpVideoViewSetBufferingRateForStreamingView(int nSetBufferingRate, void *pUserData)
1152 VideoLogInfo("[ERR]");
1156 // VideoLogInfo("");
1158 VideoAppData *pAppData = (VideoAppData *)pUserData;
1160 int nTmpPlayerType = MpVideoServiceCtrlGetPlayerTypeWithoutLog();
1162 if(nTmpPlayerType == MP_STREAMING_PLAYER)
1164 if(MpUtilCheckRTSPType(pAppData->szMediaUri))
1166 if(nSetBufferingRate == 0)
1168 MpVideoStreamingViewSetBufferingRate(-1);
1172 MpVideoStreamingViewSetBufferingRate(nSetBufferingRate);
1177 if(nSetBufferingRate >= 0)
1179 MpVideoStreamingViewSetBufferingRate(nSetBufferingRate);
1185 void MpVideoViewCtrlChangeTitle(void *pUserData)
1189 VideoLogInfo("[ERR]");
1195 int nTmpPlayerType = MpVideoServiceCtrlGetPlayerType();
1197 if(nTmpPlayerType == MP_VIDEO_PLAYER ||
1198 nTmpPlayerType == MP_VIDEO_PLAYER_SIMPLE ||
1199 nTmpPlayerType == MP_VIDEO_PLAYER_GALLERY ||
1200 nTmpPlayerType == MP_VIDEO_PLAYER_EMAIL ||
1201 nTmpPlayerType == MP_VIDEO_PLAYER_MMS)
1203 VideoAppData *pAppData = (VideoAppData *)pUserData;
1205 memset(pAppData->szSubtitle, 0, sizeof(char) * STR_LEN_MAX);
1207 MpVideoDisplayViewChangeNaviFrameTitle(pUserData);
1211 bool MpVideoViewCtrlIsTopView(void *pUserData)
1215 VideoLogInfo("[ERR]");
1221 bool bIstopView = FALSE;
1223 int nTmpPlayerType = MpVideoServiceCtrlGetPlayerType();
1225 if(nTmpPlayerType == MP_VIDEO_PLAYER ||
1226 nTmpPlayerType == MP_VIDEO_PLAYER_SIMPLE ||
1227 nTmpPlayerType == MP_VIDEO_PLAYER_GALLERY ||
1228 nTmpPlayerType == MP_VIDEO_PLAYER_EMAIL ||
1229 nTmpPlayerType == MP_VIDEO_PLAYER_MMS)
1231 VideoLogInfo("VIDEO PLAYER");
1232 bIstopView = MpVideoDisplayViewIsTopView();
1234 else if(nTmpPlayerType == MP_STREAMING_PLAYER)
1236 VideoLogInfo("STREAMING PLAYER");
1237 bIstopView = MpVideoStreamingViewIsTopView();
1243 void MpVideoViewCtrlShowNocontentImage(void *pUserData)
1247 VideoLogInfo("[ERR]");
1253 int nTmpPlayerType = MpVideoServiceCtrlGetPlayerType();
1255 if(nTmpPlayerType == MP_VIDEO_PLAYER ||
1256 nTmpPlayerType == MP_VIDEO_PLAYER_SIMPLE ||
1257 nTmpPlayerType == MP_VIDEO_PLAYER_GALLERY ||
1258 nTmpPlayerType == MP_VIDEO_PLAYER_EMAIL ||
1259 nTmpPlayerType == MP_VIDEO_PLAYER_MMS)
1261 MpVideoDisplayViewShowNocontentImage(pUserData);
1263 else if(nTmpPlayerType == MP_STREAMING_PLAYER)
1265 MpVideoStreamingViewShowNocontentImage(pUserData);
1269 void MpVideoViewCtrlHideNocontentImage(void *pUserData)
1273 VideoLogInfo("[ERR]");
1279 int nTmpPlayerType = MpVideoServiceCtrlGetPlayerType();
1281 if(nTmpPlayerType == MP_VIDEO_PLAYER ||
1282 nTmpPlayerType == MP_VIDEO_PLAYER_SIMPLE ||
1283 nTmpPlayerType == MP_VIDEO_PLAYER_GALLERY ||
1284 nTmpPlayerType == MP_VIDEO_PLAYER_EMAIL ||
1285 nTmpPlayerType == MP_VIDEO_PLAYER_MMS)
1287 MpVideoDisplayViewHideNocontentImage();
1289 else if(nTmpPlayerType == MP_STREAMING_PLAYER)
1291 MpVideoStreamingViewHideNocontentImage();
1295 void MpVideoViewCtrlResetProgressBar(void *pUserData)
1299 MpVideoDisplayViewResetProgressBar(pUserData);
1302 void MpVideoViewCtrlUpdateProgressbar(void *pUserData)
1306 VideoLogInfo("No exist pUserData.");
1310 int nTmpPlayerType = MpVideoServiceCtrlGetPlayerType();
1312 if(nTmpPlayerType == MP_VIDEO_PLAYER ||
1313 nTmpPlayerType == MP_VIDEO_PLAYER_SIMPLE ||
1314 nTmpPlayerType == MP_VIDEO_PLAYER_GALLERY ||
1315 nTmpPlayerType == MP_VIDEO_PLAYER_EMAIL ||
1316 nTmpPlayerType == MP_VIDEO_PLAYER_MMS)
1318 VideoLogInfo("VIDEO PLAYER");
1319 MpVideoDisplayViewUpdateProgressBar(pUserData);
1321 else if(nTmpPlayerType == MP_STREAMING_PLAYER)
1323 VideoLogInfo("STREAMING PLAYER");
1324 MpVideoStreamingViewUpdateProgressBar(pUserData);
1329 bool MpVideoViewCtrlIsPauseByUser(void *pUserData)
1333 VideoLogInfo("[ERR]");
1339 return MpVideoDisplayViewIsPauseByUser();
1342 void MpVideoViewCtrlShowVolume()
1346 if(MpVideoVolumeCtrlGetShowStatus())
1351 elm_object_part_content_set(pMainLayout, "elm.swallow.volume", pDisplayViewVolume);
1353 MpVideoVolumeCtrlShow();
1356 void MpVideoViewCtrlHideVolume()
1360 if(pLongPressVolumeKeyTimer)
1362 ecore_timer_del(pLongPressVolumeKeyTimer);
1363 pLongPressVolumeKeyTimer = NULL;
1366 elm_object_part_content_unset(pMainLayout, "elm.swallow.volume");
1368 MpVideoVolumeCtrlHide();