2013-05-14 07:17:25 +08:00
|
|
|
/**
|
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
|
|
|
* X11 Client Channels
|
|
|
|
*
|
|
|
|
* Copyright 2013 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2018-02-08 15:44:46 +08:00
|
|
|
#include <freerdp/gdi/video.h>
|
2013-05-14 07:17:25 +08:00
|
|
|
#include "xf_channels.h"
|
|
|
|
|
2013-06-16 01:41:05 +08:00
|
|
|
#include "xf_client.h"
|
2013-05-14 07:17:25 +08:00
|
|
|
#include "xfreerdp.h"
|
|
|
|
|
2014-06-05 06:03:25 +08:00
|
|
|
#include "xf_gfx.h"
|
2014-11-11 05:23:04 +08:00
|
|
|
#include "xf_tsmf.h"
|
2014-11-12 05:35:30 +08:00
|
|
|
#include "xf_rail.h"
|
2014-10-15 10:24:07 +08:00
|
|
|
#include "xf_cliprdr.h"
|
2017-11-29 17:26:04 +08:00
|
|
|
#include "xf_disp.h"
|
2017-12-15 18:15:24 +08:00
|
|
|
#include "xf_video.h"
|
2014-06-05 06:03:25 +08:00
|
|
|
|
2018-02-14 17:14:33 +08:00
|
|
|
void xf_OnChannelConnectedEventHandler(void* context, ChannelConnectedEventArgs* e)
|
2013-05-14 07:17:25 +08:00
|
|
|
{
|
2013-07-11 23:53:15 +08:00
|
|
|
xfContext* xfc = (xfContext*) context;
|
2018-02-14 17:14:33 +08:00
|
|
|
rdpSettings* settings = xfc->context.settings;
|
2013-05-14 07:17:25 +08:00
|
|
|
|
2013-07-11 23:53:15 +08:00
|
|
|
if (strcmp(e->name, RDPEI_DVC_CHANNEL_NAME) == 0)
|
2013-05-14 07:17:25 +08:00
|
|
|
{
|
2013-07-11 23:53:15 +08:00
|
|
|
xfc->rdpei = (RdpeiClientContext*) e->pInterface;
|
2013-05-14 07:17:25 +08:00
|
|
|
}
|
2014-11-11 05:23:04 +08:00
|
|
|
else if (strcmp(e->name, TSMF_DVC_CHANNEL_NAME) == 0)
|
|
|
|
{
|
|
|
|
xf_tsmf_init(xfc, (TsmfClientContext*) e->pInterface);
|
|
|
|
}
|
2014-06-05 06:03:25 +08:00
|
|
|
else if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0)
|
|
|
|
{
|
2014-09-13 02:57:44 +08:00
|
|
|
if (settings->SoftwareGdi)
|
2018-02-14 17:14:33 +08:00
|
|
|
gdi_graphics_pipeline_init(xfc->context.gdi, (RdpgfxClientContext*) e->pInterface);
|
2014-09-13 02:57:44 +08:00
|
|
|
else
|
|
|
|
xf_graphics_pipeline_init(xfc, (RdpgfxClientContext*) e->pInterface);
|
2014-06-05 06:03:25 +08:00
|
|
|
}
|
2014-11-12 05:35:30 +08:00
|
|
|
else if (strcmp(e->name, RAIL_SVC_CHANNEL_NAME) == 0)
|
|
|
|
{
|
|
|
|
xf_rail_init(xfc, (RailClientContext*) e->pInterface);
|
|
|
|
}
|
2014-10-15 10:24:07 +08:00
|
|
|
else if (strcmp(e->name, CLIPRDR_SVC_CHANNEL_NAME) == 0)
|
|
|
|
{
|
|
|
|
xf_cliprdr_init(xfc, (CliprdrClientContext*) e->pInterface);
|
|
|
|
}
|
2014-07-01 05:17:06 +08:00
|
|
|
else if (strcmp(e->name, ENCOMSP_SVC_CHANNEL_NAME) == 0)
|
|
|
|
{
|
|
|
|
xf_encomsp_init(xfc, (EncomspClientContext*) e->pInterface);
|
|
|
|
}
|
2017-11-29 17:26:04 +08:00
|
|
|
else if (strcmp(e->name, DISP_DVC_CHANNEL_NAME) == 0)
|
|
|
|
{
|
2018-09-24 22:44:25 +08:00
|
|
|
xf_disp_init(xfc->xfDisp, (DispClientContext*)e->pInterface);
|
2017-11-29 17:26:04 +08:00
|
|
|
}
|
2017-12-15 18:15:24 +08:00
|
|
|
else if (strcmp(e->name, GEOMETRY_DVC_CHANNEL_NAME) == 0)
|
|
|
|
{
|
2018-02-08 15:55:27 +08:00
|
|
|
gdi_video_geometry_init(xfc->context.gdi, (GeometryClientContext*)e->pInterface);
|
2017-12-15 18:15:24 +08:00
|
|
|
}
|
|
|
|
else if (strcmp(e->name, VIDEO_CONTROL_DVC_CHANNEL_NAME) == 0)
|
|
|
|
{
|
2018-02-08 15:44:46 +08:00
|
|
|
if (settings->SoftwareGdi)
|
|
|
|
gdi_video_control_init(xfc->context.gdi, (VideoClientContext*)e->pInterface);
|
|
|
|
else
|
|
|
|
xf_video_control_init(xfc, (VideoClientContext*)e->pInterface);
|
2017-12-15 18:15:24 +08:00
|
|
|
}
|
|
|
|
else if (strcmp(e->name, VIDEO_DATA_DVC_CHANNEL_NAME) == 0)
|
|
|
|
{
|
2018-02-08 15:55:27 +08:00
|
|
|
gdi_video_data_init(xfc->context.gdi, (VideoClientContext*)e->pInterface);
|
2017-12-15 18:15:24 +08:00
|
|
|
}
|
2013-05-14 07:17:25 +08:00
|
|
|
}
|
|
|
|
|
2018-02-14 17:14:33 +08:00
|
|
|
void xf_OnChannelDisconnectedEventHandler(void* context, ChannelDisconnectedEventArgs* e)
|
2013-05-14 07:17:25 +08:00
|
|
|
{
|
2014-06-21 01:52:13 +08:00
|
|
|
xfContext* xfc = (xfContext*) context;
|
2018-02-14 17:14:33 +08:00
|
|
|
rdpSettings* settings = xfc->context.settings;
|
2013-07-11 23:53:15 +08:00
|
|
|
|
2014-06-21 01:52:13 +08:00
|
|
|
if (strcmp(e->name, RDPEI_DVC_CHANNEL_NAME) == 0)
|
|
|
|
{
|
|
|
|
xfc->rdpei = NULL;
|
|
|
|
}
|
2018-09-24 22:44:25 +08:00
|
|
|
else if (strcmp(e->name, DISP_DVC_CHANNEL_NAME) == 0)
|
|
|
|
{
|
|
|
|
xf_disp_uninit(xfc->xfDisp, (DispClientContext*)e->pInterface);
|
|
|
|
}
|
2014-11-11 05:23:04 +08:00
|
|
|
else if (strcmp(e->name, TSMF_DVC_CHANNEL_NAME) == 0)
|
|
|
|
{
|
|
|
|
xf_tsmf_uninit(xfc, (TsmfClientContext*) e->pInterface);
|
|
|
|
}
|
2014-06-21 01:52:13 +08:00
|
|
|
else if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0)
|
|
|
|
{
|
2014-09-13 02:57:44 +08:00
|
|
|
if (settings->SoftwareGdi)
|
2018-02-14 17:14:33 +08:00
|
|
|
gdi_graphics_pipeline_uninit(xfc->context.gdi, (RdpgfxClientContext*) e->pInterface);
|
2014-09-13 02:57:44 +08:00
|
|
|
else
|
|
|
|
xf_graphics_pipeline_uninit(xfc, (RdpgfxClientContext*) e->pInterface);
|
2014-06-21 01:52:13 +08:00
|
|
|
}
|
2014-11-12 05:35:30 +08:00
|
|
|
else if (strcmp(e->name, RAIL_SVC_CHANNEL_NAME) == 0)
|
|
|
|
{
|
|
|
|
xf_rail_uninit(xfc, (RailClientContext*) e->pInterface);
|
|
|
|
}
|
2014-10-15 10:24:07 +08:00
|
|
|
else if (strcmp(e->name, CLIPRDR_SVC_CHANNEL_NAME) == 0)
|
|
|
|
{
|
|
|
|
xf_cliprdr_uninit(xfc, (CliprdrClientContext*) e->pInterface);
|
|
|
|
}
|
2014-07-01 05:17:06 +08:00
|
|
|
else if (strcmp(e->name, ENCOMSP_SVC_CHANNEL_NAME) == 0)
|
|
|
|
{
|
|
|
|
xf_encomsp_uninit(xfc, (EncomspClientContext*) e->pInterface);
|
|
|
|
}
|
2018-02-08 15:44:46 +08:00
|
|
|
else if (strcmp(e->name, GEOMETRY_DVC_CHANNEL_NAME) == 0)
|
|
|
|
{
|
2018-02-08 15:55:27 +08:00
|
|
|
gdi_video_geometry_uninit(xfc->context.gdi, (GeometryClientContext*)e->pInterface);
|
2018-02-08 15:44:46 +08:00
|
|
|
}
|
2018-01-26 22:21:49 +08:00
|
|
|
else if (strcmp(e->name, VIDEO_CONTROL_DVC_CHANNEL_NAME) == 0)
|
|
|
|
{
|
2018-02-08 15:44:46 +08:00
|
|
|
if (settings->SoftwareGdi)
|
|
|
|
gdi_video_control_uninit(xfc->context.gdi, (VideoClientContext*)e->pInterface);
|
|
|
|
else
|
|
|
|
xf_video_control_uninit(xfc, (VideoClientContext*)e->pInterface);
|
2018-01-26 22:21:49 +08:00
|
|
|
}
|
|
|
|
else if (strcmp(e->name, VIDEO_DATA_DVC_CHANNEL_NAME) == 0)
|
|
|
|
{
|
2018-02-08 15:55:27 +08:00
|
|
|
gdi_video_data_uninit(xfc->context.gdi, (VideoClientContext*)e->pInterface);
|
2018-01-26 22:21:49 +08:00
|
|
|
}
|
2013-05-14 07:17:25 +08:00
|
|
|
}
|