diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-07-02 11:58:19 -0400 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-07-09 10:17:42 -0400 |
commit | 18e3d61e9e3b52c177aa7a1f2a054a8a753e1b09 (patch) | |
tree | 1542603c347195c576eb989c2edb790e4eb83711 /libavcodec/h264.c | |
parent | a54f03bf07da964a1b04b03b85bc39deba76efa4 (diff) | |
download | ffmpeg-18e3d61e9e3b52c177aa7a1f2a054a8a753e1b09.tar.gz |
h264: parse display orientation SEI message
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index a04839c9c0..ec14caa30d 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -26,6 +26,7 @@ */ #include "libavutil/avassert.h" +#include "libavutil/display.h" #include "libavutil/imgutils.h" #include "libavutil/stereo3d.h" #include "libavutil/timer.h" @@ -822,6 +823,20 @@ static void decode_postinit(H264Context *h, int setup_finished) stereo->flags = AV_STEREO3D_FLAG_INVERT; } + if (h->sei_display_orientation_present && + (h->sei_anticlockwise_rotation || h->sei_hflip || h->sei_vflip)) { + double angle = h->sei_anticlockwise_rotation * 360 / (double) (1 << 16); + AVFrameSideData *rotation = av_frame_new_side_data(&cur->f, + AV_FRAME_DATA_DISPLAYMATRIX, + sizeof(int32_t) * 9); + if (!rotation) + return; + + av_display_rotation_set((int32_t *)rotation->data, angle); + av_display_matrix_flip((int32_t *)rotation->data, + h->sei_vflip, h->sei_hflip); + } + // FIXME do something with unavailable reference frames /* Sort B-frames into display order */ |