提交 62d2a75b 编写于 作者: P Piotr Tomasik 提交者: Michael Niedermayer

Added clockwise rotate values to metadata for 90 and 270 degrees

Signed-off-by: NMichael Niedermayer <michaelni@gmx.at>
上级 68134502
......@@ -2156,10 +2156,21 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
sc->width = width >> 16;
sc->height = height >> 16;
//Assign clockwise rotate values based on transform matrix so that
//we can compensate for iPhone orientation during capture.
if (display_matrix[1][0] == -65536 && display_matrix[0][1] == 65536) {
av_dict_set(&st->metadata, "rotate", "90", 0);
}
if (display_matrix[0][0] == -65536 && display_matrix[1][1] == -65536) {
av_dict_set(&st->metadata, "rotate", "180", 0);
}
if (display_matrix[1][0] == 65536 && display_matrix[0][1] == -65536) {
av_dict_set(&st->metadata, "rotate", "270", 0);
}
// transform the display width/height according to the matrix
// skip this if the display matrix is the default identity matrix
// or if it is rotating the picture, ex iPhone 3GS
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册