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

Matthias Keiser matthias at tristan-inc.com
Fri Feb 7 23:01:40 CET 2014


Am 07.02.2014 um 12:59 schrieb Rémi Denis-Courmont <remi at remlab.net>:

> 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.
> 

So we probably should use the API proposed by Jean-Baptiste Kempf:
> Why not ask the Video Output if it can rotate by itself, like a
> VOUT_DISPLAY_CAN_ROTATE, that would be defaulted to false?
Ok?


> I think you should only compare the video formats.

Sorry I don't understand what you mean.

> 
>> +
>> +        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.

I take it this means the other orientations like ORIENT_HFLIPPED. Since the openGL stuff doesn't handle this either, I seems natural to restrict the handling to the "normal" rotation cases, no? Also I think none of the demuxers currently passes these kinds of 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.

Sorry, I can't spot it. cfg is destroyed on failure, else I think the filter chain takes ownership, no? name and e are freed on line 830/831.
> 
> 
>> +            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
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel




More information about the vlc-devel mailing list