[vlc-commits] vout: invert default for event thread

Rémi Denis-Courmont git at videolan.org
Mon Nov 28 22:59:40 CET 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Nov 28 23:44:40 2016 +0200| [8d5040cfa8e60916c6244f008f0e348dc66e4b75] | committer: Rémi Denis-Courmont

vout: invert default for event thread

The name was confusing and only three rarely used video output plugins
suffer from this bug.

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

 include/vlc_vout_display.h              | 2 +-
 modules/hw/vdpau/display.c              | 1 -
 modules/video_output/aa.c               | 7 ++-----
 modules/video_output/android/display.c  | 1 -
 modules/video_output/caca.c             | 5 +----
 modules/video_output/evas.c             | 2 --
 modules/video_output/gl.c               | 1 -
 modules/video_output/ios2.m             | 1 -
 modules/video_output/macosx.m           | 1 -
 modules/video_output/sdl.c              | 2 ++
 modules/video_output/wayland/shm.c      | 1 -
 modules/video_output/win32/direct3d11.c | 1 -
 modules/video_output/win32/direct3d9.c  | 1 -
 modules/video_output/win32/directdraw.c | 1 -
 modules/video_output/win32/glwin32.c    | 1 -
 modules/video_output/xcb/x11.c          | 1 -
 modules/video_output/xcb/xvideo.c       | 1 -
 src/video_output/display.c              | 8 ++++----
 18 files changed, 10 insertions(+), 28 deletions(-)

diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index 04a265a..90f29d9 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -131,7 +131,7 @@ typedef struct {
     bool has_double_click;                  /* Is double-click generated */
     bool has_hide_mouse;                    /* Is mouse automatically hidden */
     bool has_pictures_invalid;              /* Will VOUT_DISPLAY_EVENT_PICTURES_INVALID be used */
-    bool has_event_thread;                  /* Will events (key at least) be emitted using an independent thread */
+    bool needs_event_thread VLC_DEPRECATED; /* Will events (key at least) be emitted using an independent thread */
     const vlc_fourcc_t *subpicture_chromas; /* List of supported chromas for subpicture rendering. */
 } vout_display_info_t;
 
diff --git a/modules/hw/vdpau/display.c b/modules/hw/vdpau/display.c
index f87a38e..41bbe63 100644
--- a/modules/hw/vdpau/display.c
+++ b/modules/hw/vdpau/display.c
@@ -654,7 +654,6 @@ static int Open(vlc_object_t *obj)
     /* */
     vd->sys = sys;
     vd->info.has_pictures_invalid = true;
-    vd->info.has_event_thread = true;
     vd->info.subpicture_chromas = spu_chromas;
     vd->fmt = fmt;
 
diff --git a/modules/video_output/aa.c b/modules/video_output/aa.c
index 26f7575..9b9436d 100644
--- a/modules/video_output/aa.c
+++ b/modules/video_output/aa.c
@@ -122,13 +122,10 @@ static int Open(vlc_object_t *object)
     fmt.i_visible_width = fmt.i_width;
     fmt.i_visible_height = fmt.i_height;
 
-    /* */
-    vout_display_info_t info = vd->info;
-    info.has_pictures_invalid = true;
-
     /* Setup vout_display now that everything is fine */
     vd->fmt = fmt;
-    vd->info = info;
+    vd->info.has_pictures_invalid = true;
+    vd->info.needs_event_thread = true;
 
     vd->pool    = Pool;
     vd->prepare = Prepare;
diff --git a/modules/video_output/android/display.c b/modules/video_output/android/display.c
index 9390a4d..086fdc6 100644
--- a/modules/video_output/android/display.c
+++ b/modules/video_output/android/display.c
@@ -740,7 +740,6 @@ static int Open(vlc_object_t *p_this)
     vd->display = Display;
     vd->control = Control;
     vd->manage  = NULL;
-    vd->info.has_event_thread = true;
     vd->info.is_slow = !sys->p_window->b_opaque;
 
     /* Fix initial state */
