[vlc-devel] [PATCH] direct3d9: fix orientation

Salah-Eddin Shaban salah at videolan.org
Fri Nov 17 21:53:47 CET 2017


This is the same as the original patch except that ORIENT_LEFT_BOTTOM
and ORIENT_RIGHT_TOP have been swapped to match the behavior of the
opengl vout.

It fixes the dshow issue without breaking the #2882 samples.

On Fri, Nov 17, 2017 at 10:46 PM, Salah-Eddin Shaban <salah at videolan.org> wrote:
> refs #11778, #18368
> ---
>  modules/video_output/win32/direct3d9.c | 28 ++++++++++++++--------------
>  1 file changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
> index bada359642..b385a22a78 100644
> --- a/modules/video_output/win32/direct3d9.c
> +++ b/modules/video_output/win32/direct3d9.c
> @@ -1505,48 +1505,48 @@ static void Direct3D9DestroyShaders(vout_display_t *vd)
>  static void orientationVertexOrder(video_orientation_t orientation, int vertex_order[static 4])
>  {
>      switch (orientation) {
> -        case ORIENT_ROTATED_90:
> +        case ORIENT_ROTATED_90:      /* ORIENT_RIGHT_TOP */
>              vertex_order[0] = 1;
>              vertex_order[1] = 2;
>              vertex_order[2] = 3;
>              vertex_order[3] = 0;
>              break;
> -        case ORIENT_ROTATED_270:
> +        case ORIENT_ROTATED_270:     /* ORIENT_LEFT_BOTTOM */
>              vertex_order[0] = 3;
>              vertex_order[1] = 0;
>              vertex_order[2] = 1;
>              vertex_order[3] = 2;
>              break;
> -        case ORIENT_ROTATED_180:
> +        case ORIENT_ROTATED_180:     /* ORIENT_BOTTOM_RIGHT */
>              vertex_order[0] = 2;
>              vertex_order[1] = 3;
>              vertex_order[2] = 0;
>              vertex_order[3] = 1;
>              break;
> -        case ORIENT_TRANSPOSED:
> +        case ORIENT_TRANSPOSED:      /* ORIENT_LEFT_TOP */
>              vertex_order[0] = 0;
>              vertex_order[1] = 3;
>              vertex_order[2] = 2;
>              vertex_order[3] = 1;
>              break;
> -        case ORIENT_HFLIPPED:
> -            vertex_order[0] = 3;
> -            vertex_order[1] = 2;
> -            vertex_order[2] = 1;
> -            vertex_order[3] = 0;
> -            break;
> -        case ORIENT_VFLIPPED:
> +        case ORIENT_HFLIPPED:        /* ORIENT_TOP_RIGHT */
>              vertex_order[0] = 1;
>              vertex_order[1] = 0;
>              vertex_order[2] = 3;
>              vertex_order[3] = 2;
>              break;
> -        case ORIENT_ANTI_TRANSPOSED: /* transpose + vflip */
> -            vertex_order[0] = 1;
> +        case ORIENT_VFLIPPED:        /* ORIENT_BOTTOM_LEFT */
> +            vertex_order[0] = 3;
>              vertex_order[1] = 2;
> -            vertex_order[2] = 3;
> +            vertex_order[2] = 1;
>              vertex_order[3] = 0;
>              break;
> +        case ORIENT_ANTI_TRANSPOSED: /* ORIENT_RIGHT_BOTTOM */
> +            vertex_order[0] = 2;
> +            vertex_order[1] = 1;
> +            vertex_order[2] = 0;
> +            vertex_order[3] = 3;
> +            break;
>         default:
>              vertex_order[0] = 0;
>              vertex_order[1] = 1;
> --
> 2.12.3
>


More information about the vlc-devel mailing list