[vlc-commits] [Git][videolan/vlc][master] 2 commits: lib: media_player: use d3d11drawable vout for callbacks

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Sun Apr 6 16:34:00 UTC 2025



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
d1e2e618 by Alexandre Janniaux at 2025-04-06T16:07:43+00:00
lib: media_player: use d3d11drawable vout for callbacks

The d3d11 drawable display doesn't exist yet, but the direct3d11 display
is not reachable from a wextern window (regression from previous commit
e33e383fde533c17032614bd0cbf5be1d364917a that check window type) so we
might as well change it immediately instead of doing it in three steps.

Next commit will re-establish the usage of the display by introducing
it.

- - - - -
7ff98c8e by Alexandre Janniaux at 2025-04-06T16:07:43+00:00
direct3d11: separate display from drawable display

Separating the display used in VLC and the libvlc application-side
display ensures we're not trying to use the latter in the VLC scenarios
and still ensures we check the kind of windowing that is being provided
to the display.

Fix a regression with e33e383fde533c17032614bd0cbf5be1d364917a
preventing the callbacks from opening the display.

- - - - -


2 changed files:

- lib/media_player.c
- modules/video_output/win32/direct3d11.cpp


Changes:

=====================================
lib/media_player.c
=====================================
@@ -1128,7 +1128,7 @@ bool libvlc_video_set_output_callbacks(libvlc_media_player_t *mp,
     }
     else if ( engine == libvlc_video_engine_d3d11 )
     {
-        var_SetString ( mp, "vout", "direct3d11" );
+        var_SetString ( mp, "vout", "d3d11drawable" );
         var_SetString ( mp, "dec-dev", "d3d11" );
     }
     else if ( engine == libvlc_video_engine_d3d9 )


=====================================
modules/video_output/win32/direct3d11.cpp
=====================================
@@ -58,7 +58,9 @@
 
 using Microsoft::WRL::ComPtr;
 
-static int  Open(vout_display_t *,
+static int  OpenDisplay(vout_display_t *,
+                 video_format_t *, vlc_video_context *);
+static int  OpenDrawable(vout_display_t *,
                  video_format_t *, vlc_video_context *);
 static void Close(vout_display_t *);
 
@@ -98,7 +100,12 @@ vlc_module_begin ()
         change_string_list(ppsz_hdr_mode, ppsz_hdr_mode_text)
 
     add_shortcut("direct3d11")
-    set_callback_display(Open, 300)
+    set_callback_display(OpenDisplay, 300)
+
+    add_submodule()
+        set_callback_display(OpenDrawable, 0)
+        add_shortcut("d3d11drawable")
+
 vlc_module_end ()
 
 enum d3d11_upscale
@@ -529,13 +536,9 @@ static const auto ops = []{
     return ops;
 }();
 
-static int Open(vout_display_t *vd,
+static int OpenGeneric(vout_display_t *vd,
                 video_format_t *fmtp, vlc_video_context *context)
 {
-    if (vd->cfg->window->type != VLC_WINDOW_TYPE_HWND &&
-        vd->cfg->window->type != VLC_WINDOW_TYPE_DCOMP)
-        return VLC_ENOTSUP;
-
     vout_display_sys_t *sys = new (std::nothrow) vout_display_sys_t();
     if (!sys)
         return VLC_ENOMEM;
@@ -639,6 +642,27 @@ error:
     return VLC_EGENERIC;
 }
 
+static int OpenDisplay(vout_display_t *vd,
+                       video_format_t *fmtp, vlc_video_context *context)
+{
+    if (vd->cfg->window->type != VLC_WINDOW_TYPE_HWND &&
+        vd->cfg->window->type != VLC_WINDOW_TYPE_DCOMP)
+        return VLC_ENOTSUP;
+
+    return OpenGeneric(vd, fmtp, context);
+}
+
+static int OpenDrawable(vout_display_t *vd,
+                        video_format_t *fmtp, vlc_video_context *context)
+{
+    if (vd->cfg->window->type != VLC_WINDOW_TYPE_DUMMY)
+        return VLC_ENOTSUP;
+
+    /* TODO: other checks for callback validity should be there. */
+
+    return OpenGeneric(vd, fmtp, context);
+}
+
 static void Close(vout_display_t *vd)
 {
     vout_display_sys_t *sys = static_cast<vout_display_sys_t *>(vd->sys);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/34ed2bd42cb693ce8d34548fa92e05817c2549ca...7ff98c8e83f7ab391c883003ca532dc04d72fad0

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/34ed2bd42cb693ce8d34548fa92e05817c2549ca...7ff98c8e83f7ab391c883003ca532dc04d72fad0
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