[vlc-commits] [Git][videolan/vlc][master] direct3d11: implement update_format operation

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Jun 23 07:08:16 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
292bb1d1 by Alexandre Janniaux at 2025-06-23T06:50:48+00:00
direct3d11: implement update_format operation

vlc_display_operations::update_format allows a vout display
implementation to change the display rendering settings, more
specifically the source and video context settings, without needing a
full restart of the whole display.

In case of error, a full restart is required by the core.

The implementation has been tested against 8bit -> 10bit changes and
video context changes.

- - - - -


1 changed file:

- modules/video_output/win32/direct3d11.cpp


Changes:

=====================================
modules/video_output/win32/direct3d11.cpp
=====================================
@@ -525,6 +525,34 @@ static int ChangeSourceProjection(vout_display_t *vd, video_projection_mode_t pr
     return Direct3D11CreateFormatResources(vd, vd->source);
 }
 
+static int UpdateFormat(vout_display_t *vd, const video_format_t *fmtp, vlc_video_context *vctx)
+{
+    vout_display_sys_t *sys = static_cast<vout_display_sys_t *>(vd->sys);
+
+    video_format_t fmt;
+    video_format_Copy(&fmt, fmtp);
+    video_format_Copy(&sys->picQuad.quad_fmt, &fmt);
+
+    int err = SetupOutputFormat(vd, &fmt, vctx, &sys->picQuad.quad_fmt);
+    if (err != VLC_SUCCESS)
+        goto error;
+
+    err = UpdateDisplayFormat(vd, &sys->picQuad.quad_fmt);
+    if (err != VLC_SUCCESS)
+        goto error;
+
+    err = Direct3D11CreateFormatResources(vd, &fmt);
+    if (err != VLC_SUCCESS)
+        goto error;
+
+    video_format_Clean(&fmt);
+    return VLC_SUCCESS;
+
+error:
+    video_format_Clean(&fmt);
+    return err;
+}
+
 static constexpr const auto ops = []{
     struct vlc_display_operations ops {};
     ops.close = Close;
@@ -532,6 +560,7 @@ static constexpr const auto ops = []{
     ops.display = Display;
     ops.set_display_size = SetDisplaySize;
     ops.control = Control;
+    ops.update_format = UpdateFormat;
     ops.set_viewpoint = SetViewpoint;
     ops.change_source_projection = ChangeSourceProjection;
     return ops;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/292bb1d19928b7ec29010fcf3806ec4cdfdac271

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/292bb1d19928b7ec29010fcf3806ec4cdfdac271
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list