Ejemplo n.º 1
0
BOOL wf_peer_post_connect(freerdp_peer* client)
{
	int i;
	wfInfo* wfi;
	rdpSettings* settings;
	wfPeerContext* context = (wfPeerContext*) client->context;

	wfi = context->info;
	settings = client->settings;

	if (	(get_screen_info(wfi->screenID, NULL, &wfi->servscreen_width, &wfi->servscreen_height, &wfi->bitsPerPixel) == 0) ||
		(wfi->servscreen_width == 0) ||
		(wfi->servscreen_height == 0) ||
		(wfi->bitsPerPixel == 0) )
	{
		_tprintf(_T("postconnect: error getting screen info for screen %d\n"), wfi->screenID);
		_tprintf(_T("\t%dx%dx%d\n"), wfi->servscreen_height, wfi->servscreen_width, wfi->bitsPerPixel);
		return FALSE;
	}

	if ((settings->DesktopWidth != wfi->servscreen_width) || (settings->DesktopHeight != wfi->servscreen_height))
	{
		/*
		printf("Client requested resolution %dx%d, but will resize to %dx%d\n",
			settings->DesktopWidth, settings->DesktopHeight, wfi->servscreen_width, wfi->servscreen_height);
			*/

		settings->DesktopWidth = wfi->servscreen_width;
		settings->DesktopHeight = wfi->servscreen_height;
		settings->ColorDepth = wfi->bitsPerPixel;

		client->update->DesktopResize(client->update->context);
	}

	for (i = 0; i < client->settings->ChannelCount; i++)
	{
		if (client->settings->ChannelDefArray[i].joined)
		{
			if (strncmp(client->settings->ChannelDefArray[i].Name, "rdpsnd", 6) == 0)
			{
				wf_peer_rdpsnd_init(context); /* Audio Output */
			}
		}
	}

	return TRUE;
}
Ejemplo n.º 2
0
BOOL wf_peer_post_connect(freerdp_peer* client)
{
	int i;
	wfInfo* wfi;
	rdpSettings* settings;
	wfPeerContext* context = (wfPeerContext*) client->context;

	wfi = context->info;
	settings = client->settings;

	if ((get_screen_info(wfi->screenID, NULL, &wfi->servscreen_width, &wfi->servscreen_height, &wfi->bitsPerPixel) == 0) ||
		(wfi->servscreen_width == 0) ||
		(wfi->servscreen_height == 0) ||
		(wfi->bitsPerPixel == 0) )
	{
		WLog_ERR(TAG, "postconnect: error getting screen info for screen %d", wfi->screenID);
		WLog_ERR(TAG, "\t%dx%dx%d", wfi->servscreen_height, wfi->servscreen_width, wfi->bitsPerPixel);
		return FALSE;
	}

	if ((settings->DesktopWidth != wfi->servscreen_width) || (settings->DesktopHeight != wfi->servscreen_height))
	{
		/*
		WLog_DBG(TAG, "Client requested resolution %dx%d, but will resize to %dx%d",
			settings->DesktopWidth, settings->DesktopHeight, wfi->servscreen_width, wfi->servscreen_height);
			*/

		settings->DesktopWidth = wfi->servscreen_width;
		settings->DesktopHeight = wfi->servscreen_height;
		settings->ColorDepth = wfi->bitsPerPixel;

		client->update->DesktopResize(client->update->context);
	}

	if (WTSVirtualChannelManagerIsChannelJoined(context->vcm, "rdpsnd"))
	{
		wf_peer_rdpsnd_init(context); /* Audio Output */
	}

	return TRUE;
}