diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-07-10 00:07:04 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-10 00:07:04 +0200 |
commit | cd0dc88751db969964e7b40c4d4b5fd446ac1589 (patch) | |
tree | 287290217843c6aeefc76b1f0ed9ada495820bba /libavcodec/h264_sei.c | |
parent | c67690f854452df397f3f735d0ff107a3fe51d87 (diff) | |
parent | 18e3d61e9e3b52c177aa7a1f2a054a8a753e1b09 (diff) | |
download | ffmpeg-cd0dc88751db969964e7b40c4d4b5fd446ac1589.tar.gz |
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_sei.c')
-rw-r--r-- | libavcodec/h264_sei.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c index 88bf0f4977..aa889b8bba 100644 --- a/libavcodec/h264_sei.c +++ b/libavcodec/h264_sei.c @@ -41,6 +41,7 @@ void ff_h264_reset_sei(H264Context *h) h->sei_cpb_removal_delay = -1; h->sei_buffering_period_present = 0; h->sei_frame_packing_present = 0; + h->sei_display_orientation_present = 0; } static int decode_picture_timing(H264Context *h) @@ -262,6 +263,22 @@ static int decode_frame_packing_arrangement(H264Context *h) return 0; } +static int decode_display_orientation(H264Context *h) +{ + h->sei_display_orientation_present = !get_bits1(&h->gb); + + if (h->sei_display_orientation_present) { + h->sei_hflip = get_bits1(&h->gb); // hor_flip + h->sei_vflip = get_bits1(&h->gb); // ver_flip + + h->sei_anticlockwise_rotation = get_bits(&h->gb, 16); + get_ue_golomb(&h->gb); // display_orientation_repetition_period + skip_bits1(&h->gb); // display_orientation_extension_flag + } + + return 0; +} + int ff_h264_decode_sei(H264Context *h) { while (get_bits_left(&h->gb) > 16) { @@ -322,6 +339,11 @@ int ff_h264_decode_sei(H264Context *h) if (ret < 0) return ret; break; + case SEI_TYPE_DISPLAY_ORIENTATION: + ret = decode_display_orientation(h); + if (ret < 0) + return ret; + break; default: av_log(h->avctx, AV_LOG_DEBUG, "unknown SEI type %d\n", type); } |