mirror of https://github.com/FreeRDP/FreeRDP
wfreerdp-server: fix encoder on Windows 7
This commit is contained in:
parent
34b59653dd
commit
58525ca415
|
@ -31,6 +31,7 @@ client/X11/xfreerdp.1
|
||||||
*.opensdf
|
*.opensdf
|
||||||
ipch
|
ipch
|
||||||
Debug
|
Debug
|
||||||
|
RelWithDebInfo
|
||||||
|
|
||||||
# Binaries
|
# Binaries
|
||||||
*.a
|
*.a
|
||||||
|
|
|
@ -125,6 +125,7 @@ wfInfo* wf_info_init()
|
||||||
}
|
}
|
||||||
|
|
||||||
wfi->updateEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
|
wfi->updateEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||||
|
printf("updateEvent created\n");
|
||||||
|
|
||||||
wfi->updateSemaphore = CreateSemaphore(NULL, 0, 32, NULL);
|
wfi->updateSemaphore = CreateSemaphore(NULL, 0, 32, NULL);
|
||||||
|
|
||||||
|
@ -192,16 +193,12 @@ void wf_info_peer_register(wfInfo* wfi, wfPeerContext* context)
|
||||||
context->info = wfi;
|
context->info = wfi;
|
||||||
context->updateEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
context->updateEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||||
|
|
||||||
if (wfi->peerCount == 0)
|
|
||||||
{
|
|
||||||
#ifdef WITH_WIN8
|
#ifdef WITH_WIN8
|
||||||
|
if (wfi->peerCount == 0)
|
||||||
wf_dxgi_init(wfi);
|
wf_dxgi_init(wfi);
|
||||||
|
#else
|
||||||
|
wf_mirror_driver_activate(wfi);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
wf_mirror_driver_activate(wfi);
|
|
||||||
}
|
|
||||||
|
|
||||||
wfi->peers[wfi->peerCount++] = ((rdpContext*) context)->peer;
|
wfi->peers[wfi->peerCount++] = ((rdpContext*) context)->peer;
|
||||||
|
|
||||||
|
@ -220,12 +217,10 @@ void wf_info_peer_unregister(wfInfo* wfi, wfPeerContext* context)
|
||||||
|
|
||||||
printf("Unregistering Peer: %d\n", wfi->peerCount);
|
printf("Unregistering Peer: %d\n", wfi->peerCount);
|
||||||
|
|
||||||
if(wfi->peerCount == 0)
|
|
||||||
{
|
|
||||||
#ifdef WITH_WIN8
|
#ifdef WITH_WIN8
|
||||||
|
if (wfi->peerCount == 0)
|
||||||
wf_dxgi_cleanup(wfi);
|
wf_dxgi_cleanup(wfi);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
wf_info_unlock(wfi);
|
wf_info_unlock(wfi);
|
||||||
}
|
}
|
||||||
|
@ -248,12 +243,10 @@ void wf_info_update_changes(wfInfo* wfi)
|
||||||
#ifdef WITH_WIN8
|
#ifdef WITH_WIN8
|
||||||
wf_dxgi_nextFrame(wfi, wfi->framesPerSecond / 1000);
|
wf_dxgi_nextFrame(wfi, wfi->framesPerSecond / 1000);
|
||||||
#else
|
#else
|
||||||
|
|
||||||
GETCHANGESBUF* buf;
|
GETCHANGESBUF* buf;
|
||||||
|
|
||||||
buf = (GETCHANGESBUF*) wfi->changeBuffer;
|
buf = (GETCHANGESBUF*) wfi->changeBuffer;
|
||||||
wfi->nextUpdate = buf->buffer->counter;
|
wfi->nextUpdate = buf->buffer->counter;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -274,7 +267,7 @@ void wf_info_find_invalid_region(wfInfo* wfi)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (wfi->invalid.left < 0)
|
if (wfi->invalid.left < 0)
|
||||||
wfi->invalid.left = 0;
|
wfi->invalid.left = 0;
|
||||||
|
|
||||||
if (wfi->invalid.top < 0)
|
if (wfi->invalid.top < 0)
|
||||||
wfi->invalid.top = 0;
|
wfi->invalid.top = 0;
|
||||||
|
@ -284,7 +277,6 @@ void wf_info_find_invalid_region(wfInfo* wfi)
|
||||||
|
|
||||||
if (wfi->invalid.bottom >= wfi->height)
|
if (wfi->invalid.bottom >= wfi->height)
|
||||||
wfi->invalid.bottom = wfi->height - 1;
|
wfi->invalid.bottom = wfi->height - 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wf_info_clear_invalid_region(wfInfo* wfi)
|
void wf_info_clear_invalid_region(wfInfo* wfi)
|
||||||
|
@ -323,6 +315,5 @@ void wf_info_getScreenData(wfInfo* wfi, long* width, long* height, uint8** pBits
|
||||||
*pBits = ((uint8*) (changes->Userbuffer)) + offset;
|
*pBits = ((uint8*) (changes->Userbuffer)) + offset;
|
||||||
*pitch = wfi->width * 4;
|
*pitch = wfi->width * 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,6 +138,8 @@ DWORD WINAPI wf_peer_socket_listener(LPVOID lpParam)
|
||||||
ZeroMemory(rfds, sizeof(rfds));
|
ZeroMemory(rfds, sizeof(rfds));
|
||||||
context = (wfPeerContext*) client->context;
|
context = (wfPeerContext*) client->context;
|
||||||
|
|
||||||
|
printf("PeerSocketListener\n");
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
rcount = 0;
|
rcount = 0;
|
||||||
|
@ -220,11 +222,15 @@ DWORD WINAPI wf_peer_main_loop(LPVOID lpParam)
|
||||||
|
|
||||||
wfi = context->info;
|
wfi = context->info;
|
||||||
context->socketEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
context->socketEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||||
|
printf("socketEvent created\n");
|
||||||
|
|
||||||
context->socketSemaphore = CreateSemaphore(NULL, 0, 1, NULL);
|
context->socketSemaphore = CreateSemaphore(NULL, 0, 1, NULL);
|
||||||
context->socketThread = CreateThread(NULL, 0, wf_peer_socket_listener, client, 0, NULL);
|
context->socketThread = CreateThread(NULL, 0, wf_peer_socket_listener, client, 0, NULL);
|
||||||
|
|
||||||
printf("We've got a client %s\n", client->local ? "(local)" : client->hostname);
|
printf("We've got a client %s\n", client->local ? "(local)" : client->hostname);
|
||||||
|
|
||||||
|
printf("Setting Handles\n");
|
||||||
|
|
||||||
nCount = 0;
|
nCount = 0;
|
||||||
handles[nCount++] = context->updateEvent;
|
handles[nCount++] = context->updateEvent;
|
||||||
handles[nCount++] = context->socketEvent;
|
handles[nCount++] = context->socketEvent;
|
||||||
|
@ -233,6 +239,12 @@ DWORD WINAPI wf_peer_main_loop(LPVOID lpParam)
|
||||||
{
|
{
|
||||||
status = WaitForMultipleObjects(nCount, handles, FALSE, INFINITE);
|
status = WaitForMultipleObjects(nCount, handles, FALSE, INFINITE);
|
||||||
|
|
||||||
|
if ((status == WAIT_FAILED) || (status == WAIT_TIMEOUT))
|
||||||
|
{
|
||||||
|
printf("WaitForMultipleObjects failed\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (WaitForSingleObject(context->updateEvent, 0) == 0)
|
if (WaitForSingleObject(context->updateEvent, 0) == 0)
|
||||||
{
|
{
|
||||||
if (client->activated)
|
if (client->activated)
|
||||||
|
|
Loading…
Reference in New Issue