mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
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
This commit is contained in:
parent
35bf449404
commit
0dcd76447a
1 changed files with 6 additions and 10 deletions
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue