Modify Changing surface type in player_test 94/169194/2 accepted/tizen/unified/20180207.151757 submit/tizen/20180206.071541
authorHyunil <hyunil46.park@samsung.com>
Mon, 5 Feb 2018 02:43:39 +0000 (11:43 +0900)
committerHyunil <hyunil46.park@samsung.com>
Mon, 5 Feb 2018 03:59:26 +0000 (12:59 +0900)
Change-Id: Ib2cde0ced03753d10db23219e89885b3af7ea9b1
Signed-off-by: Hyunil <hyunil46.park@samsung.com>
test/player_test.c

index ce03ee7216073c3bdc7d4009744f1dc73f9b1479..f682c0f0b32001ebb640c34f257945563c519356 100644 (file)
@@ -712,7 +712,7 @@ static int _save(unsigned char *src, int length)
 
        return TRUE;
 }
-
+#ifdef NO_USE_CODE
 static void reset_display()
 {
        int i = 0;
@@ -725,7 +725,7 @@ static void reset_display()
                }
        }
 }
-
+#endif
 static void input_filename(char *filename)
 {
        int len = strlen(filename);
@@ -1689,43 +1689,22 @@ static void change_surface(int option)
                return;
        }
 
-       if (surface_type == g_current_surface_type) {
-               g_print("same with the previous surface type(%d)\n", g_current_surface_type);
-               return;
-       } else {
-               player_state_e player_state = PLAYER_STATE_NONE;
-               ret = player_get_state(g_player[0], &player_state);
-               if (ret)
-                       g_print("failed to player_get_state(), ret(0x%x)\n", ret);
-
-               reset_display();
-
-               if (surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) {
-#ifdef _ACTIVATE_EOM_
-                       hdmi_output_id = eom_get_output_id("HDMI");
-                       if (hdmi_output_id == 0)
-                               g_print("[eom] error : HDMI output id is NULL.\n");
-
-                       eom_get_output_mode(hdmi_output_id, &output_mode);
-                       if (output_mode == EOM_OUTPUT_MODE_NONE) {
+       player_state_e player_state = PLAYER_STATE_NONE;
+       ret = player_get_state(g_player[0], &player_state);
+       if (ret)
+               g_print("failed to player_get_state(), ret(0x%x)\n", ret);
+#ifdef NO_USE_CODE
+       reset_display();
 #endif
-                               if (!g_win_id) {
-                                       g_win_id = create_win(PACKAGE);
-                                       if (g_win_id == NULL)
-                                               return;
-                                       g_print("create win_id %p\n", g_win_id);
-                                       create_render_rect_and_bg(g_win_id);
-                                       elm_win_activate(g_win_id);
-                                       evas_object_show(g_win_id);
-                                       g_win_id = selected_win_id;
-                               }
+       if (surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) {
 #ifdef _ACTIVATE_EOM_
-                       } else {
-                               /* for external */
-                       }
+               hdmi_output_id = eom_get_output_id("HDMI");
+               if (hdmi_output_id == 0)
+                       g_print("[eom] error : HDMI output id is NULL.\n");
+
+               eom_get_output_mode(hdmi_output_id, &output_mode);
+               if (output_mode == EOM_OUTPUT_MODE_NONE) {
 #endif
-                       ret = player_set_display(g_player[0], surface_type, GET_DISPLAY(selected_win_id));
-               } else {
                        if (!g_win_id) {
                                g_win_id = create_win(PACKAGE);
                                if (g_win_id == NULL)
@@ -1734,7 +1713,26 @@ static void change_surface(int option)
                                create_render_rect_and_bg(g_win_id);
                                elm_win_activate(g_win_id);
                                evas_object_show(g_win_id);
+                               g_win_id = selected_win_id;
                        }
+#ifdef _ACTIVATE_EOM_
+               } else {
+                       /* for external */
+               }
+#endif
+               ret = player_set_display(g_player[0], surface_type, GET_DISPLAY(selected_win_id));
+       } else {
+               if (!g_win_id) {
+                       g_win_id = create_win(PACKAGE);
+                       if (g_win_id == NULL)
+                               return;
+                       g_print("create win_id %p\n", g_win_id);
+                       create_render_rect_and_bg(g_win_id);
+                       elm_win_activate(g_win_id);
+                       evas_object_show(g_win_id);
+               }
+               if (surface_type == PLAYER_DISPLAY_TYPE_EVAS) {
+                       /* surface type is PLAYER_DISPLAY_TYPE_NONE */
                        int i = 0;
                        for (i = 0; i < g_handle_num; i++) {
                                /* Create evas image object for EVAS surface */
@@ -1749,13 +1747,15 @@ static void change_surface(int option)
                                ret = player_set_display(g_player[i], surface_type, g_eo[i]);
 
                        }
+               } else {
+                       g_print("surface type is PLAYER_DISPLAY_TYPE_NONE\n");
                }
-               if (ret) {
-                       g_print("failed to set display, surface_type(%d)\n", surface_type);
-                       return;
-               }
-               g_current_surface_type = surface_type;
        }
+       if (ret) {
+               g_print("failed to set display, surface_type(%d)\n", surface_type);
+               return;
+       }
+       g_current_surface_type = surface_type;
        return;
 }