[vlc-commits] [Git][videolan/vlc][master] direct3d11: fail update_format if the interop needs another chroma
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sat Oct 17 12:48:50 UTC 2026
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
5f0ab8bb by Martin Finkel at 2026-10-17T12:36:57+00:00
direct3d11: fail update_format if the interop needs another chroma
The texture format selected for the new input, the shader-level interop,
can require a different chroma than the one provided (NV12 for YV12).
The point of update_format is to avoid adding a converter, so returning
success makes no sense here: the display needs the proper converter in
front of it. Fail instead, like the OpenGL display does when its interop
changes the chroma.
- - - - -
1 changed file:
- modules/video_output/win32/direct3d11.cpp
Changes:
=====================================
modules/video_output/win32/direct3d11.cpp
=====================================
@@ -529,6 +529,9 @@ static int UpdateFormat(vout_display_t *vd, const video_format_t *fmtp, vlc_vide
{
vout_display_sys_t *sys = static_cast<vout_display_sys_t *>(vd->sys);
+ const d3d_format_t *old_texture_format = sys->picQuad.generic.textureFormat;
+ const video_format_t old_quad_fmt = sys->picQuad.quad_fmt;
+
video_format_t fmt;
video_format_Copy(&fmt, fmtp);
video_format_Copy(&sys->picQuad.quad_fmt, &fmt);
@@ -537,6 +540,17 @@ static int UpdateFormat(vout_display_t *vd, const video_format_t *fmtp, vlc_vide
if (err != VLC_SUCCESS)
goto error;
+ if (fmt.i_chroma != fmtp->i_chroma)
+ {
+ msg_Warn(vd, "Could not update format, the display changed the "
+ "requested chroma from %4.4s to %4.4s",
+ (const char *)&fmtp->i_chroma, (const char *)&fmt.i_chroma);
+ sys->picQuad.generic.textureFormat = old_texture_format;
+ sys->picQuad.quad_fmt = old_quad_fmt;
+ err = VLC_EGENERIC;
+ goto error;
+ }
+
err = UpdateDisplayFormat(vd, &sys->picQuad.quad_fmt);
if (err != VLC_SUCCESS)
goto error;
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/5f0ab8bbff0650e0ec8de3fa1812afb7d5cb6fb2
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/5f0ab8bbff0650e0ec8de3fa1812afb7d5cb6fb2
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list