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

Alexandre Janniaux ajanni at videolabs.io
Wed May 29 20:29:52 CEST 2019


Hi,

Shouldn't this be set in the SpuRenderText function ? Or maybe even in 
the
text_renderer module. Before that, no one is able to use VLC_CODEC_TEXT
subpictures.

LGTM for the intent.

-- 
Alexandre Janniaux
VideoLabs

On 2019-05-29 13:24, Steve Lhomme wrote:
> 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)


More information about the vlc-devel mailing list