server/Sample: stub server-side encomsp channel

This commit is contained in:
Marc-André Moreau 2014-06-25 15:21:02 -04:00
parent 014d8972e3
commit f1a866340e
5 changed files with 83 additions and 2 deletions

View File

@ -24,7 +24,9 @@ set(${MODULE_PREFIX}_SRCS
sf_audin.c sf_audin.c
sf_audin.h sf_audin.h
sf_rdpsnd.c sf_rdpsnd.c
sf_rdpsnd.h) sf_rdpsnd.h
sf_encomsp.c
sf_encomsp.h)
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})

View File

@ -0,0 +1,37 @@
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* FreeRDP Sample Server (Lync Multiparty)
*
* Copyright 2014 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
#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;
}

View File

@ -0,0 +1,31 @@
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* FreeRDP Sample Server (Lync Multiparty)
*
* Copyright 2014 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.
*/
#ifndef SF_ENCOMSP_H
#define SF_ENCOMSP_H
#include <freerdp/freerdp.h>
#include <freerdp/listener.h>
#include <freerdp/server/encomsp.h>
#include "sfreerdp.h"
BOOL sf_peer_encomsp_init(testPeerContext* context);
#endif /* SF_ENCOMSP_H */

View File

@ -30,16 +30,17 @@
#include <winpr/crt.h> #include <winpr/crt.h>
#include <winpr/synch.h> #include <winpr/synch.h>
#include <freerdp/channels/wtsvc.h> #include <freerdp/channels/wtsvc.h>
#include <freerdp/channels/channels.h> #include <freerdp/channels/channels.h>
#include <freerdp/constants.h> #include <freerdp/constants.h>
#include <freerdp/utils/tcp.h> #include <freerdp/utils/tcp.h>
#include <freerdp/server/rdpsnd.h> #include <freerdp/server/rdpsnd.h>
#include "sf_audin.h" #include "sf_audin.h"
#include "sf_rdpsnd.h" #include "sf_rdpsnd.h"
#include "sf_encomsp.h"
#include "sfreerdp.h" #include "sfreerdp.h"
@ -96,6 +97,9 @@ void test_peer_context_free(freerdp_peer* client, testPeerContext* context)
if (context->rdpsnd) if (context->rdpsnd)
rdpsnd_server_context_free(context->rdpsnd); rdpsnd_server_context_free(context->rdpsnd);
if (context->encomsp)
encomsp_server_context_free(context->encomsp);
WTSCloseServer((HANDLE) context->vcm); WTSCloseServer((HANDLE) context->vcm);
} }
} }
@ -516,6 +520,11 @@ BOOL tf_peer_post_connect(freerdp_peer* client)
sf_peer_rdpsnd_init(context); /* Audio Output */ sf_peer_rdpsnd_init(context); /* Audio Output */
} }
if (WTSVirtualChannelManagerIsChannelJoined(context->vcm, "encomsp"))
{
sf_peer_encomsp_init(context); /* Lync Multiparty */
}
/* Dynamic Virtual Channels */ /* Dynamic Virtual Channels */
sf_peer_audin_init(context); /* Audio Input */ sf_peer_audin_init(context); /* Audio Input */

View File

@ -27,6 +27,7 @@
#include <freerdp/channels/wtsvc.h> #include <freerdp/channels/wtsvc.h>
#include <freerdp/server/audin.h> #include <freerdp/server/audin.h>
#include <freerdp/server/rdpsnd.h> #include <freerdp/server/rdpsnd.h>
#include <freerdp/server/encomsp.h>
#include <winpr/crt.h> #include <winpr/crt.h>
#include <winpr/synch.h> #include <winpr/synch.h>
@ -55,6 +56,7 @@ struct test_peer_context
BOOL audin_open; BOOL audin_open;
UINT32 frame_id; UINT32 frame_id;
RdpsndServerContext* rdpsnd; RdpsndServerContext* rdpsnd;
EncomspServerContext* encomsp;
}; };
typedef struct test_peer_context testPeerContext; typedef struct test_peer_context testPeerContext;