<html><head></head><body>This works to create a device out of nothing, but presumably the goal is to create a device out of an encoder, not nothing. So this does in fact not work.<br><br><div class="gmail_quote">Le 4 novembre 2019 21:05:20 GMT+09: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">Allowing the window to be NULL, which is OK for D3D11/D3D9/NVDEC.<hr> include/vlc_codec.h             | 6 ++++--<br> src/input/decoder_helpers.c     | 7 ++++---<br> src/video_output/video_output.c | 2 +-<br> 3 files changed, 9 insertions(+), 6 deletions(-)<br><br>diff --git a/include/vlc_codec.h b/include/vlc_codec.h<br>index 6649ef94cc2..c0394522aae 100644<br>--- a/include/vlc_codec.h<br>+++ b/include/vlc_codec.h<br>@@ -604,8 +604,10 @@ typedef int (*vlc_decoder_device_Open)(vlc_decoder_device *device,<br>  * This function will be hidden in the future. It is now used by opengl vout<br>  * module as a transition.<br>  */<br>-VLC_USED vlc_decoder_device *<br>-vlc_decoder_device_Create(vout_window_t *window);<br>+vlc_decoder_device *<br>+vlc_decoder_device_Create(vlc_object_t *, vout_window_t *window) VLC_USED;<br>+#define vlc_decoder_device_Create(a, b) \<br>+        vlc_decoder_device_Create(VLC_OBJECT(a), (b))<br> <br> /**<br>  * Hold a decoder device<br>diff --git a/src/input/decoder_helpers.c b/src/input/decoder_helpers.c<br>index 3d8a06985db..a34d32f8185 100644<br>--- a/src/input/decoder_helpers.c<br>+++ b/src/input/decoder_helpers.c<br>@@ -181,14 +181,15 @@ static int decoder_device_Open(void *func, bool forced, va_list ap)<br>     return open(device, window);<br> }<br> <br>+#undef vlc_decoder_device_Create<br> vlc_decoder_device *<br>-vlc_decoder_device_Create(vout_window_t *window)<br>+vlc_decoder_device_Create(vlc_object_t *o, vout_window_t *window)<br> {<br>     struct vlc_decoder_device_priv *priv =<br>-            vlc_object_create(window, sizeof (*priv));<br>+            vlc_object_create(o, sizeof (*priv));<br>     if (!priv)<br>         return NULL;<br>-    char *name = var_InheritString(window, "dec-dev");<br>+    char *name = var_InheritString(o, "dec-dev");<br>     module_t *module = vlc_module_load(&priv->device, "decoder device", name,<br>                                     true, decoder_device_Open, &priv->device,<br>                                     window);<br>diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c<br>index 8aa527120c0..66ab3e22b3e 100644<br>--- a/src/video_output/video_output.c<br>+++ b/src/video_output/video_output.c<br>@@ -1990,7 +1990,7 @@ static int vout_EnableWindow(vout_thread_t *vout, const video_format_t *original<br>     if (pp_dec_device)<br>     {<br>         if (sys->dec_device == NULL)<br>-            sys->dec_device = vlc_decoder_device_Create(sys->display_cfg.window);<br>+            sys->dec_device = vlc_decoder_device_Create(vout, sys->display_cfg.window);<br>         *pp_dec_device = sys->dec_device ? vlc_decoder_device_Hold( sys->dec_device ) : NULL;<br>     }<br>     vlc_mutex_unlock(&sys->window_lock);</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>