mfreerdp-server: rdpsnd fixes (init works)

This commit is contained in:
C-o-r-E 2013-01-23 21:11:41 -05:00
parent caa1032cce
commit cd4ba385df
2 changed files with 17 additions and 15 deletions

View File

@ -30,6 +30,7 @@
#include "mf_peer.h"
#include "mf_info.h"
#include "mf_event.h"
#include "mf_rdpsnd.h"
#include <mach/clock.h>
#include <mach/mach.h>
@ -197,9 +198,9 @@ void mf_peer_context_new(freerdp_peer* client, mfPeerContext* context)
context->s = stream_new(0xFFFF);
#ifdef WITH_SERVER_CHANNELS
//#ifdef WITH_SERVER_CHANNELS
context->vcm = WTSCreateVirtualChannelManager(client);
#endif
//#endif
mf_info_peer_register(context->info, context);
}
@ -224,14 +225,14 @@ void mf_peer_context_free(freerdp_peer* client, mfPeerContext* context)
audin_server_context_free(context->audin);
#endif
#ifdef CHANNEL_RDPSND_SERVER
//#ifdef CHANNEL_RDPSND_SERVER
if (context->rdpsnd)
rdpsnd_server_context_free(context->rdpsnd);
#endif
//#endif
#ifdef WITH_SERVER_CHANNELS
//#ifdef WITH_SERVER_CHANNELS
WTSDestroyVirtualChannelManager(context->vcm);
#endif
//#endif
}
}
@ -264,7 +265,7 @@ void mf_peer_init(freerdp_peer* client)
BOOL mf_peer_post_connect(freerdp_peer* client)
{
//mfPeerContext* context = (mfPeerContext*) client->context;
mfPeerContext* context = (mfPeerContext*) client->context;
rdpSettings* settings = client->settings;
printf("Client %s is activated\n", client->hostname);
@ -302,24 +303,24 @@ BOOL mf_peer_post_connect(freerdp_peer* client)
/*printf("Client requested desktop: %dx%dx%d\n",
client->settings->DesktopWidth, client->settings->DesktopHeight, client->settings->ColorDepth);
*/
#ifdef WITH_SERVER_CHANNELS
//#ifdef WITH_SERVER_CHANNELS
/* Iterate all channel names requested by the client and activate those supported by the server */
int i;
for (i = 0; i < client->settings->ChannelCount; i++)
{
if (client->settings->ChannelDefArray[i].joined)
{
#ifdef CHANNEL_RDPSND_SERVER
//#ifdef CHANNEL_RDPSND_SERVER
if (strncmp(client->settings->ChannelDefArray[i].Name, "rdpsnd", 6) == 0)
{
mf_peer_rdpsnd_init(context); /* Audio Output */
}
#endif
//#endif
}
}
/* Dynamic Virtual Channels */
#endif
//#endif
#ifdef CHANNEL_AUDIN_SERVER
mf_peer_audin_init(context); /* Audio Input */
@ -545,9 +546,9 @@ void* mf_peer_main_loop(void* arg)
break;
}
#ifdef WITH_SERVER_CHANNELS
//#ifdef WITH_SERVER_CHANNELS
WTSVirtualChannelManagerGetFileDescriptor(context->vcm, rfds, &rcount);
#endif
//#endif
max_fds = 0;
FD_ZERO(&rfds_set);
@ -590,10 +591,10 @@ void* mf_peer_main_loop(void* arg)
}
#ifdef WITH_SERVER_CHANNELS
//#ifdef WITH_SERVER_CHANNELS
if (WTSVirtualChannelManagerCheckFileDescriptor(context->vcm) != TRUE)
break;
#endif
//#endif
}

View File

@ -46,6 +46,7 @@ static void mf_peer_rdpsnd_activated(rdpsnd_server_context* context)
BOOL mf_peer_rdpsnd_init(mfPeerContext* context)
{
printf("RDPSND INIT\n");
context->rdpsnd = rdpsnd_server_context_new(context->vcm);
context->rdpsnd->data = context;