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

Matthias Keiser matthias at tristan-inc.com
Thu Feb 6 23:21:07 CET 2014


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) {
+
+        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;
+        }
+
+        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);
+            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;
-- 
1.8.3.4 (Apple Git-47)





More information about the vlc-devel mailing list