<html><head></head><body>Hi,<br><br>The rule is very much written. It's even in the vim highlighting rules for git commit messages, and presumably in other tools too. And it's been mentioned here a few times earlier.<br><br>I admit that I sometimes go over by a few characters, but 80 is just way too much if you consider how git-log prints.<br><br><div class="gmail_quote">Le 31 mars 2021 18:04:07 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">On 2021-03-31 13:35, Alexandre Janniaux wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">On Wed, Mar 31, 2021 at 10:55:44AM +0200, Steve Lhomme wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;">On 2021-03-31 10:47, Alexandre Janniaux wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;"> Hi,<br><br> Sorry for nitpicking, but can a leaner short commit message<br> substitute this one?<br><br> Maybe:<br><br>       libvlc: select ID3D11RenderTargetView per plane<br></blockquote> I can remove the "to use" part to be under 80 chars.<br><br></blockquote>Usual conventions are more 50 characters, but I better<br>just rephrase into: short commits messages aren´t really<br>made to describe the whole patchset and intent, but to<br>provide usable one-liners to identify the changes. The<br>description commit message is made for such description.<br><br>I´d be glad if you can improve that in any way that suits<br>you. :)<br></blockquote><br>I have always written <= 80 chars in the title and never had a problem <br>until now. I'm not going to follow unwritten rules that no one follows.<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;"> Regards,<br> --<br> Alexandre Janniaux<br> Videolabs<br><br> On Wed, Mar 31, 2021 at 08:25:22AM +0200, Steve Lhomme wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #fcaf3e; padding-left: 1ex;"> This is more flexible as it doesn't depend on a shared ID3D11DeviceContext.<br><br> A NULL callback is still allowed as long as the host app does the<br> OMSetRenderTargets on their single target.<hr>    doc/libvlc/d3d11_player.cpp                  |  5 ++++-<br>    include/vlc/libvlc_media_player.h            | 11 +++++++----<br>    modules/video_output/win32/d3d11_quad.c      |  6 +++++-<br>    modules/video_output/win32/d3d11_quad.h      |  2 +-<br>    modules/video_output/win32/d3d11_swapchain.c |  6 +++---<br>    modules/video_output/win32/d3d11_swapchain.h |  2 +-<br>    modules/video_output/win32/direct3d11.c      |  7 +++++--<br>    7 files changed, 26 insertions(+), 13 deletions(-)<br><br> diff --git a/doc/libvlc/d3d11_player.cpp b/doc/libvlc/d3d11_player.cpp<br> index 4cfdce4d51b..7989846bfdd 100644<br> --- a/doc/libvlc/d3d11_player.cpp<br> +++ b/doc/libvlc/d3d11_player.cpp<br> @@ -463,11 +463,14 @@ static bool StartRendering_cb( void *opaque, bool enter )<br>        return true;<br>    }<br><br> -static bool SelectPlane_cb( void *opaque, size_t plane )<br> +static bool SelectPlane_cb( void *opaque, size_t plane, void *out )<br>    {<br> +    ID3D11RenderTargetView **output = static_cast<ID3D11RenderTargetView**>( out );<br>        struct render_context *ctx = static_cast<struct render_context *>( opaque );<br>        if ( plane != 0 ) // we only support one packed RGBA plane (DXGI_FORMAT_R8G8B8A8_UNORM)<br>            return false;<br> +    // we don't really need to return it as we already do the OMSetRenderTargets().<br> +    *output = ctx->resized.textureRenderTarget;<br>        return true;<br>    }<br><br> diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h<br> index 1af9996709d..aaf1e90ffcb 100644<br> --- a/include/vlc/libvlc_media_player.h<br> +++ b/include/vlc/libvlc_media_player.h<br> @@ -710,14 +710,17 @@ typedef void( *libvlc_video_output_set_resize_cb )( void *opaque,<br>     *<br>     * \param opaque private pointer set on the opaque parameter of @a libvlc_video_output_setup_cb() [IN]<br>     * \param plane number of the rendering plane to select<br> + * \param output handle of the rendering output for the given plane<br>     * \return true on success<br>     * \version LibVLC 4.0.0 or later<br>     *<br>     * \note This is only used with \ref libvlc_video_engine_d3d11.<br>     *<br> - * The host should call OMSetRenderTargets for Direct3D11. If this callback is<br> - * not used (set to NULL in @a libvlc_video_set_output_callbacks()) OMSetRenderTargets<br> - * has to be set during the @a libvlc_video_makeCurrent_cb()<br> + * The output parameter receives the ID3D11RenderTargetView* to use for rendering<br> + * the plane.<br> + *<br> + * If this callback is not used (set to NULL in @a libvlc_video_set_output_callbacks())<br> + * OMSetRenderTargets has to be set during the @a libvlc_video_makeCurrent_cb()<br>     * entering call.<br>     *<br>     * The number of planes depend on the DXGI_FORMAT returned during the<br> @@ -727,7 +730,7 @@ typedef void( *libvlc_video_output_set_resize_cb )( void *opaque,<br>     * This callback is called between libvlc_video_makeCurrent_cb current/not-current<br>     * calls.<br>     */<br> -typedef bool( *libvlc_video_output_select_plane_cb )( void *opaque, size_t plane );<br> +typedef bool( *libvlc_video_output_select_plane_cb )( void *opaque, size_t plane, void *output );<br><br>    /**<br>     * Set callbacks and data to render decoded video to a custom texture<br> diff --git a/modules/video_output/win32/d3d11_quad.c b/modules/video_output/win32/d3d11_quad.c<br> index b8948b16daa..aba095467c1 100644<br> --- a/modules/video_output/win32/d3d11_quad.c<br> +++ b/modules/video_output/win32/d3d11_quad.c<br> @@ -70,9 +70,13 @@ void D3D11_RenderQuad(d3d11_device_t *d3d_dev, d3d11_quad_t *quad, d3d11_vertex_<br>            if (!quad->d3dpixelShader[i])<br>                break;<br><br> -        if (unlikely(!selectPlane(selectOpaque, i)))<br> +        ID3D11RenderTargetView *renderView = NULL;<br> +        if (unlikely(!selectPlane(selectOpaque, i, &renderView)))<br>                continue;<br><br> +        if (renderView != NULL)<br> +            ID3D11DeviceContext_OMSetRenderTargets(d3d_dev->d3dcontext, 1, &renderView, NULL);<br> +<br>            ID3D11DeviceContext_PSSetShader(d3d_dev->d3dcontext, quad->d3dpixelShader[i], NULL, 0);<br><br>            ID3D11DeviceContext_RSSetViewports(d3d_dev->d3dcontext, 1, &quad->cropViewport[i]);<br> diff --git a/modules/video_output/win32/d3d11_quad.h b/modules/video_output/win32/d3d11_quad.h<br> index 01ffca82fd9..07c3a0c9d9a 100644<br> --- a/modules/video_output/win32/d3d11_quad.h<br> +++ b/modules/video_output/win32/d3d11_quad.h<br> @@ -29,7 +29,7 @@<br>    #define PS_CONST_LUMI_BOUNDS 0<br>    #define VS_CONST_VIEWPOINT   1<br><br> -typedef bool (*d3d11_select_plane_t)(void *opaque, size_t plane_index);<br> +typedef bool (*d3d11_select_plane_t)(void *opaque, size_t plane_index, ID3D11RenderTargetView **);<br><br>    void D3D11_RenderQuad(d3d11_device_t *, d3d11_quad_t *, d3d11_vertex_shader_t *,<br>                          ID3D11ShaderResourceView *resourceViews[DXGI_MAX_SHADER_VIEW],<br> diff --git a/modules/video_output/win32/d3d11_swapchain.c b/modules/video_output/win32/d3d11_swapchain.c<br> index 4b67ec4655d..f48fc0a4670 100644<br> --- a/modules/video_output/win32/d3d11_swapchain.c<br> +++ b/modules/video_output/win32/d3d11_swapchain.c<br> @@ -236,13 +236,13 @@ bool D3D11_LocalSwapchainStartEndRendering( void *opaque, bool enter )<br>        return true;<br>    }<br><br> -bool D3D11_LocalSwapchainSelectPlane( void *opaque, size_t plane )<br> +bool D3D11_LocalSwapchainSelectPlane( void *opaque, size_t plane, void *out )<br>    {<br>        struct d3d11_local_swapchain *display = opaque;<br>        if (!display->swapchainTargetView[plane])<br>            return false;<br> -    ID3D11DeviceContext_OMSetRenderTargets(display->d3d_dev->d3dcontext, 1,<br> -                                            &display->swapchainTargetView[plane], NULL);<br> +    ID3D11RenderTargetView **output = out;<br> +    *output = display->swapchainTargetView[plane];<br>        return true;<br>    }<br><br> diff --git a/modules/video_output/win32/d3d11_swapchain.h b/modules/video_output/win32/d3d11_swapchain.h<br> index f5dd4c4cf47..3d373713405 100644<br> --- a/modules/video_output/win32/d3d11_swapchain.h<br> +++ b/modules/video_output/win32/d3d11_swapchain.h<br> @@ -36,7 +36,7 @@ void *D3D11_CreateLocalSwapchainHandleDComp(vlc_object_t *, void* dcompDevice, v<br>    void D3D11_LocalSwapchainCleanupDevice( void *opaque );<br>    bool D3D11_LocalSwapchainUpdateOutput( void *opaque, const libvlc_video_render_cfg_t *cfg, libvlc_video_output_cfg_t *out );<br>    bool D3D11_LocalSwapchainStartEndRendering( void *opaque, bool enter );<br> -bool D3D11_LocalSwapchainSelectPlane( void *opaque, size_t plane );<br> +bool D3D11_LocalSwapchainSelectPlane( void *opaque, size_t plane, void *output );<br>    bool D3D11_LocalSwapchainWinstoreSize( void *opaque, uint32_t *, uint32_t * );<br>    void D3D11_LocalSwapchainSwap( void *opaque );<br>    void D3D11_LocalSwapchainSetMetadata( void *opaque, libvlc_video_metadata_type_t, const void * );<br> diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c<br> index 22e4b2a155e..db921eb7321 100644<br> --- a/modules/video_output/win32/direct3d11.c<br> +++ b/modules/video_output/win32/direct3d11.c<br> @@ -471,12 +471,15 @@ static int Control(vout_display_t *vd, int query)<br>        return res;<br>    }<br><br> -static bool SelectRenderPlane(void *opaque, size_t plane)<br> +static bool SelectRenderPlane(void *opaque, size_t plane, ID3D11RenderTargetView **targetView)<br>    {<br>        vout_display_sys_t *sys = opaque;<br>        if (!sys->selectPlaneCb)<br> +    {<br> +        *targetView = NULL;<br>            return plane == 0; // we only support one packed RGBA plane by default<br> -    return sys->selectPlaneCb(sys->outside_opaque, plane);<br> +    }<br> +    return sys->selectPlaneCb(sys->outside_opaque, plane, (void*)targetView);<br>    }<br><br>    static void PreparePicture(vout_display_t *vd, picture_t *picture, subpicture_t *subpicture,<br> --<br> 2.29.2<hr> vlc-devel mailing list<br> To unsubscribe or modify your subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></blockquote><hr> vlc-devel mailing list<br> To unsubscribe or modify your subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>