On 19/01/17 11:26, Daniel Stone wrote:
> Hi Emilio,
> 
> On 18 January 2017 at 17:43, Emilio Pozuelo Monfort <[email protected]> wrote:
>> Based on a patch from John Moser <[email protected]>
>>
>> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=850658
>>
>> Signed-off-by: Emilio Pozuelo Monfort <[email protected]>
>> ---
>>  libweston/compositor-rdp.c | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/libweston/compositor-rdp.c b/libweston/compositor-rdp.c
>> index 223382ce..16f4c628 100644
>> --- a/libweston/compositor-rdp.c
>> +++ b/libweston/compositor-rdp.c
>> @@ -664,13 +664,21 @@ rdp_peer_context_new(freerdp_peer* client, 
>> RdpPeerContext* context)
>>         context->rfx_context->mode = RLGR3;
>>         context->rfx_context->width = client->settings->DesktopWidth;
>>         context->rfx_context->height = client->settings->DesktopHeight;
>> +#ifdef PIXEL_FORMAT_BGRA32
>> +       rfx_context_set_pixel_format(context->rfx_context, 
>> PIXEL_FORMAT_BGRA32);
>> +#else
>>         rfx_context_set_pixel_format(context->rfx_context, 
>> RDP_PIXEL_FORMAT_B8G8R8A8);
>> +#endif
> 
> And still this fails on Fedora 25. The FreeRDP API is a thing of
> absolute magic: https://phabricator.freedesktop.org/P9
> 
> Does it build with this patch instead? https://phabricator.freedesktop.org/P10

It doesn't, because your magic is before the #include color.h which defines 
PIXEL_*.

This version works for me...

Cheers,
Emilio
commit 505da12c9bea18194bb35f84dc472ee9d8e14ff2
Author: Emilio Pozuelo Monfort <[email protected]>
Date:   Wed Jan 18 18:43:35 2017 +0100

    compositor-rdp: Fix build with freerdp2
    
    Based on a patch from John Moser <[email protected]>
    
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=850658
    
    Signed-off-by: Emilio Pozuelo Monfort <[email protected]>
    Reviewed-by: Daniel Stone <[email protected]>

--- a/libweston/compositor-rdp.c
+++ b/libweston/compositor-rdp.c
@@ -84,6 +84,15 @@
 #define DEFAULT_AXIS_STEP_DISTANCE 10
 #define RDP_MODE_FREQ 60 * 1000
 
+#if FREERDP_VERSION_MAJOR >= 2 && defined(PIXEL_FORMAT_BGRA32) && !defined(RDP_PIXEL_FORMAT_B8G8R8A8)
+	/* The RDP API is truly wonderful: the pixel format definition changed
+	 * from BGRA32 to B8G8R8A8, but some versions ship with a definition of
+	 * PIXEL_FORMAT_BGRA32 which doesn't actually build. Try really, really,
+	 * hard to find one which does. */
+#	define DEFAULT_PIXEL_FORMAT PIXEL_FORMAT_BGRA32
+#else
+#	define DEFAULT_PIXEL_FORMAT RDP_PIXEL_FORMAT_B8G8R8A8
+#endif
 
 struct rdp_output;
 
@@ -618,13 +627,13 @@
 	context->rfx_context->mode = RLGR3;
 	context->rfx_context->width = client->settings->DesktopWidth;
 	context->rfx_context->height = client->settings->DesktopHeight;
-	rfx_context_set_pixel_format(context->rfx_context, RDP_PIXEL_FORMAT_B8G8R8A8);
+	rfx_context_set_pixel_format(context->rfx_context, DEFAULT_PIXEL_FORMAT);
 
 	context->nsc_context = nsc_context_new();
 	if (!context->nsc_context)
 		goto out_error_nsc;
 
-	nsc_context_set_pixel_format(context->nsc_context, RDP_PIXEL_FORMAT_B8G8R8A8);
+	nsc_context_set_pixel_format(context->nsc_context, DEFAULT_PIXEL_FORMAT);
 
 	context->encode_stream = Stream_New(NULL, 65536);
 	if (!context->encode_stream)
_______________________________________________
wayland-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to