[vlc-commits] vout: pass only a boolean to VOUT_DISPLAY_CHANGE_FULLSCREEN control

Rémi Denis-Courmont git at videolan.org
Thu Oct 16 19:26:15 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Oct 15 22:31:55 2014 +0300| [31fd358e8a55953fb410898e32e5c25a4c7b09d9] | committer: Rémi Denis-Courmont

vout: pass only a boolean to VOUT_DISPLAY_CHANGE_FULLSCREEN control

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

 include/vlc_vout_display.h           |    2 +-
 modules/video_output/caopengllayer.m |    2 +-
 modules/video_output/ios2.m          |    2 +-
 modules/video_output/kva.c           |    5 ++---
 modules/video_output/msw/common.c    |    6 +++---
 modules/video_output/sdl.c           |   17 +++++------------
 src/video_output/display.c           |    9 ++-------
 7 files changed, 15 insertions(+), 28 deletions(-)

diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index 939e4e2..fc52050 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -143,7 +143,7 @@ enum {
 
     /* Ask the module to acknowledge/refuse the fullscreen state change after
      * being requested (externally or by VOUT_DISPLAY_EVENT_FULLSCREEN */
-    VOUT_DISPLAY_CHANGE_FULLSCREEN,     /* const vout_display_cfg_t *p_cfg */
+    VOUT_DISPLAY_CHANGE_FULLSCREEN,     /* bool fs */
 
     /* Ask the module to acknowledge/refuse the window management state change
      * after being requested externally or by VOUT_DISPLAY_WINDOW_STATE */
diff --git a/modules/video_output/caopengllayer.m b/modules/video_output/caopengllayer.m
index 713edb9..4571fbb 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -300,7 +300,6 @@ static int Control (vout_display_t *vd, int query, va_list ap)
         case VOUT_DISPLAY_CHANGE_ZOOM:
         case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
         case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
-        case VOUT_DISPLAY_CHANGE_FULLSCREEN:
         {
             const vout_display_cfg_t *cfg;
             const video_format_t *source;
@@ -343,6 +342,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
             assert (0);
         default:
             msg_Err (vd, "Unhandled request %d", query);
+        case VOUT_DISPLAY_CHANGE_FULLSCREEN:
             return VLC_EGENERIC;
     }
 
diff --git a/modules/video_output/ios2.m b/modules/video_output/ios2.m
index feb2203..3efeb12 100644
--- a/modules/video_output/ios2.m
+++ b/modules/video_output/ios2.m
@@ -265,7 +265,6 @@ static int Control(vout_display_t *vd, int query, va_list ap)
         case VOUT_DISPLAY_HIDE_MOUSE:
             return VLC_EGENERIC;
 
-        case VOUT_DISPLAY_CHANGE_FULLSCREEN:
         case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
         case VOUT_DISPLAY_CHANGE_ZOOM:
         case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
@@ -320,6 +319,7 @@ static int Control(vout_display_t *vd, int query, va_list ap)
             assert (0);
         default:
             msg_Err(vd, "Unknown request %d", query);
+        case VOUT_DISPLAY_CHANGE_FULLSCREEN:
             return VLC_EGENERIC;
     }
 }
diff --git a/modules/video_output/kva.c b/modules/video_output/kva.c
index d4a1153..b4d72b4 100644
--- a/modules/video_output/kva.c
+++ b/modules/video_output/kva.c
@@ -442,10 +442,9 @@ static int Control( vout_display_t *vd, int query, va_list args )
 
     case VOUT_DISPLAY_CHANGE_FULLSCREEN:
     {
-        const vout_display_cfg_t *cfg = va_arg(args, const vout_display_cfg_t *);
+        bool fs = va_arg(args, int);
 
-        WinPostMsg( sys->client, WM_VLC_FULLSCREEN_CHANGE,
-                    MPFROMLONG( cfg->is_fullscreen ), 0 );
+        WinPostMsg( sys->client, WM_VLC_FULLSCREEN_CHANGE, MPFROMLONG(fs), 0 );
         return VLC_SUCCESS;
     }
 
