<html><head></head><body>Hi,<br><br>That won't work properly if the "dec-dev" module list has more than one element. Using the force flag is rarely a good idea, if ever.<br><br><div class="gmail_quote">Le 5 juillet 2019 17:19:45 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">When selecting between D3D11 and D3D9 on Windows we need to know if the decoder<br>device may be optional or not (with external rendering it's not).<hr> include/vlc_codec.h | 3 ++-<br> modules/hw/d3d9/d3d9_device.c | 3 ++-<br> modules/hw/d3d9/d3d9_filters.h | 2 +-<br> modules/hw/vaapi/decoder_device.c | 3 ++-<br> modules/video_output/opengl/converter_vdpau.c | 3 ++-<br> modules/video_output/win32/direct3d9.c | 5 +++--<br> src/input/decoder_helpers.c | 3 +--<br> 7 files changed, 13 insertions(+), 9 deletions(-)<br><br>diff --git a/include/vlc_codec.h b/include/vlc_codec.h<br>index 223550ce9c..a2f81756b5 100644<br>--- a/include/vlc_codec.h<br>+++ b/include/vlc_codec.h<br>@@ -527,10 +527,11 @@ typedef struct vlc_decoder_device<br> * "decoder device" module open entry point<br> *<br> * @param device the "decoder device" structure to initialize<br>+ * @param forced whether the module is forced loaded or not<br> * @param window pointer to a window to help device initialization (can be NULL)<br> **/<br> typedef int (*vlc_decoder_device_Open)(vlc_decoder_device *device,<br>- vout_window_t *window);<br>+ bool forced, vout_window_t *window);<br> /** "decoder device" module close entry point */<br> typedef void (*vlc_decoder_device_Close)(vlc_decoder_device *device);<br> <br>diff --git a/modules/hw/d3d9/d3d9_device.c b/modules/hw/d3d9/d3d9_device.c<br>index aefc813b7a..acf7c31475 100644<br>--- a/modules/hw/d3d9/d3d9_device.c<br>+++ b/modules/hw/d3d9/d3d9_device.c<br>@@ -47,8 +47,9 @@ typedef struct {<br> d3d9_decoder_device_t dec_device;<br> } d3d9_decoder_device;<br> <br>-int D3D9OpenDecoderDevice(vlc_decoder_device *device, vout_window_t *wnd)<br>+int D3D9OpenDecoderDevice(vlc_decoder_device *device, bool forced, vout_window_t *wnd)<br> {<br>+ VLC_UNUSED(forced);<br> d3d9_decoder_device *sys = vlc_obj_malloc(VLC_OBJECT(device), sizeof(*sys));<br> if (unlikely(sys==NULL))<br> return VLC_ENOMEM;<br>diff --git a/modules/hw/d3d9/d3d9_filters.h b/modules/hw/d3d9/d3d9_filters.h<br>index 7819b12782..189c76f9f6 100644<br>--- a/modules/hw/d3d9/d3d9_filters.h<br>+++ b/modules/hw/d3d9/d3d9_filters.h<br>@@ -35,7 +35,7 @@ void D3D9CloseConverter(vlc_object_t *);<br> int D3D9OpenCPUConverter(vlc_object_t *);<br> void D3D9CloseCPUConverter(vlc_object_t *);<br> <br>-int D3D9OpenDecoderDevice(vlc_decoder_device *, vout_window_t *);<br>+int D3D9OpenDecoderDevice(vlc_decoder_device *, bool, vout_window_t *);<br> void D3D9CloseDecoderDevice(vlc_decoder_device *);<br> <br> void D3D9_FilterHoldInstance(filter_t *, d3d9_device_t *, D3DSURFACE_DESC *);<br>diff --git a/modules/hw/vaapi/decoder_device.c b/modules/hw/vaapi/decoder_device.c<br>index 5efe9e635b..e9f1e514f8 100644<br>--- a/modules/hw/vaapi/decoder_device.c<br>+++ b/modules/hw/vaapi/decoder_device.c<br>@@ -217,8 +217,9 @@ Close(vlc_decoder_device *device)<br> }<br> <br> static int<br>-Open(vlc_decoder_device *device, vout_window_t *window)<br>+Open(vlc_decoder_device *device, bool forced, vout_window_t *window)<br> {<br>+ VLC_UNUSED(forced);<br> VADisplay vadpy = NULL;<br> struct vaapi_instance *vainst = NULL;<br> #if defined (HAVE_VA_X11)<br>diff --git a/modules/video_output/opengl/converter_vdpau.c b/modules/video_output/opengl/converter_vdpau.c<br>index d40d5d181f..b76878a05d 100644<br>--- a/modules/video_output/opengl/converter_vdpau.c<br>+++ b/modules/video_output/opengl/converter_vdpau.c<br>@@ -185,8 +185,9 @@ DecoderContextClose(vlc_decoder_device *device)<br> }<br> <br> static int<br>-DecoderContextOpen(vlc_decoder_device *device, vout_window_t *window)<br>+DecoderContextOpen(vlc_decoder_device *device, bool forced, vout_window_t *window)<br> {<br>+ VLC_UNUSED(forced);<br> if (!window || !vlc_xlib_init(VLC_OBJECT(window)))<br> return VLC_EGENERIC;<br> <br>diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c<br>index e625c22d48..7fafcb7a07 100644<br>--- a/modules/video_output/win32/direct3d9.c<br>+++ b/modules/video_output/win32/direct3d9.c<br>@@ -73,7 +73,7 @@ static int Open(vout_display_t *, const vout_display_cfg_t *,<br> video_format_t *, vlc_video_context *);<br> static void Close(vout_display_t *);<br> <br>-static int OpenD3D9DecoderDevice(vlc_decoder_device *, vout_window_t *);<br>+static int OpenD3D9DecoderDevice(vlc_decoder_device *, bool, vout_window_t *);<br> static void CloseD3D9DecoderDevice(vlc_decoder_device *);<br> <br> static int GLConvOpen(vlc_object_t *);<br>@@ -1995,9 +1995,10 @@ struct local_render_device<br> d3d9_decoder_device_t device;<br> };<br> <br>-static int OpenD3D9DecoderDevice(vlc_decoder_device *device, vout_window_t *wnd)<br>+static int OpenD3D9DecoderDevice(vlc_decoder_device *device, bool forced, vout_window_t *wnd)<br> {<br> VLC_UNUSED(wnd);<br>+ VLC_UNUSED(forced);<br> struct local_render_device *display = vlc_obj_calloc(VLC_OBJECT(device), 1, sizeof(*display));<br> if (unlikely(display == NULL))<br> return VLC_ENOMEM;<br>diff --git a/src/input/decoder_helpers.c b/src/input/decoder_helpers.c<br>index 7384e2bda0..f484180371 100644<br>--- a/src/input/decoder_helpers.c<br>+++ b/src/input/decoder_helpers.c<br>@@ -105,7 +105,7 @@ static int decoder_device_Open(void *func, bool forced, va_list ap)<br> vlc_decoder_device_Open open = func;<br> vlc_decoder_device *device = va_arg(ap, vlc_decoder_device *);<br> vout_window_t *window = va_arg(ap, vout_window_t *);<br>- int ret = open(device, window);<br>+ int ret = open(device, forced, window);<br> if (ret != VLC_SUCCESS)<br> {<br> device->sys = NULL;<br>@@ -116,7 +116,6 @@ static int decoder_device_Open(void *func, bool forced, va_list ap)<br> {<br> assert(device->type != VLC_DECODER_DEVICE_NONE);<br> }<br>- (void) forced;<br> return ret;<br> }<br> </pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>