FreeRDP
Loading...
Searching...
No Matches
shadow_rdpgfx.c
1
19#include <freerdp/config.h>
20
21#include <freerdp/log.h>
22#include "shadow.h"
23
24#include "shadow_rdpgfx.h"
25
26int shadow_client_rdpgfx_init(rdpShadowClient* client)
27{
28 WINPR_ASSERT(client);
29
30 if (!freerdp_settings_get_bool(client->context.settings, FreeRDP_SupportGraphicsPipeline))
31 return 1;
32
33#if defined(CHANNEL_RDPGFX_SERVER)
34 RdpgfxServerContext* rdpgfx = client->rdpgfx = rdpgfx_server_context_new(client->vcm);
35 if (!rdpgfx)
36 return 0;
37
38 rdpgfx->rdpcontext = &client->context;
39
40 rdpgfx->custom = client;
41
42 if (!IFCALLRESULT(CHANNEL_RC_OK, rdpgfx->Initialize, rdpgfx, TRUE))
43 return -1;
44#endif
45
46 return 1;
47}
48
49void shadow_client_rdpgfx_uninit(rdpShadowClient* client)
50{
51 WINPR_ASSERT(client);
52 if (client->rdpgfx)
53 {
54#if defined(CHANNEL_RDPGFX_SERVER)
55 rdpgfx_server_context_free(client->rdpgfx);
56#endif
57 client->rdpgfx = NULL;
58 }
59}
FREERDP_API BOOL freerdp_settings_get_bool(const rdpSettings *settings, FreeRDP_Settings_Keys_Bool id)
Returns a boolean settings value.