diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-20 01:10:06 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-20 01:10:06 +0100 |
commit | 750cf4e5374caeef1f5174953d5b159d92abfe86 (patch) | |
tree | e11f16d94bc570a757a7e03acd0920ea62927d28 /libavformat/movenc.c | |
parent | 519868de7d9c99876efcaf57d6a9683c22732cde (diff) | |
parent | cf18e777aed9f73011c7ab7cbab8003189d4b9d8 (diff) | |
download | ffmpeg-750cf4e5374caeef1f5174953d5b159d92abfe86.tar.gz |
Merge commit 'cf18e777aed9f73011c7ab7cbab8003189d4b9d8'
* commit 'cf18e777aed9f73011c7ab7cbab8003189d4b9d8':
movenc: write the display transform matrix
Conflicts:
libavformat/movenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r-- | libavformat/movenc.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index e0b4295ed8..7f684b820e 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -2291,12 +2291,19 @@ static int mov_write_tkhd_tag(AVIOContext *pb, MOVMuxContext *mov, int rotation = 0; int group = 0; + uint32_t *display_matrix = NULL; + int display_matrix_size, i; if (st) { if (mov->per_stream_grouping) group = st->index; else group = st->codec->codec_type; + + display_matrix = (uint32_t*)av_stream_get_side_data(st, AV_PKT_DATA_DISPLAYMATRIX, + &display_matrix_size); + if (display_matrix_size < 9 * sizeof(*display_matrix)) + display_matrix = NULL; } if (track->flags & MOV_TRACK_ENABLED) @@ -2341,7 +2348,10 @@ static int mov_write_tkhd_tag(AVIOContext *pb, MOVMuxContext *mov, AVDictionaryEntry *rot = av_dict_get(st->metadata, "rotate", NULL, 0); rotation = (rot && rot->value) ? atoi(rot->value) : 0; } - if (rotation == 90) { + if (display_matrix) { + for (i = 0; i < 9; i++) + avio_wb32(pb, display_matrix[i]); + } else if (rotation == 90) { write_matrix(pb, 0, 1, -1, 0, track->enc->height, 0); } else if (rotation == 180) { write_matrix(pb, -1, 0, 0, -1, track->enc->width, track->enc->height); |