[vlc-devel] [PATCH] direct3d: the surface allocated for the pool needs to have the decoder sizeof

Steve Lhomme robux4 at gmail.com
Mon Sep 7 14:42:03 CEST 2015


This is a patch for vlc-2.2.git

It fixes some issues mentioned in https://trac.videolan.org/vlc/ticket/14531
Not sure if it covers all of them.

On Mon, Sep 7, 2015 at 2:40 PM, Steve Lhomme <robux4 at gmail.com> wrote:
> we must crop the decoded surface manually
> ---
>  modules/video_output/msw/direct3d.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/modules/video_output/msw/direct3d.c b/modules/video_output/msw/direct3d.c
> index 7fa4585..edd3d60 100644
> --- a/modules/video_output/msw/direct3d.c
> +++ b/modules/video_output/msw/direct3d.c
> @@ -971,8 +971,8 @@ static int Direct3DCreatePool(vout_display_t *vd, video_format_t *fmt)
>      /* Create a surface */
>      LPDIRECT3DSURFACE9 surface;
>      HRESULT hr = IDirect3DDevice9_CreateOffscreenPlainSurface(d3ddev,
> -                                                              fmt->i_visible_width,
> -                                                              fmt->i_visible_height,
> +                                                              fmt->i_width,
> +                                                              fmt->i_height,
>                                                                d3dfmt->format,
>                                                                D3DPOOL_DEFAULT,
>                                                                &surface,
> @@ -1461,7 +1461,12 @@ static int Direct3DImportPicture(vout_display_t *vd,
>
>      /* Copy picture surface into texture surface
>       * color space conversion happen here */
> -    hr = IDirect3DDevice9_StretchRect(sys->d3ddev, source, NULL, destination, NULL, D3DTEXF_LINEAR);
> +    RECT cropSource;
> +    cropSource.left = 0;
> +    cropSource.top = 0;
> +    cropSource.right = vd->fmt.i_visible_width;
> +    cropSource.bottom = vd->fmt.i_visible_height;
> +    hr = IDirect3DDevice9_StretchRect(sys->d3ddev, source, &cropSource, destination, NULL, D3DTEXF_LINEAR);
>      IDirect3DSurface9_Release(destination);
>      if (FAILED(hr)) {
>          msg_Dbg(vd, "%s:%d (hr=0x%0lX)", __FUNCTION__, __LINE__, hr);
> --
> 2.5.0
>


More information about the vlc-devel mailing list