<html><head></head><body>Hi,<br><br>Currently, the converter module is inside the dGL VD, and since the context is fixed for the lifetime of a VD, it can't exactly not outlive the VD. Regardless of whether its lifecycle is shorter than that of the device, I don't really follow the rationale here.<br><br><div class="gmail_quote">Le 21 octobre 2019 09:45:37 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">It's not going to change during the lifetime of the converter module, unlike<br>the video context.<hr> modules/video_output/opengl/converter_vdpau.c | 26 +++++++++++++------<br> 1 file changed, 18 insertions(+), 8 deletions(-)<br><br>diff --git a/modules/video_output/opengl/converter_vdpau.c b/modules/video_output/opengl/converter_vdpau.c<br>index 5220699128f..874f8f5307e 100644<br>--- a/modules/video_output/opengl/converter_vdpau.c<br>+++ b/modules/video_output/opengl/converter_vdpau.c<br>@@ -58,17 +58,19 @@ static PFNGLVDPAUSURFACEACCESSNVPROC            _glVDPAUSurfaceAccessNV;<br> static PFNGLVDPAUMAPSURFACESNVPROC              _glVDPAUMapSurfacesNV;<br> static PFNGLVDPAUUNMAPSURFACESNVPROC            _glVDPAUUnmapSurfacesNV;<br> <br>+typedef struct {<br>+    vlc_decoder_device *dec_device;<br>+} converter_sys_t;<br>+<br> static picture_pool_t *<br> tc_vdpau_gl_get_pool(opengl_tex_converter_t const *tc,<br>                      unsigned int requested_count)<br> {<br>-    vlc_decoder_device *dec_device = vlc_video_context_HoldDevice(tc->vctx);<br>-    picture_pool_t *pool;<br>-    pool = vlc_vdp_output_pool_create(dec_device->opaque,<br>+    converter_sys_t *sys = tc->priv;<br>+    vlc_decoder_device *dec_device = sys->dec_device;<br>+    return vlc_vdp_output_pool_create(dec_device->opaque,<br>                                       VDP_RGBA_FORMAT_B8G8R8A8,<br>                                       &tc->fmt, requested_count);<br>-    vlc_decoder_device_Release(dec_device);<br>-    return pool;<br> }<br> <br> static int<br>@@ -116,7 +118,8 @@ Close(vlc_object_t *obj)<br> {<br>     opengl_tex_converter_t *tc = (void *)obj;<br>     _glVDPAUFiniNV(); assert(tc->vt->GetError() == GL_NO_ERROR);<br>-    vlc_decoder_device *dec_device = vlc_video_context_HoldDevice(tc->vctx);<br>+    converter_sys_t *sys = tc->priv;<br>+    vlc_decoder_device *dec_device = sys->dec_device;<br>     vdp_release_x11(dec_device->opaque);<br>     vlc_decoder_device_Release(dec_device);<br> }<br>@@ -139,6 +142,14 @@ Open(vlc_object_t *obj)<br>         return VLC_EGENERIC;<br>     }<br> <br>+    converter_sys_t *sys = vlc_obj_malloc(VLC_OBJECT(tc), sizeof(*sys));<br>+    if (unlikely(sys == NULL))<br>+    {<br>+        vlc_decoder_device_Release(dec_device);<br>+        return VLC_ENOMEM;<br>+    }<br>+    sys->dec_device = dec_device;<br>+<br>     tc->fmt.i_chroma = VLC_CODEC_VDPAU_OUTPUT;<br> <br>     VdpDevice device;<br>@@ -176,8 +187,6 @@ Open(vlc_object_t *obj)<br> <br>     INTEROP_CALL(glVDPAUInitNV, (void *)(uintptr_t)device, vdp_gpa);<br> <br>-    vlc_decoder_device_Release(dec_device);<br>-<br>     tc->fshader = opengl_fragment_shader_init(tc, GL_TEXTURE_2D,<br>                                               VLC_CODEC_RGB32,<br>                                               COLOR_SPACE_UNDEF);<br>@@ -189,6 +198,7 @@ Open(vlc_object_t *obj)<br> <br>     tc->pf_get_pool = tc_vdpau_gl_get_pool;<br>     tc->pf_update = tc_vdpau_gl_update;<br>+    tc->priv = sys;<br> <br>     return VLC_SUCCESS;<br> }</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>