[v0.3.31] fix visible operation on evas surface for the same with overlay 32/96532/2
authorNAMJEONGYOON <just.nam@samsung.com>
Wed, 9 Nov 2016 08:32:10 +0000 (17:32 +0900)
committerNAMJEONGYOON <just.nam@samsung.com>
Wed, 9 Nov 2016 10:15:18 +0000 (19:15 +0900)
[player_test] remove duplicated call

Change-Id: I359b7182bcd56a56dcfcbe4a3fa7ff97ff9dcc38

include/common/player.h
include/wearable/player.h
src/player.c
test/player_test.c

index 6a44f3c..f0e6d09 100644 (file)
@@ -1188,7 +1188,7 @@ int player_get_display_mode(player_h player, player_display_mode_e *mode);
 int player_set_display_roi_area(player_h player, int x, int y, int width, int height);
 
 /**
- * @brief Sets the visibility of the x surface video display
+ * @brief Sets the visibility of the video display
  * @since_tizen 2.3
  * @remarks If no display is set, no operation is performed.
  * @param[in] player   The handle to the media player
@@ -1206,7 +1206,7 @@ int player_set_display_roi_area(player_h player, int x, int y, int width, int he
 int player_set_display_visible(player_h player, bool visible);
 
 /**
- * @brief Gets the visibility of the x surface video display.
+ * @brief Gets the visibility of the video display.
  * @since_tizen 2.3
  * @param[in] player The handle to the media player
  * @param[out] visible The current visibility of the display (@c true = visible, @c false = non-visible )
index 1f4a750..5ce79f8 100644 (file)
@@ -1189,7 +1189,7 @@ int player_get_display_mode(player_h player, player_display_mode_e *mode);
 int player_set_display_roi_area(player_h player, int x, int y, int width, int height);
 
 /**
- * @brief Sets the visibility of the x surface video display
+ * @brief Sets the visibility of the video display
  * @since_tizen 2.3.1
  * @remarks If no display is set, no operation is performed.
  * @param[in] player   The handle to the media player
@@ -1207,7 +1207,7 @@ int player_set_display_roi_area(player_h player, int x, int y, int width, int he
 int player_set_display_visible(player_h player, bool visible);
 
 /**
- * @brief Gets the visibility of the x surface video display.
+ * @brief Gets the visibility of the video display.
  * @since_tizen 2.3.1
  * @param[in] player The handle to the media player
  * @param[out] visible The current visibility of the display (@c true = visible, @c false = non-visible )
index ce13aea..cbec0cc 100644 (file)
@@ -2134,6 +2134,8 @@ int player_start(player_h player)
                        LOGE("mm_evas_renderer_set_visible err 0x%x", ret);
                        return PLAYER_ERROR_INVALID_OPERATION;
                }
+               /* avoid setting true at all times, when player is resumed */
+               EVAS_INFO(pc)->visible = EVAS_VISIBLE_TRUE;
        }
 #endif
 
@@ -2668,10 +2670,11 @@ int player_set_display_visible(player_h player, bool visible)
                ret = mm_evas_renderer_set_visible(EVAS_HANDLE(pc), visible);
                if (ret != MM_ERROR_NONE)
                        return PLAYER_ERROR_INVALID_OPERATION;
-               else
-                       return PLAYER_ERROR_NONE;
+
+               EVAS_INFO(pc)->visible = visible ? VISIBLE_TRUE : VISIBLE_FALSE;
+               return PLAYER_ERROR_NONE;
        } else {
-               EVAS_INFO(pc)->visible = visible ? EVAS_VISIBLE_TRUE : EVAS_VISIBLE_FALSE;
+               EVAS_INFO(pc)->visible = visible ? VISIBLE_TRUE : VISIBLE_FALSE;
                EVAS_INFO(pc)->update_needed = TRUE;
        }
 #endif
index a384c39..ba0d33f 100644 (file)
@@ -97,7 +97,7 @@ static Evas_Object *g_external_win_id;
 static Evas_Object *selected_win_id;
 static Evas_Object *g_eo[MAX_HANDLE] = { 0, };
 
-static int g_current_surface_type = PLAYER_DISPLAY_TYPE_OVERLAY;
+static int g_current_surface_type = -1;
 
 typedef struct {
        Evas_Object *win;
@@ -893,8 +893,12 @@ static void _player_prepare(bool async)
                player_set_subtitle_path(g_player[0], g_subtitle_uri);
                player_set_subtitle_updated_cb(g_player[0], subtitle_updated_cb, (void *)g_player[0]);
        }
+       if (g_current_surface_type == -1) {
+               player_set_display(g_player[0], PLAYER_DISPLAY_TYPE_OVERLAY, GET_DISPLAY(selected_win_id));
+               g_current_surface_type = PLAYER_DISPLAY_TYPE_OVERLAY;
+       }
+
        if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) {
-               player_set_display(g_player[0], g_current_surface_type, GET_DISPLAY(selected_win_id));
                player_set_buffering_cb(g_player[0], buffering_cb, (void *)g_player[0]);
                player_set_completed_cb(g_player[0], completed_cb, (void *)g_player[0]);
                player_set_interrupted_cb(g_player[0], interrupted_cb, (void *)g_player[0]);
@@ -906,7 +910,6 @@ static void _player_prepare(bool async)
        } else {
                int i = 0;
                for (i = 0; i < g_handle_num; i++) {
-                       player_set_display(g_player[i], g_current_surface_type, g_eo[i]);
                        player_set_buffering_cb(g_player[i], buffering_cb, (void *)g_player[i]);
                        player_set_completed_cb(g_player[i], completed_cb, (void *)g_player[i]);
                        player_set_interrupted_cb(g_player[i], interrupted_cb, (void *)g_player[i]);