Replaced fprintf with DEBUG_WARN

This commit is contained in:
Armin Novak 2014-08-11 09:19:47 +02:00
parent bcb5f90ee6
commit 8d8719e101
18 changed files with 102 additions and 94 deletions

View File

@ -43,7 +43,7 @@ int mf_info_lock(mfInfo* mfi)
break;
default:
printf("mf_info_lock failed with %#X\n", status);
DEBUG_MSG("mf_info_lock failed with %#X\n", status);
return -1;
break;
}
@ -65,7 +65,7 @@ int mf_info_try_lock(mfInfo* mfi, UINT32 ms)
break;
default:
printf("mf_info_try_lock failed with %#X\n", status);
DEBUG_MSG("mf_info_try_lock failed with %#X\n", status);
return -1;
break;
}
@ -82,7 +82,7 @@ int mf_info_unlock(mfInfo* mfi)
break;
default:
printf("mf_info_unlock failed with %#X\n", status);
DEBUG_MSG("mf_info_unlock failed with %#X\n", status);
return -1;
break;
}
@ -110,7 +110,7 @@ mfInfo* mf_info_init()
if (mutexInitStatus != 0)
{
printf(_T("CreateMutex error: %#X\n"), mutexInitStatus);
DEBUG_MSG(_T("CreateMutex error: %#X\n"), mutexInitStatus);
}
mfi->peers = (freerdp_peer**) malloc(sizeof(freerdp_peer*) * MF_INFO_MAXPEERS);
@ -163,7 +163,7 @@ void mf_info_peer_register(mfInfo* mfi, mfPeerContext* context)
int peerId;
if (mfi->peerCount == MF_INFO_MAXPEERS)
{
printf("TODO: socketClose on OS X\n");
DEBUG_MSG("TODO: socketClose on OS X\n");
//context->socketClose = TRUE;
mf_info_unlock(mfi);
return;

View File

@ -86,7 +86,7 @@ void (^streamHandler)(CGDisplayStreamFrameStatus, uint64_t, IOSurfaceRef, CGDisp
switch(status)
{
case kCGDisplayStreamFrameStatusFrameIdle:
printf("kCGDisplayStreamFrameStatusFrameIdle\n");
DEBUG_MSG("kCGDisplayStreamFrameStatusFrameIdle\n");
break;
case kCGDisplayStreamFrameStatusStopped:
@ -95,11 +95,11 @@ void (^streamHandler)(CGDisplayStreamFrameStatus, uint64_t, IOSurfaceRef, CGDisp
break;
case kCGDisplayStreamFrameStatusFrameBlank:
printf("kCGDisplayStreamFrameStatusFrameBlank\n");
DEBUG_MSG("kCGDisplayStreamFrameStatusFrameBlank\n");
break;
default:
printf("Unhandled Frame Status!!!\n");
DEBUG_MSG("Unhandled Frame Status!!!\n");
}
}
@ -193,7 +193,7 @@ int mf_mlion_start_getting_screen_updates()
err = CGDisplayStreamStart(stream);
if(err != kCGErrorSuccess)
{
printf("Failed to start displaystream!! err = %d\n", err);
DEBUG_MSG("Failed to start displaystream!! err = %d\n", err);
return 1;
}
@ -207,7 +207,7 @@ int mf_mlion_stop_getting_screen_updates()
err = CGDisplayStreamStop(stream);
if(err != kCGErrorSuccess)
{
printf("Failed to stop displaystream!! err = %d\n", err);
DEBUG_MSG("Failed to stop displaystream!! err = %d\n", err);
return 1;
}

View File

@ -44,7 +44,7 @@ static void mf_peer_rdpsnd_activated(RdpsndServerContext* context)
//we should actually loop through the list of client formats here
//and see if we can send the client something that it supports...
printf("Client supports the following %d formats: \n", context->num_client_formats);
DEBUG_MSG("Client supports the following %d formats: \n", context->num_client_formats);
for (i = 0; i < context->num_client_formats; i++)
{
@ -55,7 +55,7 @@ static void mf_peer_rdpsnd_activated(RdpsndServerContext* context)
(context->client_formats[i].nChannels == context->server_formats[j].nChannels) &&
(context->client_formats[i].nSamplesPerSec == context->server_formats[j].nSamplesPerSec))
{
printf("agreed on format!\n");
DEBUG_MSG("agreed on format!\n");
formatAgreed = TRUE;
agreedFormat = (AUDIO_FORMAT*)&context->server_formats[j];
break;
@ -68,7 +68,7 @@ static void mf_peer_rdpsnd_activated(RdpsndServerContext* context)
if (formatAgreed == FALSE)
{
printf("Could not agree on a audio format with the server\n");
DEBUG_MSG("Could not agree on a audio format with the server\n");
return;
}
@ -111,7 +111,7 @@ static void mf_peer_rdpsnd_activated(RdpsndServerContext* context)
if (status != noErr)
{
printf("Failed to create a new Audio Queue. Status code: %d\n", status);
DEBUG_MSG("Failed to create a new Audio Queue. Status code: %d\n", status);
}
@ -208,7 +208,7 @@ void mf_peer_rdpsnd_input_callback (void *inUserD
if (status != noErr)
{
printf("AudioQueueEnqueueBuffer() returned status = %d\n", status);
DEBUG_MSG("AudioQueueEnqueueBuffer() returned status = %d\n", status);
}
}

View File

@ -21,6 +21,8 @@
#include "config.h"
#endif
#include <freerdp/utils/debug.h>
#include "sfreerdp.h"
#include "sf_audin.h"
@ -33,19 +35,19 @@ static const AUDIO_FORMAT test_audio_formats[] =
static void sf_peer_audin_opening(audin_server_context* context)
{
printf("AUDIN opening.\n");
DEBUG_MSG("AUDIN opening.\n");
/* Simply choose the first format supported by the client. */
context->SelectFormat(context, 0);
}
static void sf_peer_audin_open_result(audin_server_context* context, UINT32 result)
{
printf("AUDIN open result %d.\n", result);
DEBUG_MSG("AUDIN open result %d.\n", result);
}
static void sf_peer_audin_receive_samples(audin_server_context* context, const void* buf, int nframes)
{
printf("AUDIN receive %d frames.\n", nframes);
DEBUG_MSG("AUDIN receive %d frames.\n", nframes);
}
void sf_peer_audin_init(testPeerContext* context)

View File

@ -22,6 +22,7 @@
#endif
#include <freerdp/server/audin.h>
#include <freerdp/utils/debug.h>
#include "sf_rdpsnd.h"
@ -33,7 +34,7 @@ static const AUDIO_FORMAT test_audio_formats[] =
static void sf_peer_rdpsnd_activated(RdpsndServerContext* context)
{
printf("RDPSND Activated\n");
DEBUG_MSG("RDPSND Activated\n");
}
BOOL sf_peer_rdpsnd_init(testPeerContext* context)

View File

@ -33,6 +33,7 @@
#include <freerdp/channels/wtsvc.h>
#include <freerdp/channels/channels.h>
#include <freerdp/utils/debug.h>
#include <freerdp/constants.h>
#include <freerdp/utils/tcp.h>
@ -341,7 +342,7 @@ static BOOL test_sleep_tsdiff(UINT32 *old_sec, UINT32 *old_usec, UINT32 new_sec,
if ((sec < 0) || ((sec == 0) && (usec < 0)))
{
printf("Invalid time stamp detected.\n");
DEBUG_MSG("Invalid time stamp detected.\n");
return FALSE;
}
@ -451,7 +452,7 @@ static void* tf_debug_channel_thread_func(void* arg)
Stream_SetPosition(s, BytesReturned);
printf("got %lu bytes\n", BytesReturned);
DEBUG_MSG("got %lu bytes\n", BytesReturned);
}
Stream_Free(s, TRUE);
@ -470,30 +471,30 @@ BOOL tf_peer_post_connect(freerdp_peer* client)
* callback returns.
*/
printf("Client %s is activated (osMajorType %d osMinorType %d)", client->local ? "(local)" : client->hostname,
DEBUG_MSG("Client %s is activated (osMajorType %d osMinorType %d)", client->local ? "(local)" : client->hostname,
client->settings->OsMajorType, client->settings->OsMinorType);
if (client->settings->AutoLogonEnabled)
{
printf(" and wants to login automatically as %s\\%s",
DEBUG_MSG(" and wants to login automatically as %s\\%s",
client->settings->Domain ? client->settings->Domain : "",
client->settings->Username);
/* A real server may perform OS login here if NLA is not executed previously. */
}
printf("\n");
DEBUG_MSG("\n");
printf("Client requested desktop: %dx%dx%d\n",
DEBUG_MSG("Client requested desktop: %dx%dx%d\n",
client->settings->DesktopWidth, client->settings->DesktopHeight, client->settings->ColorDepth);
#if (SAMPLE_SERVER_USE_CLIENT_RESOLUTION == 1)
context->rfx_context->width = client->settings->DesktopWidth;
context->rfx_context->height = client->settings->DesktopHeight;
printf("Using resolution requested by client.\n");
DEBUG_MSG("Using resolution requested by client.\n");
#else
client->settings->DesktopWidth = context->rfx_context->width;
client->settings->DesktopHeight = context->rfx_context->height;
printf("Resizing client to %dx%d\n", client->settings->DesktopWidth, client->settings->DesktopHeight);
DEBUG_MSG("Resizing client to %dx%d\n", client->settings->DesktopWidth, client->settings->DesktopHeight);
client->update->DesktopResize(client->update->context);
#endif
@ -506,7 +507,7 @@ BOOL tf_peer_post_connect(freerdp_peer* client)
if (context->debug_channel != NULL)
{
printf("Open channel rdpdbg.\n");
DEBUG_MSG("Open channel rdpdbg.\n");
context->stopEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
@ -561,7 +562,7 @@ BOOL tf_peer_activate(freerdp_peer* client)
void tf_peer_synchronize_event(rdpInput* input, UINT32 flags)
{
printf("Client sent a synchronize event (flags:0x%X)\n", flags);
DEBUG_MSG("Client sent a synchronize event (flags:0x%X)\n", flags);
}
void tf_peer_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
@ -570,7 +571,7 @@ void tf_peer_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
rdpUpdate* update = client->update;
testPeerContext* context = (testPeerContext*) input->context;
printf("Client sent a keyboard event (flags:0x%X code:0x%X)\n", flags, code);
DEBUG_MSG("Client sent a keyboard event (flags:0x%X code:0x%X)\n", flags, code);
if ((flags & 0x4000) && code == 0x22) /* 'g' key */
{
@ -622,7 +623,7 @@ void tf_peer_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
void tf_peer_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
{
printf("Client sent a unicode keyboard event (flags:0x%X code:0x%X)\n", flags, code);
DEBUG_MSG("Client sent a unicode keyboard event (flags:0x%X code:0x%X)\n", flags, code);
}
void tf_peer_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
@ -641,11 +642,11 @@ static void tf_peer_refresh_rect(rdpContext* context, BYTE count, RECTANGLE_16*
{
BYTE i;
printf("Client requested to refresh:\n");
DEBUG_MSG("Client requested to refresh:\n");
for (i = 0; i < count; i++)
{
printf(" (%d, %d) (%d, %d)\n", areas[i].left, areas[i].top, areas[i].right, areas[i].bottom);
DEBUG_MSG(" (%d, %d) (%d, %d)\n", areas[i].left, areas[i].top, areas[i].right, areas[i].bottom);
}
}
@ -653,11 +654,11 @@ static void tf_peer_suppress_output(rdpContext* context, BYTE allow, RECTANGLE_1
{
if (allow > 0)
{
printf("Client restore output (%d, %d) (%d, %d).\n", area->left, area->top, area->right, area->bottom);
DEBUG_MSG("Client restore output (%d, %d) (%d, %d).\n", area->left, area->top, area->right, area->bottom);
}
else
{
printf("Client minimized and suppress output.\n");
DEBUG_MSG("Client minimized and suppress output.\n");
}
}
@ -700,7 +701,7 @@ static void* test_peer_mainloop(void* arg)
client->Initialize(client);
context = (testPeerContext*) client->context;
printf("We've got a client %s\n", client->local ? "(local)" : client->hostname);
DEBUG_MSG("We've got a client %s\n", client->local ? "(local)" : client->hostname);
while (1)
{
@ -709,7 +710,7 @@ static void* test_peer_mainloop(void* arg)
memset(rfds, 0, sizeof(rfds));
if (client->GetFileDescriptor(client, rfds, &rcount) != TRUE)
{
printf("Failed to get FreeRDP file descriptor\n");
DEBUG_MSG("Failed to get FreeRDP file descriptor\n");
break;
}
@ -743,7 +744,7 @@ static void* test_peer_mainloop(void* arg)
(wsa_error == WSAEINPROGRESS) ||
(wsa_error == WSAEINTR)))
{
printf("select failed (WSAGetLastError: %d)\n", wsa_error);
DEBUG_MSG("select failed (WSAGetLastError: %d)\n", wsa_error);
break;
}
#else
@ -753,7 +754,7 @@ static void* test_peer_mainloop(void* arg)
(errno == EINPROGRESS) ||
(errno == EINTR))) /* signal occurred */
{
printf("select failed (errno: %d)\n", errno);
DEBUG_MSG("select failed (errno: %d)\n", errno);
break;
}
#endif
@ -766,7 +767,7 @@ static void* test_peer_mainloop(void* arg)
break;
}
printf("Client %s disconnected.\n", client->local ? "(local)" : client->hostname);
DEBUG_MSG("Client %s disconnected.\n", client->local ? "(local)" : client->hostname);
client->Disconnect(client);
freerdp_peer_context_free(client);
@ -799,7 +800,7 @@ static void test_server_mainloop(freerdp_listener* instance)
memset(rfds, 0, sizeof(rfds));
if (instance->GetFileDescriptor(instance, rfds, &rcount) != TRUE)
{
printf("Failed to get FreeRDP file descriptor\n");
DEBUG_MSG("Failed to get FreeRDP file descriptor\n");
break;
}
@ -827,14 +828,14 @@ static void test_server_mainloop(freerdp_listener* instance)
(errno == EINPROGRESS) ||
(errno == EINTR))) /* signal occurred */
{
printf("select failed\n");
DEBUG_MSG("select failed\n");
break;
}
}
if (instance->CheckFileDescriptor(instance) != TRUE)
{
printf("Failed to check FreeRDP file descriptor\n");
DEBUG_MSG("Failed to check FreeRDP file descriptor\n");
break;
}
}

View File

@ -36,7 +36,7 @@ int IDcount = 0;
BOOL CALLBACK moncb(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
{
printf("%d\t(%d, %d), (%d, %d)\n",
DEBUG_MSG("%d\t(%d, %d), (%d, %d)\n",
IDcount, lprcMonitor->left, lprcMonitor->top,
lprcMonitor->right, lprcMonitor->bottom);
@ -93,10 +93,10 @@ int main(int argc, char* argv[])
vscreen_w = GetSystemMetrics(SM_CXVIRTUALSCREEN);
vscreen_h = GetSystemMetrics(SM_CYVIRTUALSCREEN);
printf("\n");
DEBUG_MSG("\n");
EnumDisplayMonitors(NULL, NULL, moncb, 0);
IDcount = 0;
printf("\nVirtual Screen = %dx%d\n", vscreen_w, vscreen_h);
DEBUG_MSG("\nVirtual Screen = %dx%d\n", vscreen_w, vscreen_h);
}
return 0;
@ -108,7 +108,7 @@ int main(int argc, char* argv[])
index++;
if (index == argc)
{
printf("missing screen id parameter\n");
DEBUG_MSG("missing screen id parameter\n");
return 0;
}
@ -154,13 +154,13 @@ int main(int argc, char* argv[])
}
}
printf("Starting server\n");
DEBUG_MSG("Starting server\n");
wfreerdp_server_start(server);
WaitForSingleObject(server->thread, INFINITE);
printf("Stopping server\n");
DEBUG_MSG("Stopping server\n");
wfreerdp_server_stop(server);
wfreerdp_server_free(server);

View File

@ -35,7 +35,7 @@ int wf_directsound_activate(RdpsndServerContext* context)
wfi = wf_info_get_instance();
printf("RDPSND (direct sound) Activated\n");
DEBUG_MSG("RDPSND (direct sound) Activated\n");
hr = DirectSoundCaptureCreate8(NULL, &cap, NULL);

View File

@ -52,7 +52,7 @@ int wf_info_lock(wfInfo* wfi)
break;
case WAIT_FAILED:
printf("wf_info_lock failed with 0x%08X\n", GetLastError());
DEBUG_MSG("wf_info_lock failed with 0x%08X\n", GetLastError());
return -1;
break;
}
@ -78,7 +78,7 @@ int wf_info_try_lock(wfInfo* wfi, DWORD dwMilliseconds)
break;
case WAIT_FAILED:
printf("wf_info_try_lock failed with 0x%08X\n", GetLastError());
DEBUG_MSG("wf_info_try_lock failed with 0x%08X\n", GetLastError());
return -1;
break;
}
@ -90,7 +90,7 @@ int wf_info_unlock(wfInfo* wfi)
{
if (ReleaseMutex(wfi->mutex) == 0)
{
printf("wf_info_unlock failed with 0x%08X\n", GetLastError());
DEBUG_MSG("wf_info_unlock failed with 0x%08X\n", GetLastError());
return -1;
}
@ -213,7 +213,7 @@ void wf_info_peer_register(wfInfo* wfi, wfPeerContext* context)
wfi->peers[peerId] = ((rdpContext*) context)->peer;
wfi->peers[peerId]->pId = peerId;
wfi->peerCount++;
printf("Registering Peer: id=%d #=%d\n", peerId, wfi->peerCount);
DEBUG_MSG("Registering Peer: id=%d #=%d\n", peerId, wfi->peerCount);
wf_info_unlock(wfi);
@ -232,7 +232,7 @@ void wf_info_peer_unregister(wfInfo* wfi, wfPeerContext* context)
wfi->peerCount--;
CloseHandle(context->updateEvent);
printf("Unregistering Peer: id=%d, #=%d\n", peerId, wfi->peerCount);
DEBUG_MSG("Unregistering Peer: id=%d, #=%d\n", peerId, wfi->peerCount);
#ifdef WITH_WIN8
if (wfi->peerCount == 0)

View File

@ -102,7 +102,7 @@ DWORD WINAPI wf_server_main_loop(LPVOID lpParam)
if (instance->GetFileDescriptor(instance, rfds, &rcount) != TRUE)
{
printf("Failed to get FreeRDP file descriptor\n");
DEBUG_MSG("Failed to get FreeRDP file descriptor\n");
break;
}
@ -127,12 +127,12 @@ DWORD WINAPI wf_server_main_loop(LPVOID lpParam)
if (instance->CheckFileDescriptor(instance) != TRUE)
{
printf("Failed to check FreeRDP file descriptor\n");
DEBUG_MSG("Failed to check FreeRDP file descriptor\n");
break;
}
}
printf("wf_server_main_loop terminating\n");
DEBUG_MSG("wf_server_main_loop terminating\n");
instance->Close(instance);
@ -164,7 +164,7 @@ BOOL wfreerdp_server_stop(wfServer* server)
wfi = wf_info_get_instance();
printf("Stopping server\n");
DEBUG_MSG("Stopping server\n");
wfi->force_all_disconnect = TRUE;
server->instance->Close(server->instance);
return TRUE;
@ -210,7 +210,7 @@ FREERDP_API BOOL wfreerdp_server_is_running(wfServer* server)
bRet = GetExitCodeThread(server->thread, &tStatus);
if (bRet == 0)
{
printf("Error in call to GetExitCodeThread\n");
DEBUG_MSG("Error in call to GetExitCodeThread\n");
return FALSE;
}
@ -245,7 +245,7 @@ FREERDP_API UINT32 wfreerdp_server_get_peer_hostname(int pId, wchar_t * dstStr)
}
else
{
printf("nonexistent peer id=%d\n", pId);
DEBUG_MSG("nonexistent peer id=%d\n", pId);
return 0;
}
}

