diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-07-10 00:15:34 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-10 00:19:43 +0200 |
commit | efc66d69bfb622e874d883e0b304cf18b12e41bd (patch) | |
tree | 01adc68c2448e4f1950c37348db09790b092f875 /libavcodec/hevc.c | |
parent | cd0dc88751db969964e7b40c4d4b5fd446ac1589 (diff) | |
parent | 0569a7e0bd2006d9a5248d17a1f4bf3ca654ae50 (diff) | |
download | ffmpeg-streaming-efc66d69bfb622e874d883e0b304cf18b12e41bd.zip ffmpeg-streaming-efc66d69bfb622e874d883e0b304cf18b12e41bd.tar.gz |
Merge commit '0569a7e0bd2006d9a5248d17a1f4bf3ca654ae50'
* commit '0569a7e0bd2006d9a5248d17a1f4bf3ca654ae50':
hevc: parse display orientation SEI message
Conflicts:
libavcodec/hevc.h
libavcodec/hevc_sei.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
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 8d951b0..99298a8 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -26,6 +26,7 @@ #include "libavutil/atomic.h" #include "libavutil/attributes.h" #include "libavutil/common.h" +#include "libavutil/display.h" #include "libavutil/internal.h" #include "libavutil/md5.h" #include "libavutil/opt.h" @@ -2339,6 +2340,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; } |