Пример #1
0
static BOOL shadow_client_activate(freerdp_peer* peer)
{
	rdpSettings* settings = peer->settings;
	rdpShadowClient* client = (rdpShadowClient*) peer->context;

	if (settings->ClientDir && (strcmp(settings->ClientDir, "librdp") == 0))
	{
		/* Hack for Mac/iOS/Android Microsoft RDP clients */

		settings->RemoteFxCodec = FALSE;

		settings->NSCodec = FALSE;
		settings->NSCodecAllowSubsampling = FALSE;

		settings->SurfaceFrameMarkerEnabled = FALSE;
	}

	client->activated = TRUE;
	client->inLobby = client->mayView ? FALSE : TRUE;

	if (shadow_encoder_reset(client->encoder) < 0)
	{
		WLog_ERR(TAG, "Failed to reset encoder");
		return FALSE;
	}

	/* Update full screen in next update */
	return shadow_client_refresh_rect(client, 0, NULL);
}
Пример #2
0
static int encomsp_change_participant_control_level(EncomspServerContext* context,
		ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU* pdu)
{
	BOOL inLobby;
	BOOL mayView;
	BOOL mayInteract;
	rdpShadowClient* client = (rdpShadowClient*) context->custom;

	printf("ChangeParticipantControlLevel: ParticipantId: %d Flags: 0x%04X\n",
			pdu->ParticipantId, pdu->Flags);

	mayView = (pdu->Flags & ENCOMSP_MAY_VIEW) ? TRUE : FALSE;
	mayInteract = (pdu->Flags & ENCOMSP_MAY_INTERACT) ? TRUE : FALSE;

	if (mayInteract && !mayView)
		mayView = TRUE; /* may interact implies may view */

	if (mayInteract)
	{
		if (!client->mayInteract)
		{
			/* request interact + view */
			client->mayInteract = TRUE;
			client->mayView = TRUE;
		}
	}
	else if (mayView)
	{
		if (client->mayInteract)
		{
			/* release interact */
			client->mayInteract = FALSE;
		}
		else if (!client->mayView)
		{
			/* request view */
			client->mayView = TRUE;
		}
	}
	else
	{
		if (client->mayInteract)
		{
			/* release interact + view */
			client->mayView = FALSE;
			client->mayInteract = FALSE;
		}
		else if (client->mayView)
		{
			/* release view */
			client->mayView = FALSE;
			client->mayInteract = FALSE;
		}
	}

	inLobby = client->mayView ? FALSE : TRUE;

	if (inLobby != client->inLobby)
	{
		shadow_encoder_reset(client->encoder);
		client->inLobby = inLobby;
	}

	return 1;
}