qtdemux: does not detect orientation
authorGilbok Lee <gilbok.lee@samsung.com>
Tue, 23 Jun 2015 11:15:13 +0000 (20:15 +0900)
committerThiago Santos <thiagoss@osg.samsung.com>
Thu, 25 Jun 2015 03:24:21 +0000 (00:24 -0300)
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

index edd0a58..430d5f6 100644 (file)
@@ -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");