<html><head></head><body>Probably OK<br><br><div class="gmail_quote">Le 17 juillet 2019 11:57:10 GMT+03:00, Steve Lhomme <robux4@ycbcr.xyz> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">We don't need a generic event callback anymore since we only handle one type of<br>event.<br><br>Setting a vout_display_owner_t is now optional.<hr> include/vlc_vout_display.h      | 13 +++----------<br> modules/video_output/splitter.c |  5 +----<br> src/video_output/display.c      |  3 ++-<br> src/video_output/vout_wrapper.c | 18 ++++--------------<br> 4 files changed, 10 insertions(+), 29 deletions(-)<br><br>diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h<br>index 6d5103cb51..77f401726d 100644<br>--- a/include/vlc_vout_display.h<br>+++ b/include/vlc_vout_display.h<br>@@ -189,7 +189,7 @@ struct vout_display_owner_t {<br>      * Be careful, it does not ensure correct serialization if it is used<br>      * from multiple threads.<br>      */<br>-    void            (*event)(vout_display_t *, int, va_list);<br>+    void (*viewpoint_moved)(void *sys, const vlc_viewpoint_t *vp);<br> };<br> <br> /**<br>@@ -385,14 +385,6 @@ static inline int vout_display_Control(vout_display_t *vd, int query, ...)<br>     return ret;<br> }<br> <br>-static inline void vout_display_SendEvent(vout_display_t *vd, int query, ...)<br>-{<br>-    va_list args;<br>-    va_start(args, query);<br>-    vd->owner.event(vd, query, args);<br>-    va_end(args);<br>-}<br>-<br> VLC_API void vout_display_SendEventPicturesInvalid(vout_display_t *vd);<br> <br> static inline void vout_display_SendEventMousePressed(vout_display_t *vd, int button)<br>@@ -410,7 +402,8 @@ static inline void vout_display_SendEventMouseDoubleClick(vout_display_t *vd)<br> static inline void vout_display_SendEventViewpointMoved(vout_display_t *vd,<br>                                                         const vlc_viewpoint_t *vp)<br> {<br>-    vout_display_SendEvent(vd, VOUT_DISPLAY_EVENT_VIEWPOINT_MOVED, vp);<br>+    if (vd->owner.viewpoint_moved)<br>+        vd->owner.viewpoint_moved(vd->owner.sys, vp);<br> }<br> <br> /**<br>diff --git a/modules/video_output/splitter.c b/modules/video_output/splitter.c<br>index 5a30407395..8a39ccb961 100644<br>--- a/modules/video_output/splitter.c<br>+++ b/modules/video_output/splitter.c<br>@@ -232,10 +232,7 @@ static vout_display_t *vlc_vidsplit_CreateDisplay(vlc_object_t *obj,<br>     vlc_decoder_device *dec_device,<br>     const char *name)<br> {<br>-    vout_display_owner_t owner = {<br>-        .event = vlc_vidsplit_display_Event,<br>-    };<br>-    return vout_display_New(obj, source, cfg, vctx, dec_device, name, &owner);<br>+    return vout_display_New(obj, source, cfg, vctx, dec_device, name, NULL);<br> }<br> <br> static int vlc_vidsplit_Open(vout_display_t *vd,<br>diff --git a/src/video_output/display.c b/src/video_output/display.c<br>index 90af4a071f..5537b19996 100644<br>--- a/src/video_output/display.c<br>+++ b/src/video_output/display.c<br>@@ -779,7 +779,8 @@ vout_display_t *vout_display_New(vlc_object_t *parent,<br>     vd->display = NULL;<br>     vd->control = NULL;<br>     vd->sys = NULL;<br>-    vd->owner = *owner;<br>+    if (owner)<br>+        vd->owner = *owner;<br> <br>     vd->module = vlc_module_load(vd, "vout display", module,<br>                                  module && *module != '\0',<br>diff --git a/src/video_output/vout_wrapper.c b/src/video_output/vout_wrapper.c<br>index 0870cabafa..22c0a22f50 100644<br>--- a/src/video_output/vout_wrapper.c<br>+++ b/src/video_output/vout_wrapper.c<br>@@ -42,20 +42,10 @@ static int  Forward(vlc_object_t *, char const *,<br>                     vlc_value_t, vlc_value_t, void *);<br> #endif<br> <br>-static void VoutDisplayEvent(vout_display_t *vd, int event, va_list args)<br>+static void VoutViewpointMoved(void *sys, const vlc_viewpoint_t *vp)<br> {<br>-    vout_thread_t *vout = vd->owner.sys;<br>-<br>-    switch (event) {<br>-    case VOUT_DISPLAY_EVENT_VIEWPOINT_MOVED:<br>-        var_SetAddress(vout, "viewpoint-moved",<br>-                       (void *)va_arg(args, const vlc_viewpoint_t *));<br>-        break;<br>-    default:<br>-        msg_Err(vd, "VoutDisplayEvent received event %d", event);<br>-        /* TODO add an assert when all event are handled */<br>-        break;<br>-    }<br>+    vout_thread_t *vout = sys;<br>+    var_SetAddress(vout, "viewpoint-moved", (void*)vp);<br> }<br> <br> /* Minimum number of display picture */<br>@@ -72,7 +62,7 @@ vout_display_t *vout_OpenWrapper(vout_thread_t *vout,<br>     vout_thread_sys_t *sys = vout->p;<br>     vout_display_t *vd;<br>     vout_display_owner_t owner = {<br>-        .event = VoutDisplayEvent, .sys = vout,<br>+        .viewpoint_moved = VoutViewpointMoved, .sys = vout,<br>     };<br>     const char *modlist;<br>     char *modlistbuf = NULL;</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>