View File

@ -92,9 +92,9 @@ BOOL wf_mirror_driver_display_device_attach(wfInfo* wfi, DWORD mode)
if (status != ERROR_SUCCESS)
{
printf("Error opening RegKey: status=%0X\n", status);
DEBUG_MSG("Error opening RegKey: status=%0X\n", status);
if (status == ERROR_ACCESS_DENIED)
printf("access denied. Do you have admin privleges?\n");
DEBUG_MSG("access denied. Do you have admin privleges?\n");
return FALSE;
}
@ -104,9 +104,9 @@ BOOL wf_mirror_driver_display_device_attach(wfInfo* wfi, DWORD mode)
if (status != ERROR_SUCCESS)
{
printf("Error querying RegKey: status=%0X\n", status);
DEBUG_MSG("Error querying RegKey: status=%0X\n", status);
if (status == ERROR_ACCESS_DENIED)
printf("access denied. Do you have admin privleges?\n");
DEBUG_MSG("access denied. Do you have admin privleges?\n");
return FALSE;
}
@ -120,10 +120,10 @@ BOOL wf_mirror_driver_display_device_attach(wfInfo* wfi, DWORD mode)
if (status != ERROR_SUCCESS)
{
printf("Error writing registry key: %d ", status);
DEBUG_MSG("Error writing registry key: %d ", status);
if (status == ERROR_ACCESS_DENIED)
printf("access denied. Do you have admin privleges?");
printf("\n");
DEBUG_MSG("access denied. Do you have admin privleges?");
DEBUG_MSG("\n");
return FALSE;
}
}
@ -199,7 +199,7 @@ BOOL wf_mirror_driver_update(wfInfo* wfi, int mode)
if ( (mode != MIRROR_LOAD) && (mode != MIRROR_UNLOAD) )
{
printf("Invalid mirror mode!\n");
DEBUG_MSG("Invalid mirror mode!\n");
return FALSE;
}
@ -321,29 +321,29 @@ BOOL wf_mirror_driver_activate(wfInfo* wfi)
{
if (!wfi->mirrorDriverActive)
{
printf("Activating Mirror Driver\n");
DEBUG_MSG("Activating Mirror Driver\n");
if (wf_mirror_driver_find_display_device(wfi) == FALSE)
{
printf("Could not find dfmirage mirror driver! Is it installed?\n");
DEBUG_MSG("Could not find dfmirage mirror driver! Is it installed?\n");
return FALSE;
}
if (wf_mirror_driver_display_device_attach(wfi, 1) == FALSE)
{
printf("Could not attach display device!\n");
DEBUG_MSG("Could not attach display device!\n");
return FALSE;
}
if (wf_mirror_driver_update(wfi, MIRROR_LOAD) == FALSE)
{
printf("could not update system with new display settings!\n");
DEBUG_MSG("could not update system with new display settings!\n");
return FALSE;
}
if (wf_mirror_driver_map_memory(wfi) == FALSE)
{
printf("Unable to map memory for mirror driver!\n");
DEBUG_MSG("Unable to map memory for mirror driver!\n");
return FALSE;
}
wfi->mirrorDriverActive = TRUE;
@ -356,7 +356,7 @@ void wf_mirror_driver_deactivate(wfInfo* wfi)
{
if (wfi->mirrorDriverActive)
{
printf("Deactivating Mirror Driver\n");
DEBUG_MSG("Deactivating Mirror Driver\n");
wf_mirror_driver_cleanup(wfi);
wf_mirror_driver_display_device_attach(wfi, 0);

View File

@ -92,7 +92,7 @@ BOOL wf_peer_post_connect(freerdp_peer* client)
if ((settings->DesktopWidth != wfi->servscreen_width) || (settings->DesktopHeight != wfi->servscreen_height))
{
/*
printf("Client requested resolution %dx%d, but will resize to %dx%d\n",
DEBUG_MSG("Client requested resolution %dx%d, but will resize to %dx%d\n",
settings->DesktopWidth, settings->DesktopHeight, wfi->servscreen_width, wfi->servscreen_height);
*/
@ -256,7 +256,7 @@ DWORD WINAPI wf_peer_main_loop(LPVOID lpParam)
if (wfi->input_disabled)
{
printf("client input is disabled\n");
DEBUG_MSG("client input is disabled\n");
client->input->KeyboardEvent = wf_peer_keyboard_event_dummy;
client->input->UnicodeKeyboardEvent = wf_peer_unicode_keyboard_event_dummy;
client->input->MouseEvent = wf_peer_mouse_event_dummy;
@ -268,7 +268,7 @@ DWORD WINAPI wf_peer_main_loop(LPVOID lpParam)
context->socketSemaphore = CreateSemaphore(NULL, 0, 1, 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);
DEBUG_MSG("We've got a client %s\n", client->local ? "(local)" : client->hostname);
nCount = 0;
handles[nCount++] = context->updateEvent;
@ -280,7 +280,7 @@ DWORD WINAPI wf_peer_main_loop(LPVOID lpParam)
if ((status == WAIT_FAILED) || (status == WAIT_TIMEOUT))
{
printf("WaitForMultipleObjects failed\n");
DEBUG_MSG("WaitForMultipleObjects failed\n");
break;
}
@ -311,7 +311,7 @@ DWORD WINAPI wf_peer_main_loop(LPVOID lpParam)
//force disconnect
if (wfi->force_all_disconnect == TRUE)
{
printf("Forcing Disconnect -> ");
DEBUG_MSG("Forcing Disconnect -> ");
break;
}
@ -320,7 +320,7 @@ DWORD WINAPI wf_peer_main_loop(LPVOID lpParam)
break;
}
printf("Client %s disconnected.\n", client->local ? "(local)" : client->hostname);
DEBUG_MSG("Client %s disconnected.\n", client->local ? "(local)" : client->hostname);
if (WaitForSingleObject(context->updateEvent, 0) == 0)
{

View File

@ -54,7 +54,7 @@ static void wf_peer_rdpsnd_activated(RdpsndServerContext* context)
wfi = wf_info_get_instance();
wfi->agreed_format = NULL;
printf("Client supports the following %d formats: \n", context->num_client_formats);
DEBUG_MSG("Client supports the following %d formats: \n", context->num_client_formats);
for(i = 0; i < context->num_client_formats; i++)
{
//TODO: improve the way we agree on a format
@ -64,7 +64,7 @@ static void wf_peer_rdpsnd_activated(RdpsndServerContext* context)
(context->client_formats[i].nChannels == context->server_formats[j].nChannels) &&
(context->client_formats[i].nSamplesPerSec == context->server_formats[j].nSamplesPerSec))
{
printf("agreed on format!\n");
DEBUG_MSG("agreed on format!\n");
wfi->agreed_format = (AUDIO_FORMAT*) &context->server_formats[j];
break;
}
@ -76,7 +76,7 @@ static void wf_peer_rdpsnd_activated(RdpsndServerContext* context)
if (wfi->agreed_format == NULL)
{
printf("Could not agree on a audio format with the server\n");
DEBUG_MSG("Could not agree on a audio format with the server\n");
return;
}
@ -116,7 +116,7 @@ int wf_rdpsnd_lock()
break;
case WAIT_FAILED:
printf("wf_rdpsnd_lock failed with 0x%08X\n", GetLastError());
DEBUG_MSG("wf_rdpsnd_lock failed with 0x%08X\n", GetLastError());
return -1;
break;
}
@ -132,7 +132,7 @@ int wf_rdpsnd_unlock()
if (ReleaseMutex(wfi->snd_mutex) == 0)
{
printf("wf_rdpsnd_unlock failed with 0x%08X\n", GetLastError());
DEBUG_MSG("wf_rdpsnd_unlock failed with 0x%08X\n", GetLastError());
return -1;
}

View File

@ -176,7 +176,7 @@ void wf_update_peer_send(wfInfo* wfi, wfPeerContext* context)
/* This is an unexpected error condition */
printf("Unexpected Frame Index: Actual: %d Expected: %d\n",
DEBUG_MSG("Unexpected Frame Index: Actual: %d Expected: %d\n",
wfi->frame_idx, context->frame_idx + 1);
}
@ -189,7 +189,7 @@ void wf_update_encoder_reset(wfInfo* wfi)
{
if (wf_info_lock(wfi) > 0)
{
printf("Resetting encoder\n");
DEBUG_MSG("Resetting encoder\n");
if (wfi->rfx_context)
{
@ -226,7 +226,7 @@ void wf_update_peer_activate(wfInfo* wfi, wfPeerContext* context)
wf_update_encoder_reset(wfi);
wfi->activePeerCount++;
printf("Activating Peer Updates: %d\n", wfi->activePeerCount);
DEBUG_MSG("Activating Peer Updates: %d\n", wfi->activePeerCount);
wf_info_unlock(wfi);
}
@ -248,7 +248,7 @@ void wf_update_peer_deactivate(wfInfo* wfi, wfPeerContext* context)
client->activated = FALSE;
wfi->activePeerCount--;
printf("Deactivating Peer Updates: %d\n", wfi->activePeerCount);
DEBUG_MSG("Deactivating Peer Updates: %d\n", wfi->activePeerCount);
}
wf_info_unlock(wfi);

View File

@ -45,7 +45,7 @@ int wf_wasapi_activate(RdpsndServerContext* context)
return 1;
}
printf("RDPSND (WASAPI) Activated\n");
DEBUG_MSG("RDPSND (WASAPI) Activated\n");
CreateThread(NULL, 0, wf_rdpsnd_wasapi_thread, latestPeer, 0, NULL);

View File

@ -21,6 +21,8 @@
#include "config.h"
#endif
#include <freerdp/utils/debug.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>

View File

@ -22,6 +22,7 @@
#endif
#include <winpr/crt.h>
#include <freerdp/utils/debug.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@ -47,7 +48,7 @@ int xf_list_monitors(xfInfo* xfi)
for (i = 0; i < nmonitors; i++)
{
printf(" %s [%d] %dx%d\t+%d+%d\n",
DEBUG_MSG(" %s [%d] %dx%d\t+%d+%d\n",
(i == 0) ? "*" : " ", i,
screen[i].width, screen[i].height,
screen[i].x_org, screen[i].y_org);
@ -60,7 +61,7 @@ int xf_list_monitors(xfInfo* xfi)
Screen* screen;
screen = ScreenOfDisplay(xfi->display, DefaultScreen(xfi->display));
printf(" * [0] %dx%d\t+%d+%d\n", WidthOfScreen(screen), HeightOfScreen(screen), 0, 0);
DEBUG_MSG(" * [0] %dx%d\t+%d+%d\n", WidthOfScreen(screen), HeightOfScreen(screen), 0, 0);
#endif
return 0;

View File

@ -42,6 +42,7 @@
#include <freerdp/freerdp.h>
#include <freerdp/codec/color.h>
#include <freerdp/locale/keyboard.h>
#include <freerdp/utils/debug.h>
#include "xf_input.h"
#include "xf_cursor.h"
@ -288,7 +289,7 @@ xfInfo* xf_info_init()
}
if (xfi->use_xshm)
printf("Using X Shared Memory Extension (XShm)\n");
DEBUG_MSG("Using X Shared Memory Extension (XShm)\n");
#ifdef WITH_XDAMAGE
xf_xdamage_init(xfi);