mov: Write the display matrix in order

This will allow to copy the matrix as is and it is just cleaner to keep
the matrix in the same order specified by the mov standard (which is
also explicitly described in the documentation).

In order to preserve compatibility, flip the angle sign in the display API
av_display_rotation_set() and av_display_rotation_get(), and improve the
documentation mentioning the rotation direction.
This commit is contained in:
Vittorio Giovara
2015-03-17 17:38:48 +00:00
parent e0046bc9c9
commit e4fe535d12
4 changed files with 9 additions and 9 deletions

View File

@@ -46,12 +46,12 @@ double av_display_rotation_get(const int32_t matrix[9])
rotation = atan2(CONV_FP(matrix[1]) / scale[1],
CONV_FP(matrix[0]) / scale[0]) * 180 / M_PI;
return rotation;
return -rotation;
}
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 s = sin(radians);