[vlc-devel] [PATCH] video_text: assume the text rendering is done in SRGB/SDR

Steve Lhomme robux4 at ycbcr.xyz
Wed May 29 13:24:36 CEST 2019


If it's rendered on a HDR surface its luminance and colors will need to be
adjusted accordingly.

Reverts 08b8ef7cf313971c69d401a9b05c3b788d08e8d2
---
 src/video_output/video_text.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/video_output/video_text.c b/src/video_output/video_text.c
index 171f29e8d6..9506c2300b 100644
--- a/src/video_output/video_text.c
+++ b/src/video_output/video_text.c
@@ -68,6 +68,10 @@ static void OSDTextUpdate(subpicture_t *subpic,
     video_format_Init( &fmt, VLC_CODEC_TEXT);
     fmt.i_sar_num = 1;
     fmt.i_sar_den = 1;
+    fmt.transfer  = TRANSFER_FUNC_SRGB;
+    fmt.primaries = COLOR_PRIMARIES_SRGB;
+    fmt.space     = COLOR_SPACE_SRGB;
+    fmt.mastering.max_luminance = 0;
 
     subpicture_region_t *r = subpic->p_region = subpicture_region_New(&fmt);
     if (!r)
@@ -92,11 +96,6 @@ static void OSDTextUpdate(subpicture_t *subpic,
         r->i_y += margin_v + fmt_dst->i_y_offset;
     else if (r->i_align & SUBPICTURE_ALIGN_BOTTOM )
         r->i_y += margin_v - fmt_dst->i_y_offset;
-
-    r->fmt.transfer  = fmt_dst->transfer;
-    r->fmt.primaries = fmt_dst->primaries;
-    r->fmt.space     = fmt_dst->space;
-    r->fmt.mastering = fmt_dst->mastering;
 }
 
 static void OSDTextDestroy(subpicture_t *subpic)
-- 
2.17.1



More information about the vlc-devel mailing list