[vlc-devel] [PATCH] es_out: display HDR metadata

Steve Lhomme robux4 at videolabs.io
Wed Apr 5 17:02:06 CEST 2017


---
 src/input/es_out.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/src/input/es_out.c b/src/input/es_out.c
index 384c09ae04..9a7a8a7433 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -3188,6 +3188,58 @@ static void EsOutUpdateInfo( es_out_t *out, es_out_id_t *es, const es_format_t *
            info_category_AddInfo( p_cat, _("Field of view"), "%.2f",
                                   fmt->video.pose.f_fov_degrees );
        }
+       if ( fmt->video.mastering.max_luminance )
+       {
+           float luminance = (float)fmt->video.mastering.max_luminance /
+                                    10000.f;
+           info_category_AddInfo( p_cat, _("Max luminance"), "%.4f cd/m²",
+                                  luminance );
+       }
+       if ( fmt->video.mastering.min_luminance )
+       {
+           float luminance = (float)fmt->video.mastering.min_luminance /
+                                    10000.f;
+           info_category_AddInfo( p_cat, _("Min luminance"), "%.4f cd/m²",
+                                  luminance );
+       }
+       if ( fmt->video.mastering.primaries[4] &&
+            fmt->video.mastering.primaries[5] )
+       {
+           float x = (float)fmt->video.mastering.primaries[4] / 50000.f;
+           float y = (float)fmt->video.mastering.primaries[5] / 50000.f;
+           info_category_AddInfo( p_cat, _("Primary R"), "x=%.4f y=%.4f", x, y );
+       }
+       if ( fmt->video.mastering.primaries[0] &&
+            fmt->video.mastering.primaries[1] )
+       {
+           float x = (float)fmt->video.mastering.primaries[0] / 50000.f;
+           float y = (float)fmt->video.mastering.primaries[1] / 50000.f;
+           info_category_AddInfo( p_cat, _("Primary G"), "x=%.4f y=%.4f", x, y );
+       }
+       if ( fmt->video.mastering.primaries[2] &&
+            fmt->video.mastering.primaries[3] )
+       {
+           float x = (float)fmt->video.mastering.primaries[2] / 50000.f;
+           float y = (float)fmt->video.mastering.primaries[3] / 50000.f;
+           info_category_AddInfo( p_cat, _("Primary B"), "x=%.4f y=%.4f", x, y );
+       }
+       if ( fmt->video.mastering.white_point[0] &&
+            fmt->video.mastering.white_point[1] )
+       {
+           float x = (float)fmt->video.mastering.white_point[0].num / 50000.f;
+           float y = (float)fmt->video.mastering.white_point[1].num / 50000.f;
+           info_category_AddInfo( p_cat, _("White point"), "x=%.4f y=%.4f", x, y );
+       }
+       if ( fmt->video.ligthing.MaxCLL )
+       {
+           info_category_AddInfo( p_cat, _("MaxCLL"), "%d cd/m²",
+                                  fmt->video.ligthing.MaxCLL );
+       }
+       if ( fmt->video.ligthing.MaxFALL )
+       {
+           info_category_AddInfo( p_cat, _("MaxFALL"), "%d cd/m²",
+                                  fmt->video.ligthing.MaxFALL );
+       }
        break;
 
     case SPU_ES:
-- 
2.11.1



More information about the vlc-devel mailing list