Merge commit 'e4fe535d12f4f30df2dd672e30304af112a5a827'
* commit 'e4fe535d12f4f30df2dd672e30304af112a5a827': mov: Write the display matrix in order Conflicts: libavformat/mov.c libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -2949,7 +2949,7 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
|
|
||||||
for (i = 0; i < 3; i++)
|
for (i = 0; i < 3; i++)
|
||||||
for (j = 0; j < 3; j++)
|
for (j = 0; j < 3; j++)
|
||||||
sc->display_matrix[i * 3 + j] = display_matrix[j][i];
|
sc->display_matrix[i * 3 + j] = display_matrix[i][j];
|
||||||
|
|
||||||
rotate = av_display_rotation_get(sc->display_matrix);
|
rotate = av_display_rotation_get(sc->display_matrix);
|
||||||
if (!isnan(rotate)) {
|
if (!isnan(rotate)) {
|
||||||
|
|||||||
@@ -44,12 +44,12 @@ double av_display_rotation_get(const int32_t matrix[9])
|
|||||||
rotation = atan2(CONV_FP(matrix[1]) / scale[1],
|
rotation = atan2(CONV_FP(matrix[1]) / scale[1],
|
||||||
CONV_FP(matrix[0]) / scale[0]) * 180 / M_PI;
|
CONV_FP(matrix[0]) / scale[0]) * 180 / M_PI;
|
||||||
|
|
||||||
return rotation;
|
return -rotation;
|
||||||
}
|
}
|
||||||
|
|
||||||
void av_display_rotation_set(int32_t matrix[9], double angle)
|
void av_display_rotation_set(int32_t matrix[9], double angle)
|
||||||
{
|
{
|
||||||
double radians = angle * M_PI / 180.0f;
|
double radians = -angle * M_PI / 180.0f;
|
||||||
double c = cos(radians);
|
double c = cos(radians);
|
||||||
double s = sin(radians);
|
double s = sin(radians);
|
||||||
|
|
||||||
|
|||||||
@@ -55,9 +55,9 @@
|
|||||||
* Extract the rotation component of the transformation matrix.
|
* Extract the rotation component of the transformation matrix.
|
||||||
*
|
*
|
||||||
* @param matrix the transformation matrix
|
* @param matrix the transformation matrix
|
||||||
* @return the angle (in degrees) by which the transformation rotates the frame.
|
* @return the angle (in degrees) by which the transformation rotates the frame
|
||||||
* The angle will be in range [-180.0, 180.0], or NaN if the matrix is
|
* counterclockwise. The angle will be in range [-180.0, 180.0],
|
||||||
* singular.
|
* or NaN if the matrix is singular.
|
||||||
*
|
*
|
||||||
* @note floating point numbers are inherently inexact, so callers are
|
* @note floating point numbers are inherently inexact, so callers are
|
||||||
* recommended to round the return value to nearest integer before use.
|
* recommended to round the return value to nearest integer before use.
|
||||||
@@ -65,8 +65,8 @@
|
|||||||
double av_display_rotation_get(const int32_t matrix[9]);
|
double av_display_rotation_get(const int32_t matrix[9]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize a transformation matrix describing a pure rotation by the
|
* Initialize a transformation matrix describing a pure counterclockwise
|
||||||
* specified angle (in degrees).
|
* rotation by the specified angle (in degrees).
|
||||||
*
|
*
|
||||||
* @param matrix an allocated transformation matrix (will be fully overwritten
|
* @param matrix an allocated transformation matrix (will be fully overwritten
|
||||||
* by this function)
|
* by this function)
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
#define LIBAVUTIL_VERSION_MAJOR 54
|
#define LIBAVUTIL_VERSION_MAJOR 54
|
||||||
#define LIBAVUTIL_VERSION_MINOR 20
|
#define LIBAVUTIL_VERSION_MINOR 20
|
||||||
#define LIBAVUTIL_VERSION_MICRO 100
|
#define LIBAVUTIL_VERSION_MICRO 101
|
||||||
|
|
||||||
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
|
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
|
||||||
LIBAVUTIL_VERSION_MINOR, \
|
LIBAVUTIL_VERSION_MINOR, \
|
||||||
|
|||||||
Reference in New Issue
Block a user