From 5823da2f0a4f3a20b145027563a7304d20b24920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= Date: Mon, 17 Dec 2018 18:06:31 +0200 Subject: [PATCH] vnc: hard code likable RGB format --- modules/access/vnc.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/modules/access/vnc.c b/modules/access/vnc.c index 42dfcc2323..5013573fe1 100644 --- a/modules/access/vnc.c +++ b/modules/access/vnc.c @@ -166,19 +166,25 @@ static rfbBool mallocFrameBufferHandler( rfbClient* p_client ) break; } - if ( i_chroma != VLC_CODEC_RGB8 ) /* Palette based, no mask */ + switch( i_chroma ) { - video_format_t videofmt; - video_format_Init( &videofmt, i_chroma ); - video_format_FixRgb( &videofmt ); - - p_client->format.redShift = videofmt.i_lrshift; - p_client->format.greenShift = videofmt.i_lgshift; - p_client->format.blueShift = videofmt.i_lbshift; - p_client->format.redMax = videofmt.i_rmask >> videofmt.i_lrshift; - p_client->format.greenMax = videofmt.i_gmask >> videofmt.i_lgshift; - p_client->format.blueMax = videofmt.i_bmask >> videofmt.i_lbshift; - video_format_Clean( &videofmt ); + case VLC_CODEC_RGB16: + p_client->format.redShift = 11; + p_client->format.greenShift = 5; + p_client->format.blueShift = 0; + p_client->format.redMax = 0x1f; + p_client->format.greenMax = 0x3f; + p_client->format.blueMax = 0x1f; + break; + case VLC_CODEC_RGB24: + case VLC_CODEC_RGB32: + p_client->format.redShift = 16; + p_client->format.greenShift = 8; + p_client->format.blueShift = 0; + p_client->format.redMax = 0xff; + p_client->format.greenMax = 0xff; + p_client->format.blueMax = 0xff; + break; } /* Set up framebuffer */ -- GitLab