[vlc-devel] [PATCH] Support for rotated MP4 Movies (bug #2882)

Rémi Denis-Courmont remi at remlab.net
Fri Feb 7 12:59:33 CET 2014


On Thu, 6 Feb 2014 23:21:07 +0100, Matthias Keiser
<matthias at tristan-inc.com> wrote:
> From 0835ce77e00f83d0e15dd73e3bf28661f44e12cf Mon Sep 17 00:00:00 2001
> From: Matthias Keiser <matthias at tristan-inc.com>
> Date: Thu, 6 Feb 2014 16:22:49 +0100
> Subject: [PATCH 10/13] If the video formats orientation is rotated and
the
>  video display is not using opengl, insert a transform filter that
rotates
>  the
>  picture.
> 
> ---
>  src/video_output/video_output.c | 37
+++++++++++++++++++++++++++++++++++++
>  1 file changed, 37 insertions(+)
> 
> diff --git a/src/video_output/video_output.c
> b/src/video_output/video_output.c
> index ede3520..76d3c85 100644
> --- a/src/video_output/video_output.c
> +++ b/src/video_output/video_output.c
> @@ -743,6 +743,43 @@ static void ThreadChangeFilters(vout_thread_t
*vout,
>  
>      vlc_array_init(&array_static);
>      vlc_array_init(&array_interactive);
> +
> +    if (!vout_GetDisplayOpengl(vout->p->display.vd) &&
> vout->p->filter.format.orientation != ORIENT_TOP_LEFT) {

This precludes any other output from ever accelerating rotation. Yet
Direct3D, VDPAU and probably others could definitely support it... This is
unacceptable w.r.t. VDPAU, since the transform filter does not work with
it.

I think you should only compare the video formats.

> +
> +        char *angle = NULL;
> +
> +        switch (vout->p->filter.format.orientation) {
> +
> +            case ORIENT_ROTATED_90:
> +                angle = "270";
> +                break;
> +            case ORIENT_ROTATED_180:
> +                angle = "180";
> +                break;
> +            case ORIENT_ROTATED_270:
> +                angle = "90";
> +                break;
> +            default:
> +                angle = NULL;
> +                break;

Missing the indirect orientations.

> +        }
> +
> +        if (angle) {
> +
> +            config_chain_t *cfg;
> +            char *name;
> +            char config[30];
> +            snprintf(config, 30, "transform{type=%s}", angle);
> +            char *next;
> +            VLC_UNUSED(next);
> +            next = config_ChainCreate(&name, &cfg, config);

Memory leaks.

> +            vout_filter_t *e = xmalloc(sizeof(*e));
> +            e->name = name;
> +            e->cfg  = cfg;
> +            vlc_array_insert(&array_interactive, e, 0);
> +        }
> +    }
> +
>      char *current = filters ? strdup(filters) : NULL;
>      while (current) {
>          config_chain_t *cfg;

-- 
Rémi Denis-Courmont
Sent from my collocated server



More information about the vlc-devel mailing list