21#include <freerdp/config.h> 
   23#include <freerdp/log.h> 
   26#include "shadow_encomsp.h" 
   28#define TAG SERVER_TAG("shadow") 
   36encomsp_change_participant_control_level(EncomspServerContext* context,
 
   42  rdpShadowClient* client = (rdpShadowClient*)context->custom;
 
   45            "ChangeParticipantControlLevel: ParticipantId: %" PRIu32 
" Flags: 0x%04" PRIX16 
"",
 
   46            pdu->ParticipantId, pdu->Flags);
 
   48  mayView = (pdu->Flags & ENCOMSP_MAY_VIEW) ? TRUE : FALSE;
 
   49  mayInteract = (pdu->Flags & ENCOMSP_MAY_INTERACT) ? TRUE : FALSE;
 
   51  if (mayInteract && !mayView)
 
   56    if (!client->mayInteract)
 
   59      client->mayInteract = TRUE;
 
   60      client->mayView = TRUE;
 
   65    if (client->mayInteract)
 
   68      client->mayInteract = FALSE;
 
   70    else if (!client->mayView)
 
   73      client->mayView = TRUE;
 
   78    if (client->mayInteract)
 
   81      client->mayView = FALSE;
 
   82      client->mayInteract = FALSE;
 
   84    else if (client->mayView)
 
   87      client->mayView = FALSE;
 
   88      client->mayInteract = FALSE;
 
   92  inLobby = client->mayView ? FALSE : TRUE;
 
   94  if (inLobby != client->inLobby)
 
   96    shadow_encoder_reset(client->encoder);
 
   97    client->inLobby = inLobby;
 
  100  return CHANNEL_RC_OK;
 
  103int shadow_client_encomsp_init(rdpShadowClient* client)
 
  105  EncomspServerContext* encomsp = NULL;
 
  107  encomsp = client->encomsp = encomsp_server_context_new(client->vcm);
 
  109  encomsp->rdpcontext = &client->context;
 
  111  encomsp->custom = (
void*)client;
 
  113  encomsp->ChangeParticipantControlLevel = encomsp_change_participant_control_level;
 
  116    client->encomsp->Start(client->encomsp);
 
  121void shadow_client_encomsp_uninit(rdpShadowClient* client)
 
  125    client->encomsp->Stop(client->encomsp);
 
  126    encomsp_server_context_free(client->encomsp);
 
  127    client->encomsp = NULL;