From 0dcd76447a5057541a69918d74a2c2d4e40f1069 Mon Sep 17 00:00:00 2001 From: Gilbok Lee Date: Tue, 23 Jun 2015 20:15:13 +0900 Subject: [PATCH] qtdemux: does not detect orientation Most files don't contain the values for transposing the coordinates back to the positive quadrant so qtdemux was ignoring the rotation tag. To be able to properly handle those files qtdemux will also ignore the transposing values to only detect the rotation using the values abde from the transformation matrix: [a b c] [d e f] [g h i] https://bugzilla.gnome.org/show_bug.cgi?id=738681 --- gst/isomp4/qtdemux.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index edd0a58..430d5f6 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -7719,25 +7719,21 @@ qtdemux_inspect_transformation_matrix (GstQTDemux * qtdemux, * This macro will only compare value abdegh, it expects cfi to have already * been checked */ -#define QTCHECK_MATRIX(m,a,b,d,e,g,h) ((m)[0] == (a << 16) && (m)[1] == (b << 16) && \ - (m)[3] == (d << 16) && (m)[4] == (e << 16) && \ - (m)[6] == (g << 16) && (m)[7] == (h << 16)) +#define QTCHECK_MATRIX(m,a,b,d,e) ((m)[0] == (a << 16) && (m)[1] == (b << 16) && \ + (m)[3] == (d << 16) && (m)[4] == (e << 16)) /* only handle the cases where the last column has standard values */ if (matrix[2] == 0 && matrix[5] == 0 && matrix[8] == 1 << 30) { const gchar *rotation_tag = NULL; /* no rotation needed */ - if (QTCHECK_MATRIX (matrix, 1, 0, 0, 1, 0, 0)) { + if (QTCHECK_MATRIX (matrix, 1, 0, 0, 1)) { /* NOP */ - } else if (QTCHECK_MATRIX (matrix, 0, 1, G_MAXUINT16, 0, - stream->display_height, 0)) { + } else if (QTCHECK_MATRIX (matrix, 0, 1, G_MAXUINT16, 0)) { rotation_tag = "rotate-90"; - } else if (QTCHECK_MATRIX (matrix, G_MAXUINT16, 0, 0, G_MAXUINT16, - stream->display_width, stream->display_height)) { + } else if (QTCHECK_MATRIX (matrix, G_MAXUINT16, 0, 0, G_MAXUINT16)) { rotation_tag = "rotate-180"; - } else if (QTCHECK_MATRIX (matrix, 0, G_MAXUINT16, 1, 0, 0, - stream->display_width)) { + } else if (QTCHECK_MATRIX (matrix, 0, G_MAXUINT16, 1, 0)) { rotation_tag = "rotate-270"; } else { GST_FIXME_OBJECT (qtdemux, "Unhandled transformation matrix values"); -- 2.7.4