[vlc-devel] [PATCH 3/5] packetizer: hevc: write the HDR metadata in the output video format
Steve Lhomme
robux4 at videolabs.io
Wed Mar 29 15:39:29 CEST 2017
---
modules/packetizer/hevc.c | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/modules/packetizer/hevc.c b/modules/packetizer/hevc.c
index 8392e64ea3..cee9684c74 100644
--- a/modules/packetizer/hevc.c
+++ b/modules/packetizer/hevc.c
@@ -694,13 +694,26 @@ static bool ParseSEICallback( const hxxx_sei_data_t *p_sei_data, void *cbdata )
decoder_t *p_dec = (decoder_t *) cbdata;
decoder_sys_t *p_sys = p_dec->p_sys;
- if( p_sei_data->i_type == HXXX_SEI_USER_DATA_REGISTERED_ITU_T_T35 )
+ switch( p_sei_data->i_type )
{
- if( p_sei_data->itu_t35.type == HXXX_ITU_T35_TYPE_CC )
+ case HXXX_SEI_USER_DATA_REGISTERED_ITU_T_T35:
{
- cc_storage_append( p_sys->p_ccs, true, p_sei_data->itu_t35.u.cc.p_data,
- p_sei_data->itu_t35.u.cc.i_data );
- }
+ if( p_sei_data->itu_t35.type == HXXX_ITU_T35_TYPE_CC )
+ {
+ cc_storage_append( p_sys->p_ccs, true, p_sei_data->itu_t35.u.cc.p_data,
+ p_sei_data->itu_t35.u.cc.i_data );
+ }
+ } break;
+ case HXXX_SEI_MASTERING_DISPLAY_COLOUR_VOLUME:
+ {
+ video_format_t *p_fmt = &p_dec->fmt_out.video;
+ for (size_t i=0; i<ARRAY_SIZE(p_sei_data->color_volume.primaries); ++i)
+ p_fmt->mastering.primaries[i] = p_sei_data->color_volume.primaries[i];
+ for (size_t i=0; i<ARRAY_SIZE(p_sei_data->color_volume.white_point); ++i)
+ p_fmt->mastering.white_point[i] = p_sei_data->color_volume.white_point[i];
+ p_fmt->mastering.max_luminance = p_sei_data->color_volume.max_luminance;
+ p_fmt->mastering.min_luminance = p_sei_data->color_volume.min_luminance;
+ } break;
}
return true;
--
2.11.1
More information about the vlc-devel
mailing list