Merge commit '18e3d61e9e3b52c177aa7a1f2a054a8a753e1b09'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 9 Jul 2014 22:07:04 +0000 (00:07 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 9 Jul 2014 22:07:04 +0000 (00:07 +0200)
* commit '18e3d61e9e3b52c177aa7a1f2a054a8a753e1b09':
  h264: parse display orientation SEI message

Conflicts:
libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/h264.c
libavcodec/h264.h
libavcodec/h264_sei.c

   * @author Michael Niedermayer <michaelni@gmx.at>
   */
  
 +#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"
  #include "libavutil/timer.h"
  #include "internal.h"
@@@ -866,9 -823,20 +867,23 @@@ static void decode_postinit(H264Contex
              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;
 +
      // FIXME do something with unavailable reference frames
  
      /* Sort B-frames into display order */
Simple merge
Simple merge