[0.3.137][test] Remove player_get_display_rotation() in event_handler_set_parameters() 33/245733/2
authorGilbok Lee <gilbok.lee@samsung.com>
Thu, 15 Oct 2020 02:56:59 +0000 (11:56 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Thu, 15 Oct 2020 03:41:29 +0000 (12:41 +0900)
- video_changed_callback is not called from the main loop.

Change-Id: I37bb4f2e0bb6ed7cf81ef4e18496dc7fd4739df8

test/player_test.c

index 8efcd93..2ba5f3e 100644 (file)
@@ -70,6 +70,7 @@ static void event_handler_set_dov_fov();
 static void event_handler_set_window_parameters();
 mm_navevent_handler_h event_handler;
 mm_navevent_handler_size_s image_size;
+player_display_rotation_e g_rotation = PLAYER_DISPLAY_ROTATION_NONE;
 #endif
 
 static tizen_profile_e _get_tizen_profile()
@@ -1900,6 +1901,7 @@ static void set_display_rotation(int rotation)
        if (player_set_display_rotation(g_player[0], rotation) != PLAYER_ERROR_NONE)
                g_print("failed to set_display_rotation\n");
 #ifdef USE_EVENT_HANDLER
+       g_rotation = (player_display_rotation_e) rotation;
        event_handler_set_window_parameters();
 #endif
 }
@@ -1908,6 +1910,9 @@ static void get_display_rotation()
 {
        player_display_rotation_e rotation = 0;
        player_get_display_rotation(g_player[0], &rotation);
+#ifdef USE_EVENT_HANDLER
+       g_rotation = (player_display_rotation_e) rotation;
+#endif
        g_print("                                                            ==> [Player_Test] Video Overlay Display rotation: [%d ] \n", rotation);
 }
 
@@ -2266,17 +2271,15 @@ static void event_handler_set_dov_fov()
 
 static void event_handler_set_window_parameters()
 {
-       player_display_rotation_e window_orientation;
        mm_navevent_handler_size_s window_size;
        float image_ratio;
 
-       player_get_display_rotation(g_player[0], &window_orientation);
        elm_win_screen_size_get(selected_win_id, NULL, NULL, &window_size.width, &window_size.height);
 
        image_ratio = (float)image_size.width / (float)image_size.height;
 
-       if (window_orientation == PLAYER_DISPLAY_ROTATION_NONE ||
-                       window_orientation == PLAYER_DISPLAY_ROTATION_180) {
+       if (g_rotation == PLAYER_DISPLAY_ROTATION_NONE ||
+                       g_rotation == PLAYER_DISPLAY_ROTATION_180) {
                window_size.height = (int)((float)window_size.width / image_ratio);
        } else {
                window_size.height = window_size.width;
@@ -2284,7 +2287,7 @@ static void event_handler_set_window_parameters()
        }
 
        mm_navevent_handler_set_window_parameters(event_handler,
-                       (mm_navevent_handler_orientation_e)window_orientation, window_size);
+                       (mm_navevent_handler_orientation_e)g_rotation, window_size);
 }
 #endif