From f1a866340ec9e4f348b6d8cabeccfeb6a992c614 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc-Andr=C3=A9=20Moreau?= Date: Wed, 25 Jun 2014 15:21:02 -0400 Subject: [PATCH] server/Sample: stub server-side encomsp channel --- server/Sample/CMakeLists.txt | 4 +++- server/Sample/sf_encomsp.c | 37 +++++++++++++++++++++++++++++++++++++ server/Sample/sf_encomsp.h | 31 +++++++++++++++++++++++++++++++ server/Sample/sfreerdp.c | 11 ++++++++++- server/Sample/sfreerdp.h | 2 ++ 5 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 server/Sample/sf_encomsp.c create mode 100644 server/Sample/sf_encomsp.h diff --git a/server/Sample/CMakeLists.txt b/server/Sample/CMakeLists.txt index 972cc29..638a5fe 100644 --- a/server/Sample/CMakeLists.txt +++ b/server/Sample/CMakeLists.txt @@ -24,7 +24,9 @@ set(${MODULE_PREFIX}_SRCS sf_audin.c sf_audin.h sf_rdpsnd.c - sf_rdpsnd.h) + sf_rdpsnd.h + sf_encomsp.c + sf_encomsp.h) add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) diff --git a/server/Sample/sf_encomsp.c b/server/Sample/sf_encomsp.c new file mode 100644 index 0000000..a152182 --- /dev/null +++ b/server/Sample/sf_encomsp.c @@ -0,0 +1,37 @@ +/** + * FreeRDP: A Remote Desktop Protocol Implementation + * FreeRDP Sample Server (Lync Multiparty) + * + * Copyright 2014 Marc-Andre Moreau + * + * 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 + +#include "sf_encomsp.h" + +BOOL sf_peer_encomsp_init(testPeerContext* context) +{ + context->encomsp = encomsp_server_context_new(context->vcm); + + if (!context->encomsp) + return FALSE; + + if (context->encomsp->Start(context->encomsp) < 0) + return FALSE; + + return TRUE; +} diff --git a/server/Sample/sf_encomsp.h b/server/Sample/sf_encomsp.h new file mode 100644 index 0000000..f2abd31 --- /dev/null +++ b/server/Sample/sf_encomsp.h @@ -0,0 +1,31 @@ +/** + * FreeRDP: A Remote Desktop Protocol Implementation + * FreeRDP Sample Server (Lync Multiparty) + * + * Copyright 2014 Marc-Andre Moreau + * + * 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. + */ + +#ifndef SF_ENCOMSP_H +#define SF_ENCOMSP_H + +#include +#include +#include + +#include "sfreerdp.h" + +BOOL sf_peer_encomsp_init(testPeerContext* context); + +#endif /* SF_ENCOMSP_H */ diff --git a/server/Sample/sfreerdp.c b/server/Sample/sfreerdp.c index 3a2d36d..a990d4a 100644 --- a/server/Sample/sfreerdp.c +++ b/server/Sample/sfreerdp.c @@ -30,16 +30,17 @@ #include #include + #include #include - #include #include #include #include "sf_audin.h" #include "sf_rdpsnd.h" +#include "sf_encomsp.h" #include "sfreerdp.h" @@ -96,6 +97,9 @@ void test_peer_context_free(freerdp_peer* client, testPeerContext* context) if (context->rdpsnd) rdpsnd_server_context_free(context->rdpsnd); + if (context->encomsp) + encomsp_server_context_free(context->encomsp); + WTSCloseServer((HANDLE) context->vcm); } } @@ -516,6 +520,11 @@ BOOL tf_peer_post_connect(freerdp_peer* client) sf_peer_rdpsnd_init(context); /* Audio Output */ } + if (WTSVirtualChannelManagerIsChannelJoined(context->vcm, "encomsp")) + { + sf_peer_encomsp_init(context); /* Lync Multiparty */ + } + /* Dynamic Virtual Channels */ sf_peer_audin_init(context); /* Audio Input */ diff --git a/server/Sample/sfreerdp.h b/server/Sample/sfreerdp.h index a052da9..0c0e1cf 100644 --- a/server/Sample/sfreerdp.h +++ b/server/Sample/sfreerdp.h @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -55,6 +56,7 @@ struct test_peer_context BOOL audin_open; UINT32 frame_id; RdpsndServerContext* rdpsnd; + EncomspServerContext* encomsp; }; typedef struct test_peer_context testPeerContext; -- 2.7.4