diff --git a/modules/video_output/caca.c b/modules/video_output/caca.c
index c082ef3..22d5d95 100644
--- a/modules/video_output/caca.c
+++ b/modules/video_output/caca.c
@@ -185,12 +185,9 @@ static int Open(vlc_object_t *object)
         fmt.i_bmask = 0x000000ff;
     }
 
-    /* TODO */
-    vout_display_info_t info = vd->info;
-
     /* Setup vout_display now that everything is fine */
     vd->fmt = fmt;
-    vd->info = info;
+    vd->info.needs_event_thread = true;
 
     vd->pool    = Pool;
     vd->prepare = Prepare;
diff --git a/modules/video_output/evas.c b/modules/video_output/evas.c
index b38c6b5..9166d09 100644
--- a/modules/video_output/evas.c
+++ b/modules/video_output/evas.c
@@ -912,8 +912,6 @@ Open( vlc_object_t *p_this )
     vd->control = Control;
     vd->manage  = Manage;
 
-    vd->info.has_event_thread = true;
-
     /* Fix initial state */
     vout_display_SendEventFullscreen( vd, true );
 
diff --git a/modules/video_output/gl.c b/modules/video_output/gl.c
index d22cbee..6d1fce6 100644
--- a/modules/video_output/gl.c
+++ b/modules/video_output/gl.c
@@ -138,7 +138,6 @@ static int Open (vlc_object_t *obj)
 
     vd->sys = sys;
     vd->info.has_pictures_invalid = false;
-    vd->info.has_event_thread = true;
     vd->info.subpicture_chromas = spu_chromas;
     vd->pool = Pool;
     vd->prepare = PictureRender;
diff --git a/modules/video_output/ios2.m b/modules/video_output/ios2.m
index bfeefe5..061f186 100644
--- a/modules/video_output/ios2.m
+++ b/modules/video_output/ios2.m
@@ -275,7 +275,6 @@ static int Open(vlc_object_t *this)
         /* */
         vout_display_info_t info = vd->info;
         info.has_pictures_invalid = false;
-        info.has_event_thread = true;
         info.subpicture_chromas = subpicture_chromas;
         info.is_slow = !sys->zero_copy;
         info.has_hide_mouse = false;
diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index 81be6c5..de5b475 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -271,7 +271,6 @@ static int Open (vlc_object_t *this)
         /* */
         vout_display_info_t info = vd->info;
         info.has_pictures_invalid = false;
-        info.has_event_thread = true;
         info.subpicture_chromas = subpicture_chromas;
         info.has_hide_mouse = true;
 
diff --git a/modules/video_output/sdl.c b/modules/video_output/sdl.c
index 44992b7..7c588e5 100644
--- a/modules/video_output/sdl.c
+++ b/modules/video_output/sdl.c
@@ -177,6 +177,8 @@ static int Open(vlc_object_t *object)
     /* */
     vout_display_info_t info = vd->info;
 
+    info.needs_event_thread = true;
+
     /* Set main window's size */
     int display_width;
     int display_height;
diff --git a/modules/video_output/wayland/shm.c b/modules/video_output/wayland/shm.c
index 8cda503..547db7b 100644
--- a/modules/video_output/wayland/shm.c
+++ b/modules/video_output/wayland/shm.c
@@ -468,7 +468,6 @@ static int Open(vlc_object_t *obj)
     vd->fmt.i_chroma = VLC_CODEC_RGB32;
 
     vd->info.has_pictures_invalid = sys->viewport == NULL;
-    vd->info.has_event_thread = true;
 
     vd->pool = Pool;
     vd->prepare = Prepare;
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 7b515f1..973b8b0 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -494,7 +494,6 @@ static int Open(vlc_object_t *object)
     info.is_slow              = !is_d3d11_opaque(fmt.i_chroma);
     info.has_double_click     = true;
     info.has_hide_mouse       = false;
