[0.3.78] Move destroy Evas_handle code and fix typo 42/155242/3
authorHyunil <hyunil46.park@samsung.com>
Thu, 12 Oct 2017 11:03:25 +0000 (20:03 +0900)
committerHyunil <hyunil46.park@samsung.com>
Fri, 13 Oct 2017 04:36:52 +0000 (13:36 +0900)
Change-Id: I3fbc82b19c1b2f2dfef3579103dcacd7d056e4eb
Signed-off-by: Hyunil <hyunil46.park@samsung.com>
disp/player_display.c
disp/player_display.h
packaging/capi-media-player.spec
src/player.c

index 70ccbbb..5fdbc8c 100644 (file)
@@ -224,23 +224,22 @@ int disp_set_evas_display_roi_area(MMHandleType evas_handle, int x, int y, int w
        return ret;
 }
 
-int disp_set_evas_display_old_info(void *display, void *evas_handle, int mode, int rotation, int visible)
+int disp_set_evas_display_old_info(void *display, MMHandleType evas_handle, int mode, int rotation, int visible)
 {
        int ret = MM_ERROR_NONE;
        return_val_if_fail(display != NULL, MM_ERROR_INVALID_ARGUMENT);
        return_val_if_fail(evas_handle != NULL, MM_ERROR_INVALID_HANDLE);
 
        LOGW("set evas information mode %d, rotation %d, visible %d", mode, rotation, visible);
-
        ret = mm_evas_renderer_set_geometry(evas_handle, mode);
-       ret |= mm_evas_renderer_set_rotation(evas_handle, mode);
-
+       ret |= mm_evas_renderer_set_rotation(evas_handle, rotation);
        /* if user didn't set visible, it will be set to true in player_start */
        if (visible != DISP_EVAS_VISIBLE_NONE)
                ret |= mm_evas_renderer_set_visible(evas_handle, (visible == DISP_EVAS_VISIBLE_TRUE) ? true : false);
+
        return ret;
 }