diff --git a/modules/video_output/msw/common.c b/modules/video_output/msw/common.c
index fa9fb86..5687091 100644
--- a/modules/video_output/msw/common.c
+++ b/modules/video_output/msw/common.c
@@ -607,9 +607,9 @@ int CommonControl(vout_display_t *vd, int query, va_list args)
         sys->is_on_top = is_on_top;
         return VLC_SUCCESS;
     }
-    case VOUT_DISPLAY_CHANGE_FULLSCREEN: {   /* const vout_display_cfg_t *p_cfg */
-        const vout_display_cfg_t *cfg = va_arg(args, const vout_display_cfg_t *);
-        if (CommonControlSetFullscreen(vd, cfg->is_fullscreen))
+    case VOUT_DISPLAY_CHANGE_FULLSCREEN: {
+        bool fs = va_arg(args, int);
+        if (CommonControlSetFullscreen(vd, fs))
             return VLC_EGENERIC;
         UpdateRects(vd, NULL, NULL, false);
         return VLC_SUCCESS;
diff --git a/modules/video_output/sdl.c b/modules/video_output/sdl.c
index c81c59c..990ff5a 100644
--- a/modules/video_output/sdl.c
+++ b/modules/video_output/sdl.c
@@ -494,24 +494,17 @@ static int Control(vout_display_t *vd, int query, va_list args)
         return VLC_SUCCESS;
     }
     case VOUT_DISPLAY_CHANGE_FULLSCREEN: {
-        vout_display_cfg_t cfg = *va_arg(args, const vout_display_cfg_t *);
+        bool fs = va_arg(args, int);
 
         /* Fix flags */
         sys->display_flags &= ~(SDL_FULLSCREEN | SDL_RESIZABLE);
-        sys->display_flags |= cfg.is_fullscreen ? SDL_FULLSCREEN : SDL_RESIZABLE;
+        sys->display_flags |= fs ? SDL_FULLSCREEN : SDL_RESIZABLE;
 
-        if (cfg.is_fullscreen) {
-            cfg.display.width = sys->desktop_width;
-            cfg.display.height = sys->desktop_height;
-        }
-
-        if (sys->overlay) {
-            sys->display = SDL_SetVideoMode(cfg.display.width, cfg.display.height,
+        if (sys->overlay)
+            sys->display = SDL_SetVideoMode(sys->desktop_width, sys->desktop_height,
                                             sys->display_bpp, sys->display_flags);
 
-            vout_display_PlacePicture(&sys->place, &vd->source, &cfg, !sys->overlay);
-        }
-        vout_display_SendEventDisplaySize(vd, cfg.display.width, cfg.display.height);
+        vout_display_SendEventDisplaySize(vd, sys->desktop_width, sys->desktop_height);
         return VLC_SUCCESS;
     }
     case VOUT_DISPLAY_CHANGE_ZOOM:
diff --git a/src/video_output/display.c b/src/video_output/display.c
index f34b781..ec0871d 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -858,13 +858,8 @@ bool vout_ManageDisplay(vout_display_t *vd, bool allow_reset_pictures)
 
         /* */
         if (ch_fullscreen) {
-            vout_display_cfg_t cfg = osys->cfg;
-
-            cfg.is_fullscreen  = is_fullscreen;
-            cfg.display.width  = cfg.is_fullscreen ? 0 : osys->width_saved;
-            cfg.display.height = cfg.is_fullscreen ? 0 : osys->height_saved;
-
-            if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_FULLSCREEN, &cfg) == VLC_SUCCESS) {
+            if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_FULLSCREEN,
+                                     is_fullscreen) == VLC_SUCCESS) {
                 osys->cfg.is_fullscreen = is_fullscreen;
 
                 if (!is_fullscreen)



More information about the vlc-commits mailing list