summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-07-10 00:07:04 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-07-10 00:07:04 +0200
commitcd0dc88751db969964e7b40c4d4b5fd446ac1589 (patch)
tree287290217843c6aeefc76b1f0ed9ada495820bba /libavcodec/h264.c
parentc67690f854452df397f3f735d0ff107a3fe51d87 (diff)
parent18e3d61e9e3b52c177aa7a1f2a054a8a753e1b09 (diff)
Merge commit '18e3d61e9e3b52c177aa7a1f2a054a8a753e1b09'
* commit '18e3d61e9e3b52c177aa7a1f2a054a8a753e1b09': h264: parse display orientation SEI message Conflicts: libavcodec/h264.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 7718b5118f..1d919872fe 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -28,6 +28,7 @@
#define UNCHECKED_BITSTREAM_READER 1
#include "libavutil/avassert.h"
+#include "libavutil/display.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/stereo3d.h"
@@ -866,6 +867,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);
+ }
+
cur->mmco_reset = h->mmco_reset;
h->mmco_reset = 0;