vlc | branch: master | Steve Lhomme <[email protected]> | Fri Mar 31 11:07:31 2017 +0200| [10a1b37e937945462dfea3bd7833a6ca487c4127] | committer: Hugo Beauzée-Luyssen
hxxx_sei: add HDR10 metadata parsing Signed-off-by: Hugo Beauzée-Luyssen <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=10a1b37e937945462dfea3bd7833a6ca487c4127 --- modules/packetizer/hxxx_sei.c | 24 ++++++++++++++++++++++++ modules/packetizer/hxxx_sei.h | 16 +++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/modules/packetizer/hxxx_sei.c b/modules/packetizer/hxxx_sei.c index e83528c..e1529bf 100644 --- a/modules/packetizer/hxxx_sei.c +++ b/modules/packetizer/hxxx_sei.c @@ -145,6 +145,30 @@ void HxxxParseSEI(const uint8_t *p_buf, size_t i_buf, b_continue = pf_callback( &sei_data, cbdata ); } break; + case HXXX_SEI_MASTERING_DISPLAY_COLOUR_VOLUME: + { + if ( bs_remain( &s ) < (16*6+16*2+32+32) ) + /* not enough data */ + break; + for ( size_t i = 0; i < 6 ; ++i) + sei_data.colour_volume.primaries[i] = bs_read( &s, 16 ); + for ( size_t i = 0; i < 2 ; ++i) + sei_data.colour_volume.white_point[i] = bs_read( &s, 16 ); + sei_data.colour_volume.max_luminance = bs_read( &s, 32 ); + sei_data.colour_volume.min_luminance = bs_read( &s, 32 ); + b_continue = pf_callback( &sei_data, cbdata ); + } break; + + case HXXX_SEI_CONTENT_LIGHT_LEVEL: + { + if ( bs_remain( &s ) < (16+16) ) + /* not enough data */ + break; + sei_data.content_light_lvl.MaxCLL = bs_read( &s, 16 ); + sei_data.content_light_lvl.MaxFALL = bs_read( &s, 16 ); + b_continue = pf_callback( &sei_data, cbdata ); + } break; + default: /* Will skip */ break; diff --git a/modules/packetizer/hxxx_sei.h b/modules/packetizer/hxxx_sei.h index 7b53a57..e2f1603 100644 --- a/modules/packetizer/hxxx_sei.h +++ b/modules/packetizer/hxxx_sei.h @@ -25,7 +25,9 @@ enum hxxx_sei_type_e { HXXX_SEI_PIC_TIMING = 1, HXXX_SEI_USER_DATA_REGISTERED_ITU_T_T35 = 4, - HXXX_SEI_RECOVERY_POINT = 6 + HXXX_SEI_RECOVERY_POINT = 6, + HXXX_SEI_MASTERING_DISPLAY_COLOUR_VOLUME = 137, /* SMPTE ST 2086 */ + HXXX_SEI_CONTENT_LIGHT_LEVEL = 144, }; enum hxxx_sei_t35_type_e @@ -55,6 +57,18 @@ typedef struct { int i_frames; } recovery; + struct + { + uint16_t primaries[3*2]; /* G,B,R / x,y */ + uint16_t white_point[2]; /* x,y */ + uint32_t max_luminance; + uint32_t min_luminance; + } colour_volume; /* SMPTE ST 2086 */ + struct + { + uint16_t MaxCLL; + uint16_t MaxFALL; + } content_light_lvl; /* CTA-861.3 */ }; } hxxx_sei_data_t; _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
