[vlc-devel] [PATCH 2/2] vout:win32: don't use CommonManage anymore

Steve Lhomme robux4 at ycbcr.xyz
Tue Apr 2 16:37:56 CEST 2019


The child window (hwnd child of hparent) is always resized with the parent so
we don't need this trick anymore.

We should always get a VOUT_DISPLAY_CHANGE_DISPLAY_SIZE when the size changes.
---
 modules/video_output/win32/common.c     |  6 ------
 modules/video_output/win32/common.h     |  1 -
 modules/video_output/win32/direct3d11.c |  2 --
 modules/video_output/win32/direct3d9.c  |  2 --
 modules/video_output/win32/events.c     | 15 ---------------
 modules/video_output/win32/events.h     |  1 -
 modules/video_output/win32/glwin32.c    |  2 --
 modules/video_output/win32/wingdi.c     |  2 --
 8 files changed, 31 deletions(-)

diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index 03d15c06c1..693aae6750 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -209,12 +209,6 @@ void CommonClean(vlc_object_t *obj, vout_display_sys_win32_t *sys)
     }
 }
 
-void CommonManage(vout_display_t *vd, display_win32_area_t *area, vout_display_sys_win32_t *sys)
-{
-    if (sys->event != NULL && EventThreadGetAndResetSizeChanged(sys->event))
-        UpdateRects(vd, area, sys);
-}
-
 /* */
 static void CommonChangeThumbnailClip(vlc_object_t *obj, vout_display_sys_win32_t *sys, bool show)
 {
diff --git a/modules/video_output/win32/common.h b/modules/video_output/win32/common.h
index 30ce435995..8eb13d45ca 100644
--- a/modules/video_output/win32/common.h
+++ b/modules/video_output/win32/common.h
@@ -78,7 +78,6 @@ typedef struct vout_display_sys_win32_t
 int  CommonInit(vlc_object_t *, display_win32_area_t *, vout_display_sys_win32_t *, bool projection_gestures);
 void CommonClean(vlc_object_t *, vout_display_sys_win32_t *);
 #endif /* !VLC_WINSTORE_APP */
-void CommonManage(vout_display_t *, display_win32_area_t *, vout_display_sys_win32_t *);
 int  CommonControl(vout_display_t *, display_win32_area_t *, vout_display_sys_win32_t *, int , va_list );
 
 void UpdateRects (vout_display_t *, display_win32_area_t *, vout_display_sys_win32_t *);
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 7161855ffc..0152f81ede 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -287,8 +287,6 @@ static bool StartRendering(void *opaque)
 #if VLC_WINSTORE_APP
     /* TODO read the swapchain size and call VOUT_DISPLAY_CHANGE_DISPLAY_SIZE */
     UpdateRects(vd, &sys->area, &sys->sys);
-#else /* !VLC_WINSTORE_APP */
-    CommonManage(vd, &sys->area, &sys->sys);
 #endif
 
     if ( sys->area.place_changed )
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 225f810b5d..eac948061c 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -1179,8 +1179,6 @@ static void Prepare(vout_display_t *vd, picture_t *picture,
     VLC_UNUSED(date);
     vout_display_sys_t *sys = vd->sys;
 
-    CommonManage(vd, &sys->area, &sys->sys);
-
     /* Position Change */
     if (sys->area.place_changed) {
 #if 0 /* need that when bicubic filter is available */
diff --git a/modules/video_output/win32/events.c b/modules/video_output/win32/events.c
index 98920290e3..df950fa4eb 100644
--- a/modules/video_output/win32/events.c
+++ b/modules/video_output/win32/events.c
@@ -81,8 +81,6 @@ struct event_thread_t
     HWND hwnd;
     HWND hvideownd;
     vout_display_place_t place;
-
-    atomic_bool size_changed;
 };
 
 /***************************
@@ -342,11 +340,6 @@ void EventThreadUpdatePlace( event_thread_t *p_event,
     vlc_mutex_unlock( &p_event->lock );
 }
 
-bool EventThreadGetAndResetSizeChanged( event_thread_t *p_event )
-{
-    return atomic_exchange(&p_event->size_changed, false);
-}
-
 event_thread_t *EventThreadCreate( vlc_object_t *obj, vout_window_t *parent_window)
 {
     if (parent_window->type != VOUT_WINDOW_TYPE_HWND)
@@ -373,7 +366,6 @@ event_thread_t *EventThreadCreate( vlc_object_t *obj, vout_window_t *parent_wind
     p_event->is_cursor_hidden = false;
     p_event->button_pressed = 0;
     p_event->hwnd = NULL;
-    atomic_init(&p_event->size_changed, false);
 
     /* initialized to 0 to match the init in the display_win32_area_t */
     p_event->place.x = 0;
@@ -403,8 +395,6 @@ int EventThreadStart( event_thread_t *p_event, event_hwnd_t *p_hwnd, const event
     p_event->window_area.right  = p_cfg->width;
     p_event->window_area.bottom = p_cfg->height;
 
-    atomic_store(&p_event->size_changed, false);
-
     p_event->b_ready = false;
     atomic_store( &p_event->b_done, false);
     p_event->b_error = false;
@@ -761,11 +751,6 @@ static long FAR PASCAL WinVoutEventProc( HWND hwnd, UINT message,
     switch( message )
     {
 
-    case WM_SIZE:
-        if (!p_event->hparent)
-            atomic_store(&p_event->size_changed, true);
-        return 0;
-
     case WM_CAPTURECHANGED:
         for( int button = 0; p_event->button_pressed; button++ )
         {
diff --git a/modules/video_output/win32/events.h b/modules/video_output/win32/events.h
index e2e518ccb5..752761f01b 100644
--- a/modules/video_output/win32/events.h
+++ b/modules/video_output/win32/events.h
@@ -49,4 +49,3 @@ void            EventThreadStop( event_thread_t * );
 
 void            EventThreadUpdatePlace( event_thread_t *p_event,
                                         const vout_display_place_t *p_place );
-bool            EventThreadGetAndResetSizeChanged( event_thread_t * );
diff --git a/modules/video_output/win32/glwin32.c b/modules/video_output/win32/glwin32.c
index b1f376087e..518fff9e14 100644
--- a/modules/video_output/win32/glwin32.c
+++ b/modules/video_output/win32/glwin32.c
@@ -222,8 +222,6 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
     VLC_UNUSED(date);
     vout_display_sys_t *sys = vd->sys;
 
-    CommonManage(vd, &sys->area, &sys->sys);
-
     const int width  = sys->area.place.width;
     const int height = sys->area.place.height;
     vlc_gl_Resize (sys->gl, width, height);
diff --git a/modules/video_output/win32/wingdi.c b/modules/video_output/win32/wingdi.c
index 96561c191d..f44c905868 100644
--- a/modules/video_output/win32/wingdi.c
+++ b/modules/video_output/win32/wingdi.c
@@ -175,8 +175,6 @@ static void Display(vout_display_t *vd, picture_t *picture)
     }
 
     ReleaseDC(sys->sys.hvideownd, hdc);
-
-    CommonManage(vd, &sys->area, &sys->sys);
 }
 
 static int Init(vout_display_t *vd, video_format_t *fmt)
-- 
2.17.1



More information about the vlc-devel mailing list