-int disp_destroty_evas_display(MMHandleType *evas_handle)
+int disp_destroy_evas_display(MMHandleType *evas_handle)
 {
        int ret = MM_ERROR_NONE;
        return_val_if_fail(evas_handle != NULL, MM_ERROR_INVALID_HANDLE);
index 574399c..c126941 100644 (file)
@@ -32,8 +32,8 @@ int disp_set_evas_display_disp_mode(MMHandleType evas_handle, int mode);
 int disp_get_evas_display_visible(MMHandleType evas_handle, bool *p_visible);
 int disp_set_evas_display_visible(MMHandleType evas_handle, bool visible);
 int disp_set_evas_display_roi_area(MMHandleType evas_handle, int x, int y, int width, int height);
-int disp_set_evas_display_old_info(void *display, void *evas_handle, int mode, int rotation, int visible);
-int disp_destroty_evas_display(MMHandleType *evas_handle);
+int disp_set_evas_display_old_info(void *display, MMHandleType evas_handle, int mode, int rotation, int visible);
+int disp_destroy_evas_display(MMHandleType *evas_handle);
 int disp_create_evas_display(void *display, MMHandleType *evas_handle);
 void disp_media_packet_video_decode_cb(media_packet_h packet, void *evas_handle);
 
index 3d09da1..9423d7d 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-player
 Summary:    A Media Player API
-Version:    0.3.77
+Version:    0.3.78
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index c15d1bd..ca6eb28 100644 (file)
@@ -1816,7 +1816,7 @@ int player_destroy(player_h player)
        player_cli_s *pc = (player_cli_s *) player;
        char *ret_buf = NULL;
 #ifdef TIZEN_FEATURE_EVAS_RENDERER
-       int (*p_disp_destroty_evas_display)(void **) = NULL;
+       int (*p_disp_destroy_evas_display)(void **) = NULL;
 #endif
        LOGD("ENTER");
 
@@ -1829,8 +1829,8 @@ int player_destroy(player_h player)
        if (CALLBACK_INFO(pc) && EVAS_INFO(pc)->support_video) {
                if (EVAS_HANDLE(pc)) {
                        player_unset_media_packet_video_frame_decoded_cb(player);
-                       PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_destroty_evas_display, "disp_destroty_evas_display");
-                       if (p_disp_destroty_evas_display(&EVAS_HANDLE(pc)) != MM_ERROR_NONE)
+                       PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_destroy_evas_display, "disp_destroy_evas_display");
+                       if (p_disp_destroy_evas_display(&EVAS_HANDLE(pc)) != MM_ERROR_NONE)
                                LOGW("fail to unset evas client");
                        __player_unset_retrieve_buffer_cb(player);
                        g_free(pc->cb_info->evas_info);
@@ -2583,7 +2583,7 @@ int player_set_display(player_h player, player_display_type_e type, player_displ
        player_state_e state = PLAYER_STATE_NONE;
        unsigned int (*p_disp_set_wl_display)(int, void *) = NULL;
 #ifdef TIZEN_FEATURE_EVAS_RENDERER
-       int (*p_disp_destroty_evas_display)(void **) = NULL;
+       int (*p_disp_destroy_evas_display)(void **) = NULL;
        int (*p_disp_create_evas_display)(void *, void **) = NULL;
        int (*p_disp_set_evas_display_old_info)(void *, void *, int, int, int) = NULL;
        int (*p_disp_set_evas_display_roi_area)(void *, int, int, int, int) = NULL;
@@ -2632,6 +2632,23 @@ int player_set_display(player_h player, player_display_type_e type, player_displ
                if (!display)
                        return PLAYER_ERROR_INVALID_PARAMETER;
 
+#ifdef TIZEN_FEATURE_EVAS_RENDERER
+               /**
+                * To support repeating play and stop, Evas_handle should not be destroyed in player_unprepare.
+                * When the display type changes, Player need to destroy Evas_handle to set values of video output,
+                * Otherwise, the values is not set because of checking Evas_handle.
+                */
+               if (EVAS_HANDLE(pc)) {
+                       LOGW("evas client already exists");
+                       player_unset_media_packet_video_frame_decoded_cb(player);
+                       PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_destroy_evas_display, "disp_destroy_evas_display");
+                       if (p_disp_destroy_evas_display(&EVAS_HANDLE(pc)) != MM_ERROR_NONE)
+                               LOGW("fail to unset evas client");
+                       __player_unset_retrieve_buffer_cb(player);
+                       /* need to set display information again to new handle */
+                       EVAS_INFO(pc)->update_needed = TRUE;
+               }
+#endif
                /* set evas_render or wayland */
                if (conv_type == PLAYER_PRIVATE_DISPLAY_TYPE_OVERLAY) {
                        PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_wl_display, "disp_set_wl_display");
@@ -2648,17 +2665,6 @@ int player_set_display(player_h player, player_display_type_e type, player_displ
                                return PLAYER_ERROR_INVALID_OPERATION;
                        }
 
-                       if (EVAS_HANDLE(pc)) {
-                               LOGW("evas client already exists");
-                               player_unset_media_packet_video_frame_decoded_cb(player);
-                               PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_destroty_evas_display, "disp_destroty_evas_display");
-                               if (p_disp_destroty_evas_display(&EVAS_HANDLE(pc)) != MM_ERROR_NONE)
-                                       LOGW("fail to unset evas client");
-                               __player_unset_retrieve_buffer_cb(player);
-
-                               /* need to set display information again to new handle */
-                               EVAS_INFO(pc)->update_needed = TRUE;
-                       }
                        PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_create_evas_display, "disp_create_evas_display");
                        ret = p_disp_create_evas_display(display, &EVAS_HANDLE(pc));
                        if (ret != MM_ERROR_NONE) return PLAYER_ERROR_INVALID_OPERATION;
@@ -2666,7 +2672,7 @@ int player_set_display(player_h player, player_display_type_e type, player_displ
                        /* before evas handle is created, user could set display information */
                        if (EVAS_INFO(pc)->update_needed) {
                                PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_old_info, "disp_set_evas_display_old_info");
-                               ret = p_disp_set_evas_display_old_info(display, CALLBACK_INFO(pc), EVAS_INFO(pc)->mode, EVAS_INFO(pc)->rotation, EVAS_INFO(pc)->visible);
+                               ret = p_disp_set_evas_display_old_info(display, EVAS_HANDLE(pc), EVAS_INFO(pc)->mode, EVAS_INFO(pc)->rotation, EVAS_INFO(pc)->visible);
                                if (ret != MM_ERROR_NONE) return PLAYER_ERROR_INVALID_OPERATION;
                                if (EVAS_INFO(pc)->mode == PLAYER_DISPLAY_MODE_DST_ROI) {
                                        PLAYER_DISP_DLSYM(pc->dl_handle, p_disp_set_evas_display_roi_area, "disp_set_evas_display_roi_area");