-    info.has_event_thread     = true;
     info.has_pictures_invalid = !is_d3d11_opaque(fmt.i_chroma);
 
     if (var_InheritBool(vd, "direct3d11-hw-blending") &&
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 6800e9a..25aef91 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -218,7 +218,6 @@ static int Open(vlc_object_t *object)
     info.has_double_click = true;
     info.has_hide_mouse = false;
     info.has_pictures_invalid = !is_d3d9_opaque(fmt.i_chroma);
-    info.has_event_thread = true;
     if (var_InheritBool(vd, "direct3d9-hw-blending") &&
         sys->d3dregion_format != D3DFMT_UNKNOWN &&
         (sys->d3dcaps.SrcBlendCaps  & D3DPBLENDCAPS_SRCALPHA) &&
diff --git a/modules/video_output/win32/directdraw.c b/modules/video_output/win32/directdraw.c
index c2f5eea..f65162c 100644
--- a/modules/video_output/win32/directdraw.c
+++ b/modules/video_output/win32/directdraw.c
@@ -202,7 +202,6 @@ static int Open(vlc_object_t *object)
     info.has_double_click = true;
     info.has_hide_mouse = false;
     info.has_pictures_invalid = true;
-    info.has_event_thread = true;
 
     /* Interaction TODO support starting with wallpaper mode */
     vlc_mutex_init(&sys->lock);
diff --git a/modules/video_output/win32/glwin32.c b/modules/video_output/win32/glwin32.c
index 4a0ac0d..d5b51e2 100644
--- a/modules/video_output/win32/glwin32.c
+++ b/modules/video_output/win32/glwin32.c
@@ -229,7 +229,6 @@ static int Open(vlc_object_t *object)
     vout_display_info_t info = vd->info;
     info.has_double_click = true;
     info.has_hide_mouse = false;
-    info.has_event_thread = true;
     info.subpicture_chromas = subpicture_chromas;
 
    /* Setup vout_display now that everything is fine */
diff --git a/modules/video_output/xcb/x11.c b/modules/video_output/xcb/x11.c
index 7117881..6003cff 100644
--- a/modules/video_output/xcb/x11.c
+++ b/modules/video_output/xcb/x11.c
@@ -301,7 +301,6 @@ found_format:;
 
     /* Setup vout_display_t once everything is fine */
     vd->info.has_pictures_invalid = true;
-    vd->info.has_event_thread = true;
 
     vd->fmt = fmt_pic;
     vd->pool = Pool;
diff --git a/modules/video_output/xcb/xvideo.c b/modules/video_output/xcb/xvideo.c
index dde4f33..58f98d3 100644
--- a/modules/video_output/xcb/xvideo.c
+++ b/modules/video_output/xcb/xvideo.c
@@ -558,7 +558,6 @@ static int Open (vlc_object_t *obj)
     /* */
     vout_display_info_t info = vd->info;
     info.has_pictures_invalid = false;
-    info.has_event_thread = true;
 
     /* Setup vout_display_t once everything is fine */
     p_sys->swap_uv = vlc_fourcc_AreUVPlanesSwapped (fmt.i_chroma,
diff --git a/src/video_output/display.c b/src/video_output/display.c
index 71ceeff..e4bd497 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -93,7 +93,7 @@ static vout_display_t *vout_display_New(vlc_object_t *obj,
     vd->info.has_double_click = false;
     vd->info.has_hide_mouse = false;
     vd->info.has_pictures_invalid = false;
-    vd->info.has_event_thread = false;
+    vd->info.needs_event_thread = false;
     vd->info.subpicture_chromas = NULL;
 
     vd->cfg = cfg;
@@ -654,10 +654,10 @@ static void VoutDisplayEvent(vout_display_t *vd, int event, va_list args)
     case VOUT_DISPLAY_EVENT_KEY: {
         const int key = (int)va_arg(args, int);
         msg_Dbg(vd, "VoutDisplayEvent 'key' 0x%2.2x", key);
-        if (vd->info.has_event_thread)
-            vout_SendEventKey(osys->vout, key);
-        else
+        if (vd->info.needs_event_thread)
             VoutDisplayEventKey(vd, key);
+        else
+            vout_SendEventKey(osys->vout, key);
         break;
     }
     case VOUT_DISPLAY_EVENT_MOUSE_STATE:



More information about the vlc-commits mailing list