FreeRDP
xf_channels.c
1 
20 #include <freerdp/config.h>
21 
22 #include <winpr/assert.h>
23 #include <freerdp/gdi/video.h>
24 #include "xf_channels.h"
25 
26 #include "xf_client.h"
27 #include "xfreerdp.h"
28 
29 #include "xf_gfx.h"
30 #if defined(CHANNEL_TSMF_CLIENT)
31 #include "xf_tsmf.h"
32 #endif
33 #include "xf_rail.h"
34 #include "xf_cliprdr.h"
35 #include "xf_disp.h"
36 #include "xf_video.h"
37 
38 void xf_OnChannelConnectedEventHandler(void* context, const ChannelConnectedEventArgs* e)
39 {
40  xfContext* xfc = (xfContext*)context;
41  rdpSettings* settings = NULL;
42 
43  WINPR_ASSERT(xfc);
44  WINPR_ASSERT(e);
45  WINPR_ASSERT(e->name);
46 
47  settings = xfc->common.context.settings;
48  WINPR_ASSERT(settings);
49 
50  if (FALSE)
51  {
52  }
53 #if defined(CHANNEL_TSMF_CLIENT)
54  else if (strcmp(e->name, TSMF_DVC_CHANNEL_NAME) == 0)
55  {
56  xf_tsmf_init(xfc, (TsmfClientContext*)e->pInterface);
57  }
58 #endif
59  else if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0)
60  {
61  xf_graphics_pipeline_init(xfc, (RdpgfxClientContext*)e->pInterface);
62  }
63  else if (strcmp(e->name, RAIL_SVC_CHANNEL_NAME) == 0)
64  {
65  xf_rail_init(xfc, (RailClientContext*)e->pInterface);
66  }
67  else if (strcmp(e->name, CLIPRDR_SVC_CHANNEL_NAME) == 0)
68  {
69  xf_cliprdr_init(xfc, (CliprdrClientContext*)e->pInterface);
70  }
71  else if (strcmp(e->name, DISP_DVC_CHANNEL_NAME) == 0)
72  {
73  xf_disp_init(xfc->xfDisp, (DispClientContext*)e->pInterface);
74  }
75  else if (strcmp(e->name, VIDEO_CONTROL_DVC_CHANNEL_NAME) == 0)
76  {
77  if (freerdp_settings_get_bool(settings, FreeRDP_SoftwareGdi))
78  gdi_video_control_init(xfc->common.context.gdi, (VideoClientContext*)e->pInterface);
79  else
80  xf_video_control_init(xfc, (VideoClientContext*)e->pInterface);
81  }
82  else
83  freerdp_client_OnChannelConnectedEventHandler(context, e);
84 }
85 
86 void xf_OnChannelDisconnectedEventHandler(void* context, const ChannelDisconnectedEventArgs* e)
87 {
88  xfContext* xfc = (xfContext*)context;
89  rdpSettings* settings = NULL;
90 
91  WINPR_ASSERT(xfc);
92  WINPR_ASSERT(e);
93  WINPR_ASSERT(e->name);
94 
95  settings = xfc->common.context.settings;
96  WINPR_ASSERT(settings);
97 
98  if (FALSE)
99  {
100  }
101  else if (strcmp(e->name, DISP_DVC_CHANNEL_NAME) == 0)
102  {
103  xf_disp_uninit(xfc->xfDisp, (DispClientContext*)e->pInterface);
104  }
105 #if defined(CHANNEL_TSMF_CLIENT)
106  else if (strcmp(e->name, TSMF_DVC_CHANNEL_NAME) == 0)
107  {
108  xf_tsmf_uninit(xfc, (TsmfClientContext*)e->pInterface);
109  }
110 #endif
111  else if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0)
112  {
113  xf_graphics_pipeline_uninit(xfc, (RdpgfxClientContext*)e->pInterface);
114  }
115  else if (strcmp(e->name, RAIL_SVC_CHANNEL_NAME) == 0)
116  {
117  xf_rail_uninit(xfc, (RailClientContext*)e->pInterface);
118  }
119  else if (strcmp(e->name, CLIPRDR_SVC_CHANNEL_NAME) == 0)
120  {
121  xf_cliprdr_uninit(xfc, (CliprdrClientContext*)e->pInterface);
122  }
123  else if (strcmp(e->name, VIDEO_CONTROL_DVC_CHANNEL_NAME) == 0)
124  {
125  if (freerdp_settings_get_bool(settings, FreeRDP_SoftwareGdi))
126  gdi_video_control_uninit(xfc->common.context.gdi, (VideoClientContext*)e->pInterface);
127  else
128  xf_video_control_uninit(xfc, (VideoClientContext*)e->pInterface);
129  }
130  else
131  freerdp_client_OnChannelDisconnectedEventHandler(context, e);
132 }
FREERDP_API BOOL freerdp_settings_get_bool(const rdpSettings *settings, FreeRDP_Settings_Keys_Bool id)
Returns a boolean settings value.