diff --git a/client/common/client.c b/client/common/client.c index 4460e8ae7..8f273326c 100644 --- a/client/common/client.c +++ b/client/common/client.c @@ -33,6 +33,29 @@ #include #include +#if defined(CHANNEL_AINPUT_CLIENT) +#include +#include +#endif + +#if defined(CHANNEL_VIDEO_CLIENT) +#include +#include +#include +#endif + +#if defined(CHANNEL_RDPGFX_CLIENT) +#include +#include +#include +#endif + +#if defined(CHANNEL_GEOMETRY_CLIENT) +#include +#include +#include +#endif + #include #define TAG CLIENT_TAG("common") @@ -903,3 +926,93 @@ int freerdp_client_common_stop(rdpContext* context) return 0; } + +void freerdp_client_OnChannelConnectedEventHandler(void* context, + const ChannelConnectedEventArgs* e) +{ + rdpClientContext* cctx = (rdpClientContext*)context; + + WINPR_ASSERT(cctx); + WINPR_ASSERT(e); + + if (0) + { + } +#if defined(CHANNEL_AINPUT_CLIENT) + else if (strcmp(e->name, AINPUT_DVC_CHANNEL_NAME) == 0) + cctx->ainput = (AInputClientContext*)e->pInterface; +#endif +#if defined(CHANNEL_RDPEI_CLIENT) + else if (strcmp(e->name, RDPEI_DVC_CHANNEL_NAME) == 0) + { + cctx->rdpei = (RdpeiClientContext*)e->pInterface; + } +#endif +#if defined(CHANNEL_RDPGFX_CLIENT) + else if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0) + { + gdi_graphics_pipeline_init(cctx->context.gdi, (RdpgfxClientContext*)e->pInterface); + } +#endif +#if defined(CHANNEL_GEOMETRY_CLIENT) + else if (strcmp(e->name, GEOMETRY_DVC_CHANNEL_NAME) == 0) + { + gdi_video_geometry_init(cctx->context.gdi, (GeometryClientContext*)e->pInterface); + } +#endif +#if defined(CHANNEL_VIDEO_CLIENT) + else if (strcmp(e->name, VIDEO_CONTROL_DVC_CHANNEL_NAME) == 0) + { + gdi_video_control_init(cctx->context.gdi, (VideoClientContext*)e->pInterface); + } + else if (strcmp(e->name, VIDEO_DATA_DVC_CHANNEL_NAME) == 0) + { + gdi_video_data_init(cctx->context.gdi, (VideoClientContext*)e->pInterface); + } +#endif +} + +void freerdp_client_OnChannelDisconnectedEventHandler(void* context, + const ChannelDisconnectedEventArgs* e) +{ + rdpClientContext* cctx = (rdpClientContext*)context; + + WINPR_ASSERT(cctx); + WINPR_ASSERT(e); + + if (0) + { + } +#if defined(CHANNEL_AINPUT_CLIENT) + else if (strcmp(e->name, AINPUT_DVC_CHANNEL_NAME) == 0) + cctx->ainput = NULL; +#endif +#if defined(CHANNEL_RDPEI_CLIENT) + else if (strcmp(e->name, RDPEI_DVC_CHANNEL_NAME) == 0) + { + cctx->rdpei = NULL; + } +#endif +#if defined(CHANNEL_RDPGFX_CLIENT) + else if (strcmp(e->name, RDPGFX_DVC_CHANNEL_NAME) == 0) + { + gdi_graphics_pipeline_uninit(cctx->context.gdi, (RdpgfxClientContext*)e->pInterface); + } +#endif +#if defined(CHANNEL_GEOMETRY_CLIENT) + else if (strcmp(e->name, GEOMETRY_DVC_CHANNEL_NAME) == 0) + { + gdi_video_geometry_uninit(cctx->context.gdi, (GeometryClientContext*)e->pInterface); + } +#endif +#if defined(CHANNEL_VIDEO_CLIENT) + else if (strcmp(e->name, VIDEO_CONTROL_DVC_CHANNEL_NAME) == 0) + { + gdi_video_control_uninit(cctx->context.gdi, (VideoClientContext*)e->pInterface); + } + else if (strcmp(e->name, VIDEO_DATA_DVC_CHANNEL_NAME) == 0) + { + gdi_video_data_uninit(cctx->context.gdi, (VideoClientContext*)e->pInterface); + } +#endif +} diff --git a/include/freerdp/client.h b/include/freerdp/client.h index 5243e3489..d857650db 100644 --- a/include/freerdp/client.h +++ b/include/freerdp/client.h @@ -20,8 +20,20 @@ #ifndef FREERDP_CLIENT_H #define FREERDP_CLIENT_H +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include +#include + +#if defined(CHANNEL_AINPUT_CLIENT) +#include +#endif + +#if defined(CHANNEL_RDPEI_CLIENT) +#include +#endif #ifdef __cplusplus extern "C" @@ -70,6 +82,13 @@ extern "C" { rdpContext context; HANDLE thread; +#if defined(CHANNEL_AINPUT_CLIENT) + AInputClientContext* ainput; +#endif + +#if defined(CHANNEL_RDPEI_CLIENT) + RdpeiClientContext* rdpei; +#endif }; /* Common client functions */ @@ -101,6 +120,13 @@ extern "C" FREERDP_API BOOL client_cli_authenticate_ex(freerdp* instance, char** username, char** password, char** domain, rdp_auth_reason reason); + FREERDP_API void + freerdp_client_OnChannelConnectedEventHandler(void* context, + const ChannelConnectedEventArgs* e); + FREERDP_API void + freerdp_client_OnChannelDisconnectedEventHandler(void* context, + const ChannelDisconnectedEventArgs* e); + #if defined(WITH_FREERDP_DEPRECATED) FREERDP_API WINPR_DEPRECATED_VAR("Use client_cli_authenticate_ex", BOOL client_cli_authenticate(freerdp* instance,