[vlc-commits] [Git][videolan/vlc][master] 2 commits: access/rdp: map the format to known chromas
Steve Lhomme (@robUx4)
gitlab at videolan.org
Wed Oct 4 13:52:28 UTC 2023
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
1674af48 by Steve Lhomme at 2023-10-04T13:21:43+00:00
access/rdp: map the format to known chromas
According to the color definitions in [1]. And the naming matches the memory
order:
> The format naming scheme is based on byte position in memory.
Given it's a Windows protocol the 15/16-bit variants are assumed to be
Little-Endian.
The pixel formats should be the one we set in postConnectHandler,
but we map all of them just in case.
[1} https://github.com/FreeRDP/FreeRDP/blob/b608be19e4f83586ed1518a85ba100c770008014/include/freerdp/codec/color.h
- - - - -
8c98fc91 by Steve Lhomme at 2023-10-04T13:21:43+00:00
access/rdp: fail if gdi_init() fails
- - - - -
1 changed file:
- modules/access/rdp.c
Changes:
=====================================
modules/access/rdp.c
=====================================
@@ -140,23 +140,60 @@ static BOOL desktopResizeHandler( rdpContext *p_context )
p_sys->es = NULL;
}
- vlc_fourcc_t i_chroma;
+ vlc_fourcc_t i_chroma = 0;
/* Now init and fill es format */
- switch ( i_colordepth )
+ switch ( p_gdi->dstFormat )
{
default:
msg_Dbg( p_vlccontext->p_demux, "invalid color depth %d", i_colordepth);
/* fallthrough */
- case 16:
- i_chroma = VLC_CODEC_RGB16;
+ case PIXEL_FORMAT_RGB16:
+ i_chroma = VLC_CODEC_RGB565LE;
break;
- case 24:
+ case PIXEL_FORMAT_BGR16:
+ i_chroma = VLC_CODEC_BGR565LE;
+ break;
+ case PIXEL_FORMAT_RGB15:
+ i_chroma = VLC_CODEC_RGB555LE;
+ break;
+ case PIXEL_FORMAT_BGR15:
+ i_chroma = VLC_CODEC_BGR555LE;
+ break;
+ case PIXEL_FORMAT_RGB24:
i_chroma = VLC_CODEC_RGB24;
break;
- case 32:
+ case PIXEL_FORMAT_BGR24:
+ i_chroma = VLC_CODEC_BGR24;
+ break;
+ case PIXEL_FORMAT_ARGB32:
i_chroma = VLC_CODEC_ARGB;
break;
+ case PIXEL_FORMAT_XRGB32:
+ i_chroma = VLC_CODEC_XRGB;
+ break;
+ case PIXEL_FORMAT_ABGR32:
+ i_chroma = VLC_CODEC_ABGR;
+ break;
+ case PIXEL_FORMAT_XBGR32:
+ i_chroma = VLC_CODEC_XBGR;
+ break;
+ case PIXEL_FORMAT_BGRA32:
+ i_chroma = VLC_CODEC_BGRA;
+ break;
+ case PIXEL_FORMAT_BGRX32:
+ i_chroma = VLC_CODEC_BGRX;
+ break;
+ case PIXEL_FORMAT_RGBA32:
+ i_chroma = VLC_CODEC_RGBA;
+ break;
+ case PIXEL_FORMAT_RGBX32:
+ i_chroma = VLC_CODEC_RGBX;
+ break;
}
+
+ if (unlikely(i_chroma == 0))
+ return FALSE;
+
es_format_t fmt;
es_format_Init( &fmt, VIDEO_ES, i_chroma );
video_format_Setup( &fmt.video, i_chroma, p_gdi->width, p_gdi->height,
@@ -257,8 +294,8 @@ static BOOL postConnectHandler( freerdp *p_instance )
break;
}
- gdi_init( p_instance,
- format );
+ if ( gdi_init( p_instance, format ) != TRUE )
+ return FALSE;
desktopResizeHandler( p_instance->context );
return TRUE;
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ed5f57a144aaadc7aeef1dd6a443e5e169bb4845...8c98fc91e0b516122d0ab247c65bc3bfe7a9ec3b
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ed5f57a144aaadc7aeef1dd6a443e5e169bb4845...8c98fc91e0b516122d0ab247c65bc3bfe7a9ec3b
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list