[vlc-commits] vout_display: remove/deprecate fullscreen state

Rémi Denis-Courmont git at videolan.org
Sun Aug 6 20:27:13 CEST 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Aug  5 23:04:57 2017 +0300| [057e5729c51c693e255c9348046c103b75bdb19c] | committer: Rémi Denis-Courmont

vout_display: remove/deprecate fullscreen state

Live window state, this was moved from display to window eight years
ago (minus one week). When the fullscreen state changes, the window
plugin emits a resize event, which triggers any necessary updates in
the display. The display does not need to know about fullscreen state
as such. But it is retained on HWND platforms due to legacy code, just
like window state before.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=057e5729c51c693e255c9348046c103b75bdb19c
---

 include/vlc_vout_display.h             | 12 ++++++----
 modules/codec/omxil/vout.c             |  1 -
 modules/hw/mmal/vout.c                 |  1 -
 modules/video_output/android/display.c |  1 -
 modules/video_output/caopengllayer.m   |  1 -
 modules/video_output/evas.c            |  2 --
 modules/video_output/flaschen.c        |  1 -
 modules/video_output/ios.m             |  1 -
 src/video_output/display.c             | 42 +++++++++++++++++-----------------
 src/video_output/video_output.c        | 16 +++++++++++--
 10 files changed, 42 insertions(+), 36 deletions(-)

diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index 1723a5b451..bbe2e9acb8 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -81,7 +81,9 @@ enum {
  * Initial/Current configuration for a vout_display_t
  */
 typedef struct {
-    bool is_fullscreen;  /* Is the display fullscreen */
+#if defined(_WIN32) || defined(__OS2__)
+    bool is_fullscreen VLC_DEPRECATED;  /* Is the display fullscreen */
+#endif
 
     /* Display properties */
     struct {
@@ -145,10 +147,10 @@ enum {
      */
     VOUT_DISPLAY_RESET_PICTURES,
 
+#if defined(_WIN32) || defined(__OS2__)
     /* Ask the module to acknowledge/refuse the fullscreen state change after
      * being requested (externally or by VOUT_DISPLAY_EVENT_FULLSCREEN */
-    VOUT_DISPLAY_CHANGE_FULLSCREEN,     /* bool fs */
-#if defined(_WIN32) || defined(__OS2__)
+    VOUT_DISPLAY_CHANGE_FULLSCREEN VLC_DEPRECATED,     /* bool fs */
     /* Ask the module to acknowledge/refuse the window management state change
      * after being requested externally or by VOUT_DISPLAY_WINDOW_STATE */
     VOUT_DISPLAY_CHANGE_WINDOW_STATE VLC_DEPRECATED,   /* unsigned state */
@@ -193,8 +195,8 @@ enum {
     /* */
     VOUT_DISPLAY_EVENT_PICTURES_INVALID,    /* The buffer are now invalid and need to be changed */
 
-    VOUT_DISPLAY_EVENT_FULLSCREEN,
 #if defined(_WIN32) || defined(__OS2__)
+    VOUT_DISPLAY_EVENT_FULLSCREEN,
     VOUT_DISPLAY_EVENT_WINDOW_STATE,
 #endif
 
@@ -366,12 +368,12 @@ static inline void vout_display_SendEventKey(vout_display_t *vd, int key)
 {
     vout_display_SendEvent(vd, VOUT_DISPLAY_EVENT_KEY, key);
 }
+#if defined(_WIN32) || defined(__OS2__)
 static inline void vout_display_SendEventFullscreen(vout_display_t *vd, bool is_fullscreen,
                                                     bool is_window_fullscreen)
 {
     vout_display_SendEvent(vd, VOUT_DISPLAY_EVENT_FULLSCREEN, is_fullscreen, is_window_fullscreen);
 }
-#if defined(_WIN32) || defined(__OS2__)
 static inline void vout_display_SendWindowState(vout_display_t *vd, unsigned state)
 {
     vout_display_SendEvent(vd, VOUT_DISPLAY_EVENT_WINDOW_STATE, state);
diff --git a/modules/codec/omxil/vout.c b/modules/codec/omxil/vout.c
index ffbe4f5b13..84d79acd46 100644
--- a/modules/codec/omxil/vout.c
+++ b/modules/codec/omxil/vout.c
@@ -457,7 +457,6 @@ static int Control(vout_display_t *vd, int query, va_list args)
         UpdateDisplaySize(vd, cfg);
         return VLC_SUCCESS;
     }
-    case VOUT_DISPLAY_CHANGE_FULLSCREEN:
     case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
     case VOUT_DISPLAY_CHANGE_ZOOM:
     case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
diff --git a/modules/hw/mmal/vout.c b/modules/hw/mmal/vout.c
index 94f3180b4d..1d378e3aa1 100644
--- a/modules/hw/mmal/vout.c
+++ b/modules/hw/mmal/vout.c
@@ -637,7 +637,6 @@ static int vd_control(vout_display_t *vd, int query, va_list args)
 
         case VOUT_DISPLAY_RESET_PICTURES:
             vlc_assert_unreachable();
-        case VOUT_DISPLAY_CHANGE_FULLSCREEN:
         case VOUT_DISPLAY_CHANGE_ZOOM:
             msg_Warn(vd, "Unsupported control query %d", query);
             break;
diff --git a/modules/video_output/android/display.c b/modules/video_output/android/display.c
index eb4d89fbca..6757299e35 100644
--- a/modules/video_output/android/display.c
+++ b/modules/video_output/android/display.c
@@ -1179,7 +1179,6 @@ static int Control(vout_display_t *vd, int query, va_list args)
 
     switch (query) {
     case VOUT_DISPLAY_HIDE_MOUSE:
-    case VOUT_DISPLAY_CHANGE_FULLSCREEN:
         return VLC_SUCCESS;
     case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
     case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
diff --git a/modules/video_output/caopengllayer.m b/modules/video_output/caopengllayer.m
index a9777c6af9..7d129a9fc6 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -388,7 +388,6 @@ static int Control (vout_display_t *vd, int query, va_list ap)
             vlc_assert_unreachable ();
         default:
             msg_Err (vd, "Unhandled request %d", query);
-        case VOUT_DISPLAY_CHANGE_FULLSCREEN:
             return VLC_EGENERIC;
     }
 
diff --git a/modules/video_output/evas.c b/modules/video_output/evas.c
index a6116af0a9..66daaea86b 100644
--- a/modules/video_output/evas.c
+++ b/modules/video_output/evas.c
@@ -765,8 +765,6 @@ Control( vout_display_t *vd, int i_query, va_list ap )
         }
         return VLC_SUCCESS;
     }
-    case VOUT_DISPLAY_CHANGE_FULLSCREEN:
-        return VLC_SUCCESS;
     case VOUT_DISPLAY_RESET_PICTURES:
         msg_Dbg( vd, "VOUT_DISPLAY_RESET_PICTURES" );
 
diff --git a/modules/video_output/flaschen.c b/modules/video_output/flaschen.c
index 5e2d3ed0b4..4ae5022101 100644
--- a/modules/video_output/flaschen.c
+++ b/modules/video_output/flaschen.c
@@ -238,7 +238,6 @@ static int Control(vout_display_t *vd, int query, va_list args)
     case VOUT_DISPLAY_CHANGE_ZOOM:
     case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
     case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
-    case VOUT_DISPLAY_CHANGE_FULLSCREEN:
         return VLC_EGENERIC;
 
     case VOUT_DISPLAY_HIDE_MOUSE:
diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m
index 192c99edbd..e4a56cb2cb 100644
--- a/modules/video_output/ios.m
+++ b/modules/video_output/ios.m
@@ -350,7 +350,6 @@ static int Control(vout_display_t *vd, int query, va_list ap)
             vlc_assert_unreachable ();
         default:
             msg_Err(vd, "Unknown request %d", query);
-        case VOUT_DISPLAY_CHANGE_FULLSCREEN:
             return VLC_EGENERIC;
     }
 }
diff --git a/src/video_output/display.c b/src/video_output/display.c
index a629423337..79b419ce4d 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -339,16 +339,17 @@ typedef struct {
     vlc_rational_t sar_initial;
 
     /* */
-    unsigned width_saved;
-    unsigned height_saved;
-
-    /* */
     bool ch_display_filled;
     bool is_display_filled;
 
     bool ch_zoom;
     vlc_rational_t zoom;
 #if defined(_WIN32) || defined(__OS2__)
+    unsigned width_saved;
+    unsigned height_saved;
+    bool ch_fullscreen;
+    bool is_fullscreen;
+    bool window_fullscreen;
     bool ch_wm_state;
     unsigned wm_state;
     unsigned wm_state_initial;
@@ -394,9 +395,6 @@ typedef struct {
 
     bool reset_pictures;
 
-    bool ch_fullscreen;
-    bool is_fullscreen;
-    bool window_fullscreen;
     signed char fit_window;
 
     bool ch_display_size;
@@ -655,6 +653,7 @@ static void VoutDisplayEvent(vout_display_t *vd, int event, va_list args)
                                      va_arg(args, const vlc_viewpoint_t *));
         break;
 
+#if defined(_WIN32) || defined(__OS2__)
     case VOUT_DISPLAY_EVENT_FULLSCREEN: {
         const int is_fullscreen = (int)va_arg(args, int);
         const bool window_fullscreen = va_arg(args, int);
@@ -670,7 +669,7 @@ static void VoutDisplayEvent(vout_display_t *vd, int event, va_list args)
         vlc_mutex_unlock(&osys->lock);
         break;
     }
-#if defined(_WIN32) || defined(__OS2__)
+
     case VOUT_DISPLAY_EVENT_WINDOW_STATE: {
         const unsigned state = va_arg(args, unsigned);
 
@@ -815,12 +814,11 @@ bool vout_ManageDisplay(vout_display_t *vd, bool allow_reset_pictures)
     for (;;) {
 
         vlc_mutex_lock(&osys->lock);
-
+#if defined(_WIN32) || defined(__OS2__)
         bool ch_fullscreen  = osys->ch_fullscreen;
         bool is_fullscreen  = osys->is_fullscreen;
         osys->ch_fullscreen = false;
 
-#if defined(_WIN32) || defined(__OS2__)
         bool ch_wm_state  = osys->ch_wm_state;
         unsigned wm_state  = osys->wm_state;
         osys->ch_wm_state = false;
@@ -841,19 +839,19 @@ bool vout_ManageDisplay(vout_display_t *vd, bool allow_reset_pictures)
 
         vlc_mutex_unlock(&osys->lock);
 
-        if (!ch_fullscreen &&
-            !ch_display_size &&
+        if (!ch_display_size &&
             !reset_pictures &&
             !osys->ch_display_filled &&
             !osys->ch_zoom &&
 #if defined(_WIN32) || defined(__OS2__)
+            !ch_fullscreen &&
             !ch_wm_state &&
 #endif
             !osys->ch_sar &&
             !osys->ch_crop &&
             !osys->ch_viewpoint) {
 
-            if (!osys->cfg.is_fullscreen && osys->fit_window != 0) {
+            if (osys->fit_window != 0) {
                 VoutDisplayFitWindow(vd, osys->fit_window == -1);
                 osys->fit_window = 0;
                 continue;
@@ -862,6 +860,7 @@ bool vout_ManageDisplay(vout_display_t *vd, bool allow_reset_pictures)
         }
 
         /* */
+#if defined(_WIN32) || defined(__OS2__)
         if (ch_fullscreen) {
             if (osys->window_fullscreen
              || vout_display_Control(vd, VOUT_DISPLAY_CHANGE_FULLSCREEN,
@@ -877,15 +876,17 @@ bool vout_ManageDisplay(vout_display_t *vd, bool allow_reset_pictures)
                 msg_Err(vd, "Failed to set fullscreen");
             }
         }
+#endif
 
         /* */
         if (ch_display_size) {
             vout_display_cfg_t cfg = osys->cfg;
             cfg.display.width  = display_width;
             cfg.display.height = display_height;
-
+#if defined(_WIN32) || defined(__OS2__)
             osys->width_saved  = osys->cfg.display.width;
             osys->height_saved = osys->cfg.display.height;
+#endif
 
             vout_display_Control(vd, VOUT_DISPLAY_CHANGE_DISPLAY_SIZE, &cfg);
 
@@ -1242,13 +1243,17 @@ static vout_display_t *DisplayNew(vout_thread_t *vout,
     osys->mouse.last_moved = mdate();
     osys->mouse.double_click_timeout = double_click_timeout;
     osys->mouse.hide_timeout = hide_timeout;
-    osys->is_fullscreen  = cfg->is_fullscreen;
     osys->display_width  = cfg->display.width;
     osys->display_height = cfg->display.height;
     osys->is_display_filled = cfg->is_display_filled;
+    osys->viewpoint      = cfg->viewpoint;
+
+    osys->zoom.num = cfg->zoom.num;
+    osys->zoom.den = cfg->zoom.den;
+#if defined(_WIN32) || defined(__OS2__)
+    osys->is_fullscreen  = cfg->is_fullscreen;
     osys->width_saved    = cfg->display.width;
     osys->height_saved   = cfg->display.height;
-    osys->viewpoint      = cfg->viewpoint;
     if (osys->is_fullscreen) {
         vout_display_cfg_t cfg_windowed = *cfg;
         cfg_windowed.is_fullscreen  = false;
@@ -1259,9 +1264,6 @@ static vout_display_t *DisplayNew(vout_thread_t *vout,
                                            source, &cfg_windowed);
     }
 
-    osys->zoom.num = cfg->zoom.num;
-    osys->zoom.den = cfg->zoom.den;
-#if defined(_WIN32) || defined(__OS2__)
     osys->wm_state_initial = VOUT_WINDOW_STATE_NORMAL;
     osys->wm_state = state->wm_state;
     osys->ch_wm_state = true;
@@ -1414,7 +1416,6 @@ static void SplitterEvent(vout_display_t *vd, int event, va_list args)
     case VOUT_DISPLAY_EVENT_MOUSE_DOUBLE_CLICK:
     case VOUT_DISPLAY_EVENT_KEY:
     case VOUT_DISPLAY_EVENT_CLOSE:
-    case VOUT_DISPLAY_EVENT_FULLSCREEN:
     case VOUT_DISPLAY_EVENT_DISPLAY_SIZE:
     case VOUT_DISPLAY_EVENT_PICTURES_INVALID:
         VoutDisplayEvent(vd, event, args);
@@ -1584,7 +1585,6 @@ vout_display_t *vout_NewSplitter(vout_thread_t *vout,
         vout_display_state_t ostate;
 
         memset(&ostate, 0, sizeof(ostate));
-        ostate.cfg.is_fullscreen = false;
         ostate.cfg.display = state->cfg.display;
         ostate.cfg.align.horizontal = 0; /* TODO */
         ostate.cfg.align.vertical = 0; /* TODO */
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 640232a0ea..6b6dc8e028 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -166,7 +166,9 @@ static vout_thread_t *VoutCreate(vlc_object_t *object,
     if (vout->p->splitter_name == NULL) {
         vout_window_cfg_t wcfg = {
             .is_standalone = !var_InheritBool(vout, "embedded-video"),
+#if !defined(_WIN32) && !defined(__OS2__)
             .is_fullscreen = var_GetBool(vout, "fullscreen"),
+#endif
             .type = VOUT_WINDOW_TYPE_INVALID,
             // TODO: take pixel A/R, crop and zoom into account
 #ifdef __APPLE__
@@ -560,9 +562,10 @@ void vout_ControlChangeViewpoint(vout_thread_t *vout,
 static void VoutGetDisplayCfg(vout_thread_t *vout, vout_display_cfg_t *cfg, const char *title)
 {
     /* Load configuration */
+#if defined(_WIN32) || defined(__OS2__)
     cfg->is_fullscreen = var_GetBool(vout, "fullscreen")
                          || var_GetBool(vout, "video-wallpaper");
-
+#endif
     cfg->viewpoint = vout->p->original.pose;
 
     cfg->display.title = title;
@@ -1270,12 +1273,18 @@ static void ThreadChangeFullscreen(vout_thread_t *vout, bool fullscreen)
 {
     vout_window_t *window = vout->p->window;
 
+#if !defined(_WIN32) && !defined(__OS2__)
+    if (window != NULL)
+        vout_window_SetFullScreen(window, fullscreen);
+#else
     bool window_fullscreen = false;
     if (window != NULL
      && vout_window_SetFullScreen(window, fullscreen) == VLC_SUCCESS)
         window_fullscreen = true;
+    /* FIXME: remove this event */
     if (vout->p->display.vd != NULL)
         vout_display_SendEventFullscreen(vout->p->display.vd, fullscreen, window_fullscreen);
+#endif
 }
 
 static void ThreadChangeWindowState(vout_thread_t *vout, unsigned state)
@@ -1539,7 +1548,10 @@ static int ThreadReinit(vout_thread_t *vout,
 
     vout_ReinitInterlacingSupport(vout);
 
-    if (!state.cfg.is_fullscreen) {
+#if defined(_WIN32) || defined(__OS2__)
+    if (!state.cfg.is_fullscreen)
+#endif
+    {
         state.cfg.display.width  = 0;
         state.cfg.display.height = 0;
     }



More information about the vlc-commits mailing list