diff --git a/libweston/backend-rdp/meson.build b/libweston/backend-rdp/meson.build index 95d9a83b..e3b60250 100644 --- a/libweston/backend-rdp/meson.build +++ b/libweston/backend-rdp/meson.build @@ -26,6 +26,22 @@ if cc.has_member( config_h.set('HAVE_SURFACE_BITS_BMP', '1') endif +if cc.has_type( + 'enum SURFCMD_CMDTYPE', + dependencies : dep_frdp, + prefix : '#include ' +) + config_h.set('HAVE_SURFCMD_CMDTYPE', '1') +endif + +if cc.has_function( + 'nsc_context_set_parameters', + dependencies : dep_frdp, + prefix: '#include ' +) + config_h.set('HAVE_NSC_CONTEXT_SET_PARAMETERS', '1') +endif + deps_rdp = [ dep_libweston_private, dep_frdp, diff --git a/libweston/backend-rdp/rdp.c b/libweston/backend-rdp/rdp.c index 2b33d29c..9e414aa2 100644 --- a/libweston/backend-rdp/rdp.c +++ b/libweston/backend-rdp/rdp.c @@ -212,6 +212,9 @@ rdp_peer_refresh_rfx(pixman_region32_t *damage, pixman_image_t *image, freerdp_p cmd.skipCompression = TRUE; #else memset(&cmd, 0, sizeof(*cmd)); +#endif +#ifdef HAVE_SURFCMD_CMDTYPE + cmd.cmdType = CMDTYPE_STREAM_SURFACE_BITS; #endif cmd.destLeft = damage->extents.x1; cmd.destTop = damage->extents.y1; @@ -270,7 +273,9 @@ rdp_peer_refresh_nsc(pixman_region32_t *damage, pixman_image_t *image, freerdp_p #else memset(cmd, 0, sizeof(*cmd)); #endif - +#ifdef HAVE_SURFCMD_CMDTYPE + cmd.cmdType = CMDTYPE_SET_SURFACE_BITS; +#endif cmd.destLeft = damage->extents.x1; cmd.destTop = damage->extents.y1; cmd.destRight = damage->extents.x2; @@ -326,6 +331,9 @@ rdp_peer_refresh_raw(pixman_region32_t *region, pixman_image_t *image, freerdp_p update->SurfaceFrameMarker(peer->context, &marker); memset(&cmd, 0, sizeof(cmd)); +#ifdef HAVE_SURFCMD_CMDTYPE + cmd.cmdType = CMDTYPE_SET_SURFACE_BITS; +#endif SURFACE_BPP(cmd) = 32; SURFACE_CODECID(cmd) = 0; @@ -758,8 +766,11 @@ rdp_peer_context_new(freerdp_peer* client, RdpPeerContext* context) if (!context->nsc_context) goto out_error_nsc; +#ifdef HAVE_NSC_CONTEXT_SET_PARAMETERS + nsc_context_set_parameters(context->nsc_context, NSC_COLOR_FORMAT, DEFAULT_PIXEL_FORMAT); +#else nsc_context_set_pixel_format(context->nsc_context, DEFAULT_PIXEL_FORMAT); - +#endif context->encode_stream = Stream_New(NULL, 65536); if (!context->encode_stream) goto out_error_stream;