diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-07-02 12:02:15 -0400 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-07-09 10:18:06 -0400 |
commit | 0569a7e0bd2006d9a5248d17a1f4bf3ca654ae50 (patch) | |
tree | 6e5c1f8623a9eec558be6eee5f5ef6d5567d0c8b /libavcodec/hevc.c | |
parent | 18e3d61e9e3b52c177aa7a1f2a054a8a753e1b09 (diff) | |
download | ffmpeg-0569a7e0bd2006d9a5248d17a1f4bf3ca654ae50.tar.gz |
hevc: parse display orientation SEI message
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r-- | libavcodec/hevc.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index 9ba136dd70..13f989b10f 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -25,6 +25,7 @@ #include "libavutil/attributes.h" #include "libavutil/common.h" +#include "libavutil/display.h" #include "libavutil/internal.h" #include "libavutil/md5.h" #include "libavutil/opt.h" @@ -2457,6 +2458,20 @@ static int set_side_data(HEVCContext *s) stereo->flags = AV_STEREO3D_FLAG_INVERT; } + if (s->sei_display_orientation_present && + (s->sei_anticlockwise_rotation || s->sei_hflip || s->sei_vflip)) { + double angle = s->sei_anticlockwise_rotation * 360 / (double) (1 << 16); + AVFrameSideData *rotation = av_frame_new_side_data(out, + AV_FRAME_DATA_DISPLAYMATRIX, + sizeof(int32_t) * 9); + if (!rotation) + return AVERROR(ENOMEM); + + av_display_rotation_set((int32_t *)rotation->data, angle); + av_display_matrix_flip((int32_t *)rotation->data, + s->sei_vflip, s->sei_hflip); + } + return 0; } |