[vlc-devel] [PATCH v2 1/7] video output: setup interruption context in vout

Alexandre Janniaux ajanni at videolabs.io
Thu Feb 11 11:17:13 UTC 2021


Hi,

Where do you suggest to move the «interrupt-like» mechanism
then?

Regards,
--
Alexandre Janniaux
Videolabs

On Thu, Feb 11, 2021 at 12:27:35PM +0200, Rémi Denis-Courmont wrote:
> Same as v1.
>
> -1
>
> Le 11 février 2021 10:34:03 GMT+02:00, Alexandre Janniaux <ajanni at videolabs.io> a écrit :
> >Some display are doing IO (eg. texture synchronization, WSI details)
> >and
> >might be waiting within the prepare/display code. Install an
> >interruption context to allow notifying them that we're gonna kill
> >them.
> >---
> > src/video_output/video_output.c | 14 ++++++++++++++
> > 1 file changed, 14 insertions(+)
> >
> >diff --git a/src/video_output/video_output.c
> >b/src/video_output/video_output.c
> >index d04d3f4d11..d1eaf81242 100644
> >--- a/src/video_output/video_output.c
> >+++ b/src/video_output/video_output.c
> >@@ -49,6 +49,7 @@
> > #include <vlc_plugin.h>
> > #include <vlc_codec.h>
> > #include <vlc_atomic.h>
> >+#include <vlc_interrupt.h>
> >
> > #include <libvlc.h>
> > #include "vout_private.h"
> >@@ -162,6 +163,7 @@ typedef struct vout_thread_sys_t
> >vout_chrono_t   render;           /**< picture render time estimator */
> >     vout_chrono_t   static_filter;
> >
> >+    vlc_interrupt_t *interrupt;
> >     vlc_atomic_rc_t rc;
> >
> > } vout_thread_sys_t;
> >@@ -1763,6 +1765,8 @@ static void *Thread(void *object)
> >     vlc_tick_t deadline = VLC_TICK_INVALID;
> >     bool wait = false;
> >
> >+    vlc_interrupt_set(sys->interrupt);
> >+
> >     for (;;) {
> >         if (wait)
> >         {
> >@@ -1848,9 +1852,11 @@ void vout_StopDisplay(vout_thread_t *vout)
> >     vout_thread_sys_t *sys = VOUT_THREAD_TO_SYS(vout);
> >
> >     atomic_store(&sys->control_is_terminated, true);
> >+    vlc_interrupt_kill(sys->interrupt);
> >// wake up so it goes back to the loop that will detect the terminated
> >state
> >     vout_control_Wake(&sys->control);
> >     vlc_join(sys->thread, NULL);
> >+    vlc_interrupt_destroy(sys->interrupt);
> >
> >     vout_ReleaseDisplay(sys);
> > }
> >@@ -2147,6 +2153,14 @@ int vout_Request(const vout_configuration_t
> >*cfg, vlc_video_context *vctx, input
> >
> >     if (sys->display != NULL)
> >         vout_StopDisplay(cfg->vout);
> >+    sys->interrupt = vlc_interrupt_create();
> >+    if (sys->interrupt == NULL)
> >+    {
> >+        video_format_Clean(&original);
> >+        vout_DisableWindow(vout);
> >+        return -1;
> >+    }
> >+
> >
> >     vout_ReinitInterlacingSupport(cfg->vout, &sys->private);
> >
> >--
> >2.30.1
> >
> >_______________________________________________
> >vlc-devel mailing list
> >To unsubscribe or modify your subscription options:
> >https://mailman.videolan.org/listinfo/vlc-devel
>
> --
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.

> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list