Merge branch 'master' of github.com:awakecoding/FreeRDP into shadow
Conflicts: channels/encomsp/client/encomsp_main.c libfreerdp/core/tcp.c libfreerdp/crypto/certificate.c server/Windows/CMakeLists.txt server/X11/xf_cursor.c server/X11/xf_input.c server/X11/xf_interface.c server/X11/xf_monitors.c server/X11/xf_peer.c
This commit is contained in:
commit
e4a4aa4d3a
@ -72,7 +72,7 @@ static BOOL audin_alsa_set_params(AudinALSADevice* alsa, snd_pcm_t* capture_hand
|
||||
|
||||
if ((error = snd_pcm_hw_params_malloc(&hw_params)) < 0)
|
||||
{
|
||||
DEBUG_WARN("snd_pcm_hw_params_malloc (%s)",
|
||||
CLOG_ERR("snd_pcm_hw_params_malloc (%s)",
|
||||
snd_strerror(error));
|
||||
return FALSE;
|
||||
}
|
||||
@ -206,7 +206,7 @@ static void* audin_alsa_thread_func(void* arg)
|
||||
{
|
||||
if ((error = snd_pcm_open(&capture_handle, alsa->device_name, SND_PCM_STREAM_CAPTURE, 0)) < 0)
|
||||
{
|
||||
DEBUG_WARN("snd_pcm_open (%s)", snd_strerror(error));
|
||||
CLOG_ERR("snd_pcm_open (%s)", snd_strerror(error));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -226,7 +226,7 @@ static void* audin_alsa_thread_func(void* arg)
|
||||
}
|
||||
else if (error < 0)
|
||||
{
|
||||
DEBUG_WARN("snd_pcm_readi (%s)", snd_strerror(error));
|
||||
CLOG_ERR("snd_pcm_readi (%s)", snd_strerror(error));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ static int audin_process_formats(IWTSVirtualChannelCallback* pChannelCallback, w
|
||||
DEBUG_DVC("NumFormats %d", NumFormats);
|
||||
if ((NumFormats < 1) || (NumFormats > 1000))
|
||||
{
|
||||
DEBUG_WARN("bad NumFormats %d", NumFormats);
|
||||
CLOG_ERR("bad NumFormats %d", NumFormats);
|
||||
return 1;
|
||||
}
|
||||
Stream_Seek_UINT32(s); /* cbSizeFormatsPacket */
|
||||
@ -262,7 +262,7 @@ static int audin_process_open(IWTSVirtualChannelCallback* pChannelCallback, wStr
|
||||
|
||||
if (initialFormat >= (UINT32) callback->formats_count)
|
||||
{
|
||||
DEBUG_WARN("invalid format index %d (total %d)",
|
||||
CLOG_ERR("invalid format index %d (total %d)",
|
||||
initialFormat, callback->formats_count);
|
||||
return 1;
|
||||
}
|
||||
@ -293,7 +293,7 @@ static int audin_process_format_change(IWTSVirtualChannelCallback* pChannelCallb
|
||||
|
||||
if (NewFormat >= (UINT32) callback->formats_count)
|
||||
{
|
||||
DEBUG_WARN("invalid format index %d (total %d)",
|
||||
CLOG_ERR("invalid format index %d (total %d)",
|
||||
NewFormat, callback->formats_count);
|
||||
return 1;
|
||||
}
|
||||
@ -340,7 +340,7 @@ static int audin_on_data_received(IWTSVirtualChannelCallback* pChannelCallback,
|
||||
break;
|
||||
|
||||
default:
|
||||
DEBUG_WARN("unknown MessageId=0x%x", MessageId);
|
||||
CLOG_ERR("unknown MessageId=0x%x", MessageId);
|
||||
error = 1;
|
||||
break;
|
||||
}
|
||||
@ -429,7 +429,7 @@ static void audin_register_device_plugin(IWTSPlugin* pPlugin, IAudinDevice* devi
|
||||
|
||||
if (audin->device)
|
||||
{
|
||||
DEBUG_WARN("existing device, abort.");
|
||||
CLOG_ERR("existing device, abort.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -454,7 +454,7 @@ static BOOL audin_load_device_plugin(IWTSPlugin* pPlugin, const char* name, ADDI
|
||||
|
||||
if (entry(&entryPoints) != 0)
|
||||
{
|
||||
DEBUG_WARN("%s entry returns error.", name);
|
||||
CLOG_ERR("%s entry returns error.", name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -613,7 +613,7 @@ int DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints)
|
||||
|
||||
if (audin->device == NULL)
|
||||
{
|
||||
DEBUG_WARN("no sound device.");
|
||||
CLOG_ERR("no sound device.");
|
||||
}
|
||||
|
||||
return error;
|
||||
|
@ -27,13 +27,13 @@
|
||||
#include <freerdp/dvc.h>
|
||||
#include <freerdp/types.h>
|
||||
#include <freerdp/addin.h>
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/channels/log.h>
|
||||
#include <freerdp/client/audin.h>
|
||||
|
||||
#ifdef WITH_DEBUG_DVC
|
||||
#define DEBUG_DVC(fmt, ...) DEBUG_CLASS(DVC, fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_DVC(fmt, ...) CLOG_CLASS(DVC, fmt, ## __VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG_DVC(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_DVC(fmt, ...) CLOG_NULL(fmt, ## __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#endif /* FREERDP_AUDIN_CLIENT_MAIN_H */
|
||||
|
@ -96,7 +96,7 @@ static void* audin_opensles_thread_func(void* arg)
|
||||
int rc = android_RecIn(opensles->stream, buffer.s, raw_size);
|
||||
if (rc < 0)
|
||||
{
|
||||
DEBUG_WARN("android_RecIn %d", rc);
|
||||
CLOG_ERR("android_RecIn %d", rc);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -250,7 +250,7 @@ static void audin_opensles_set_format(IAudinDevice* device,
|
||||
break;
|
||||
|
||||
default:
|
||||
DEBUG_WARN("Encoding '%d' [%08X] not supported",
|
||||
CLOG_ERR("Encoding '%d' [%08X] not supported",
|
||||
(format->wFormatTag),
|
||||
format->wFormatTag);
|
||||
return;
|
||||
@ -309,7 +309,7 @@ static void audin_opensles_close(IAudinDevice* device)
|
||||
* ignore duplicate requests. */
|
||||
if (!opensles->stopEvent)
|
||||
{
|
||||
DEBUG_WARN("[ERROR] function called without matching open.");
|
||||
CLOG_ERR("[ERROR] function called without matching open.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -362,7 +362,7 @@ int android_RecIn(OPENSL_STREAM *p,short *buffer,int size)
|
||||
e = Queue_Dequeue(p->queue);
|
||||
if (!e)
|
||||
{
|
||||
DEBUG_WARN("[ERROR] got e=%p from queue", e);
|
||||
CLOG_ERR("[ERROR] got e=%p from queue", e);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ static BOOL audin_pulse_connect(IAudinDevice* device)
|
||||
|
||||
if (pa_context_connect(pulse->context, NULL, 0, NULL))
|
||||
{
|
||||
DEBUG_WARN("pa_context_connect failed (%d)",
|
||||
CLOG_ERR("pa_context_connect failed (%d)",
|
||||
pa_context_errno(pulse->context));
|
||||
return FALSE;
|
||||
}
|
||||
@ -102,7 +102,7 @@ static BOOL audin_pulse_connect(IAudinDevice* device)
|
||||
if (pa_threaded_mainloop_start(pulse->mainloop) < 0)
|
||||
{
|
||||
pa_threaded_mainloop_unlock(pulse->mainloop);
|
||||
DEBUG_WARN("pa_threaded_mainloop_start failed (%d)",
|
||||
CLOG_ERR("pa_threaded_mainloop_start failed (%d)",
|
||||
pa_context_errno(pulse->context));
|
||||
return FALSE;
|
||||
}
|
||||
@ -113,7 +113,7 @@ static BOOL audin_pulse_connect(IAudinDevice* device)
|
||||
break;
|
||||
if (!PA_CONTEXT_IS_GOOD(state))
|
||||
{
|
||||
DEBUG_WARN("bad context state (%d)",
|
||||
CLOG_ERR("bad context state (%d)",
|
||||
pa_context_errno(pulse->context));
|
||||
break;
|
||||
}
|
||||
@ -297,7 +297,7 @@ static void audin_pulse_stream_request_callback(pa_stream* stream, size_t length
|
||||
*/
|
||||
if (pulse->buffer == NULL)
|
||||
{
|
||||
/* fprintf(stderr, "%s: ignoring input, pulse buffer not ready.\n", __func__); */
|
||||
/* CLOG_ERR( "%s: ignoring input, pulse buffer not ready.\n", __func__); */
|
||||
return;
|
||||
}
|
||||
|
||||
@ -415,7 +415,7 @@ static void audin_pulse_open(IAudinDevice* device, AudinReceive receive, void* u
|
||||
&buffer_attr, PA_STREAM_ADJUST_LATENCY) < 0)
|
||||
{
|
||||
pa_threaded_mainloop_unlock(pulse->mainloop);
|
||||
DEBUG_WARN("pa_stream_connect_playback failed (%d)",
|
||||
CLOG_ERR("pa_stream_connect_playback failed (%d)",
|
||||
pa_context_errno(pulse->context));
|
||||
return;
|
||||
}
|
||||
@ -427,7 +427,7 @@ static void audin_pulse_open(IAudinDevice* device, AudinReceive receive, void* u
|
||||
break;
|
||||
if (!PA_STREAM_IS_GOOD(state))
|
||||
{
|
||||
DEBUG_WARN("bad stream state (%d)",
|
||||
CLOG_ERR("bad stream state (%d)",
|
||||
pa_context_errno(pulse->context));
|
||||
break;
|
||||
}
|
||||
@ -512,7 +512,7 @@ int freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEnt
|
||||
|
||||
if (!pulse->mainloop)
|
||||
{
|
||||
DEBUG_WARN("pa_threaded_mainloop_new failed");
|
||||
CLOG_ERR("pa_threaded_mainloop_new failed");
|
||||
audin_pulse_free((IAudinDevice*) pulse);
|
||||
return 1;
|
||||
}
|
||||
@ -521,7 +521,7 @@ int freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEnt
|
||||
|
||||
if (!pulse->context)
|
||||
{
|
||||
DEBUG_WARN("pa_context_new failed");
|
||||
CLOG_ERR("pa_context_new failed");
|
||||
audin_pulse_free((IAudinDevice*) pulse);
|
||||
return 1;
|
||||
}
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include <freerdp/codec/audio.h>
|
||||
#include <freerdp/channels/wtsvc.h>
|
||||
#include <freerdp/server/audin.h>
|
||||
#include <freerdp/channels/log.h>
|
||||
|
||||
#define MSG_SNDIN_VERSION 0x01
|
||||
#define MSG_SNDIN_FORMATS 0x02
|
||||
@ -385,7 +386,7 @@ static void* audin_server_thread_func(void* arg)
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "audin_server_thread_func: unknown MessageId %d\n", MessageId);
|
||||
CLOG_ERR( "audin_server_thread_func: unknown MessageId %d\n", MessageId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ void cliprdr_process_short_format_names(cliprdrPlugin* cliprdr, wStream* s, UINT
|
||||
}
|
||||
|
||||
if (num_formats * 36 != length)
|
||||
DEBUG_WARN("dataLen %d not divided by 36!", length);
|
||||
CLOG_ERR("dataLen %d not divided by 36!", length);
|
||||
|
||||
ascii = (flags & CB_ASCII_NAMES) ? TRUE : FALSE;
|
||||
|
||||
|
@ -87,7 +87,7 @@ void cliprdr_packet_send(cliprdrPlugin* cliprdr, wStream* s)
|
||||
Stream_SetPosition(s, pos);
|
||||
|
||||
#ifdef WITH_DEBUG_CLIPRDR
|
||||
printf("Cliprdr Sending (%d bytes)\n", dataLen + 8);
|
||||
CLOG_DBG("Cliprdr Sending (%d bytes)\n", dataLen + 8);
|
||||
winpr_HexDump(Stream_Buffer(s), dataLen + 8);
|
||||
#endif
|
||||
|
||||
@ -101,18 +101,18 @@ static void cliprdr_process_connect(rdpSvcPlugin* plugin)
|
||||
|
||||
void cliprdr_print_general_capability_flags(UINT32 flags)
|
||||
{
|
||||
fprintf(stderr, "generalFlags (0x%08X) {\n", flags);
|
||||
CLOG_ERR( "generalFlags (0x%08X) {\n", flags);
|
||||
|
||||
if (flags & CB_USE_LONG_FORMAT_NAMES)
|
||||
fprintf(stderr, "\tCB_USE_LONG_FORMAT_NAMES\n");
|
||||
CLOG_ERR( "\tCB_USE_LONG_FORMAT_NAMES\n");
|
||||
if (flags & CB_STREAM_FILECLIP_ENABLED)
|
||||
fprintf(stderr, "\tCB_STREAM_FILECLIP_ENABLED\n");
|
||||
CLOG_ERR( "\tCB_STREAM_FILECLIP_ENABLED\n");
|
||||
if (flags & CB_FILECLIP_NO_FILE_PATHS)
|
||||
fprintf(stderr, "\tCB_FILECLIP_NO_FILE_PATHS\n");
|
||||
CLOG_ERR( "\tCB_FILECLIP_NO_FILE_PATHS\n");
|
||||
if (flags & CB_CAN_LOCK_CLIPDATA)
|
||||
fprintf(stderr, "\tCB_CAN_LOCK_CLIPDATA\n");
|
||||
CLOG_ERR( "\tCB_CAN_LOCK_CLIPDATA\n");
|
||||
|
||||
fprintf(stderr, "}\n");
|
||||
CLOG_ERR( "}\n");
|
||||
}
|
||||
|
||||
static void cliprdr_process_general_capability(cliprdrPlugin* cliprdr, wStream* s)
|
||||
@ -198,7 +198,7 @@ static void cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, wStream* s, UINT16
|
||||
break;
|
||||
|
||||
default:
|
||||
DEBUG_WARN("unknown cliprdr capability set: %d", capabilitySetType);
|
||||
CLOG_ERR("unknown cliprdr capability set: %d", capabilitySetType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -380,7 +380,7 @@ static void cliprdr_process_receive(rdpSvcPlugin* plugin, wStream* s)
|
||||
break;
|
||||
|
||||
default:
|
||||
DEBUG_WARN("unknown msgType %d", msgType);
|
||||
CLOG_ERR("unknown msgType %d", msgType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -496,7 +496,7 @@ static void cliprdr_process_event(rdpSvcPlugin* plugin, wMessage* event)
|
||||
break;
|
||||
|
||||
default:
|
||||
DEBUG_WARN("unknown event type %d", GetMessageType(event->id));
|
||||
CLOG_ERR("unknown event type %d", GetMessageType(event->id));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
#include <winpr/stream.h>
|
||||
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/channels/log.h>
|
||||
#include <freerdp/utils/svc_plugin.h>
|
||||
|
||||
struct cliprdr_plugin
|
||||
@ -45,9 +45,9 @@ void cliprdr_packet_send(cliprdrPlugin* cliprdr, wStream* data_out);
|
||||
CliprdrClientContext* cliprdr_get_client_interface(cliprdrPlugin* cliprdr);
|
||||
|
||||
#ifdef WITH_DEBUG_CLIPRDR
|
||||
#define DEBUG_CLIPRDR(fmt, ...) DEBUG_CLASS(CLIPRDR, fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_CLIPRDR(fmt, ...) CLOG_CLASS(CLIPRDR, fmt, ## __VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG_CLIPRDR(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_CLIPRDR(fmt, ...) CLOG_NULL(fmt, ## __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#endif /* __CLIPRDR_MAIN_H */
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <winpr/print.h>
|
||||
#include <winpr/stream.h>
|
||||
|
||||
#include <freerdp/channels/log.h>
|
||||
#include "cliprdr_main.h"
|
||||
|
||||
/**
|
||||
@ -70,7 +71,7 @@ static int cliprdr_server_send_capabilities(CliprdrServerContext* context)
|
||||
CLIPRDR_HEADER header;
|
||||
ULONG written;
|
||||
|
||||
printf("CliprdrServerSendCapabilities\n");
|
||||
CLOG_DBG("CliprdrServerSendCapabilities\n");
|
||||
|
||||
header.msgType = CB_CLIP_CAPS;
|
||||
header.msgFlags = 0;
|
||||
@ -111,7 +112,7 @@ static int cliprdr_server_send_monitor_ready(CliprdrServerContext* context)
|
||||
CLIPRDR_HEADER header;
|
||||
ULONG written;
|
||||
|
||||
printf("CliprdrServerSendMonitorReady\n");
|
||||
CLOG_DBG("CliprdrServerSendMonitorReady\n");
|
||||
|
||||
header.msgType = CB_MONITOR_READY;
|
||||
header.msgFlags = 0;
|
||||
@ -139,7 +140,7 @@ static int cliprdr_server_send_format_list_response(CliprdrServerContext* contex
|
||||
CLIPRDR_HEADER header;
|
||||
ULONG written;
|
||||
|
||||
printf("CliprdrServerSendFormatListResponse\n");
|
||||
CLOG_DBG("CliprdrServerSendFormatListResponse\n");
|
||||
|
||||
header.msgType = CB_FORMAT_LIST_RESPONSE;
|
||||
header.msgFlags = CB_RESPONSE_OK;
|
||||
@ -207,7 +208,7 @@ static int cliprdr_server_receive_temporary_directory(CliprdrServerContext* cont
|
||||
ConvertFromUnicode(CP_UTF8, 0, wszTempDir, -1,
|
||||
&(context->priv->ClientTemporaryDirectory), 0, NULL, NULL);
|
||||
|
||||
printf("ClientTemporaryDirectory: %s\n", context->priv->ClientTemporaryDirectory);
|
||||
CLOG_DBG("ClientTemporaryDirectory: %s\n", context->priv->ClientTemporaryDirectory);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -252,7 +253,7 @@ static int cliprdr_server_receive_long_format_list(CliprdrServerContext* context
|
||||
int length;
|
||||
int position;
|
||||
|
||||
printf("%s\n", __FUNCTION__);
|
||||
CLOG_DBG("%s\n", __FUNCTION__);
|
||||
|
||||
position = Stream_GetPosition(s);
|
||||
Stream_SetPosition(s, Stream_Length(s));
|
||||
@ -305,7 +306,7 @@ static int cliprdr_server_receive_long_format_list(CliprdrServerContext* context
|
||||
|
||||
for (i = 0; i < context->priv->ClientFormatNameCount; i++)
|
||||
{
|
||||
printf("Format %d: Id: 0x%04X Name: %s Length: %d\n", i,
|
||||
CLOG_DBG("Format %d: Id: 0x%04X Name: %s Length: %d\n", i,
|
||||
context->priv->ClientFormatNames[i].id,
|
||||
context->priv->ClientFormatNames[i].name,
|
||||
context->priv->ClientFormatNames[i].length);
|
||||
@ -316,7 +317,7 @@ static int cliprdr_server_receive_long_format_list(CliprdrServerContext* context
|
||||
|
||||
static int cliprdr_server_receive_short_format_list(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header)
|
||||
{
|
||||
printf("%s: unimplemented\n", __FUNCTION__);
|
||||
CLOG_DBG("%s: unimplemented\n", __FUNCTION__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -340,7 +341,7 @@ static int cliprdr_server_receive_format_list(CliprdrServerContext* context, wSt
|
||||
|
||||
static int cliprdr_server_receive_pdu(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header)
|
||||
{
|
||||
printf("CliprdrServerReceivePdu: msgType: %d msgFlags: 0x%08X dataLen: %d\n",
|
||||
CLOG_DBG("CliprdrServerReceivePdu: msgType: %d msgFlags: 0x%08X dataLen: %d\n",
|
||||
header->msgType, header->msgFlags, header->dataLen);
|
||||
|
||||
switch (header->msgType)
|
||||
@ -379,7 +380,7 @@ static int cliprdr_server_receive_pdu(CliprdrServerContext* context, wStream* s,
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("Unexpected clipboard PDU type: %d\n", header->msgType);
|
||||
CLOG_DBG("Unexpected clipboard PDU type: %d\n", header->msgType);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ int disp_send_display_control_monitor_layout_pdu(DISP_CHANNEL_CALLBACK* callback
|
||||
|
||||
Stream_Write_UINT32(s, NumMonitors); /* NumMonitors (4 bytes) */
|
||||
|
||||
//fprintf(stderr, "NumMonitors: %d\n", NumMonitors);
|
||||
//CLOG_ERR( "NumMonitors: %d\n", NumMonitors);
|
||||
|
||||
for (index = 0; index < NumMonitors; index++)
|
||||
{
|
||||
@ -125,14 +125,14 @@ int disp_send_display_control_monitor_layout_pdu(DISP_CHANNEL_CALLBACK* callback
|
||||
Stream_Write_UINT32(s, Monitors[index].DeviceScaleFactor); /* DeviceScaleFactor (4 bytes) */
|
||||
|
||||
#if 0
|
||||
fprintf(stderr, "\t: Flags: 0x%04X\n", Monitors[index].Flags);
|
||||
fprintf(stderr, "\t: Left: %d\n", Monitors[index].Left);
|
||||
fprintf(stderr, "\t: Top: %d\n", Monitors[index].Top);
|
||||
fprintf(stderr, "\t: Width: %d\n", Monitors[index].Width);
|
||||
fprintf(stderr, "\t: Height: %d\n", Monitors[index].Height);
|
||||
fprintf(stderr, "\t: PhysicalWidth: %d\n", Monitors[index].PhysicalWidth);
|
||||
fprintf(stderr, "\t: PhysicalHeight: %d\n", Monitors[index].PhysicalHeight);
|
||||
fprintf(stderr, "\t: Orientation: %d\n", Monitors[index].Orientation);
|
||||
CLOG_ERR( "\t: Flags: 0x%04X\n", Monitors[index].Flags);
|
||||
CLOG_ERR( "\t: Left: %d\n", Monitors[index].Left);
|
||||
CLOG_ERR( "\t: Top: %d\n", Monitors[index].Top);
|
||||
CLOG_ERR( "\t: Width: %d\n", Monitors[index].Width);
|
||||
CLOG_ERR( "\t: Height: %d\n", Monitors[index].Height);
|
||||
CLOG_ERR( "\t: PhysicalWidth: %d\n", Monitors[index].PhysicalWidth);
|
||||
CLOG_ERR( "\t: PhysicalHeight: %d\n", Monitors[index].PhysicalHeight);
|
||||
CLOG_ERR( "\t: Orientation: %d\n", Monitors[index].Orientation);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -158,8 +158,8 @@ int disp_recv_display_control_caps_pdu(DISP_CHANNEL_CALLBACK* callback, wStream*
|
||||
Stream_Read_UINT32(s, disp->MaxMonitorAreaFactorA); /* MaxMonitorAreaFactorA (4 bytes) */
|
||||
Stream_Read_UINT32(s, disp->MaxMonitorAreaFactorB); /* MaxMonitorAreaFactorB (4 bytes) */
|
||||
|
||||
//fprintf(stderr, "DisplayControlCapsPdu: MaxNumMonitors: %d MaxMonitorAreaFactorA: %d MaxMonitorAreaFactorB: %d\n",
|
||||
// disp->MaxNumMonitors, disp->MaxMonitorAreaFactorA, disp->MaxMonitorAreaFactorB);
|
||||
//CLOG_ERR( "DisplayControlCapsPdu: MaxNumMonitors: %d MaxMonitorWidth: %d MaxMonitorHeight: %d\n",
|
||||
// disp->MaxNumMonitors, disp->MaxMonitorWidth, disp->MaxMonitorHeight);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -175,7 +175,7 @@ int disp_recv_pdu(DISP_CHANNEL_CALLBACK* callback, wStream* s)
|
||||
Stream_Read_UINT32(s, type); /* Type (4 bytes) */
|
||||
Stream_Read_UINT32(s, length); /* Length (4 bytes) */
|
||||
|
||||
//fprintf(stderr, "Type: %d Length: %d\n", type, length);
|
||||
//CLOG_ERR( "Type: %d Length: %d\n", type, length);
|
||||
|
||||
switch (type)
|
||||
{
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include <freerdp/dvc.h>
|
||||
#include <freerdp/types.h>
|
||||
#include <freerdp/addin.h>
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/channels/log.h>
|
||||
|
||||
#include <freerdp/client/disp.h>
|
||||
|
||||
|
@ -130,7 +130,7 @@ int drdynvc_write_data(drdynvcPlugin* drdynvc, UINT32 ChannelId, BYTE* data, UIN
|
||||
if (status != CHANNEL_RC_OK)
|
||||
{
|
||||
drdynvc->channel_error = status;
|
||||
DEBUG_WARN("VirtualChannelWrite failed %d", status);
|
||||
CLOG_ERR("VirtualChannelWrite failed %d", status);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@ int drdynvc_push_event(drdynvcPlugin* drdynvc, wMessage* event)
|
||||
|
||||
if (status != CHANNEL_RC_OK)
|
||||
{
|
||||
DEBUG_WARN("pVirtualChannelEventPush failed %d", status);
|
||||
CLOG_ERR("pVirtualChannelEventPush failed %d", status);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -165,7 +165,7 @@ static int drdynvc_send_capability_response(drdynvcPlugin* drdynvc)
|
||||
|
||||
if (status != CHANNEL_RC_OK)
|
||||
{
|
||||
DEBUG_WARN("VirtualChannelWrite failed %d", status);
|
||||
CLOG_ERR("VirtualChannelWrite failed %d", status);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -270,7 +270,7 @@ static int drdynvc_process_create_request(drdynvcPlugin* drdynvc, int Sp, int cb
|
||||
|
||||
if (status != CHANNEL_RC_OK)
|
||||
{
|
||||
DEBUG_WARN("VirtualChannelWrite failed %d", status);
|
||||
CLOG_ERR("VirtualChannelWrite failed %d", status);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -329,7 +329,7 @@ static int drdynvc_process_close_request(drdynvcPlugin* drdynvc, int Sp, int cbC
|
||||
|
||||
if (error != CHANNEL_RC_OK)
|
||||
{
|
||||
DEBUG_WARN("VirtualChannelWrite failed %d", error);
|
||||
CLOG_ERR("VirtualChannelWrite failed %d", error);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -376,7 +376,7 @@ static void drdynvc_process_receive(rdpSvcPlugin* plugin, wStream* s)
|
||||
break;
|
||||
|
||||
default:
|
||||
DEBUG_WARN("unknown drdynvc cmd 0x%x", Cmd);
|
||||
CLOG_ERR("unknown drdynvc cmd 0x%x", Cmd);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -26,12 +26,12 @@
|
||||
|
||||
#include <freerdp/dvc.h>
|
||||
#include <freerdp/types.h>
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/channels/log.h>
|
||||
|
||||
#ifdef WITH_DEBUG_DVC
|
||||
#define DEBUG_DVC(fmt, ...) DEBUG_CLASS(DVC, fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_DVC(fmt, ...) CLOG_CLASS(DVC, fmt, ## __VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG_DVC(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_DVC(fmt, ...) CLOG_NULL(fmt, ## __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -71,7 +71,7 @@ static int dvcman_create_listener(IWTSVirtualChannelManager* pChannelMgr,
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARN("Maximum DVC listener number reached.");
|
||||
CLOG_ERR("Maximum DVC listener number reached.");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -89,7 +89,7 @@ static int dvcman_push_event(IWTSVirtualChannelManager* pChannelMgr, wMessage* p
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARN("event_type %d push failed.", GetMessageType(pEvent->id));
|
||||
CLOG_ERR("event_type %d push failed.", GetMessageType(pEvent->id));
|
||||
}
|
||||
|
||||
return status;
|
||||
@ -108,7 +108,7 @@ static int dvcman_register_plugin(IDRDYNVC_ENTRY_POINTS* pEntryPoints, const cha
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARN("Maximum DVC plugin number reached.");
|
||||
CLOG_ERR("Maximum DVC plugin number reached.");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -218,7 +218,7 @@ int dvcman_load_addin(IWTSVirtualChannelManager* pChannelMgr, ADDIN_ARGV* args,
|
||||
DVCMAN_ENTRY_POINTS entryPoints;
|
||||
PDVC_PLUGIN_ENTRY pDVCPluginEntry = NULL;
|
||||
|
||||
fprintf(stderr, "Loading Dynamic Virtual Channel %s\n", args->argv[0]);
|
||||
CLOG_ERR( "Loading Dynamic Virtual Channel %s\n", args->argv[0]);
|
||||
|
||||
pDVCPluginEntry = (PDVC_PLUGIN_ENTRY) freerdp_load_channel_addin_entry(args->argv[0],
|
||||
NULL, NULL, FREERDP_ADDIN_CHANNEL_DYNAMIC);
|
||||
@ -388,7 +388,7 @@ int dvcman_create_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 Channel
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARN("channel rejected by plugin");
|
||||
CLOG_ERR("channel rejected by plugin");
|
||||
|
||||
free(channel);
|
||||
return 1;
|
||||
@ -409,7 +409,7 @@ int dvcman_open_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId
|
||||
|
||||
if (!channel)
|
||||
{
|
||||
DEBUG_WARN("ChannelId %d not found!", ChannelId);
|
||||
CLOG_ERR("ChannelId %d not found!", ChannelId);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -434,7 +434,7 @@ int dvcman_close_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelI
|
||||
|
||||
if (!channel)
|
||||
{
|
||||
DEBUG_WARN("ChannelId %d not found!", ChannelId);
|
||||
CLOG_ERR("ChannelId %d not found!", ChannelId);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -468,7 +468,7 @@ int dvcman_receive_channel_data_first(IWTSVirtualChannelManager* pChannelMgr, UI
|
||||
|
||||
if (!channel)
|
||||
{
|
||||
DEBUG_WARN("ChannelId %d not found!", ChannelId);
|
||||
CLOG_ERR("ChannelId %d not found!", ChannelId);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -491,7 +491,7 @@ int dvcman_receive_channel_data(IWTSVirtualChannelManager* pChannelMgr, UINT32 C
|
||||
|
||||
if (!channel)
|
||||
{
|
||||
DEBUG_WARN("ChannelId %d not found!", ChannelId);
|
||||
CLOG_ERR("ChannelId %d not found!", ChannelId);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -500,7 +500,7 @@ int dvcman_receive_channel_data(IWTSVirtualChannelManager* pChannelMgr, UINT32 C
|
||||
/* Fragmented data */
|
||||
if (Stream_GetPosition(channel->dvc_data) + dataSize > (UINT32) Stream_Capacity(channel->dvc_data))
|
||||
{
|
||||
DEBUG_WARN("data exceeding declared length!");
|
||||
CLOG_ERR("data exceeding declared length!");
|
||||
Stream_Release(channel->dvc_data);
|
||||
channel->dvc_data = NULL;
|
||||
return 1;
|
||||
|
@ -27,12 +27,12 @@
|
||||
#include <freerdp/dvc.h>
|
||||
#include <freerdp/types.h>
|
||||
#include <freerdp/addin.h>
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/channels/log.h>
|
||||
|
||||
#ifdef WITH_DEBUG_DVC
|
||||
#define DEBUG_DVC(fmt, ...) DEBUG_CLASS(DVC, fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_DVC(fmt, ...) CLOG_CLASS(DVC, fmt, ## __VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG_DVC(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_DVC(fmt, ...) CLOG_NULL(fmt, ## __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#endif /* __ECHO_MAIN_H */
|
||||
|
@ -24,11 +24,47 @@
|
||||
#include <winpr/crt.h>
|
||||
#include <winpr/print.h>
|
||||
|
||||
#include <freerdp/channels/log.h>
|
||||
#include <freerdp/client/encomsp.h>
|
||||
|
||||
#include "encomsp_main.h"
|
||||
|
||||
<<<<<<< HEAD
|
||||
static int encomsp_read_header(wStream* s, ENCOMSP_ORDER_HEADER* header)
|
||||
=======
|
||||
EncomspClientContext* encomsp_get_client_interface(encomspPlugin* encomsp)
|
||||
{
|
||||
EncomspClientContext* pInterface;
|
||||
pInterface = (EncomspClientContext*) encomsp->channelEntryPoints.pInterface;
|
||||
return pInterface;
|
||||
}
|
||||
|
||||
int encomsp_virtual_channel_write(encomspPlugin* encomsp, wStream* s)
|
||||
{
|
||||
UINT32 status = 0;
|
||||
|
||||
if (!encomsp)
|
||||
return -1;
|
||||
|
||||
#if 0
|
||||
CLOG_DBG("EncomspWrite (%d)\n", Stream_Length(s));
|
||||
winpr_HexDump(Stream_Buffer(s), Stream_Length(s));
|
||||
#endif
|
||||
|
||||
status = encomsp->channelEntryPoints.pVirtualChannelWrite(encomsp->OpenHandle,
|
||||
Stream_Buffer(s), (UINT32) Stream_Length(s), s);
|
||||
|
||||
if (status != CHANNEL_RC_OK)
|
||||
{
|
||||
CLOG_ERR( "encomsp_virtual_channel_write: VirtualChannelWrite failed %d\n", status);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int encomsp_read_header(wStream* s, ENCOMSP_ORDER_HEADER* header)
|
||||
>>>>>>> 31ac35698fe9fe0214669028098885f69e4b6a37
|
||||
{
|
||||
if (Stream_GetRemainingLength(s) < ENCOMSP_ORDER_HEADER_SIZE)
|
||||
return -1;
|
||||
@ -59,7 +95,7 @@ static int encomsp_read_unicode_string(wStream* s, ENCOMSP_UNICODE_STRING* str)
|
||||
if (str->cchString > 1024)
|
||||
return -1;
|
||||
|
||||
if (Stream_GetRemainingLength(s) < (str->cchString * 2))
|
||||
if (Stream_GetRemainingLength(s) < (size_t) (str->cchString * 2))
|
||||
return -1;
|
||||
|
||||
Stream_Read(s, &(str->wString), (str->cchString * 2)); /* String (variable) */
|
||||
@ -125,7 +161,7 @@ static int encomsp_recv_filter_updated_pdu(encomspPlugin* encomsp, wStream* s, E
|
||||
|
||||
if ((beg + header->Length) > end)
|
||||
{
|
||||
if (Stream_GetRemainingLength(s) < ((beg + header->Length) - end))
|
||||
if (Stream_GetRemainingLength(s) < (size_t) ((beg + header->Length) - end))
|
||||
return -1;
|
||||
|
||||
Stream_SetPosition(s, (beg + header->Length));
|
||||
@ -170,7 +206,7 @@ static int encomsp_recv_application_created_pdu(encomspPlugin* encomsp, wStream*
|
||||
|
||||
if ((beg + header->Length) > end)
|
||||
{
|
||||
if (Stream_GetRemainingLength(s) < ((beg + header->Length) - end))
|
||||
if (Stream_GetRemainingLength(s) < (size_t) ((beg + header->Length) - end))
|
||||
return -1;
|
||||
|
||||
Stream_SetPosition(s, (beg + header->Length));
|
||||
@ -211,7 +247,7 @@ static int encomsp_recv_application_removed_pdu(encomspPlugin* encomsp, wStream*
|
||||
|
||||
if ((beg + header->Length) > end)
|
||||
{
|
||||
if (Stream_GetRemainingLength(s) < ((beg + header->Length) - end))
|
||||
if (Stream_GetRemainingLength(s) < (size_t) ((beg + header->Length) - end))
|
||||
return -1;
|
||||
|
||||
Stream_SetPosition(s, (beg + header->Length));
|
||||
@ -257,7 +293,7 @@ static int encomsp_recv_window_created_pdu(encomspPlugin* encomsp, wStream* s, E
|
||||
|
||||
if ((beg + header->Length) > end)
|
||||
{
|
||||
if (Stream_GetRemainingLength(s) < ((beg + header->Length) - end))
|
||||
if (Stream_GetRemainingLength(s) < (size_t) ((beg + header->Length) - end))
|
||||
return -1;
|
||||
|
||||
Stream_SetPosition(s, (beg + header->Length));
|
||||
@ -298,7 +334,7 @@ static int encomsp_recv_window_removed_pdu(encomspPlugin* encomsp, wStream* s, E
|
||||
|
||||
if ((beg + header->Length) > end)
|
||||
{
|
||||
if (Stream_GetRemainingLength(s) < ((beg + header->Length) - end))
|
||||
if (Stream_GetRemainingLength(s) < (size_t) ((beg + header->Length) - end))
|
||||
return -1;
|
||||
|
||||
Stream_SetPosition(s, (beg + header->Length));
|
||||
@ -339,7 +375,7 @@ static int encomsp_recv_show_window_pdu(encomspPlugin* encomsp, wStream* s, ENCO
|
||||
|
||||
if ((beg + header->Length) > end)
|
||||
{
|
||||
if (Stream_GetRemainingLength(s) < ((beg + header->Length) - end))
|
||||
if (Stream_GetRemainingLength(s) < (size_t) ((beg + header->Length) - end))
|
||||
return -1;
|
||||
|
||||
Stream_SetPosition(s, (beg + header->Length));
|
||||
@ -385,7 +421,7 @@ static int encomsp_recv_participant_created_pdu(encomspPlugin* encomsp, wStream*
|
||||
|
||||
if ((beg + header->Length) > end)
|
||||
{
|
||||
if (Stream_GetRemainingLength(s) < ((beg + header->Length) - end))
|
||||
if (Stream_GetRemainingLength(s) < (size_t) ((beg + header->Length) - end))
|
||||
return -1;
|
||||
|
||||
Stream_SetPosition(s, (beg + header->Length));
|
||||
@ -428,7 +464,7 @@ static int encomsp_recv_participant_removed_pdu(encomspPlugin* encomsp, wStream*
|
||||
|
||||
if ((beg + header->Length) > end)
|
||||
{
|
||||
if (Stream_GetRemainingLength(s) < ((beg + header->Length) - end))
|
||||
if (Stream_GetRemainingLength(s) < (size_t) ((beg + header->Length) - end))
|
||||
return -1;
|
||||
|
||||
Stream_SetPosition(s, (beg + header->Length));
|
||||
@ -470,7 +506,7 @@ static int encomsp_recv_change_participant_control_level_pdu(encomspPlugin* enco
|
||||
|
||||
if ((beg + header->Length) > end)
|
||||
{
|
||||
if (Stream_GetRemainingLength(s) < ((beg + header->Length) - end))
|
||||
if (Stream_GetRemainingLength(s) < (size_t) ((beg + header->Length) - end))
|
||||
return -1;
|
||||
|
||||
Stream_SetPosition(s, (beg + header->Length));
|
||||
@ -530,7 +566,7 @@ static int encomsp_recv_graphics_stream_paused_pdu(encomspPlugin* encomsp, wStre
|
||||
|
||||
if ((beg + header->Length) > end)
|
||||
{
|
||||
if (Stream_GetRemainingLength(s) < ((beg + header->Length) - end))
|
||||
if (Stream_GetRemainingLength(s) < (size_t) ((beg + header->Length) - end))
|
||||
return -1;
|
||||
|
||||
Stream_SetPosition(s, (beg + header->Length));
|
||||
@ -566,7 +602,7 @@ static int encomsp_recv_graphics_stream_resumed_pdu(encomspPlugin* encomsp, wStr
|
||||
|
||||
if ((beg + header->Length) > end)
|
||||
{
|
||||
if (Stream_GetRemainingLength(s) < ((beg + header->Length) - end))
|
||||
if (Stream_GetRemainingLength(s) < (size_t) ((beg + header->Length) - end))
|
||||
return -1;
|
||||
|
||||
Stream_SetPosition(s, (beg + header->Length));
|
||||
@ -590,7 +626,7 @@ static int encomsp_process_receive(encomspPlugin* encomsp, wStream* s)
|
||||
if (encomsp_read_header(s, &header) < 0)
|
||||
return -1;
|
||||
|
||||
//printf("EncomspReceive: Type: %d Length: %d\n", header.Type, header.Length);
|
||||
//CLOG_DBG("EncomspReceive: Type: %d Length: %d\n", header.Type, header.Length);
|
||||
|
||||
switch (header.Type)
|
||||
{
|
||||
@ -722,7 +758,7 @@ int encomsp_send(encomspPlugin* encomsp, wStream* s)
|
||||
if (status != CHANNEL_RC_OK)
|
||||
{
|
||||
Stream_Free(s, TRUE);
|
||||
fprintf(stderr, "encomsp_send: VirtualChannelWrite failed %d\n", status);
|
||||
CLOG_ERR( "encomsp_send: VirtualChannelWrite failed %d\n", status);
|
||||
}
|
||||
|
||||
return status;
|
||||
@ -754,7 +790,7 @@ static void encomsp_virtual_channel_event_data_received(encomspPlugin* encomsp,
|
||||
{
|
||||
if (Stream_Capacity(data_in) != Stream_GetPosition(data_in))
|
||||
{
|
||||
fprintf(stderr, "encomsp_plugin_process_received: read error\n");
|
||||
CLOG_ERR( "encomsp_plugin_process_received: read error\n");
|
||||
}
|
||||
|
||||
encomsp->data_in = NULL;
|
||||
@ -774,7 +810,7 @@ static VOID VCAPITYPE encomsp_virtual_channel_open_event(DWORD openHandle, UINT
|
||||
|
||||
if (!encomsp)
|
||||
{
|
||||
fprintf(stderr, "encomsp_virtual_channel_open_event: error no match\n");
|
||||
CLOG_ERR( "encomsp_virtual_channel_open_event: error no match\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -834,7 +870,7 @@ static void encomsp_virtual_channel_event_connected(encomspPlugin* encomsp, LPVO
|
||||
|
||||
if (status != CHANNEL_RC_OK)
|
||||
{
|
||||
fprintf(stderr, "encomsp_virtual_channel_event_connected: open failed: status: %d\n", status);
|
||||
CLOG_ERR( "encomsp_virtual_channel_event_connected: open failed: status: %d\n", status);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -872,7 +908,7 @@ static VOID VCAPITYPE encomsp_virtual_channel_init_event(LPVOID pInitHandle, UIN
|
||||
|
||||
if (!encomsp)
|
||||
{
|
||||
fprintf(stderr, "encomsp_virtual_channel_init_event: error no match\n");
|
||||
CLOG_ERR( "encomsp_virtual_channel_init_event: error no match\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -23,9 +23,9 @@
|
||||
rdpPrinterDriver* printer_win_get_driver(void);
|
||||
|
||||
#ifdef WITH_DEBUG_WINPR
|
||||
#define DEBUG_WINPR(fmt, ...) DEBUG_CLASS(WINPR, fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_WINPR(fmt, ...) CLOG_CLASS(WINPR, fmt, ## __VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG_WINPR(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_WINPR(fmt, ...) CLOG_NULL(fmt, ## __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <winpr/crt.h>
|
||||
|
||||
#include <freerdp/utils/rail.h>
|
||||
#include <freerdp/channels/log.h>
|
||||
|
||||
#include "rail_orders.h"
|
||||
|
||||
@ -522,7 +523,7 @@ BOOL rail_order_recv(railPlugin* rail, wStream* s)
|
||||
}
|
||||
|
||||
default:
|
||||
fprintf(stderr, "Unknown RAIL PDU order reveived.");
|
||||
CLOG_ERR( "Unknown RAIL PDU order reveived.");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <freerdp/types.h>
|
||||
#include <freerdp/addin.h>
|
||||
#include <freerdp/client/channels.h>
|
||||
#include <freerdp/channels/log.h>
|
||||
|
||||
#include "rdpdr_main.h"
|
||||
|
||||
@ -122,7 +123,7 @@ BOOL devman_load_device_service(DEVMAN* devman, RDPDR_DEVICE* device)
|
||||
if (!ServiceName)
|
||||
return FALSE;
|
||||
|
||||
fprintf(stderr, "Loading device service %s (static)\n", ServiceName);
|
||||
CLOG_ERR( "Loading device service %s (static)\n", ServiceName);
|
||||
entry = (PDEVICE_SERVICE_ENTRY) freerdp_load_channel_addin_entry(ServiceName, NULL, "DeviceServiceEntry", 0);
|
||||
|
||||
if (!entry)
|
||||
|
@ -31,6 +31,7 @@
|
||||
|
||||
#include <freerdp/types.h>
|
||||
#include <freerdp/constants.h>
|
||||
#include <freerdp/channels/log.h>
|
||||
#include <freerdp/channels/rdpdr.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
@ -451,7 +452,7 @@ static void* drive_hotplug_thread_func(void* arg)
|
||||
|
||||
if (mfd < 0)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to open /proc/mounts.");
|
||||
CLOG_ERR( "ERROR: Unable to open /proc/mounts.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -662,7 +663,7 @@ static void rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, BOOL use
|
||||
|
||||
count++;
|
||||
|
||||
fprintf(stderr, "registered device #%d: %s (type=%d id=%d)\n",
|
||||
CLOG_ERR( "registered device #%d: %s (type=%d id=%d)\n",
|
||||
count, device->name, device->type, device->id);
|
||||
}
|
||||
}
|
||||
@ -845,7 +846,7 @@ int rdpdr_send(rdpdrPlugin* rdpdr, wStream* s)
|
||||
if (status != CHANNEL_RC_OK)
|
||||
{
|
||||
Stream_Free(s, TRUE);
|
||||
fprintf(stderr, "rdpdr_send: VirtualChannelWrite failed %d\n", status);
|
||||
CLOG_ERR( "rdpdr_send: VirtualChannelWrite failed %d\n", status);
|
||||
}
|
||||
|
||||
return status;
|
||||
@ -883,7 +884,7 @@ static void rdpdr_virtual_channel_event_data_received(rdpdrPlugin* rdpdr,
|
||||
{
|
||||
if (Stream_Capacity(data_in) != Stream_GetPosition(data_in))
|
||||
{
|
||||
fprintf(stderr, "svc_plugin_process_received: read error\n");
|
||||
CLOG_ERR( "svc_plugin_process_received: read error\n");
|
||||
}
|
||||
|
||||
rdpdr->data_in = NULL;
|
||||
@ -903,7 +904,7 @@ static VOID VCAPITYPE rdpdr_virtual_channel_open_event(DWORD openHandle, UINT ev
|
||||
|
||||
if (!rdpdr)
|
||||
{
|
||||
fprintf(stderr, "rdpdr_virtual_channel_open_event: error no match\n");
|
||||
CLOG_ERR( "rdpdr_virtual_channel_open_event: error no match\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -963,7 +964,7 @@ static void rdpdr_virtual_channel_event_connected(rdpdrPlugin* rdpdr, LPVOID pDa
|
||||
|
||||
if (status != CHANNEL_RC_OK)
|
||||
{
|
||||
fprintf(stderr, "rdpdr_virtual_channel_event_connected: open failed: status: %d\n", status);
|
||||
CLOG_ERR( "rdpdr_virtual_channel_event_connected: open failed: status: %d\n", status);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1009,7 +1010,7 @@ static VOID VCAPITYPE rdpdr_virtual_channel_init_event(LPVOID pInitHandle, UINT
|
||||
|
||||
if (!rdpdr)
|
||||
{
|
||||
fprintf(stderr, "rdpdr_virtual_channel_init_event: error no match\n");
|
||||
CLOG_ERR( "rdpdr_virtual_channel_init_event: error no match\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <winpr/print.h>
|
||||
#include <winpr/stream.h>
|
||||
|
||||
#include <freerdp/channels/log.h>
|
||||
#include "rdpdr_main.h"
|
||||
|
||||
static UINT32 g_ClientId = 0;
|
||||
@ -36,7 +37,7 @@ static int rdpdr_server_send_announce_request(RdpdrServerContext* context)
|
||||
RDPDR_HEADER header;
|
||||
ULONG written;
|
||||
|
||||
printf("RdpdrServerSendAnnounceRequest\n");
|
||||
CLOG_DBG("RdpdrServerSendAnnounceRequest\n");
|
||||
|
||||
header.Component = RDPDR_CTYP_CORE;
|
||||
header.PacketId = PAKID_CORE_SERVER_ANNOUNCE;
|
||||
@ -69,7 +70,7 @@ static int rdpdr_server_receive_announce_response(RdpdrServerContext* context, w
|
||||
Stream_Read_UINT16(s, VersionMinor); /* VersionMinor (2 bytes) */
|
||||
Stream_Read_UINT32(s, ClientId); /* ClientId (4 bytes) */
|
||||
|
||||
printf("Client Announce Response: VersionMajor: 0x%04X VersionMinor: 0x%04X ClientId: 0x%04X\n",
|
||||
CLOG_DBG("Client Announce Response: VersionMajor: 0x%04X VersionMinor: 0x%04X ClientId: 0x%04X\n",
|
||||
VersionMajor, VersionMinor, ClientId);
|
||||
|
||||
context->priv->ClientId = ClientId;
|
||||
@ -109,7 +110,7 @@ static int rdpdr_server_receive_client_name_request(RdpdrServerContext* context,
|
||||
|
||||
Stream_Seek(s, ComputerNameLen);
|
||||
|
||||
printf("ClientComputerName: %s\n", context->priv->ClientComputerName);
|
||||
CLOG_DBG("ClientComputerName: %s\n", context->priv->ClientComputerName);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -298,7 +299,7 @@ static int rdpdr_server_send_core_capability_request(RdpdrServerContext* context
|
||||
UINT16 numCapabilities;
|
||||
ULONG written;
|
||||
|
||||
printf("RdpdrServerSendCoreCapabilityRequest\n");
|
||||
CLOG_DBG("RdpdrServerSendCoreCapabilityRequest\n");
|
||||
|
||||
header.Component = RDPDR_CTYP_CORE;
|
||||
header.PacketId = PAKID_CORE_SERVER_CAPABILITY;
|
||||
@ -364,7 +365,7 @@ static int rdpdr_server_receive_core_capability_response(RdpdrServerContext* con
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("Unknown capabilityType %d\n", capabilityHeader.CapabilityType);
|
||||
CLOG_DBG("Unknown capabilityType %d\n", capabilityHeader.CapabilityType);
|
||||
Stream_Seek(s, capabilityHeader.CapabilityLength - RDPDR_CAPABILITY_HEADER_LENGTH);
|
||||
break;
|
||||
}
|
||||
@ -380,7 +381,7 @@ static int rdpdr_server_send_client_id_confirm(RdpdrServerContext* context)
|
||||
RDPDR_HEADER header;
|
||||
ULONG written;
|
||||
|
||||
printf("RdpdrServerSendClientIdConfirm\n");
|
||||
CLOG_DBG("RdpdrServerSendClientIdConfirm\n");
|
||||
|
||||
header.Component = RDPDR_CTYP_CORE;
|
||||
header.PacketId = PAKID_CORE_CLIENTID_CONFIRM;
|
||||
@ -416,7 +417,7 @@ static int rdpdr_server_receive_device_list_announce_request(RdpdrServerContext*
|
||||
|
||||
Stream_Read_UINT32(s, DeviceCount); /* DeviceCount (4 bytes) */
|
||||
|
||||
printf("%s: DeviceCount: %d\n", __FUNCTION__, DeviceCount);
|
||||
CLOG_DBG("%s: DeviceCount: %d\n", __FUNCTION__, DeviceCount);
|
||||
|
||||
for (i = 0; i < DeviceCount; i++)
|
||||
{
|
||||
@ -425,7 +426,7 @@ static int rdpdr_server_receive_device_list_announce_request(RdpdrServerContext*
|
||||
Stream_Read(s, PreferredDosName, 8); /* PreferredDosName (8 bytes) */
|
||||
Stream_Read_UINT32(s, DeviceDataLength); /* DeviceDataLength (4 bytes) */
|
||||
|
||||
printf("Device %d Name: %s Id: 0x%04X DataLength: %d\n",
|
||||
CLOG_DBG("Device %d Name: %s Id: 0x%04X DataLength: %d\n",
|
||||
i, PreferredDosName, DeviceId, DeviceDataLength);
|
||||
|
||||
switch (DeviceId)
|
||||
@ -462,7 +463,7 @@ static int rdpdr_server_send_user_logged_on(RdpdrServerContext* context)
|
||||
RDPDR_HEADER header;
|
||||
ULONG written;
|
||||
|
||||
printf("%s\n", __FUNCTION__);
|
||||
CLOG_DBG("%s\n", __FUNCTION__);
|
||||
|
||||
header.Component = RDPDR_CTYP_CORE;
|
||||
header.PacketId = PAKID_CORE_USER_LOGGEDON;
|
||||
@ -483,7 +484,7 @@ static int rdpdr_server_send_user_logged_on(RdpdrServerContext* context)
|
||||
|
||||
static int rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header)
|
||||
{
|
||||
printf("RdpdrServerReceivePdu: Component: 0x%04X PacketId: 0x%04X\n",
|
||||
CLOG_DBG("RdpdrServerReceivePdu: Component: 0x%04X PacketId: 0x%04X\n",
|
||||
header->Component, header->PacketId);
|
||||
|
||||
winpr_HexDump(Stream_Buffer(s), Stream_Length(s));
|
||||
@ -545,7 +546,7 @@ static int rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, RDP
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Unknown RDPDR_HEADER.Component: 0x%04X\n", header->Component);
|
||||
CLOG_DBG("Unknown RDPDR_HEADER.Component: 0x%04X\n", header->Component);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -201,7 +201,7 @@ int rdpei_send_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s, UINT16 eventId,
|
||||
status = callback->channel->Write(callback->channel, (UINT32) Stream_Length(s), Stream_Buffer(s), NULL);
|
||||
|
||||
#ifdef WITH_DEBUG_RDPEI
|
||||
fprintf(stderr, "rdpei_send_pdu: eventId: %d (%s) length: %d status: %d\n",
|
||||
CLOG_ERR( "rdpei_send_pdu: eventId: %d (%s) length: %d status: %d\n",
|
||||
eventId, RDPEI_EVENTID_STRINGS[eventId], pduLength, status);
|
||||
#endif
|
||||
|
||||
@ -239,17 +239,17 @@ int rdpei_send_cs_ready_pdu(RDPEI_CHANNEL_CALLBACK* callback)
|
||||
void rdpei_print_contact_flags(UINT32 contactFlags)
|
||||
{
|
||||
if (contactFlags & CONTACT_FLAG_DOWN)
|
||||
printf(" CONTACT_FLAG_DOWN");
|
||||
CLOG_DBG(" CONTACT_FLAG_DOWN");
|
||||
if (contactFlags & CONTACT_FLAG_UPDATE)
|
||||
printf(" CONTACT_FLAG_UPDATE");
|
||||
CLOG_DBG(" CONTACT_FLAG_UPDATE");
|
||||
if (contactFlags & CONTACT_FLAG_UP)
|
||||
printf(" CONTACT_FLAG_UP");
|
||||
CLOG_DBG(" CONTACT_FLAG_UP");
|
||||
if (contactFlags & CONTACT_FLAG_INRANGE)
|
||||
printf(" CONTACT_FLAG_INRANGE");
|
||||
CLOG_DBG(" CONTACT_FLAG_INRANGE");
|
||||
if (contactFlags & CONTACT_FLAG_INCONTACT)
|
||||
printf(" CONTACT_FLAG_INCONTACT");
|
||||
CLOG_DBG(" CONTACT_FLAG_INCONTACT");
|
||||
if (contactFlags & CONTACT_FLAG_CANCELED)
|
||||
printf(" CONTACT_FLAG_CANCELED");
|
||||
CLOG_DBG(" CONTACT_FLAG_CANCELED");
|
||||
}
|
||||
|
||||
int rdpei_write_touch_frame(wStream* s, RDPINPUT_TOUCH_FRAME* frame)
|
||||
@ -259,8 +259,8 @@ int rdpei_write_touch_frame(wStream* s, RDPINPUT_TOUCH_FRAME* frame)
|
||||
RDPINPUT_CONTACT_DATA* contact;
|
||||
|
||||
#ifdef WITH_DEBUG_RDPEI
|
||||
printf("contactCount: %d\n", frame->contactCount);
|
||||
printf("frameOffset: 0x%08X\n", (UINT32) frame->frameOffset);
|
||||
CLOG_DBG("contactCount: %d\n", frame->contactCount);
|
||||
CLOG_DBG("frameOffset: 0x%08X\n", (UINT32) frame->frameOffset);
|
||||
#endif
|
||||
|
||||
rdpei_write_2byte_unsigned(s, frame->contactCount); /* contactCount (TWO_BYTE_UNSIGNED_INTEGER) */
|
||||
@ -284,13 +284,13 @@ int rdpei_write_touch_frame(wStream* s, RDPINPUT_TOUCH_FRAME* frame)
|
||||
contact->contactRectBottom = contact->y + rectSize;
|
||||
|
||||
#ifdef WITH_DEBUG_RDPEI
|
||||
printf("contact[%d].contactId: %d\n", index, contact->contactId);
|
||||
printf("contact[%d].fieldsPresent: %d\n", index, contact->fieldsPresent);
|
||||
printf("contact[%d].x: %d\n", index, contact->x);
|
||||
printf("contact[%d].y: %d\n", index, contact->y);
|
||||
printf("contact[%d].contactFlags: 0x%04X", index, contact->contactFlags);
|
||||
CLOG_DBG("contact[%d].contactId: %d\n", index, contact->contactId);
|
||||
CLOG_DBG("contact[%d].fieldsPresent: %d\n", index, contact->fieldsPresent);
|
||||
CLOG_DBG("contact[%d].x: %d\n", index, contact->x);
|
||||
CLOG_DBG("contact[%d].y: %d\n", index, contact->y);
|
||||
CLOG_DBG("contact[%d].contactFlags: 0x%04X", index, contact->contactFlags);
|
||||
rdpei_print_contact_flags(contact->contactFlags);
|
||||
printf("\n");
|
||||
CLOG_DBG("\n");
|
||||
#endif
|
||||
|
||||
Stream_Write_UINT8(s, contact->contactId); /* contactId (1 byte) */
|
||||
@ -371,7 +371,7 @@ int rdpei_recv_sc_ready_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s)
|
||||
#if 0
|
||||
if (protocolVersion != RDPINPUT_PROTOCOL_V10)
|
||||
{
|
||||
fprintf(stderr, "Unknown [MS-RDPEI] protocolVersion: 0x%08X\n", protocolVersion);
|
||||
CLOG_ERR( "Unknown [MS-RDPEI] protocolVersion: 0x%08X\n", protocolVersion);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
@ -408,7 +408,7 @@ int rdpei_recv_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s)
|
||||
Stream_Read_UINT32(s, pduLength); /* pduLength (4 bytes) */
|
||||
|
||||
#ifdef WITH_DEBUG_RDPEI
|
||||
fprintf(stderr, "rdpei_recv_pdu: eventId: %d (%s) length: %d\n",
|
||||
CLOG_ERR( "rdpei_recv_pdu: eventId: %d (%s) length: %d\n",
|
||||
eventId, RDPEI_EVENTID_STRINGS[eventId], pduLength);
|
||||
#endif
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include <freerdp/dvc.h>
|
||||
#include <freerdp/types.h>
|
||||
#include <freerdp/addin.h>
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/channels/log.h>
|
||||
|
||||
#include <freerdp/client/rdpei.h>
|
||||
|
||||
@ -100,9 +100,9 @@ struct _RDPINPUT_CONTACT_POINT
|
||||
typedef struct _RDPINPUT_CONTACT_POINT RDPINPUT_CONTACT_POINT;
|
||||
|
||||
#ifdef WITH_DEBUG_DVC
|
||||
#define DEBUG_DVC(fmt, ...) DEBUG_CLASS(DVC, fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_DVC(fmt, ...) CLOG_CLASS(DVC, fmt, ## __VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG_DVC(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_DVC(fmt, ...) CLOG_NULL(fmt, ## __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#endif /* FREERDP_CHANNEL_RDPEI_CLIENT_MAIN_H */
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include <winpr/collections.h>
|
||||
|
||||
#include <freerdp/addin.h>
|
||||
#include <freerdp/channels/log.h>
|
||||
|
||||
#include "rdpgfx_common.h"
|
||||
#include "rdpgfx_codec.h"
|
||||
@ -202,7 +203,7 @@ int rdpgfx_recv_reset_graphics_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s
|
||||
|
||||
pad = 340 - (RDPGFX_HEADER_SIZE + 12 + (pdu.monitorCount * 20));
|
||||
|
||||
if (Stream_GetRemainingLength(s) < pad)
|
||||
if (Stream_GetRemainingLength(s) < (size_t) pad)
|
||||
return -1;
|
||||
|
||||
Stream_Seek(s, pad); /* pad (total size is 340 bytes) */
|
||||
@ -253,7 +254,7 @@ int rdpgfx_recv_cache_import_reply_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStrea
|
||||
|
||||
Stream_Read_UINT16(s, pdu.importedEntriesCount); /* cacheSlot (2 bytes) */
|
||||
|
||||
if (Stream_GetRemainingLength(s) < (pdu.importedEntriesCount * 2))
|
||||
if (Stream_GetRemainingLength(s) < (size_t) (pdu.importedEntriesCount * 2))
|
||||
return -1;
|
||||
|
||||
pdu.cacheSlots = (UINT16*) calloc(pdu.importedEntriesCount, sizeof(UINT16));
|
||||
@ -524,7 +525,7 @@ int rdpgfx_recv_solid_fill_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s)
|
||||
rdpgfx_read_color32(s, &(pdu.fillPixel)); /* fillPixel (4 bytes) */
|
||||
Stream_Read_UINT16(s, pdu.fillRectCount); /* fillRectCount (2 bytes) */
|
||||
|
||||
if (Stream_GetRemainingLength(s) < (pdu.fillRectCount * 8))
|
||||
if (Stream_GetRemainingLength(s) < (size_t) (pdu.fillRectCount * 8))
|
||||
return -1;
|
||||
|
||||
pdu.fillRects = (RDPGFX_RECT16*) calloc(pdu.fillRectCount, sizeof(RDPGFX_RECT16));
|
||||
@ -565,7 +566,7 @@ int rdpgfx_recv_surface_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStrea
|
||||
rdpgfx_read_rect16(s, &(pdu.rectSrc)); /* rectSrc (8 bytes ) */
|
||||
Stream_Read_UINT16(s, pdu.destPtsCount); /* destPtsCount (2 bytes) */
|
||||
|
||||
if (Stream_GetRemainingLength(s) < (pdu.destPtsCount * 4))
|
||||
if (Stream_GetRemainingLength(s) < (size_t) (pdu.destPtsCount * 4))
|
||||
return -1;
|
||||
|
||||
pdu.destPts = (RDPGFX_POINT16*) calloc(pdu.destPtsCount, sizeof(RDPGFX_POINT16));
|
||||
@ -636,7 +637,7 @@ int rdpgfx_recv_cache_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream*
|
||||
Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */
|
||||
Stream_Read_UINT16(s, pdu.destPtsCount); /* destPtsCount (2 bytes) */
|
||||
|
||||
if (Stream_GetRemainingLength(s) < (pdu.destPtsCount * 4))
|
||||
if (Stream_GetRemainingLength(s) < (size_t) (pdu.destPtsCount * 4))
|
||||
return -1;
|
||||
|
||||
pdu.destPts = (RDPGFX_POINT16*) calloc(pdu.destPtsCount, sizeof(RDPGFX_POINT16));
|
||||
@ -809,7 +810,7 @@ int rdpgfx_recv_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s)
|
||||
|
||||
if (status < 0)
|
||||
{
|
||||
fprintf(stderr, "Error while parsing GFX cmdId: %s (0x%04X)\n",
|
||||
CLOG_ERR( "Error while parsing GFX cmdId: %s (0x%04X)\n",
|
||||
rdpgfx_get_cmd_id_string(header.cmdId), header.cmdId);
|
||||
return -1;
|
||||
}
|
||||
@ -818,7 +819,7 @@ int rdpgfx_recv_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s)
|
||||
|
||||
if (end != (beg + header.pduLength))
|
||||
{
|
||||
fprintf(stderr, "Unexpected gfx pdu end: Actual: %d, Expected: %d\n",
|
||||
CLOG_ERR( "Unexpected gfx pdu end: Actual: %d, Expected: %d\n",
|
||||
end, (beg + header.pduLength));
|
||||
|
||||
Stream_SetPosition(s, (beg + header.pduLength));
|
||||
@ -840,13 +841,13 @@ static int rdpgfx_on_data_received(IWTSVirtualChannelCallback* pChannelCallback,
|
||||
|
||||
if (status < 0)
|
||||
{
|
||||
printf("zgfx_decompress failure! status: %d\n", status);
|
||||
CLOG_DBG("zgfx_decompress failure! status: %d\n", status);
|
||||
return 0;
|
||||
}
|
||||
|
||||
s = Stream_New(pDstData, DstSize);
|
||||
|
||||
while (Stream_GetPosition(s) < Stream_Length(s))
|
||||
while (((size_t) Stream_GetPosition(s)) < Stream_Length(s))
|
||||
{
|
||||
status = rdpgfx_recv_pdu(callback, s);
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
#include <freerdp/types.h>
|
||||
#include <freerdp/codec/dsp.h>
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/channels/log.h>
|
||||
|
||||
#include "rdpsnd_main.h"
|
||||
|
||||
@ -68,7 +68,7 @@ struct rdpsnd_alsa_plugin
|
||||
#define SND_PCM_CHECK(_func, _status) \
|
||||
if (_status < 0) \
|
||||
{ \
|
||||
fprintf(stderr, "%s: %d\n", _func, _status); \
|
||||
CLOG_ERR( "%s: %d\n", _func, _status); \
|
||||
return -1; \
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ static int rdpsnd_alsa_set_hw_params(rdpsndAlsaPlugin* alsa)
|
||||
|
||||
if (alsa->buffer_size > buffer_size_max)
|
||||
{
|
||||
fprintf(stderr, "Warning: requested sound buffer size %d, got %d instead\n",
|
||||
CLOG_ERR( "Warning: requested sound buffer size %d, got %d instead\n",
|
||||
(int) alsa->buffer_size, (int) buffer_size_max);
|
||||
alsa->buffer_size = buffer_size_max;
|
||||
}
|
||||
@ -262,7 +262,7 @@ static void rdpsnd_alsa_open_mixer(rdpsndAlsaPlugin* alsa)
|
||||
|
||||
if (status < 0)
|
||||
{
|
||||
DEBUG_WARN("snd_mixer_open failed");
|
||||
CLOG_ERR("snd_mixer_open failed");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -270,7 +270,7 @@ static void rdpsnd_alsa_open_mixer(rdpsndAlsaPlugin* alsa)
|
||||
|
||||
if (status < 0)
|
||||
{
|
||||
DEBUG_WARN("snd_mixer_attach failed");
|
||||
CLOG_ERR("snd_mixer_attach failed");
|
||||
snd_mixer_close(alsa->mixer_handle);
|
||||
return;
|
||||
}
|
||||
@ -279,7 +279,7 @@ static void rdpsnd_alsa_open_mixer(rdpsndAlsaPlugin* alsa)
|
||||
|
||||
if (status < 0)
|
||||
{
|
||||
DEBUG_WARN("snd_mixer_selem_register failed");
|
||||
CLOG_ERR("snd_mixer_selem_register failed");
|
||||
snd_mixer_close(alsa->mixer_handle);
|
||||
return;
|
||||
}
|
||||
@ -288,7 +288,7 @@ static void rdpsnd_alsa_open_mixer(rdpsndAlsaPlugin* alsa)
|
||||
|
||||
if (status < 0)
|
||||
{
|
||||
DEBUG_WARN("snd_mixer_load failed");
|
||||
CLOG_ERR("snd_mixer_load failed");
|
||||
snd_mixer_close(alsa->mixer_handle);
|
||||
return;
|
||||
}
|
||||
@ -310,7 +310,7 @@ static void rdpsnd_alsa_open(rdpsndDevicePlugin* device, AUDIO_FORMAT* format, i
|
||||
|
||||
if (status < 0)
|
||||
{
|
||||
DEBUG_WARN("snd_pcm_open failed");
|
||||
CLOG_ERR("snd_pcm_open failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -579,7 +579,7 @@ static void rdpsnd_alsa_wave_play(rdpsndDevicePlugin* device, RDPSND_WAVE* wave)
|
||||
}
|
||||
else if (status < 0)
|
||||
{
|
||||
fprintf(stderr, "status: %d\n", status);
|
||||
CLOG_ERR( "status: %d\n", status);
|
||||
snd_pcm_close(alsa->pcm_handle);
|
||||
alsa->pcm_handle = NULL;
|
||||
rdpsnd_alsa_open((rdpsndDevicePlugin*) alsa, NULL, alsa->latency);
|
||||
@ -600,7 +600,7 @@ static void rdpsnd_alsa_wave_play(rdpsndDevicePlugin* device, RDPSND_WAVE* wave)
|
||||
wave->wLatency = (UINT16) (wave->wLocalTimeB - wave->wLocalTimeA);
|
||||
wave->wTimeStampB = wave->wTimeStampA + wave->wLatency;
|
||||
|
||||
//fprintf(stderr, "wTimeStampA: %d wTimeStampB: %d wLatency: %d\n", wave->wTimeStampA, wave->wTimeStampB, wave->wLatency);
|
||||
//CLOG_ERR( "wTimeStampA: %d wTimeStampB: %d wLatency: %d\n", wave->wTimeStampA, wave->wTimeStampB, wave->wLatency);
|
||||
}
|
||||
|
||||
static COMMAND_LINE_ARGUMENT_A rdpsnd_alsa_args[] =
|
||||
|
@ -37,7 +37,7 @@
|
||||
#define reportResult(result,operation) (_reportResult((result),(operation),__FILE__,__LINE__))
|
||||
static inline bool _reportResult(kern_return_t result, const char *operation, const char* file, int line) {
|
||||
if ( result != ERR_SUCCESS ) {
|
||||
printf("%s:%d: %s: %s\n", file, line, operation, mach_error_string(result));
|
||||
CLOG_DBG("%s:%d: %s: %s\n", file, line, operation, mach_error_string(result));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -108,7 +108,7 @@ bool TPCircularBufferInit(TPCircularBuffer *buffer, int length) {
|
||||
if ( virtualAddress != bufferAddress+buffer->length ) {
|
||||
// If the memory is not contiguous, clean up both allocated buffers and try again
|
||||
if ( retries-- == 0 ) {
|
||||
printf("Couldn't map buffer memory to end of buffer\n");
|
||||
CLOG_DBG("Couldn't map buffer memory to end of buffer\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -121,7 +121,7 @@ static void rdpsnd_mac_open(rdpsndDevicePlugin* device, AUDIO_FORMAT* format, in
|
||||
|
||||
if (status != 0)
|
||||
{
|
||||
fprintf(stderr, "AudioQueueNewOutput failure\n");
|
||||
CLOG_ERR( "AudioQueueNewOutput failure\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -135,7 +135,7 @@ static void rdpsnd_mac_open(rdpsndDevicePlugin* device, AUDIO_FORMAT* format, in
|
||||
|
||||
if (status != 0)
|
||||
{
|
||||
printf("AudioQueueGetProperty failure: kAudioQueueProperty_DecodeBufferSizeFrames\n");
|
||||
CLOG_DBG("AudioQueueGetProperty failure: kAudioQueueProperty_DecodeBufferSizeFrames\n");
|
||||
}
|
||||
|
||||
for (index = 0; index < MAC_AUDIO_QUEUE_NUM_BUFFERS; index++)
|
||||
@ -144,7 +144,7 @@ static void rdpsnd_mac_open(rdpsndDevicePlugin* device, AUDIO_FORMAT* format, in
|
||||
|
||||
if (status != 0)
|
||||
{
|
||||
fprintf(stderr, "AudioQueueAllocateBuffer failed\n");
|
||||
CLOG_ERR( "AudioQueueAllocateBuffer failed\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -219,7 +219,7 @@ static void rdpsnd_mac_set_volume(rdpsndDevicePlugin* device, UINT32 value)
|
||||
|
||||
if (status != 0)
|
||||
{
|
||||
fprintf(stderr, "AudioQueueSetParameter kAudioQueueParam_Volume failed: %f\n", fVolume);
|
||||
CLOG_ERR( "AudioQueueSetParameter kAudioQueueParam_Volume failed: %f\n", fVolume);
|
||||
}
|
||||
}
|
||||
|
||||
@ -238,7 +238,7 @@ static void rdpsnd_mac_start(rdpsndDevicePlugin* device)
|
||||
|
||||
if (status != 0)
|
||||
{
|
||||
fprintf(stderr, "AudioQueueStart failed\n");
|
||||
CLOG_ERR( "AudioQueueStart failed\n");
|
||||
}
|
||||
|
||||
mac->isPlaying = TRUE;
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
#include <freerdp/types.h>
|
||||
#include <freerdp/codec/dsp.h>
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/channels/log.h>
|
||||
|
||||
#include "opensl_io.h"
|
||||
#include "rdpsnd_main.h"
|
||||
@ -187,7 +187,7 @@ static void rdpsnd_opensles_open(rdpsndDevicePlugin* device,
|
||||
assert(opensles->stream);
|
||||
|
||||
if (!opensles->stream)
|
||||
DEBUG_WARN("android_OpenAudioDevice failed");
|
||||
CLOG_ERR("android_OpenAudioDevice failed");
|
||||
else
|
||||
rdpsnd_opensles_set_volume(device, opensles->volume);
|
||||
|
||||
@ -364,7 +364,7 @@ static void rdpsnd_opensles_play(rdpsndDevicePlugin* device,
|
||||
|
||||
ret = android_AudioOut(opensles->stream, src.s, size / 2);
|
||||
if (ret < 0)
|
||||
DEBUG_WARN("android_AudioOut failed (%d)", ret);
|
||||
CLOG_ERR("android_AudioOut failed (%d)", ret);
|
||||
}
|
||||
|
||||
static void rdpsnd_opensles_start(rdpsndDevicePlugin* device)
|
||||
|
@ -45,7 +45,7 @@
|
||||
#include <freerdp/types.h>
|
||||
#include <freerdp/addin.h>
|
||||
#include <freerdp/constants.h>
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/channels/log.h>
|
||||
#include <freerdp/utils/signal.h>
|
||||
|
||||
#include "rdpsnd_main.h"
|
||||
@ -195,13 +195,13 @@ void rdpsnd_select_supported_audio_formats(rdpsndPlugin* rdpsnd)
|
||||
}
|
||||
|
||||
#if 0
|
||||
fprintf(stderr, "Server ");
|
||||
CLOG_ERR( "Server ");
|
||||
rdpsnd_print_audio_formats(rdpsnd->ServerFormats, rdpsnd->NumberOfServerFormats);
|
||||
fprintf(stderr, "\n");
|
||||
CLOG_ERR( "\n");
|
||||
|
||||
fprintf(stderr, "Client ");
|
||||
CLOG_ERR( "Client ");
|
||||
rdpsnd_print_audio_formats(rdpsnd->ClientFormats, rdpsnd->NumberOfClientFormats);
|
||||
fprintf(stderr, "\n");
|
||||
CLOG_ERR( "\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -544,7 +544,7 @@ static void rdpsnd_recv_pdu(rdpsndPlugin* rdpsnd, wStream* s)
|
||||
Stream_Seek_UINT8(s); /* bPad */
|
||||
Stream_Read_UINT16(s, BodySize);
|
||||
|
||||
//fprintf(stderr, "msgType %d BodySize %d\n", msgType, BodySize);
|
||||
//CLOG_ERR( "msgType %d BodySize %d\n", msgType, BodySize);
|
||||
|
||||
switch (msgType)
|
||||
{
|
||||
@ -569,7 +569,7 @@ static void rdpsnd_recv_pdu(rdpsndPlugin* rdpsnd, wStream* s)
|
||||
break;
|
||||
|
||||
default:
|
||||
DEBUG_WARN("unknown msgType %d", msgType);
|
||||
CLOG_ERR("unknown msgType %d", msgType);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -580,7 +580,7 @@ static void rdpsnd_register_device_plugin(rdpsndPlugin* rdpsnd, rdpsndDevicePlug
|
||||
{
|
||||
if (rdpsnd->device)
|
||||
{
|
||||
DEBUG_WARN("existing device, abort.");
|
||||
CLOG_ERR("existing device, abort.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -606,7 +606,7 @@ static BOOL rdpsnd_load_device_plugin(rdpsndPlugin* rdpsnd, const char* name, AD
|
||||
|
||||
if (entry(&entryPoints) != 0)
|
||||
{
|
||||
DEBUG_WARN("%s entry returns error.", name);
|
||||
CLOG_ERR("%s entry returns error.", name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -795,7 +795,7 @@ static void rdpsnd_process_connect(rdpsndPlugin* rdpsnd)
|
||||
|
||||
if (!rdpsnd->device)
|
||||
{
|
||||
DEBUG_WARN("no sound device.");
|
||||
CLOG_ERR("no sound device.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -875,7 +875,7 @@ int rdpsnd_virtual_channel_write(rdpsndPlugin* rdpsnd, wStream* s)
|
||||
if (status != CHANNEL_RC_OK)
|
||||
{
|
||||
Stream_Free(s, TRUE);
|
||||
fprintf(stderr, "rdpdr_virtual_channel_write: VirtualChannelWrite failed %d\n", status);
|
||||
CLOG_ERR( "rdpdr_virtual_channel_write: VirtualChannelWrite failed %d\n", status);
|
||||
}
|
||||
|
||||
return status;
|
||||
@ -907,7 +907,7 @@ static void rdpsnd_virtual_channel_event_data_received(rdpsndPlugin* plugin,
|
||||
{
|
||||
if (Stream_Capacity(s) != Stream_GetPosition(s))
|
||||
{
|
||||
fprintf(stderr, "rdpsnd_virtual_channel_event_data_received: read error\n");
|
||||
CLOG_ERR( "rdpsnd_virtual_channel_event_data_received: read error\n");
|
||||
}
|
||||
|
||||
plugin->data_in = NULL;
|
||||
@ -927,7 +927,7 @@ static VOID VCAPITYPE rdpsnd_virtual_channel_open_event(DWORD openHandle, UINT e
|
||||
|
||||
if (!plugin)
|
||||
{
|
||||
fprintf(stderr, "rdpsnd_virtual_channel_open_event: error no match\n");
|
||||
CLOG_ERR( "rdpsnd_virtual_channel_open_event: error no match\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -987,7 +987,7 @@ static void rdpsnd_virtual_channel_event_connected(rdpsndPlugin* plugin, LPVOID
|
||||
|
||||
if (status != CHANNEL_RC_OK)
|
||||
{
|
||||
fprintf(stderr, "rdpsnd_virtual_channel_event_connected: open failed: status: %d\n", status);
|
||||
CLOG_ERR( "rdpsnd_virtual_channel_event_connected: open failed: status: %d\n", status);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1040,7 +1040,7 @@ static VOID VCAPITYPE rdpsnd_virtual_channel_init_event(LPVOID pInitHandle, UINT
|
||||
|
||||
if (!plugin)
|
||||
{
|
||||
fprintf(stderr, "rdpsnd_virtual_channel_init_event: error no match\n");
|
||||
CLOG_ERR( "rdpsnd_virtual_channel_init_event: error no match\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include <freerdp/client/rdpsnd.h>
|
||||
|
||||
#if defined(WITH_DEBUG_SND)
|
||||
#define DEBUG_SND(fmt, ...) DEBUG_CLASS("rdpsnd", fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_SND(fmt, ...) CLOG_CLASS("rdpsnd", fmt, ## __VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG_SND(fmt, ...) do { } while (0)
|
||||
#endif
|
||||
|
@ -34,6 +34,7 @@
|
||||
|
||||
#include <freerdp/types.h>
|
||||
#include <freerdp/codec/dsp.h>
|
||||
#include <freerdp/channels/log.h>
|
||||
|
||||
#include "rdpsnd_main.h"
|
||||
|
||||
@ -101,11 +102,11 @@ static void CALLBACK rdpsnd_winmm_callback_function(HWAVEOUT hwo, UINT uMsg, DWO
|
||||
switch (uMsg)
|
||||
{
|
||||
case MM_WOM_OPEN:
|
||||
fprintf(stderr, "MM_WOM_OPEN\n");
|
||||
CLOG_ERR( "MM_WOM_OPEN\n");
|
||||
break;
|
||||
|
||||
case MM_WOM_CLOSE:
|
||||
fprintf(stderr, "MM_WOM_CLOSE\n");
|
||||
CLOG_ERR( "MM_WOM_CLOSE\n");
|
||||
break;
|
||||
|
||||
case MM_WOM_DONE:
|
||||
@ -121,7 +122,7 @@ static void CALLBACK rdpsnd_winmm_callback_function(HWAVEOUT hwo, UINT uMsg, DWO
|
||||
if (!wave)
|
||||
return;
|
||||
|
||||
fprintf(stderr, "MM_WOM_DONE: dwBufferLength: %d cBlockNo: %d\n",
|
||||
CLOG_ERR( "MM_WOM_DONE: dwBufferLength: %d cBlockNo: %d\n",
|
||||
lpWaveHdr->dwBufferLength, wave->cBlockNo);
|
||||
|
||||
wave->wLocalTimeB = GetTickCount();
|
||||
@ -155,7 +156,7 @@ static void rdpsnd_winmm_open(rdpsndDevicePlugin* device, AUDIO_FORMAT* format,
|
||||
|
||||
if (mmResult != MMSYSERR_NOERROR)
|
||||
{
|
||||
fprintf(stderr, "waveOutOpen failed: %d\n", mmResult);
|
||||
CLOG_ERR( "waveOutOpen failed: %d\n", mmResult);
|
||||
}
|
||||
}
|
||||
|
||||
@ -172,7 +173,7 @@ static void rdpsnd_winmm_close(rdpsndDevicePlugin* device)
|
||||
|
||||
if (mmResult != MMSYSERR_NOERROR)
|
||||
{
|
||||
fprintf(stderr, "waveOutClose failure: %d\n", mmResult);
|
||||
CLOG_ERR( "waveOutClose failure: %d\n", mmResult);
|
||||
}
|
||||
|
||||
winmm->hWaveOut = NULL;
|
||||
@ -299,7 +300,7 @@ void rdpsnd_winmm_wave_play(rdpsndDevicePlugin* device, RDPSND_WAVE* wave)
|
||||
|
||||
if (mmResult != MMSYSERR_NOERROR)
|
||||
{
|
||||
fprintf(stderr, "waveOutPrepareHeader failure: %d\n", mmResult);
|
||||
CLOG_ERR( "waveOutPrepareHeader failure: %d\n", mmResult);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -307,7 +308,7 @@ void rdpsnd_winmm_wave_play(rdpsndDevicePlugin* device, RDPSND_WAVE* wave)
|
||||
|
||||
if (mmResult != MMSYSERR_NOERROR)
|
||||
{
|
||||
fprintf(stderr, "waveOutWrite failure: %d\n", mmResult);
|
||||
CLOG_ERR( "waveOutWrite failure: %d\n", mmResult);
|
||||
waveOutUnprepareHeader(winmm->hWaveOut, lpWaveHdr, sizeof(WAVEHDR));
|
||||
return;
|
||||
}
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include <winpr/print.h>
|
||||
#include <winpr/stream.h>
|
||||
|
||||
#include <freerdp/channels/log.h>
|
||||
|
||||
#include "rdpsnd_main.h"
|
||||
|
||||
BOOL rdpsnd_server_send_formats(RdpsndServerContext* context, wStream* s)
|
||||
@ -108,7 +110,7 @@ static BOOL rdpsnd_server_recv_quality_mode(RdpsndServerContext* context, wStrea
|
||||
Stream_Read_UINT16(s, quality);
|
||||
Stream_Seek_UINT16(s); // reserved
|
||||
|
||||
fprintf(stderr, "Client requested sound quality: %#0X\n", quality);
|
||||
CLOG_ERR( "Client requested sound quality: %#0X\n", quality);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -137,7 +139,7 @@ static BOOL rdpsnd_server_recv_formats(RdpsndServerContext* context, wStream* s)
|
||||
|
||||
if (!context->num_client_formats)
|
||||
{
|
||||
fprintf(stderr, "%s: client doesn't support any format!\n", __FUNCTION__);
|
||||
CLOG_ERR( "%s: client doesn't support any format!\n", __FUNCTION__);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -174,7 +176,7 @@ static BOOL rdpsnd_server_recv_formats(RdpsndServerContext* context, wStream* s)
|
||||
|
||||
if (!context->num_client_formats)
|
||||
{
|
||||
fprintf(stderr, "%s: client doesn't support any known format!\n", __FUNCTION__);
|
||||
CLOG_ERR( "%s: client doesn't support any known format!\n", __FUNCTION__);
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
@ -230,7 +232,7 @@ static BOOL rdpsnd_server_select_format(RdpsndServerContext* context, int client
|
||||
|
||||
if (client_format_index < 0 || client_format_index >= context->num_client_formats)
|
||||
{
|
||||
fprintf(stderr, "%s: index %d is not correct.\n", __FUNCTION__, client_format_index);
|
||||
CLOG_ERR( "%s: index %d is not correct.\n", __FUNCTION__, client_format_index);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -242,7 +244,7 @@ static BOOL rdpsnd_server_select_format(RdpsndServerContext* context, int client
|
||||
|
||||
if (format->nSamplesPerSec == 0)
|
||||
{
|
||||
fprintf(stderr, "%s: invalid Client Sound Format!!\n", __FUNCTION__);
|
||||
CLOG_ERR( "%s: invalid Client Sound Format!!\n", __FUNCTION__);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -475,7 +477,7 @@ static int rdpsnd_server_start(RdpsndServerContext* context)
|
||||
|
||||
if (!WTSVirtualChannelQuery(priv->ChannelHandle, WTSVirtualEventHandle, &buffer, &bytesReturned) || (bytesReturned != sizeof(HANDLE)))
|
||||
{
|
||||
fprintf(stderr, "%s: error during WTSVirtualChannelQuery(WTSVirtualEventHandle) or invalid returned size(%d)\n",
|
||||
CLOG_ERR( "%s: error during WTSVirtualChannelQuery(WTSVirtualEventHandle) or invalid returned size(%d)\n",
|
||||
__FUNCTION__, bytesReturned);
|
||||
if (buffer)
|
||||
WTSFreeMemory(buffer);
|
||||
@ -631,7 +633,7 @@ BOOL rdpsnd_server_handle_messages(RdpsndServerContext *context)
|
||||
if (GetLastError() == ERROR_NO_DATA)
|
||||
return TRUE;
|
||||
|
||||
fprintf(stderr, "%s: channel connection closed\n", __FUNCTION__);
|
||||
CLOG_ERR( "%s: channel connection closed\n", __FUNCTION__);
|
||||
return FALSE;
|
||||
}
|
||||
priv->expectedBytes -= bytesReturned;
|
||||
@ -659,7 +661,7 @@ BOOL rdpsnd_server_handle_messages(RdpsndServerContext *context)
|
||||
|
||||
/* when here we have the header + the body */
|
||||
#ifdef WITH_DEBUG_SND
|
||||
fprintf(stderr, "%s: message type %d\n", __FUNCTION__, priv->msgType);
|
||||
CLOG_ERR( "%s: message type %d\n", __FUNCTION__, priv->msgType);
|
||||
#endif
|
||||
priv->expectedBytes = 4;
|
||||
priv->waitingHeader = TRUE;
|
||||
@ -685,7 +687,7 @@ BOOL rdpsnd_server_handle_messages(RdpsndServerContext *context)
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "%s: UNKOWN MESSAGE TYPE!! (%#0X)\n\n", __FUNCTION__, priv->msgType);
|
||||
CLOG_ERR( "%s: UNKOWN MESSAGE TYPE!! (%#0X)\n\n", __FUNCTION__, priv->msgType);
|
||||
ret = FALSE;
|
||||
break;
|
||||
}
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
#include <freerdp/assistance.h>
|
||||
|
||||
#include <freerdp/channels/log.h>
|
||||
#include <freerdp/client/remdesk.h>
|
||||
|
||||
#include "remdesk_main.h"
|
||||
@ -49,7 +50,7 @@ int remdesk_virtual_channel_write(remdeskPlugin* remdesk, wStream* s)
|
||||
|
||||
if (status != CHANNEL_RC_OK)
|
||||
{
|
||||
fprintf(stderr, "remdesk_virtual_channel_write: VirtualChannelWrite failed %d\n", status);
|
||||
CLOG_ERR( "remdesk_virtual_channel_write: VirtualChannelWrite failed %d\n", status);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -225,7 +226,7 @@ static int remdesk_recv_ctl_result_pdu(remdeskPlugin* remdesk, wStream* s, REMDE
|
||||
|
||||
*pResult = result;
|
||||
|
||||
//printf("RemdeskRecvResult: 0x%04X\n", result);
|
||||
//CLOG_DBG("RemdeskRecvResult: 0x%04X\n", result);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -396,7 +397,7 @@ static int remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, REMDESK_CHAN
|
||||
|
||||
Stream_Read_UINT32(s, msgType); /* msgType (4 bytes) */
|
||||
|
||||
//printf("msgType: %d\n", msgType);
|
||||
//CLOG_DBG("msgType: %d\n", msgType);
|
||||
|
||||
switch (msgType)
|
||||
{
|
||||
@ -461,7 +462,7 @@ static int remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, REMDESK_CHAN
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "remdesk_recv_control_pdu: unknown msgType: %d\n", msgType);
|
||||
CLOG_ERR( "remdesk_recv_control_pdu: unknown msgType: %d\n", msgType);
|
||||
status = -1;
|
||||
break;
|
||||
}
|
||||
@ -475,7 +476,7 @@ static int remdesk_process_receive(remdeskPlugin* remdesk, wStream* s)
|
||||
REMDESK_CHANNEL_HEADER header;
|
||||
|
||||
#if 0
|
||||
printf("RemdeskReceive: %d\n", Stream_GetRemainingLength(s));
|
||||
CLOG_DBG("RemdeskReceive: %d\n", Stream_GetRemainingLength(s));
|
||||
winpr_HexDump(Stream_Pointer(s), Stream_GetRemainingLength(s));
|
||||
#endif
|
||||
|
||||
@ -585,7 +586,7 @@ int remdesk_send(remdeskPlugin* remdesk, wStream* s)
|
||||
if (status != CHANNEL_RC_OK)
|
||||
{
|
||||
Stream_Free(s, TRUE);
|
||||
fprintf(stderr, "remdesk_send: VirtualChannelWrite failed %d\n", status);
|
||||
CLOG_ERR( "remdesk_send: VirtualChannelWrite failed %d\n", status);
|
||||
}
|
||||
|
||||
return status;
|
||||
@ -617,7 +618,7 @@ static void remdesk_virtual_channel_event_data_received(remdeskPlugin* remdesk,
|
||||
{
|
||||
if (Stream_Capacity(data_in) != Stream_GetPosition(data_in))
|
||||
{
|
||||
fprintf(stderr, "remdesk_plugin_process_received: read error\n");
|
||||
CLOG_ERR( "remdesk_plugin_process_received: read error\n");
|
||||
}
|
||||
|
||||
remdesk->data_in = NULL;
|
||||
@ -637,7 +638,7 @@ static VOID VCAPITYPE remdesk_virtual_channel_open_event(DWORD openHandle, UINT
|
||||
|
||||
if (!remdesk)
|
||||
{
|
||||
fprintf(stderr, "remdesk_virtual_channel_open_event: error no match\n");
|
||||
CLOG_ERR( "remdesk_virtual_channel_open_event: error no match\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -697,7 +698,7 @@ static void remdesk_virtual_channel_event_connected(remdeskPlugin* remdesk, LPVO
|
||||
|
||||
if (status != CHANNEL_RC_OK)
|
||||
{
|
||||
fprintf(stderr, "remdesk_virtual_channel_event_connected: open failed: status: %d\n", status);
|
||||
CLOG_ERR( "remdesk_virtual_channel_event_connected: open failed: status: %d\n", status);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -735,7 +736,7 @@ static VOID VCAPITYPE remdesk_virtual_channel_init_event(LPVOID pInitHandle, UIN
|
||||
|
||||
if (!remdesk)
|
||||
{
|
||||
fprintf(stderr, "remdesk_virtual_channel_init_event: error no match\n");
|
||||
CLOG_ERR( "remdesk_virtual_channel_init_event: error no match\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -372,7 +372,7 @@ void smartcard_process_irp(SMARTCARD_DEVICE* smartcard, IRP* irp)
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "Unexpected SmartCard IRP: MajorFunction 0x%08X MinorFunction: 0x%08X",
|
||||
CLOG_ERR( "Unexpected SmartCard IRP: MajorFunction 0x%08X MinorFunction: 0x%08X",
|
||||
irp->MajorFunction, irp->MinorFunction);
|
||||
|
||||
irp->IoStatus = STATUS_NOT_SUPPORTED;
|
||||
|
@ -21,7 +21,7 @@
|
||||
#ifndef FREERDP_CHANNEL_SMARTCARD_CLIENT_MAIN_H
|
||||
#define FREERDP_CHANNEL_SMARTCARD_CLIENT_MAIN_H
|
||||
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/channels/log.h>
|
||||
#include <freerdp/channels/rdpdr.h>
|
||||
|
||||
#include <winpr/crt.h>
|
||||
|
@ -1142,7 +1142,7 @@ UINT32 smartcard_irp_device_control_decode(SMARTCARD_DEVICE* smartcard, SMARTCAR
|
||||
smartcard_get_ioctl_string(ioControlCode, TRUE), ioControlCode, irp->FileId, irp->CompletionId);
|
||||
|
||||
#if 0
|
||||
printf("%s (0x%08X) FileId: %d CompletionId: %d\n",
|
||||
CLOG_DBG("%s (0x%08X) FileId: %d CompletionId: %d\n",
|
||||
smartcard_get_ioctl_string(ioControlCode, TRUE), ioControlCode, irp->FileId, irp->CompletionId);
|
||||
#endif
|
||||
|
||||
|
@ -56,7 +56,7 @@ static BOOL tsmf_alsa_open_device(TSMFAlsaAudioDevice *alsa)
|
||||
error = snd_pcm_open(&alsa->out_handle, alsa->device, SND_PCM_STREAM_PLAYBACK, 0);
|
||||
if(error < 0)
|
||||
{
|
||||
DEBUG_WARN("failed to open device %s", alsa->device);
|
||||
CLOG_ERR("failed to open device %s", alsa->device);
|
||||
return FALSE;
|
||||
}
|
||||
DEBUG_TSMF("open device %s", alsa->device);
|
||||
@ -95,7 +95,7 @@ static BOOL tsmf_alsa_set_format(ITSMFAudioDevice *audio,
|
||||
error = snd_pcm_hw_params_malloc(&hw_params);
|
||||
if(error < 0)
|
||||
{
|
||||
DEBUG_WARN("snd_pcm_hw_params_malloc failed");
|
||||
CLOG_ERR("snd_pcm_hw_params_malloc failed");
|
||||
return FALSE;
|
||||
}
|
||||
snd_pcm_hw_params_any(alsa->out_handle, hw_params);
|
||||
@ -115,7 +115,7 @@ static BOOL tsmf_alsa_set_format(ITSMFAudioDevice *audio,
|
||||
error = snd_pcm_sw_params_malloc(&sw_params);
|
||||
if(error < 0)
|
||||
{
|
||||
DEBUG_WARN("snd_pcm_sw_params_malloc");
|
||||
CLOG_ERR("snd_pcm_sw_params_malloc");
|
||||
return FALSE;
|
||||
}
|
||||
snd_pcm_sw_params_current(alsa->out_handle, sw_params);
|
||||
|
@ -27,10 +27,12 @@
|
||||
|
||||
#include <winpr/crt.h>
|
||||
|
||||
#include <freerdp/channels/log.h>
|
||||
#include <freerdp/utils/event.h>
|
||||
#include <freerdp/client/tsmf.h>
|
||||
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libavutil/common.h>
|
||||
|
||||
#include "tsmf_constants.h"
|
||||
#include "tsmf_decoder.h"
|
||||
@ -47,6 +49,20 @@
|
||||
#define MAX_AUDIO_FRAME_SIZE 192000
|
||||
#endif
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 55
|
||||
#define AV_CODEC_ID_VC1 CODEC_ID_VC1
|
||||
#define AV_CODEC_ID_WMAV2 CODEC_ID_WMAV2
|
||||
#define AV_CODEC_ID_WMAPRO CODEC_ID_WMAPRO
|
||||
#define AV_CODEC_ID_MP3 CODEC_ID_MP3
|
||||
#define AV_CODEC_ID_MP2 CODEC_ID_MP2
|
||||
#define AV_CODEC_ID_MPEG2VIDEO CODEC_ID_MPEG2VIDEO
|
||||
#define AV_CODEC_ID_WMV3 CODEC_ID_WMV3
|
||||
#define AV_CODEC_ID_AAC CODEC_ID_AAC
|
||||
#define AV_CODEC_ID_H264 CODEC_ID_H264
|
||||
#define AV_CODEC_ID_AC3 CODEC_ID_AC3
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct _TSMFFFmpegDecoder
|
||||
{
|
||||
ITSMFDecoder iface;
|
||||
@ -73,7 +89,7 @@ static BOOL tsmf_ffmpeg_init_context(ITSMFDecoder *decoder)
|
||||
mdecoder->codec_context = avcodec_alloc_context3(NULL);
|
||||
if(!mdecoder->codec_context)
|
||||
{
|
||||
DEBUG_WARN("avcodec_alloc_context failed.");
|
||||
CLOG_ERR("avcodec_alloc_context failed.");
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
@ -127,7 +143,7 @@ static BOOL tsmf_ffmpeg_init_stream(ITSMFDecoder *decoder, const TS_AM_MEDIA_TYP
|
||||
mdecoder->codec = avcodec_find_decoder(mdecoder->codec_id);
|
||||
if(!mdecoder->codec)
|
||||
{
|
||||
DEBUG_WARN("avcodec_find_decoder failed.");
|
||||
CLOG_ERR("avcodec_find_decoder failed.");
|
||||
return FALSE;
|
||||
}
|
||||
mdecoder->codec_context->codec_id = mdecoder->codec_id;
|
||||
@ -189,7 +205,7 @@ static BOOL tsmf_ffmpeg_prepare(ITSMFDecoder *decoder)
|
||||
TSMFFFmpegDecoder *mdecoder = (TSMFFFmpegDecoder *) decoder;
|
||||
if(avcodec_open2(mdecoder->codec_context, mdecoder->codec, NULL) < 0)
|
||||
{
|
||||
DEBUG_WARN("avcodec_open2 failed.");
|
||||
CLOG_ERR("avcodec_open2 failed.");
|
||||
return FALSE;
|
||||
}
|
||||
mdecoder->prepared = 1;
|
||||
@ -213,28 +229,28 @@ static BOOL tsmf_ffmpeg_set_format(ITSMFDecoder *decoder, TS_AM_MEDIA_TYPE *medi
|
||||
switch(media_type->SubType)
|
||||
{
|
||||
case TSMF_SUB_TYPE_WVC1:
|
||||
mdecoder->codec_id = CODEC_ID_VC1;
|
||||
mdecoder->codec_id = AV_CODEC_ID_VC1;
|
||||
break;
|
||||
case TSMF_SUB_TYPE_WMA2:
|
||||
mdecoder->codec_id = CODEC_ID_WMAV2;
|
||||
mdecoder->codec_id = AV_CODEC_ID_WMAV2;
|
||||
break;
|
||||
case TSMF_SUB_TYPE_WMA9:
|
||||
mdecoder->codec_id = CODEC_ID_WMAPRO;
|
||||
mdecoder->codec_id = AV_CODEC_ID_WMAPRO;
|
||||
break;
|
||||
case TSMF_SUB_TYPE_MP3:
|
||||
mdecoder->codec_id = CODEC_ID_MP3;
|
||||
mdecoder->codec_id = AV_CODEC_ID_MP3;
|
||||
break;
|
||||
case TSMF_SUB_TYPE_MP2A:
|
||||
mdecoder->codec_id = CODEC_ID_MP2;
|
||||
mdecoder->codec_id = AV_CODEC_ID_MP2;
|
||||
break;
|
||||
case TSMF_SUB_TYPE_MP2V:
|
||||
mdecoder->codec_id = CODEC_ID_MPEG2VIDEO;
|
||||
mdecoder->codec_id = AV_CODEC_ID_MPEG2VIDEO;
|
||||
break;
|
||||
case TSMF_SUB_TYPE_WMV3:
|
||||
mdecoder->codec_id = CODEC_ID_WMV3;
|
||||
mdecoder->codec_id = AV_CODEC_ID_WMV3;
|
||||
break;
|
||||
case TSMF_SUB_TYPE_AAC:
|
||||
mdecoder->codec_id = CODEC_ID_AAC;
|
||||
mdecoder->codec_id = AV_CODEC_ID_AAC;
|
||||
/* For AAC the pFormat is a HEAACWAVEINFO struct, and the codec data
|
||||
is at the end of it. See
|
||||
http://msdn.microsoft.com/en-us/library/dd757806.aspx */
|
||||
@ -246,10 +262,10 @@ static BOOL tsmf_ffmpeg_set_format(ITSMFDecoder *decoder, TS_AM_MEDIA_TYPE *medi
|
||||
break;
|
||||
case TSMF_SUB_TYPE_H264:
|
||||
case TSMF_SUB_TYPE_AVC1:
|
||||
mdecoder->codec_id = CODEC_ID_H264;
|
||||
mdecoder->codec_id = AV_CODEC_ID_H264;
|
||||
break;
|
||||
case TSMF_SUB_TYPE_AC3:
|
||||
mdecoder->codec_id = CODEC_ID_AC3;
|
||||
mdecoder->codec_id = AV_CODEC_ID_AC3;
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
@ -285,13 +301,13 @@ static BOOL tsmf_ffmpeg_decode_video(ITSMFDecoder *decoder, const BYTE *data, UI
|
||||
#endif
|
||||
if(len < 0)
|
||||
{
|
||||
DEBUG_WARN("data_size %d, avcodec_decode_video failed (%d)", data_size, len);
|
||||
CLOG_ERR("data_size %d, avcodec_decode_video failed (%d)", data_size, len);
|
||||
ret = FALSE;
|
||||
}
|
||||
else
|
||||
if(!decoded)
|
||||
{
|
||||
DEBUG_WARN("data_size %d, no frame is decoded.", data_size);
|
||||
CLOG_ERR("data_size %d, no frame is decoded.", data_size);
|
||||
ret = FALSE;
|
||||
}
|
||||
else
|
||||
@ -387,7 +403,7 @@ static BOOL tsmf_ffmpeg_decode_audio(ITSMFDecoder *decoder, const BYTE *data, UI
|
||||
#endif
|
||||
if(len <= 0 || frame_size <= 0)
|
||||
{
|
||||
DEBUG_WARN("error decoding");
|
||||
CLOG_ERR("error decoding");
|
||||
break;
|
||||
}
|
||||
src += len;
|
||||
@ -427,7 +443,7 @@ static BOOL tsmf_ffmpeg_decode(ITSMFDecoder *decoder, const BYTE *data, UINT32 d
|
||||
case AVMEDIA_TYPE_AUDIO:
|
||||
return tsmf_ffmpeg_decode_audio(decoder, data, data_size, extensions);
|
||||
default:
|
||||
DEBUG_WARN("unknown media type.");
|
||||
CLOG_ERR("unknown media type.");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@ -451,7 +467,7 @@ static UINT32 tsmf_ffmpeg_get_decoded_format(ITSMFDecoder *decoder)
|
||||
case PIX_FMT_YUV420P:
|
||||
return RDP_PIXFMT_I420;
|
||||
default:
|
||||
DEBUG_WARN("unsupported pixel format %u",
|
||||
CLOG_ERR("unsupported pixel format %u",
|
||||
mdecoder->codec_context->pix_fmt);
|
||||
return (UINT32) -1;
|
||||
}
|
||||
@ -504,7 +520,7 @@ ITSMFDecoder *freerdp_tsmf_client_decoder_subsystem_entry(void)
|
||||
avcodec_register_all();
|
||||
initialized = TRUE;
|
||||
}
|
||||
fprintf(stderr, "TSMFDecoderEntry FFMPEG\n");
|
||||
CLOG_ERR( "TSMFDecoderEntry FFMPEG\n");
|
||||
decoder = (TSMFFFmpegDecoder *) malloc(sizeof(TSMFFFmpegDecoder));
|
||||
ZeroMemory(decoder, sizeof(TSMFFFmpegDecoder));
|
||||
decoder->iface.SetFormat = tsmf_ffmpeg_set_format;
|
||||
|
@ -87,7 +87,7 @@ int tsmf_platform_create(TSMFGstreamerDecoder *decoder)
|
||||
|
||||
if (!hdl)
|
||||
{
|
||||
DEBUG_WARN("%s: Could not allocate handle.", __func__);
|
||||
CLOG_ERR("%s: Could not allocate handle.", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@ int tsmf_platform_create(TSMFGstreamerDecoder *decoder)
|
||||
|
||||
if (hdl->shmid < 0)
|
||||
{
|
||||
DEBUG_WARN("%s: failed to get access to shared memory - shmget()",
|
||||
CLOG_ERR("%s: failed to get access to shared memory - shmget()",
|
||||
__func__);
|
||||
return -2;
|
||||
}
|
||||
@ -106,7 +106,7 @@ int tsmf_platform_create(TSMFGstreamerDecoder *decoder)
|
||||
|
||||
if (hdl->xfwin == (int *)-1)
|
||||
{
|
||||
DEBUG_WARN("%s: shmat failed!", __func__);
|
||||
CLOG_ERR("%s: shmat failed!", __func__);
|
||||
return -3;
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ int tsmf_platform_create(TSMFGstreamerDecoder *decoder)
|
||||
|
||||
if (!hdl->disp)
|
||||
{
|
||||
DEBUG_WARN("Failed to open display");
|
||||
CLOG_ERR("Failed to open display");
|
||||
return -4;
|
||||
}
|
||||
|
||||
@ -140,7 +140,7 @@ int tsmf_platform_register_handler(TSMFGstreamerDecoder *decoder)
|
||||
|
||||
if (!bus)
|
||||
{
|
||||
DEBUG_WARN("gst_pipeline_get_bus failed!");
|
||||
CLOG_ERR("gst_pipeline_get_bus failed!");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -193,7 +193,7 @@ int tsmf_window_create(TSMFGstreamerDecoder *decoder)
|
||||
|
||||
if (!hdl->subwin)
|
||||
{
|
||||
DEBUG_WARN("Could not create subwindow!");
|
||||
CLOG_ERR("Could not create subwindow!");
|
||||
}
|
||||
|
||||
XMapWindow(hdl->disp, hdl->subwin);
|
||||
@ -238,14 +238,14 @@ int tsmf_window_resize(TSMFGstreamerDecoder *decoder, int x, int y, int width,
|
||||
|
||||
if (!gst_video_overlay_set_render_rectangle(overlay, 0, 0, width, height))
|
||||
{
|
||||
DEBUG_WARN("Could not resize overlay!");
|
||||
CLOG_ERR("Could not resize overlay!");
|
||||
}
|
||||
|
||||
gst_video_overlay_expose(overlay);
|
||||
#else
|
||||
if (!gst_x_overlay_set_render_rectangle(overlay, 0, 0, width, height))
|
||||
{
|
||||
DEBUG_WARN("Could not resize overlay!");
|
||||
CLOG_ERR("Could not resize overlay!");
|
||||
}
|
||||
|
||||
gst_x_overlay_expose(overlay);
|
||||
|
@ -120,10 +120,10 @@ int tsmf_gstreamer_pipeline_set_state(TSMFGstreamerDecoder *mdecoder, GstState d
|
||||
state_change = gst_element_set_state(mdecoder->pipe, desired_state);
|
||||
|
||||
if (state_change == GST_STATE_CHANGE_FAILURE)
|
||||
DEBUG_WARN("%s: (%s) GST_STATE_CHANGE_FAILURE.", sname, name);
|
||||
CLOG_ERR("%s: (%s) GST_STATE_CHANGE_FAILURE.", sname, name);
|
||||
else if (state_change == GST_STATE_CHANGE_ASYNC)
|
||||
{
|
||||
DEBUG_WARN("%s: (%s) GST_STATE_CHANGE_ASYNC.", sname, name);
|
||||
CLOG_ERR("%s: (%s) GST_STATE_CHANGE_ASYNC.", sname, name);
|
||||
mdecoder->state = desired_state;
|
||||
}
|
||||
else
|
||||
@ -142,7 +142,7 @@ static GstBuffer *tsmf_get_buffer_from_data(const void *raw_data, gsize size)
|
||||
|
||||
if (!data)
|
||||
{
|
||||
DEBUG_WARN("Could not allocate %"G_GSIZE_FORMAT" bytes of data.", size);
|
||||
CLOG_ERR("Could not allocate %"G_GSIZE_FORMAT" bytes of data.", size);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -154,7 +154,7 @@ static GstBuffer *tsmf_get_buffer_from_data(const void *raw_data, gsize size)
|
||||
|
||||
if (!buffer)
|
||||
{
|
||||
DEBUG_WARN("Could not create GstBuffer");
|
||||
CLOG_ERR("Could not create GstBuffer");
|
||||
free(data);
|
||||
return NULL;
|
||||
}
|
||||
@ -346,7 +346,7 @@ static BOOL tsmf_gstreamer_set_format(ITSMFDecoder *decoder, TS_AM_MEDIA_TYPE *m
|
||||
NULL);
|
||||
break;
|
||||
default:
|
||||
DEBUG_WARN("unknown format:(%d).", media_type->SubType);
|
||||
CLOG_ERR("unknown format:(%d).", media_type->SubType);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -358,7 +358,7 @@ static BOOL tsmf_gstreamer_set_format(ITSMFDecoder *decoder, TS_AM_MEDIA_TYPE *m
|
||||
|
||||
if (!buffer)
|
||||
{
|
||||
DEBUG_WARN("could not allocate GstBuffer!");
|
||||
CLOG_ERR("could not allocate GstBuffer!");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -416,7 +416,7 @@ BOOL tsmf_gstreamer_pipeline_build(TSMFGstreamerDecoder *mdecoder)
|
||||
|
||||
if (!mdecoder->pipe)
|
||||
{
|
||||
DEBUG_WARN("Failed to create new pipe");
|
||||
CLOG_ERR("Failed to create new pipe");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -424,7 +424,7 @@ BOOL tsmf_gstreamer_pipeline_build(TSMFGstreamerDecoder *mdecoder)
|
||||
|
||||
if (!mdecoder->src)
|
||||
{
|
||||
DEBUG_WARN("Failed to get appsrc");
|
||||
CLOG_ERR("Failed to get appsrc");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -432,7 +432,7 @@ BOOL tsmf_gstreamer_pipeline_build(TSMFGstreamerDecoder *mdecoder)
|
||||
|
||||
if (!mdecoder->outsink)
|
||||
{
|
||||
DEBUG_WARN("Failed to get sink");
|
||||
CLOG_ERR("Failed to get sink");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -442,7 +442,7 @@ BOOL tsmf_gstreamer_pipeline_build(TSMFGstreamerDecoder *mdecoder)
|
||||
|
||||
if (!mdecoder->volume)
|
||||
{
|
||||
DEBUG_WARN("Failed to get volume");
|
||||
CLOG_ERR("Failed to get volume");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@ -482,7 +482,7 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder *decoder, const BYTE *data, UIN
|
||||
|
||||
if (!mdecoder)
|
||||
{
|
||||
DEBUG_WARN("Decoder not initialized!");
|
||||
CLOG_ERR("Decoder not initialized!");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -498,13 +498,13 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder *decoder, const BYTE *data, UIN
|
||||
|
||||
if (mdecoder->gst_caps == NULL)
|
||||
{
|
||||
DEBUG_WARN("tsmf_gstreamer_set_format not called or invalid format.");
|
||||
CLOG_ERR("tsmf_gstreamer_set_format not called or invalid format.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!mdecoder->src)
|
||||
{
|
||||
DEBUG_WARN("failed to construct pipeline correctly. Unable to push buffer to source element.");
|
||||
CLOG_ERR("failed to construct pipeline correctly. Unable to push buffer to source element.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -512,7 +512,7 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder *decoder, const BYTE *data, UIN
|
||||
|
||||
if (gst_buf == NULL)
|
||||
{
|
||||
DEBUG_WARN("tsmf_get_buffer_from_data(%p, %d) failed.", data, data_size);
|
||||
CLOG_ERR("tsmf_get_buffer_from_data(%p, %d) failed.", data, data_size);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -534,7 +534,7 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder *decoder, const BYTE *data, UIN
|
||||
GST_SEEK_TYPE_SET, sample_time,
|
||||
GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
|
||||
{
|
||||
DEBUG_WARN("seek failed");
|
||||
CLOG_ERR("seek failed");
|
||||
}
|
||||
|
||||
mdecoder->pipeline_start_time_valid = 0;
|
||||
@ -608,7 +608,7 @@ static void tsmf_gstreamer_control(ITSMFDecoder *decoder, ITSMFControlMsg contro
|
||||
|
||||
if (mdecoder->paused)
|
||||
{
|
||||
DEBUG_WARN("%s: Ignoring control PAUSE, already received!", get_type(mdecoder));
|
||||
CLOG_ERR("%s: Ignoring control PAUSE, already received!", get_type(mdecoder));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -624,7 +624,7 @@ static void tsmf_gstreamer_control(ITSMFDecoder *decoder, ITSMFControlMsg contro
|
||||
|
||||
if (!mdecoder->paused && !mdecoder->shutdown)
|
||||
{
|
||||
DEBUG_WARN("%s: Ignoring control RESUME, already received!", get_type(mdecoder));
|
||||
CLOG_ERR("%s: Ignoring control RESUME, already received!", get_type(mdecoder));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -642,7 +642,7 @@ static void tsmf_gstreamer_control(ITSMFDecoder *decoder, ITSMFControlMsg contro
|
||||
|
||||
if (mdecoder->shutdown)
|
||||
{
|
||||
DEBUG_WARN("%s: Ignoring control STOP, already received!", get_type(mdecoder));
|
||||
CLOG_ERR("%s: Ignoring control STOP, already received!", get_type(mdecoder));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -656,7 +656,7 @@ static void tsmf_gstreamer_control(ITSMFDecoder *decoder, ITSMFControlMsg contro
|
||||
gst_app_src_end_of_stream((GstAppSrc *)mdecoder->src);
|
||||
}
|
||||
else
|
||||
DEBUG_WARN("Unknown control message %08x", control_msg);
|
||||
CLOG_ERR("Unknown control message %08x", control_msg);
|
||||
}
|
||||
|
||||
static BOOL tsmf_gstreamer_buffer_filled(ITSMFDecoder *decoder)
|
||||
|
@ -72,7 +72,7 @@ static BOOL tsmf_pulse_connect(TSMFPulseAudioDevice *pulse)
|
||||
return FALSE;
|
||||
if(pa_context_connect(pulse->context, NULL, 0, NULL))
|
||||
{
|
||||
DEBUG_WARN("pa_context_connect failed (%d)",
|
||||
CLOG_ERR("pa_context_connect failed (%d)",
|
||||
pa_context_errno(pulse->context));
|
||||
return FALSE;
|
||||
}
|
||||
@ -80,7 +80,7 @@ static BOOL tsmf_pulse_connect(TSMFPulseAudioDevice *pulse)
|
||||
if(pa_threaded_mainloop_start(pulse->mainloop) < 0)
|
||||
{
|
||||
pa_threaded_mainloop_unlock(pulse->mainloop);
|
||||
DEBUG_WARN("pa_threaded_mainloop_start failed (%d)",
|
||||
CLOG_ERR("pa_threaded_mainloop_start failed (%d)",
|
||||
pa_context_errno(pulse->context));
|
||||
return FALSE;
|
||||
}
|
||||
@ -120,19 +120,19 @@ static BOOL tsmf_pulse_open(ITSMFAudioDevice *audio, const char *device)
|
||||
pulse->mainloop = pa_threaded_mainloop_new();
|
||||
if(!pulse->mainloop)
|
||||
{
|
||||
DEBUG_WARN("pa_threaded_mainloop_new failed");
|
||||
CLOG_ERR("pa_threaded_mainloop_new failed");
|
||||
return FALSE;
|
||||
}
|
||||
pulse->context = pa_context_new(pa_threaded_mainloop_get_api(pulse->mainloop), "freerdp");
|
||||
if(!pulse->context)
|
||||
{
|
||||
DEBUG_WARN("pa_context_new failed");
|
||||
CLOG_ERR("pa_context_new failed");
|
||||
return FALSE;
|
||||
}
|
||||
pa_context_set_state_callback(pulse->context, tsmf_pulse_context_state_callback, pulse);
|
||||
if(tsmf_pulse_connect(pulse))
|
||||
{
|
||||
DEBUG_WARN("tsmf_pulse_connect failed");
|
||||
CLOG_ERR("tsmf_pulse_connect failed");
|
||||
return FALSE;
|
||||
}
|
||||
DEBUG_TSMF("open device %s", pulse->device);
|
||||
@ -214,7 +214,7 @@ static BOOL tsmf_pulse_open_stream(TSMFPulseAudioDevice *pulse)
|
||||
if(!pulse->stream)
|
||||
{
|
||||
pa_threaded_mainloop_unlock(pulse->mainloop);
|
||||
DEBUG_WARN("pa_stream_new failed (%d)",
|
||||
CLOG_ERR("pa_stream_new failed (%d)",
|
||||
pa_context_errno(pulse->context));
|
||||
return FALSE;
|
||||
}
|
||||
@ -233,7 +233,7 @@ static BOOL tsmf_pulse_open_stream(TSMFPulseAudioDevice *pulse)
|
||||
NULL, NULL) < 0)
|
||||
{
|
||||
pa_threaded_mainloop_unlock(pulse->mainloop);
|
||||
DEBUG_WARN("pa_stream_connect_playback failed (%d)",
|
||||
CLOG_ERR("pa_stream_connect_playback failed (%d)",
|
||||
pa_context_errno(pulse->context));
|
||||
return FALSE;
|
||||
}
|
||||
@ -244,7 +244,7 @@ static BOOL tsmf_pulse_open_stream(TSMFPulseAudioDevice *pulse)
|
||||
break;
|
||||
if(!PA_STREAM_IS_GOOD(state))
|
||||
{
|
||||
DEBUG_WARN("bad stream state (%d)",
|
||||
CLOG_ERR("bad stream state (%d)",
|
||||
pa_context_errno(pulse->context));
|
||||
break;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ static ITSMFAudioDevice* tsmf_load_audio_device_by_name(const char* name, const
|
||||
|
||||
if (audio == NULL)
|
||||
{
|
||||
DEBUG_WARN("failed to call export function in %s", name);
|
||||
CLOG_ERR("failed to call export function in %s", name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -264,21 +264,21 @@ static void tsmf_print_guid(const BYTE *guid)
|
||||
#ifdef WITH_DEBUG_TSMF
|
||||
int i;
|
||||
for(i = 3; i >= 0; i--)
|
||||
fprintf(stderr, "%02X", guid[i]);
|
||||
fprintf(stderr, "-");
|
||||
CLOG_ERR( "%02X", guid[i]);
|
||||
CLOG_ERR( "-");
|
||||
for(i = 5; i >= 4; i--)
|
||||
fprintf(stderr, "%02X", guid[i]);
|
||||
fprintf(stderr, "-");
|
||||
CLOG_ERR( "%02X", guid[i]);
|
||||
CLOG_ERR( "-");
|
||||
for(i = 7; i >= 6; i--)
|
||||
fprintf(stderr, "%02X", guid[i]);
|
||||
fprintf(stderr, "-");
|
||||
CLOG_ERR( "%02X", guid[i]);
|
||||
CLOG_ERR( "-");
|
||||
for(i = 8; i < 16; i++)
|
||||
{
|
||||
fprintf(stderr, "%02X", guid[i]);
|
||||
CLOG_ERR( "%02X", guid[i]);
|
||||
if(i == 9)
|
||||
fprintf(stderr, "-");
|
||||
CLOG_ERR( "-");
|
||||
}
|
||||
fprintf(stderr, "\n");
|
||||
CLOG_ERR( "\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ static ITSMFDecoder *tsmf_load_decoder_by_name(const char *name, TS_AM_MEDIA_TYP
|
||||
decoder = entry();
|
||||
if(decoder == NULL)
|
||||
{
|
||||
DEBUG_WARN("failed to call export function in %s", name);
|
||||
CLOG_ERR("failed to call export function in %s", name);
|
||||
return NULL;
|
||||
}
|
||||
if(!decoder->SetFormat(decoder, media_type))
|
||||
|
@ -80,7 +80,7 @@ int tsmf_ifman_exchange_capability_request(TSMF_IFMAN *ifman)
|
||||
MMREDIR_CAPABILITY_PLATFORM_MF | MMREDIR_CAPABILITY_PLATFORM_DSHOW);
|
||||
break;
|
||||
default:
|
||||
DEBUG_WARN("unknown capability type %d", CapabilityType);
|
||||
CLOG_ERR("unknown capability type %d", CapabilityType);
|
||||
break;
|
||||
}
|
||||
Stream_SetPosition(ifman->output, pos + cbCapabilityLength);
|
||||
@ -236,7 +236,7 @@ int tsmf_ifman_shutdown_presentation(TSMF_IFMAN *ifman)
|
||||
if(presentation)
|
||||
tsmf_presentation_free(presentation);
|
||||
else
|
||||
DEBUG_WARN("unknown presentation id");
|
||||
CLOG_ERR("unknown presentation id");
|
||||
Stream_EnsureRemainingCapacity(ifman->output, 4);
|
||||
Stream_Write_UINT32(ifman->output, 0); /* Result */
|
||||
ifman->output_interface_id = TSMF_INTERFACE_DEFAULT | STREAM_ID_STUB;
|
||||
@ -261,7 +261,7 @@ int tsmf_ifman_on_stream_volume(TSMF_IFMAN *ifman)
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARN("unknown presentation id");
|
||||
CLOG_ERR("unknown presentation id");
|
||||
}
|
||||
ifman->output_pending = TRUE;
|
||||
return 0;
|
||||
@ -393,13 +393,13 @@ int tsmf_ifman_on_sample(TSMF_IFMAN *ifman)
|
||||
presentation = tsmf_presentation_find_by_id(ifman->presentation_id);
|
||||
if(presentation == NULL)
|
||||
{
|
||||
DEBUG_WARN("unknown presentation id");
|
||||
CLOG_ERR("unknown presentation id");
|
||||
return 1;
|
||||
}
|
||||
stream = tsmf_stream_find_by_id(presentation, StreamId);
|
||||
if(stream == NULL)
|
||||
{
|
||||
DEBUG_WARN("unknown stream id");
|
||||
CLOG_ERR("unknown stream id");
|
||||
return 1;
|
||||
}
|
||||
tsmf_stream_push_sample(stream, ifman->channel_callback,
|
||||
@ -420,7 +420,7 @@ int tsmf_ifman_on_flush(TSMF_IFMAN *ifman)
|
||||
presentation = tsmf_presentation_find_by_id(ifman->presentation_id);
|
||||
if(presentation == NULL)
|
||||
{
|
||||
DEBUG_WARN("unknown presentation id");
|
||||
CLOG_ERR("unknown presentation id");
|
||||
return 1;
|
||||
}
|
||||
tsmf_presentation_flush(presentation);
|
||||
@ -460,7 +460,7 @@ int tsmf_ifman_on_playback_started(TSMF_IFMAN *ifman)
|
||||
if(presentation)
|
||||
tsmf_presentation_start(presentation);
|
||||
else
|
||||
DEBUG_WARN("unknown presentation id");
|
||||
CLOG_ERR("unknown presentation id");
|
||||
Stream_EnsureRemainingCapacity(ifman->output, 16);
|
||||
Stream_Write_UINT32(ifman->output, CLIENT_EVENT_NOTIFICATION); /* FunctionId */
|
||||
Stream_Write_UINT32(ifman->output, 0); /* StreamId */
|
||||
@ -480,7 +480,7 @@ int tsmf_ifman_on_playback_paused(TSMF_IFMAN *ifman)
|
||||
if(presentation)
|
||||
tsmf_presentation_paused(presentation);
|
||||
else
|
||||
DEBUG_WARN("unknown presentation id");
|
||||
CLOG_ERR("unknown presentation id");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -494,7 +494,7 @@ int tsmf_ifman_on_playback_restarted(TSMF_IFMAN *ifman)
|
||||
if(presentation)
|
||||
tsmf_presentation_restarted(presentation);
|
||||
else
|
||||
DEBUG_WARN("unknown presentation id");
|
||||
CLOG_ERR("unknown presentation id");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -506,7 +506,7 @@ int tsmf_ifman_on_playback_stopped(TSMF_IFMAN *ifman)
|
||||
if(presentation)
|
||||
tsmf_presentation_stop(presentation);
|
||||
else
|
||||
DEBUG_WARN("unknown presentation id");
|
||||
CLOG_ERR("unknown presentation id");
|
||||
Stream_EnsureRemainingCapacity(ifman->output, 16);
|
||||
Stream_Write_UINT32(ifman->output, CLIENT_EVENT_NOTIFICATION); /* FunctionId */
|
||||
Stream_Write_UINT32(ifman->output, 0); /* StreamId */
|
||||
|
@ -89,14 +89,14 @@ void tsmf_playback_ack(IWTSVirtualChannelCallback *pChannelCallback,
|
||||
Stream_Write_UINT64(s, data_size); /* cbData */
|
||||
DEBUG_TSMF("response size %d", (int) Stream_GetPosition(s));
|
||||
if(!callback || !callback->channel || !callback->channel->Write)
|
||||
DEBUG_WARN("callback=%p, channel=%p, write=%p", callback,
|
||||
CLOG_ERR("callback=%p, channel=%p, write=%p", callback,
|
||||
callback->channel, callback->channel->Write);
|
||||
else
|
||||
status = callback->channel->Write(callback->channel,
|
||||
Stream_GetPosition(s), Stream_Buffer(s), NULL);
|
||||
if(status)
|
||||
{
|
||||
DEBUG_WARN("response error %d", status);
|
||||
CLOG_ERR("response error %d", status);
|
||||
}
|
||||
Stream_Free(s, TRUE);
|
||||
}
|
||||
@ -108,7 +108,7 @@ BOOL tsmf_push_event(IWTSVirtualChannelCallback *pChannelCallback, wMessage *eve
|
||||
status = callback->channel_mgr->PushEvent(callback->channel_mgr, event);
|
||||
if(status)
|
||||
{
|
||||
DEBUG_WARN("response error %d", status);
|
||||
CLOG_ERR("response error %d", status);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
@ -130,7 +130,7 @@ static int tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, w
|
||||
/* 2.2.1 Shared Message Header (SHARED_MSG_HEADER) */
|
||||
if(cbSize < 12)
|
||||
{
|
||||
DEBUG_WARN("invalid size. cbSize=%d", cbSize);
|
||||
CLOG_ERR("invalid size. cbSize=%d", cbSize);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -272,7 +272,7 @@ static int tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, w
|
||||
}
|
||||
if(status == -1)
|
||||
{
|
||||
DEBUG_WARN("InterfaceId 0x%X FunctionId 0x%X not processed.",
|
||||
CLOG_ERR("InterfaceId 0x%X FunctionId 0x%X not processed.",
|
||||
InterfaceId, FunctionId);
|
||||
/* When a request is not implemented we return empty response indicating error */
|
||||
}
|
||||
@ -289,7 +289,7 @@ static int tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, w
|
||||
status = callback->channel->Write(callback->channel, length, Stream_Buffer(output), NULL);
|
||||
if(status)
|
||||
{
|
||||
DEBUG_WARN("response error %d", status);
|
||||
CLOG_ERR("response error %d", status);
|
||||
}
|
||||
}
|
||||
Stream_Free(output, TRUE);
|
||||
|
@ -271,7 +271,7 @@ TSMF_PRESENTATION *tsmf_presentation_new(const BYTE *guid, IWTSVirtualChannelCal
|
||||
|
||||
if (!presentation)
|
||||
{
|
||||
DEBUG_WARN("calloc failed");
|
||||
CLOG_ERR("calloc failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -320,7 +320,7 @@ TSMF_PRESENTATION *tsmf_presentation_find_by_id(const BYTE *guid)
|
||||
ArrayList_Unlock(presentation_list);
|
||||
|
||||
if (!found)
|
||||
DEBUG_WARN("presentation id %s not found", guid_to_string(guid, guid_str, sizeof(guid_str)));
|
||||
CLOG_ERR("presentation id %s not found", guid_to_string(guid, guid_str, sizeof(guid_str)));
|
||||
|
||||
return (found) ? presentation : NULL;
|
||||
}
|
||||
@ -902,7 +902,7 @@ TSMF_STREAM *tsmf_stream_new(TSMF_PRESENTATION *presentation, UINT32 stream_id)
|
||||
|
||||
if (stream)
|
||||
{
|
||||
DEBUG_WARN("duplicated stream id %d!", stream_id);
|
||||
CLOG_ERR("duplicated stream id %d!", stream_id);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -910,7 +910,7 @@ TSMF_STREAM *tsmf_stream_new(TSMF_PRESENTATION *presentation, UINT32 stream_id)
|
||||
|
||||
if (!stream)
|
||||
{
|
||||
DEBUG_WARN("Calloc failed");
|
||||
CLOG_ERR("Calloc failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -966,7 +966,7 @@ void tsmf_stream_set_format(TSMF_STREAM *stream, const char *name, wStream *s)
|
||||
|
||||
if (stream->decoder)
|
||||
{
|
||||
DEBUG_WARN("duplicated call");
|
||||
CLOG_ERR("duplicated call");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1071,7 +1071,7 @@ void tsmf_stream_push_sample(TSMF_STREAM *stream, IWTSVirtualChannelCallback *pC
|
||||
|
||||
if (!sample)
|
||||
{
|
||||
DEBUG_WARN("calloc failed!");
|
||||
CLOG_ERR("calloc failed!");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1087,7 +1087,7 @@ void tsmf_stream_push_sample(TSMF_STREAM *stream, IWTSVirtualChannelCallback *pC
|
||||
|
||||
if (!sample->data)
|
||||
{
|
||||
DEBUG_WARN("calloc failed!");
|
||||
CLOG_ERR("calloc failed!");
|
||||
free(sample);
|
||||
return;
|
||||
}
|
||||
|
@ -26,12 +26,12 @@
|
||||
|
||||
#include <freerdp/dvc.h>
|
||||
#include <freerdp/types.h>
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/channels/log.h>
|
||||
|
||||
#ifdef WITH_DEBUG_TSMF
|
||||
#define DEBUG_TSMF(fmt, ...) DEBUG_CLASS(TSMF, fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_TSMF(fmt, ...) CLOG_CLASS(TSMF, fmt, ## __VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG_TSMF(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_TSMF(fmt, ...) CLOG_NULL(fmt, ## __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
typedef struct _TS_AM_MEDIA_TYPE
|
||||
|
@ -237,7 +237,7 @@ static int urbdrc_process_io_control(URBDRC_CHANNEL_CALLBACK* callback, BYTE* da
|
||||
{
|
||||
case IOCTL_INTERNAL_USB_SUBMIT_URB: /** 0x00220003 */
|
||||
LLOGLN(urbdrc_debug, ("ioctl: IOCTL_INTERNAL_USB_SUBMIT_URB"));
|
||||
fprintf(stderr, " Function IOCTL_INTERNAL_USB_SUBMIT_URB: Unchecked\n");
|
||||
CLOG_ERR( " Function IOCTL_INTERNAL_USB_SUBMIT_URB: Unchecked\n");
|
||||
break;
|
||||
|
||||
case IOCTL_INTERNAL_USB_RESET_PORT: /** 0x00220007 */
|
||||
@ -269,12 +269,12 @@ static int urbdrc_process_io_control(URBDRC_CHANNEL_CALLBACK* callback, BYTE* da
|
||||
|
||||
case IOCTL_INTERNAL_USB_CYCLE_PORT: /** 0x0022001F */
|
||||
LLOGLN(urbdrc_debug, ("ioctl: IOCTL_INTERNAL_USB_CYCLE_PORT"));
|
||||
fprintf(stderr, " Function IOCTL_INTERNAL_USB_CYCLE_PORT: Unchecked\n");
|
||||
CLOG_ERR( " Function IOCTL_INTERNAL_USB_CYCLE_PORT: Unchecked\n");
|
||||
break;
|
||||
|
||||
case IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION: /** 0x00220027 */
|
||||
LLOGLN(urbdrc_debug, ("ioctl: IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION"));
|
||||
fprintf(stderr, " Function IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION: Unchecked\n");
|
||||
CLOG_ERR( " Function IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION: Unchecked\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -448,7 +448,7 @@ static int urb_select_configuration(URBDRC_CHANNEL_CALLBACK* callback, BYTE* dat
|
||||
|
||||
if (transferDir == 0)
|
||||
{
|
||||
fprintf(stderr, "urb_select_configuration: not support transfer out\n");
|
||||
CLOG_ERR( "urb_select_configuration: not support transfer out\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -540,7 +540,7 @@ static int urb_select_interface(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, U
|
||||
|
||||
if (transferDir == 0)
|
||||
{
|
||||
fprintf(stderr, "urb_select_interface: not support transfer out\n");
|
||||
CLOG_ERR( "urb_select_interface: not support transfer out\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1297,7 +1297,7 @@ static int urb_os_feature_descriptor_request(URBDRC_CHANNEL_CALLBACK * callback,
|
||||
switch (transferDir)
|
||||
{
|
||||
case USBD_TRANSFER_DIRECTION_OUT:
|
||||
fprintf(stderr, "Function urb_os_feature_descriptor_request: OUT Unchecked\n");
|
||||
CLOG_ERR( "Function urb_os_feature_descriptor_request: OUT Unchecked\n");
|
||||
memcpy(buffer, data + offset, OutputBufferSize);
|
||||
break;
|
||||
case USBD_TRANSFER_DIRECTION_IN:
|
||||
@ -1700,7 +1700,7 @@ static int urb_control_feature_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE
|
||||
switch (transferDir)
|
||||
{
|
||||
case USBD_TRANSFER_DIRECTION_OUT:
|
||||
fprintf(stderr, "Function urb_control_feature_request: OUT Unchecked\n");
|
||||
CLOG_ERR( "Function urb_control_feature_request: OUT Unchecked\n");
|
||||
memcpy(buffer, data + offset, OutputBufferSize);
|
||||
bmRequestType |= 0x00;
|
||||
break;
|
||||
@ -1718,7 +1718,7 @@ static int urb_control_feature_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE
|
||||
bmRequest = 0x01; /* REQUEST_CLEAR_FEATURE */
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "urb_control_feature_request: Error Command %x\n", command);
|
||||
CLOG_ERR( "urb_control_feature_request: Error Command %x\n", command);
|
||||
zfree(out_data);
|
||||
return -1;
|
||||
}
|
||||
|
@ -201,7 +201,7 @@ static void func_iso_callback(struct libusb_transfer *transfer)
|
||||
}
|
||||
else
|
||||
{
|
||||
//fprintf(stderr, "actual length %d \n", act_len);
|
||||
//CLOG_ERR( "actual length %d \n", act_len);
|
||||
//exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
@ -362,7 +362,7 @@ static int func_config_release_all_interface(LIBUSB_DEVICE_HANDLE* libusb_handle
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
fprintf(stderr, "config_release_all_interface: error num %d\n", ret);
|
||||
CLOG_ERR( "config_release_all_interface: error num %d\n", ret);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -380,7 +380,7 @@ static int func_claim_all_interface(LIBUSB_DEVICE_HANDLE* libusb_handle, int Num
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
fprintf(stderr, "claim_all_interface: error num %d\n", ret);
|
||||
CLOG_ERR( "claim_all_interface: error num %d\n", ret);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -394,28 +394,28 @@ static void* print_transfer_status(enum libusb_transfer_status status)
|
||||
switch (status)
|
||||
{
|
||||
case LIBUSB_TRANSFER_COMPLETED:
|
||||
//fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_COMPLETED\n");
|
||||
//CLOG_ERR( "Transfer Status: LIBUSB_TRANSFER_COMPLETED\n");
|
||||
break;
|
||||
case LIBUSB_TRANSFER_ERROR:
|
||||
fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_ERROR\n");
|
||||
CLOG_ERR( "Transfer Status: LIBUSB_TRANSFER_ERROR\n");
|
||||
break;
|
||||
case LIBUSB_TRANSFER_TIMED_OUT:
|
||||
fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_TIMED_OUT\n");
|
||||
CLOG_ERR( "Transfer Status: LIBUSB_TRANSFER_TIMED_OUT\n");
|
||||
break;
|
||||
case LIBUSB_TRANSFER_CANCELLED:
|
||||
fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_CANCELLED\n");
|
||||
CLOG_ERR( "Transfer Status: LIBUSB_TRANSFER_CANCELLED\n");
|
||||
break;
|
||||
case LIBUSB_TRANSFER_STALL:
|
||||
fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_STALL\n");
|
||||
CLOG_ERR( "Transfer Status: LIBUSB_TRANSFER_STALL\n");
|
||||
break;
|
||||
case LIBUSB_TRANSFER_NO_DEVICE:
|
||||
fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_NO_DEVICE\n");
|
||||
CLOG_ERR( "Transfer Status: LIBUSB_TRANSFER_NO_DEVICE\n");
|
||||
break;
|
||||
case LIBUSB_TRANSFER_OVERFLOW:
|
||||
fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_OVERFLOW\n");
|
||||
CLOG_ERR( "Transfer Status: LIBUSB_TRANSFER_OVERFLOW\n");
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "Transfer Status: Get unknow error num %d (0x%x)\n",
|
||||
CLOG_ERR( "Transfer Status: Get unknow error num %d (0x%x)\n",
|
||||
status, status);
|
||||
}
|
||||
return 0;
|
||||
@ -426,28 +426,28 @@ static void print_status(enum libusb_transfer_status status)
|
||||
switch (status)
|
||||
{
|
||||
case LIBUSB_TRANSFER_COMPLETED:
|
||||
fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_COMPLETED\n");
|
||||
CLOG_ERR( "Transfer status: LIBUSB_TRANSFER_COMPLETED\n");
|
||||
break;
|
||||
case LIBUSB_TRANSFER_ERROR:
|
||||
fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_ERROR\n");
|
||||
CLOG_ERR( "Transfer status: LIBUSB_TRANSFER_ERROR\n");
|
||||
break;
|
||||
case LIBUSB_TRANSFER_TIMED_OUT:
|
||||
fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_TIMED_OUT\n");
|
||||
CLOG_ERR( "Transfer status: LIBUSB_TRANSFER_TIMED_OUT\n");
|
||||
break;
|
||||
case LIBUSB_TRANSFER_CANCELLED:
|
||||
fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_CANCELLED\n");
|
||||
CLOG_ERR( "Transfer status: LIBUSB_TRANSFER_CANCELLED\n");
|
||||
break;
|
||||
case LIBUSB_TRANSFER_STALL:
|
||||
fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_STALL\n");
|
||||
CLOG_ERR( "Transfer status: LIBUSB_TRANSFER_STALL\n");
|
||||
break;
|
||||
case LIBUSB_TRANSFER_NO_DEVICE:
|
||||
fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_NO_DEVICE\n");
|
||||
CLOG_ERR( "Transfer status: LIBUSB_TRANSFER_NO_DEVICE\n");
|
||||
break;
|
||||
case LIBUSB_TRANSFER_OVERFLOW:
|
||||
fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_OVERFLOW\n");
|
||||
CLOG_ERR( "Transfer status: LIBUSB_TRANSFER_OVERFLOW\n");
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "Transfer status: unknow status %d(0x%x)\n", status, status);
|
||||
CLOG_ERR( "Transfer status: unknow status %d(0x%x)\n", status, status);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -484,7 +484,7 @@ static LIBUSB_DEVICE_DESCRIPTOR* udev_new_descript(LIBUSB_DEVICE* libusb_dev)
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
fprintf(stderr, "libusb_get_device_descriptor: ERROR!!\n");
|
||||
CLOG_ERR( "libusb_get_device_descriptor: ERROR!!\n");
|
||||
free(descriptor);
|
||||
return NULL;
|
||||
}
|
||||
@ -654,7 +654,7 @@ static int libusb_udev_select_interface(IUDEVICE* idev, BYTE InterfaceNumber, BY
|
||||
|
||||
if (error < 0)
|
||||
{
|
||||
fprintf(stderr, "%s: Set interface altsetting get error num %d\n",
|
||||
CLOG_ERR( "%s: Set interface altsetting get error num %d\n",
|
||||
__func__, error);
|
||||
}
|
||||
}
|
||||
@ -681,7 +681,7 @@ static MSUSB_CONFIG_DESCRIPTOR* libusb_udev_complete_msconfig_setup(IUDEVICE* id
|
||||
LibusbConfig = pdev->LibusbConfig;
|
||||
if (LibusbConfig->bNumInterfaces != MsConfig->NumInterfaces)
|
||||
{
|
||||
fprintf(stderr, "Select Configuration: Libusb NumberInterfaces(%d) is different "
|
||||
CLOG_ERR( "Select Configuration: Libusb NumberInterfaces(%d) is different "
|
||||
"with MsConfig NumberInterfaces(%d)\n",
|
||||
LibusbConfig->bNumInterfaces, MsConfig->NumInterfaces);
|
||||
}
|
||||
@ -827,7 +827,7 @@ static int libusb_udev_select_configuration(IUDEVICE* idev, UINT32 bConfiguratio
|
||||
ret = libusb_set_configuration(libusb_handle, bConfigurationValue);
|
||||
|
||||
if (ret < 0){
|
||||
fprintf(stderr, "libusb_set_configuration: ERROR number %d!!\n", ret);
|
||||
CLOG_ERR( "libusb_set_configuration: ERROR number %d!!\n", ret);
|
||||
func_claim_all_interface(libusb_handle, (*LibusbConfig)->bNumInterfaces);
|
||||
return -1;
|
||||
}
|
||||
@ -835,7 +835,7 @@ static int libusb_udev_select_configuration(IUDEVICE* idev, UINT32 bConfiguratio
|
||||
{
|
||||
ret = libusb_get_active_config_descriptor (libusb_dev, LibusbConfig);
|
||||
if (ret < 0){
|
||||
fprintf(stderr, "libusb_get_config_descriptor_by_value: ERROR number %d!!\n", ret);
|
||||
CLOG_ERR( "libusb_get_config_descriptor_by_value: ERROR number %d!!\n", ret);
|
||||
func_claim_all_interface(libusb_handle, (*LibusbConfig)->bNumInterfaces);
|
||||
return -1;
|
||||
}
|
||||
@ -885,7 +885,7 @@ static int libusb_udev_control_pipe_request(IUDEVICE* idev, UINT32 RequestId,
|
||||
*UsbdStatus = 0;
|
||||
/*
|
||||
if(pdev->request_queue->unregister_request(pdev->request_queue, RequestId))
|
||||
fprintf(stderr, "request_queue_unregister_request: not fount request 0x%x\n", RequestId);
|
||||
CLOG_ERR( "request_queue_unregister_request: not fount request 0x%x\n", RequestId);
|
||||
*/
|
||||
return error;
|
||||
}
|
||||
@ -980,12 +980,12 @@ static int libusb_udev_os_feature_descriptor_request(IUDEVICE* idev, UINT32 Requ
|
||||
ms_string_desc,
|
||||
0x12,
|
||||
Timeout);
|
||||
//fprintf(stderr, "Get ms string: result number %d", error);
|
||||
//CLOG_ERR( "Get ms string: result number %d", error);
|
||||
if (error > 0)
|
||||
{
|
||||
BYTE bMS_Vendorcode;
|
||||
data_read_BYTE(ms_string_desc + 16, bMS_Vendorcode);
|
||||
//fprintf(stderr, "bMS_Vendorcode:0x%x", bMS_Vendorcode);
|
||||
//CLOG_ERR( "bMS_Vendorcode:0x%x", bMS_Vendorcode);
|
||||
/** get os descriptor */
|
||||
error = libusb_control_transfer(pdev->libusb_handle,
|
||||
LIBUSB_ENDPOINT_IN |LIBUSB_REQUEST_TYPE_VENDOR | Recipient,
|
||||
@ -1004,7 +1004,7 @@ static int libusb_udev_os_feature_descriptor_request(IUDEVICE* idev, UINT32 Requ
|
||||
*UsbdStatus = USBD_STATUS_SUCCESS;
|
||||
/*
|
||||
if(pdev->request_queue->unregister_request(pdev->request_queue, RequestId))
|
||||
fprintf(stderr, "request_queue_unregister_request: not fount request 0x%x\n", RequestId);
|
||||
CLOG_ERR( "request_queue_unregister_request: not fount request 0x%x\n", RequestId);
|
||||
*/
|
||||
return error;
|
||||
}
|
||||
@ -1263,7 +1263,7 @@ static int libusb_udev_isoch_transfer(IUDEVICE* idev, UINT32 RequestId, UINT32 E
|
||||
|
||||
if (iso_transfer == NULL)
|
||||
{
|
||||
fprintf(stderr, "Error: libusb_alloc_transfer.\n");
|
||||
CLOG_ERR( "Error: libusb_alloc_transfer.\n");
|
||||
status = -1;
|
||||
}
|
||||
|
||||
@ -1368,7 +1368,7 @@ static int libusb_udev_bulk_or_interrupt_transfer(IUDEVICE* idev, UINT32 Request
|
||||
|
||||
if (!ep_desc)
|
||||
{
|
||||
fprintf(stderr, "func_get_ep_desc: endpoint 0x%x is not found!!\n", EndpointAddress);
|
||||
CLOG_ERR( "func_get_ep_desc: endpoint 0x%x is not found!!\n", EndpointAddress);
|
||||
return -1;
|
||||
}
|
||||
transfer_type = (ep_desc->bmAttributes) & 0x3;
|
||||
@ -1494,7 +1494,7 @@ static int libusb_udev_bulk_or_interrupt_transfer(IUDEVICE* idev, UINT32 Request
|
||||
if (request)
|
||||
{
|
||||
if(pdev->request_queue->unregister_request(pdev->request_queue, RequestId))
|
||||
fprintf(stderr, "request_queue_unregister_request: not fount request 0x%x\n", RequestId);
|
||||
CLOG_ERR( "request_queue_unregister_request: not fount request 0x%x\n", RequestId);
|
||||
}
|
||||
|
||||
libusb_free_transfer(transfer);
|
||||
@ -1704,7 +1704,7 @@ static IUDEVICE* udev_init(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_number)
|
||||
|
||||
if (status < 0)
|
||||
{
|
||||
fprintf(stderr, "USB init: Error to get HUB handle!!\n");
|
||||
CLOG_ERR( "USB init: Error to get HUB handle!!\n");
|
||||
pdev->hub_handle = NULL;
|
||||
}
|
||||
|
||||
@ -1712,7 +1712,7 @@ static IUDEVICE* udev_init(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_number)
|
||||
|
||||
if (!pdev->devDescriptor)
|
||||
{
|
||||
fprintf(stderr, "USB init: Error to get device descriptor!!\n");
|
||||
CLOG_ERR( "USB init: Error to get device descriptor!!\n");
|
||||
zfree(pdev);
|
||||
return NULL;
|
||||
}
|
||||
@ -1723,7 +1723,7 @@ static IUDEVICE* udev_init(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_number)
|
||||
|
||||
if (status < 0)
|
||||
{
|
||||
fprintf(stderr, "libusb_get_descriptor: ERROR!!ret:%d\n", status);
|
||||
CLOG_ERR( "libusb_get_descriptor: ERROR!!ret:%d\n", status);
|
||||
zfree(pdev);
|
||||
return NULL;
|
||||
}
|
||||
@ -1752,7 +1752,7 @@ static IUDEVICE* udev_init(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_number)
|
||||
case CLASS_CONTENT_SECURITY:
|
||||
//case CLASS_WIRELESS_CONTROLLER:
|
||||
//case CLASS_ELSE_DEVICE:
|
||||
fprintf(stderr, " Device is not supported!!\n");
|
||||
CLOG_ERR( " Device is not supported!!\n");
|
||||
zfree(pdev);
|
||||
return NULL;
|
||||
default:
|
||||
@ -1818,7 +1818,7 @@ int udev_new_by_id(UINT16 idVendor, UINT16 idProduct, IUDEVICE*** devArray)
|
||||
ssize_t total_device;
|
||||
int i, status, num = 0;
|
||||
|
||||
fprintf(stderr, "VID: 0x%04X PID: 0x%04X\n", idVendor, idProduct);
|
||||
CLOG_ERR( "VID: 0x%04X PID: 0x%04X\n", idVendor, idProduct);
|
||||
|
||||
array = (UDEVICE**) malloc(16 * sizeof(UDEVICE*));
|
||||
|
||||
@ -1839,7 +1839,7 @@ int udev_new_by_id(UINT16 idVendor, UINT16 idProduct, IUDEVICE*** devArray)
|
||||
|
||||
if (status < 0)
|
||||
{
|
||||
fprintf(stderr, "libusb_open: (by id) error: 0x%08X (%d)\n", status, status);
|
||||
CLOG_ERR( "libusb_open: (by id) error: 0x%08X (%d)\n", status, status);
|
||||
zfree(descriptor);
|
||||
zfree(array[num]);
|
||||
continue;
|
||||
@ -1876,7 +1876,7 @@ IUDEVICE* udev_new_by_addr(int bus_number, int dev_number)
|
||||
|
||||
if (pDev->libusb_dev == NULL)
|
||||
{
|
||||
fprintf(stderr, "libusb_device_new: ERROR!!\n");
|
||||
CLOG_ERR( "libusb_device_new: ERROR!!\n");
|
||||
zfree(pDev);
|
||||
return NULL;
|
||||
}
|
||||
@ -1885,7 +1885,7 @@ IUDEVICE* udev_new_by_addr(int bus_number, int dev_number)
|
||||
|
||||
if (status < 0)
|
||||
{
|
||||
fprintf(stderr, "libusb_open: (by addr) ERROR!!\n");
|
||||
CLOG_ERR( "libusb_open: (by addr) ERROR!!\n");
|
||||
zfree(pDev);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ static int udevman_register_udevice(IUDEVMAN* idevman, int bus_number, int dev_n
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "udevman_register_udevice: function error!!");
|
||||
CLOG_ERR( "udevman_register_udevice: function error!!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ TRANSFER_REQUEST* request_queue_get_request_by_endpoint(REQUEST_QUEUE* queue, BY
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&queue->request_loading);
|
||||
fprintf(stderr, "request_queue_get_request_by_id: ERROR!!\n");
|
||||
CLOG_ERR( "request_queue_get_request_by_id: ERROR!!\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -156,16 +156,16 @@ static void searchman_list_show(USB_SEARCHMAN* self)
|
||||
int num = 0;
|
||||
USB_SEARCHDEV* usb;
|
||||
|
||||
fprintf(stderr, "=========== Usb Search List ========= \n");
|
||||
CLOG_ERR( "=========== Usb Search List ========= \n");
|
||||
self->rewind(self);
|
||||
while (self->has_next(self))
|
||||
{
|
||||
usb = self->get_next(self);
|
||||
fprintf(stderr, " USB %d: \n", num++);
|
||||
fprintf(stderr, " idVendor: 0x%04X \n", usb->idVendor);
|
||||
fprintf(stderr, " idProduct: 0x%04X \n", usb->idProduct);
|
||||
CLOG_ERR( " USB %d: \n", num++);
|
||||
CLOG_ERR( " idVendor: 0x%04X \n", usb->idVendor);
|
||||
CLOG_ERR( " idProduct: 0x%04X \n", usb->idProduct);
|
||||
}
|
||||
fprintf(stderr, "================= END =============== \n");
|
||||
CLOG_ERR( "================= END =============== \n");
|
||||
}
|
||||
|
||||
void searchman_free(USB_SEARCHMAN* self)
|
||||
@ -202,7 +202,7 @@ USB_SEARCHMAN* searchman_new(void * urbdrc, UINT32 UsbDevice)
|
||||
|
||||
if (ret != 0)
|
||||
{
|
||||
fprintf(stderr, "searchman mutex initialization: searchman->mutex failed");
|
||||
CLOG_ERR( "searchman mutex initialization: searchman->mutex failed");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
|
||||
#include <freerdp/dvc.h>
|
||||
#include <freerdp/addin.h>
|
||||
#include <freerdp/channels/log.h>
|
||||
|
||||
#include "urbdrc_types.h"
|
||||
#include "urbdrc_main.h"
|
||||
@ -468,7 +469,7 @@ static void* urbdrc_search_usb_device(void* arg)
|
||||
|
||||
if (!udev)
|
||||
{
|
||||
fprintf(stderr, "Can't create udev\n");
|
||||
CLOG_ERR( "Can't create udev\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -652,7 +653,7 @@ static void* urbdrc_search_usb_device(void* arg)
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "No Device from receive_device(). An error occured.\n");
|
||||
CLOG_ERR( "No Device from receive_device(). An error occured.\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -835,7 +836,7 @@ static int urbdrc_on_data_received(IWTSVirtualChannelCallback* pChannelCallback,
|
||||
|
||||
if (transfer_data == NULL)
|
||||
{
|
||||
fprintf(stderr, "transfer_data is NULL!!");
|
||||
CLOG_ERR( "transfer_data is NULL!!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1000,7 +1001,7 @@ static void urbdrc_register_udevman_addin(IWTSPlugin* pPlugin, IUDEVMAN* udevman
|
||||
|
||||
if (urbdrc->udevman)
|
||||
{
|
||||
DEBUG_WARN("existing device, abort.");
|
||||
CLOG_ERR("existing device, abort.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1025,7 +1026,7 @@ static int urbdrc_load_udevman_addin(IWTSPlugin* pPlugin, const char* name, ADDI
|
||||
|
||||
if (entry(&entryPoints) != 0)
|
||||
{
|
||||
DEBUG_WARN("%s entry returns error.", name);
|
||||
CLOG_ERR("%s entry returns error.", name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
#include <freerdp/dvc.h>
|
||||
#include <freerdp/types.h>
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/channels/log.h>
|
||||
#include <freerdp/utils/msusb.h>
|
||||
|
||||
#include <uuid/uuid.h>
|
||||
@ -37,9 +37,9 @@
|
||||
#include <winpr/stream.h>
|
||||
|
||||
#ifdef WITH_DEBUG_DVC
|
||||
#define DEBUG_DVC(fmt, ...) DEBUG_CLASS(DVC, fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_DVC(fmt, ...) CLOG_CLASS(DVC, fmt, ## __VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG_DVC(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_DVC(fmt, ...) CLOG_NULL(fmt, ## __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#define CAPABILITIES_NEGOTIATOR 0x00000000
|
||||
@ -316,10 +316,10 @@ enum device_descriptor_table
|
||||
#define MAX_URB_REQUSET_NUM 0x80
|
||||
|
||||
#define LOG_LEVEL 1
|
||||
#define LLOG(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { printf _args ; } } while (0)
|
||||
#define LLOGLN(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { printf _args ; printf("\n"); } } while (0)
|
||||
#define LLOG(_level, args) \
|
||||
do { if (_level < LOG_LEVEL) { CLOG_DBG args ; } } while (0)
|
||||
#define LLOGLN(_level, args) \
|
||||
do { if (_level < LOG_LEVEL) { CLOG_DBG args ; } } while (0)
|
||||
|
||||
#define dummy_wait_obj(void) do{ sleep(5); } while(0)
|
||||
#define dummy_wait_s_obj(_s) do{ sleep(_s); } while(0)
|
||||
|
@ -292,7 +292,7 @@ static void df_process_channel_event(rdpChannels* channels, freerdp* instance)
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "df_process_channel_event: unknown event type %d\n", GetMessageType(event->id));
|
||||
DEBUG_WARN( "df_process_channel_event: unknown event type %d\n", GetMessageType(event->id));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -339,17 +339,17 @@ int dfreerdp_run(freerdp* instance)
|
||||
|
||||
if (freerdp_get_fds(instance, rfds, &rcount, wfds, &wcount) != TRUE)
|
||||
{
|
||||
fprintf(stderr, "Failed to get FreeRDP file descriptor\n");
|
||||
DEBUG_WARN( "Failed to get FreeRDP file descriptor\n");
|
||||
break;
|
||||
}
|
||||
if (freerdp_channels_get_fds(channels, instance, rfds, &rcount, wfds, &wcount) != TRUE)
|
||||
{
|
||||
fprintf(stderr, "Failed to get channel manager file descriptor\n");
|
||||
DEBUG_WARN( "Failed to get channel manager file descriptor\n");
|
||||
break;
|
||||
}
|
||||
if (df_get_fds(instance, rfds, &rcount, wfds, &wcount) != TRUE)
|
||||
{
|
||||
fprintf(stderr, "Failed to get dfreerdp file descriptor\n");
|
||||
DEBUG_WARN( "Failed to get dfreerdp file descriptor\n");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -378,24 +378,24 @@ int dfreerdp_run(freerdp* instance)
|
||||
(errno == EINPROGRESS) ||
|
||||
(errno == EINTR))) /* signal occurred */
|
||||
{
|
||||
fprintf(stderr, "dfreerdp_run: select failed\n");
|
||||
DEBUG_WARN( "dfreerdp_run: select failed\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (freerdp_check_fds(instance) != TRUE)
|
||||
{
|
||||
fprintf(stderr, "Failed to check FreeRDP file descriptor\n");
|
||||
DEBUG_WARN( "Failed to check FreeRDP file descriptor\n");
|
||||
break;
|
||||
}
|
||||
if (df_check_fds(instance, &rfds_set) != TRUE)
|
||||
{
|
||||
fprintf(stderr, "Failed to check dfreerdp file descriptor\n");
|
||||
DEBUG_WARN( "Failed to check dfreerdp file descriptor\n");
|
||||
break;
|
||||
}
|
||||
if (freerdp_channels_check_fds(channels, instance) != TRUE)
|
||||
{
|
||||
fprintf(stderr, "Failed to check channel manager file descriptor\n");
|
||||
DEBUG_WARN( "Failed to check channel manager file descriptor\n");
|
||||
break;
|
||||
}
|
||||
df_process_channel_event(channels, instance);
|
||||
|
@ -617,7 +617,7 @@ DWORD fixKeyCode(DWORD keyCode, unichar keyChar, enum APPLE_KEYBOARD_TYPE type)
|
||||
vkcode &= 0xFF;
|
||||
|
||||
#if 0
|
||||
fprintf(stderr, "keyDown: keyCode: 0x%04X scancode: 0x%04X vkcode: 0x%04X keyFlags: %d name: %s\n",
|
||||
DEBUG_WARN( "keyDown: keyCode: 0x%04X scancode: 0x%04X vkcode: 0x%04X keyFlags: %d name: %s\n",
|
||||
keyCode, scancode, vkcode, keyFlags, GetVirtualKeyName(vkcode));
|
||||
#endif
|
||||
|
||||
@ -654,7 +654,7 @@ DWORD fixKeyCode(DWORD keyCode, unichar keyChar, enum APPLE_KEYBOARD_TYPE type)
|
||||
vkcode &= 0xFF;
|
||||
|
||||
#if 0
|
||||
fprintf(stderr, "keyUp: key: 0x%04X scancode: 0x%04X vkcode: 0x%04X keyFlags: %d name: %s\n",
|
||||
DEBUG_WARN( "keyUp: key: 0x%04X scancode: 0x%04X vkcode: 0x%04X keyFlags: %d name: %s\n",
|
||||
keyCode, scancode, vkcode, keyFlags, GetVirtualKeyName(vkcode));
|
||||
#endif
|
||||
|
||||
@ -683,29 +683,29 @@ DWORD fixKeyCode(DWORD keyCode, unichar keyChar, enum APPLE_KEYBOARD_TYPE type)
|
||||
vkcode &= 0xFF;
|
||||
|
||||
#if 0
|
||||
fprintf(stderr, "flagsChanged: key: 0x%04X scancode: 0x%04X vkcode: 0x%04X extended: %d name: %s modFlags: 0x%04X\n",
|
||||
DEBUG_WARN( "flagsChanged: key: 0x%04X scancode: 0x%04X vkcode: 0x%04X extended: %d name: %s modFlags: 0x%04X\n",
|
||||
key - 8, scancode, vkcode, keyFlags, GetVirtualKeyName(vkcode), modFlags);
|
||||
|
||||
if (modFlags & NSAlphaShiftKeyMask)
|
||||
fprintf(stderr, "NSAlphaShiftKeyMask\n");
|
||||
DEBUG_WARN( "NSAlphaShiftKeyMask\n");
|
||||
|
||||
if (modFlags & NSShiftKeyMask)
|
||||
fprintf(stderr, "NSShiftKeyMask\n");
|
||||
DEBUG_WARN( "NSShiftKeyMask\n");
|
||||
|
||||
if (modFlags & NSControlKeyMask)
|
||||
fprintf(stderr, "NSControlKeyMask\n");
|
||||
DEBUG_WARN( "NSControlKeyMask\n");
|
||||
|
||||
if (modFlags & NSAlternateKeyMask)
|
||||
fprintf(stderr, "NSAlternateKeyMask\n");
|
||||
DEBUG_WARN( "NSAlternateKeyMask\n");
|
||||
|
||||
if (modFlags & NSCommandKeyMask)
|
||||
fprintf(stderr, "NSCommandKeyMask\n");
|
||||
DEBUG_WARN( "NSCommandKeyMask\n");
|
||||
|
||||
if (modFlags & NSNumericPadKeyMask)
|
||||
fprintf(stderr, "NSNumericPadKeyMask\n");
|
||||
DEBUG_WARN( "NSNumericPadKeyMask\n");
|
||||
|
||||
if (modFlags & NSHelpKeyMask)
|
||||
fprintf(stderr, "NSHelpKeyMask\n");
|
||||
DEBUG_WARN( "NSHelpKeyMask\n");
|
||||
#endif
|
||||
|
||||
if ((modFlags & NSAlphaShiftKeyMask) && !(kbdModFlags & NSAlphaShiftKeyMask))
|
||||
@ -832,7 +832,7 @@ BOOL mac_pre_connect(freerdp* instance)
|
||||
|
||||
if (!settings->ServerHostname)
|
||||
{
|
||||
fprintf(stderr, "error: server hostname was not specified with /v:<server>[:port]\n");
|
||||
DEBUG_WARN( "error: server hostname was not specified with /v:<server>[:port]\n");
|
||||
[NSApp terminate:nil];
|
||||
return -1;
|
||||
}
|
||||
@ -1200,7 +1200,7 @@ static void update_activity_cb(freerdp* instance)
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "update_activity_cb: No queue!\n");
|
||||
DEBUG_WARN( "update_activity_cb: No queue!\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1225,7 +1225,7 @@ static void input_activity_cb(freerdp* instance)
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "input_activity_cb: No queue!\n");
|
||||
DEBUG_WARN( "input_activity_cb: No queue!\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1238,7 +1238,7 @@ static void channel_activity_cb(freerdp* instance)
|
||||
|
||||
if (event)
|
||||
{
|
||||
fprintf(stderr, "channel_activity_cb: message %d\n", event->id);
|
||||
DEBUG_WARN( "channel_activity_cb: message %d\n", event->id);
|
||||
|
||||
switch (GetMessageClass(event->id))
|
||||
{
|
||||
|
@ -20,7 +20,6 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <winpr/crt.h>
|
||||
|
||||
@ -32,6 +31,9 @@
|
||||
|
||||
#include "wf_cliprdr.h"
|
||||
|
||||
extern BOOL WINAPI AddClipboardFormatListener(_In_ HWND hwnd);
|
||||
extern BOOL WINAPI RemoveClipboardFormatListener(_In_ HWND hwnd);
|
||||
|
||||
#define WM_CLIPRDR_MESSAGE (WM_USER + 156)
|
||||
#define OLE_SETCLIPBOARD 1
|
||||
|
||||
@ -129,7 +131,14 @@ static void clear_format_map(cliprdrContext *cliprdr)
|
||||
|
||||
cliprdr->map_size= 0;
|
||||
}
|
||||
|
||||
/*
|
||||
2.2.2.3 Client Temporary Directory PDU (CLIPRDR_TEMP_DIRECTORY)
|
||||
The Temporary Directory PDU is an optional PDU sent from the client to the server.
|
||||
This PDU informs the server of a location on the client file system that MUST be
|
||||
used to deposit files being copied to the client. The location MUST be accessible
|
||||
by the server to be useful. Section 3.1.1.3 specifies how direct file access
|
||||
impacts file copy and paste.
|
||||
*/
|
||||
int cliprdr_send_tempdir(cliprdrContext *cliprdr)
|
||||
{
|
||||
RDP_CB_TEMPDIR_EVENT *cliprdr_event;
|
||||
@ -140,6 +149,9 @@ int cliprdr_send_tempdir(cliprdrContext *cliprdr)
|
||||
if (!cliprdr_event)
|
||||
return -1;
|
||||
|
||||
/* Sending the TEMP path would only be valid iff the path is accessible from the server.
|
||||
This should perhaps to change to a command line parameter value
|
||||
*/
|
||||
GetEnvironmentVariableW(L"TEMP", (LPWSTR)cliprdr_event->dirname, 260);
|
||||
|
||||
return freerdp_channels_send_event(cliprdr->channels, (wMessage *)cliprdr_event);
|
||||
@ -367,32 +379,21 @@ static LRESULT CALLBACK cliprdr_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM
|
||||
switch (Msg)
|
||||
{
|
||||
case WM_CREATE:
|
||||
DEBUG_CLIPRDR("info: %s - WM_CREATE", __FUNCTION__);
|
||||
cliprdr = (cliprdrContext *)((CREATESTRUCT *)lParam)->lpCreateParams;
|
||||
cliprdr->hwndNextViewer = SetClipboardViewer(hWnd);
|
||||
|
||||
if (cliprdr->hwndNextViewer == NULL && GetLastError() != 0)
|
||||
{
|
||||
DEBUG_CLIPRDR("error: SetClipboardViewer failed with 0x%0x.", GetLastError());
|
||||
if (!AddClipboardFormatListener(hWnd)) {
|
||||
DEBUG_CLIPRDR("error: AddClipboardFormatListener failed with %#x.", GetLastError());
|
||||
}
|
||||
cliprdr->hwndClipboard = hWnd;
|
||||
break;
|
||||
|
||||
case WM_CLOSE:
|
||||
ChangeClipboardChain(hWnd, cliprdr->hwndNextViewer);
|
||||
DEBUG_CLIPRDR("info: %s - WM_CLOSE", __FUNCTION__);
|
||||
RemoveClipboardFormatListener(hWnd);
|
||||
break;
|
||||
|
||||
case WM_CHANGECBCHAIN:
|
||||
if (cliprdr->hwndNextViewer == (HWND)wParam)
|
||||
{
|
||||
cliprdr->hwndNextViewer = (HWND)lParam;
|
||||
}
|
||||
else if (cliprdr->hwndNextViewer != NULL)
|
||||
{
|
||||
SendMessage(cliprdr->hwndNextViewer, Msg, wParam, lParam);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DRAWCLIPBOARD:
|
||||
case WM_CLIPBOARDUPDATE:
|
||||
DEBUG_CLIPRDR("info: %s - WM_CLIPBOARDUPDATE", __FUNCTION__);
|
||||
if (cliprdr->channel_initialized)
|
||||
{
|
||||
if ((GetClipboardOwner() != cliprdr->hwndClipboard) && (S_FALSE == OleIsCurrentClipboard(cliprdr->data_obj)))
|
||||
@ -404,11 +405,10 @@ static LRESULT CALLBACK cliprdr_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM
|
||||
cliprdr_send_format_list(cliprdr);
|
||||
}
|
||||
}
|
||||
if (cliprdr->hwndNextViewer != NULL && cliprdr->hwndNextViewer != hWnd)
|
||||
SendMessage(cliprdr->hwndNextViewer, Msg, wParam, lParam);
|
||||
break;
|
||||
|
||||
case WM_RENDERALLFORMATS:
|
||||
DEBUG_CLIPRDR("info: %s - WM_RENDERALLFORMATS", __FUNCTION__);
|
||||
/* discard all contexts in clipboard */
|
||||
if (!OpenClipboard(cliprdr->hwndClipboard))
|
||||
{
|
||||
@ -420,6 +420,7 @@ static LRESULT CALLBACK cliprdr_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM
|
||||
break;
|
||||
|
||||
case WM_RENDERFORMAT:
|
||||
DEBUG_CLIPRDR("info: %s - WM_RENDERFORMAT", __FUNCTION__);
|
||||
if (cliprdr_send_data_request(cliprdr, (UINT32)wParam) != 0)
|
||||
{
|
||||
DEBUG_CLIPRDR("error: cliprdr_send_data_request failed.");
|
||||
@ -435,9 +436,11 @@ static LRESULT CALLBACK cliprdr_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM
|
||||
break;
|
||||
|
||||
case WM_CLIPRDR_MESSAGE:
|
||||
DEBUG_CLIPRDR("info: %s - WM_CLIPRDR_MESSAGE", __FUNCTION__);
|
||||
switch (wParam)
|
||||
{
|
||||
case OLE_SETCLIPBOARD:
|
||||
DEBUG_CLIPRDR("info: %s - OLE_SETCLIPBOARD", __FUNCTION__);
|
||||
if (wf_create_file_obj(cliprdr, &cliprdr->data_obj))
|
||||
if (OleSetClipboard(cliprdr->data_obj) != S_OK)
|
||||
wf_destroy_file_obj(cliprdr->data_obj);
|
||||
@ -448,7 +451,6 @@ static LRESULT CALLBACK cliprdr_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_CLIPBOARDUPDATE:
|
||||
case WM_DESTROYCLIPBOARD:
|
||||
case WM_ASKCBFORMATNAME:
|
||||
case WM_HSCROLLCLIPBOARD:
|
||||
@ -568,7 +570,7 @@ void wf_cliprdr_init(wfContext* wfc, rdpChannels* channels)
|
||||
if (!wfc->instance->settings->RedirectClipboard)
|
||||
{
|
||||
wfc->cliprdr_context = NULL;
|
||||
fprintf(stderr, "clipboard is not redirected.\n");
|
||||
DEBUG_WARN( "clipboard is not redirected.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -643,9 +645,12 @@ static void wf_cliprdr_process_cb_clip_caps_event(wfContext *wfc, RDP_CB_CLIP_CA
|
||||
static void wf_cliprdr_process_cb_monitor_ready_event(wfContext *wfc, RDP_CB_MONITOR_READY_EVENT *ready_event)
|
||||
{
|
||||
cliprdrContext *cliprdr = (cliprdrContext *)wfc->cliprdr_context;
|
||||
|
||||
#if 0
|
||||
/*Disabled since the current function only sends the temp directory which is not
|
||||
guaranteed to be accessible to the server
|
||||
*/
|
||||
cliprdr_send_tempdir(cliprdr);
|
||||
|
||||
#endif
|
||||
cliprdr->channel_initialized = TRUE;
|
||||
|
||||
cliprdr_send_format_list(wfc->cliprdr_context);
|
||||
@ -658,7 +663,7 @@ static BOOL wf_cliprdr_get_file_contents(wchar_t *file_name, BYTE *buffer, int p
|
||||
|
||||
if (file_name == NULL || buffer == NULL || puSize == NULL)
|
||||
{
|
||||
fprintf(stderr, "get file contents Invalid Arguments.\n");
|
||||
DEBUG_WARN( "get file contents Invalid Arguments.\n");
|
||||
return FALSE;
|
||||
}
|
||||
hFile = CreateFileW(file_name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, NULL);
|
||||
@ -1175,7 +1180,7 @@ static void wf_cliprdr_process_cb_filecontents_request_event(wfContext *wfc, RDP
|
||||
hRet = OleGetClipboard(&pDataObj);
|
||||
if (!SUCCEEDED(hRet))
|
||||
{
|
||||
fprintf(stderr, "filecontents: get ole clipboard failed.\n");
|
||||
DEBUG_WARN( "filecontents: get ole clipboard failed.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
@ -1273,7 +1278,7 @@ static void wf_cliprdr_process_cb_filecontents_request_event(wfContext *wfc, RDP
|
||||
event->nPositionLow, event->nPositionHigh, event->cbRequested, &uSize);
|
||||
if (bRet == FALSE)
|
||||
{
|
||||
fprintf(stderr, "get file contents failed.\n");
|
||||
DEBUG_WARN( "get file contents failed.\n");
|
||||
uSize = 0;
|
||||
goto error;
|
||||
}
|
||||
@ -1304,7 +1309,7 @@ error:
|
||||
IDataObject_Release(pDataObj);
|
||||
pDataObj = NULL;
|
||||
}
|
||||
fprintf(stderr, "filecontents: send failed response.\n");
|
||||
DEBUG_WARN( "filecontents: send failed response.\n");
|
||||
cliprdr_send_response_filecontents(cliprdr, event->streamId, 0, NULL);
|
||||
return;
|
||||
}
|
||||
|
@ -53,7 +53,6 @@ struct cliprdr_context {
|
||||
BOOL channel_initialized;
|
||||
|
||||
HWND hwndClipboard;
|
||||
HWND hwndNextViewer;
|
||||
|
||||
HANDLE cliprdr_thread;
|
||||
HANDLE hmem;
|
||||
|
@ -63,7 +63,7 @@ BOOL wf_set_rop2(HDC hdc, int rop2)
|
||||
{
|
||||
if ((rop2 < 0x01) || (rop2 > 0x10))
|
||||
{
|
||||
fprintf(stderr, "Unsupported ROP2: %d\n", rop2);
|
||||
DEBUG_WARN( "Unsupported ROP2: %d\n", rop2);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -643,7 +643,7 @@ void wf_gdi_surface_bits(wfContext* wfc, SURFACE_BITS_COMMAND* surface_bits_comm
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "Unsupported codecID %d\n", surface_bits_command->codecID);
|
||||
DEBUG_WARN( "Unsupported codecID %d\n", surface_bits_command->codecID);
|
||||
}
|
||||
|
||||
if (tile_bitmap != NULL)
|
||||
|
@ -161,7 +161,7 @@ void wf_Bitmap_Decompress(wfContext* wfc, rdpBitmap* bitmap,
|
||||
|
||||
if (status != TRUE)
|
||||
{
|
||||
fprintf(stderr, "Bitmap Decompression Failed\n");
|
||||
DEBUG_WARN( "Bitmap Decompression Failed\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -65,7 +65,7 @@ int wf_create_console(void)
|
||||
freopen("CONOUT$", "w", stdout);
|
||||
freopen("CONOUT$", "w", stderr);
|
||||
|
||||
fprintf(stderr, "Debug console created.\n");
|
||||
DEBUG_WARN( "Debug console created.\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -202,7 +202,7 @@ BOOL wf_pre_connect(freerdp* instance)
|
||||
|
||||
wfc->connectionRdpFile = freerdp_client_rdp_file_new();
|
||||
|
||||
fprintf(stderr, "Using connection file: %s\n", settings->ConnectionFile);
|
||||
DEBUG_WARN( "Using connection file: %s\n", settings->ConnectionFile);
|
||||
|
||||
freerdp_client_parse_rdp_file(wfc->connectionRdpFile, settings->ConnectionFile);
|
||||
freerdp_client_populate_settings_from_rdp_file(wfc->connectionRdpFile, settings);
|
||||
@ -291,7 +291,7 @@ BOOL wf_pre_connect(freerdp* instance)
|
||||
if ((settings->DesktopWidth < 64) || (settings->DesktopHeight < 64) ||
|
||||
(settings->DesktopWidth > 4096) || (settings->DesktopHeight > 4096))
|
||||
{
|
||||
fprintf(stderr, "wf_pre_connect: invalid dimensions %d %d\n", settings->DesktopWidth, settings->DesktopHeight);
|
||||
DEBUG_WARN( "wf_pre_connect: invalid dimensions %d %d\n", settings->DesktopWidth, settings->DesktopHeight);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -487,7 +487,7 @@ BOOL wf_authenticate(freerdp* instance, char** username, char** password, char**
|
||||
|
||||
if (status != NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "CredUIPromptForCredentials unexpected status: 0x%08X\n", status);
|
||||
DEBUG_WARN( "CredUIPromptForCredentials unexpected status: 0x%08X\n", status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -496,7 +496,7 @@ BOOL wf_authenticate(freerdp* instance, char** username, char** password, char**
|
||||
|
||||
status = CredUIParseUserNameA(UserName, User, sizeof(User), Domain, sizeof(Domain));
|
||||
|
||||
//fprintf(stderr, "User: %s Domain: %s Password: %s\n", User, Domain, Password);
|
||||
//DEBUG_WARN( "User: %s Domain: %s Password: %s\n", User, Domain, Password);
|
||||
|
||||
*username = _strdup(User);
|
||||
|
||||
@ -590,7 +590,7 @@ static BOOL wf_auto_reconnect(freerdp* instance)
|
||||
return FALSE;
|
||||
|
||||
/* A network disconnect was detected */
|
||||
fprintf(stderr, "Network disconnect!\n");
|
||||
DEBUG_WARN( "Network disconnect!\n");
|
||||
if (!instance->settings->AutoReconnectionEnabled)
|
||||
{
|
||||
/* No auto-reconnect - just quit */
|
||||
@ -605,7 +605,7 @@ static BOOL wf_auto_reconnect(freerdp* instance)
|
||||
return FALSE;
|
||||
|
||||
/* Attempt the next reconnect */
|
||||
fprintf(stderr, "Attempting reconnect (%u of %u)\n", num_retries, max_retries);
|
||||
DEBUG_WARN( "Attempting reconnect (%u of %u)\n", num_retries, max_retries);
|
||||
if (freerdp_reconnect(instance))
|
||||
{
|
||||
return TRUE;
|
||||
@ -614,7 +614,7 @@ static BOOL wf_auto_reconnect(freerdp* instance)
|
||||
Sleep(5000);
|
||||
}
|
||||
|
||||
fprintf(stderr, "Maximum reconnect retries exceeded\n");
|
||||
DEBUG_WARN( "Maximum reconnect retries exceeded\n");
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@ -784,13 +784,13 @@ DWORD WINAPI wf_client_thread(LPVOID lpParam)
|
||||
{
|
||||
if (freerdp_get_fds(instance, rfds, &rcount, wfds, &wcount) != TRUE)
|
||||
{
|
||||
fprintf(stderr, "Failed to get FreeRDP file descriptor\n");
|
||||
DEBUG_WARN( "Failed to get FreeRDP file descriptor\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (wf_get_fds(instance, rfds, &rcount, wfds, &wcount) != TRUE)
|
||||
{
|
||||
fprintf(stderr, "Failed to get wfreerdp file descriptor\n");
|
||||
DEBUG_WARN( "Failed to get wfreerdp file descriptor\n");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -798,7 +798,7 @@ DWORD WINAPI wf_client_thread(LPVOID lpParam)
|
||||
{
|
||||
if (freerdp_channels_get_fds(channels, instance, rfds, &rcount, wfds, &wcount) != TRUE)
|
||||
{
|
||||
fprintf(stderr, "Failed to get channel manager file descriptor\n");
|
||||
DEBUG_WARN( "Failed to get channel manager file descriptor\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -816,14 +816,14 @@ DWORD WINAPI wf_client_thread(LPVOID lpParam)
|
||||
/* exit if nothing to do */
|
||||
if (fds_count == 0)
|
||||
{
|
||||
fprintf(stderr, "wfreerdp_run: fds_count is zero\n");
|
||||
DEBUG_WARN( "wfreerdp_run: fds_count is zero\n");
|
||||
//break;
|
||||
}
|
||||
|
||||
/* do the wait */
|
||||
if (MsgWaitForMultipleObjects(fds_count, fds, FALSE, 1000, QS_ALLINPUT) == WAIT_FAILED)
|
||||
{
|
||||
fprintf(stderr, "wfreerdp_run: WaitForMultipleObjects failed: 0x%04X\n", GetLastError());
|
||||
DEBUG_WARN( "wfreerdp_run: WaitForMultipleObjects failed: 0x%04X\n", GetLastError());
|
||||
break;
|
||||
}
|
||||
|
||||
@ -834,7 +834,7 @@ DWORD WINAPI wf_client_thread(LPVOID lpParam)
|
||||
if (wf_auto_reconnect(instance))
|
||||
continue;
|
||||
|
||||
fprintf(stderr, "Failed to check FreeRDP file descriptor\n");
|
||||
DEBUG_WARN( "Failed to check FreeRDP file descriptor\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -844,7 +844,7 @@ DWORD WINAPI wf_client_thread(LPVOID lpParam)
|
||||
}
|
||||
if (wf_check_fds(instance) != TRUE)
|
||||
{
|
||||
fprintf(stderr, "Failed to check wfreerdp file descriptor\n");
|
||||
DEBUG_WARN( "Failed to check wfreerdp file descriptor\n");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -852,7 +852,7 @@ DWORD WINAPI wf_client_thread(LPVOID lpParam)
|
||||
{
|
||||
if (freerdp_channels_check_fds(channels, instance) != TRUE)
|
||||
{
|
||||
fprintf(stderr, "Failed to check channel manager file descriptor\n");
|
||||
DEBUG_WARN( "Failed to check channel manager file descriptor\n");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -960,7 +960,7 @@ DWORD WINAPI wf_keyboard_thread(LPVOID lpParam)
|
||||
{
|
||||
if (status == -1)
|
||||
{
|
||||
fprintf(stderr, "keyboard thread error getting message\n");
|
||||
DEBUG_WARN( "keyboard thread error getting message\n");
|
||||
break;
|
||||
}
|
||||
else
|
||||
@ -974,7 +974,7 @@ DWORD WINAPI wf_keyboard_thread(LPVOID lpParam)
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "failed to install keyboard hook\n");
|
||||
DEBUG_WARN( "failed to install keyboard hook\n");
|
||||
}
|
||||
|
||||
printf("Keyboard thread exited.\n");
|
||||
@ -1002,7 +1002,7 @@ int freerdp_client_focus_out(wfContext* wfc)
|
||||
|
||||
int freerdp_client_set_window_size(wfContext* wfc, int width, int height)
|
||||
{
|
||||
fprintf(stderr, "freerdp_client_set_window_size %d, %d", width, height);
|
||||
DEBUG_WARN( "freerdp_client_set_window_size %d, %d", width, height);
|
||||
|
||||
if ((width != wfc->client_width) || (height != wfc->client_height))
|
||||
{
|
||||
@ -1027,7 +1027,7 @@ int freerdp_client_load_settings_from_rdp_file(wfContext* wfc, char* filename)
|
||||
freerdp_client_rdp_file_free(wfc->connectionRdpFile);
|
||||
wfc->connectionRdpFile = freerdp_client_rdp_file_new();
|
||||
|
||||
fprintf(stderr, "Using connection file: %s\n", settings->ConnectionFile);
|
||||
DEBUG_WARN( "Using connection file: %s\n", settings->ConnectionFile);
|
||||
|
||||
if (!freerdp_client_parse_rdp_file(wfc->connectionRdpFile, settings->ConnectionFile))
|
||||
{
|
||||
|
@ -26,7 +26,7 @@ LPSTR tr_esc_str(LPCSTR arg)
|
||||
tmp = (LPSTR)realloc(tmp, ds * sizeof(CHAR));
|
||||
if(NULL == tmp)
|
||||
{
|
||||
fprintf(stderr, "Could not allocate string buffer.");
|
||||
DEBUG_WARN( "Could not allocate string buffer.");
|
||||
exit(-2);
|
||||
}
|
||||
/* Copy character for character and check, if it is necessary to escape. */
|
||||
@ -40,7 +40,7 @@ LPSTR tr_esc_str(LPCSTR arg)
|
||||
tmp = (LPSTR)realloc(tmp, ds * sizeof(CHAR));
|
||||
if(NULL == tmp)
|
||||
{
|
||||
fprintf(stderr, "Could not reallocate string buffer.");
|
||||
DEBUG_WARN( "Could not reallocate string buffer.");
|
||||
exit(-3);
|
||||
}
|
||||
tmp[cs++] = '&';
|
||||
@ -53,7 +53,7 @@ LPSTR tr_esc_str(LPCSTR arg)
|
||||
tmp = (LPSTR)realloc(tmp, ds * sizeof(CHAR));
|
||||
if(NULL == tmp)
|
||||
{
|
||||
fprintf(stderr, "Could not reallocate string buffer.");
|
||||
DEBUG_WARN( "Could not reallocate string buffer.");
|
||||
exit(-4);
|
||||
}
|
||||
tmp[cs++] = '&';
|
||||
@ -66,7 +66,7 @@ LPSTR tr_esc_str(LPCSTR arg)
|
||||
tmp = (LPSTR)realloc(tmp, ds * sizeof(CHAR));
|
||||
if(NULL == tmp)
|
||||
{
|
||||
fprintf(stderr, "Could not reallocate string buffer.");
|
||||
DEBUG_WARN( "Could not reallocate string buffer.");
|
||||
exit(-5);
|
||||
}
|
||||
tmp[cs++] = '&';
|
||||
@ -81,7 +81,7 @@ LPSTR tr_esc_str(LPCSTR arg)
|
||||
tmp = (LPSTR)realloc(tmp, ds * sizeof(CHAR));
|
||||
if(NULL == tmp)
|
||||
{
|
||||
fprintf(stderr, "Could not reallocate string buffer.");
|
||||
DEBUG_WARN( "Could not reallocate string buffer.");
|
||||
exit(-6);
|
||||
}
|
||||
tmp[cs++] = '&';
|
||||
@ -96,7 +96,7 @@ LPSTR tr_esc_str(LPCSTR arg)
|
||||
tmp = (LPSTR)realloc(tmp, ds * sizeof(CHAR));
|
||||
if(NULL == tmp)
|
||||
{
|
||||
fprintf(stderr, "Could not reallocate string buffer.");
|
||||
DEBUG_WARN( "Could not reallocate string buffer.");
|
||||
exit(-7);
|
||||
}
|
||||
tmp[cs++] = '&';
|
||||
@ -125,7 +125,7 @@ int main(int argc, char *argv[])
|
||||
fp = fopen(fname, "w");
|
||||
if(NULL == fp)
|
||||
{
|
||||
fprintf(stderr, "Could not open '%s' for writing.", fname);
|
||||
DEBUG_WARN( "Could not open '%s' for writing.", fname);
|
||||
return -1;
|
||||
}
|
||||
/* The tag used as header in the manpage */
|
||||
@ -136,7 +136,7 @@ int main(int argc, char *argv[])
|
||||
* compatible XML */
|
||||
if(elements < 2)
|
||||
{
|
||||
fprintf(stderr, "The argument array 'args' is empty, writing an empty file.");
|
||||
DEBUG_WARN( "The argument array 'args' is empty, writing an empty file.");
|
||||
elements = 1;
|
||||
}
|
||||
for(x=0; x<elements - 1; x++)
|
||||
|
@ -573,7 +573,7 @@ BOOL xf_get_pixmap_info(xfContext *xfc)
|
||||
pfs = XListPixmapFormats(xfc->display, &pf_count);
|
||||
if(pfs == NULL)
|
||||
{
|
||||
fprintf(stderr, "xf_get_pixmap_info: XListPixmapFormats failed\n");
|
||||
DEBUG_WARN( "xf_get_pixmap_info: XListPixmapFormats failed\n");
|
||||
return 1;
|
||||
}
|
||||
for(i = 0; i < pf_count; i++)
|
||||
@ -592,13 +592,13 @@ BOOL xf_get_pixmap_info(xfContext *xfc)
|
||||
template.screen = xfc->screen_number;
|
||||
if(XGetWindowAttributes(xfc->display, RootWindowOfScreen(xfc->screen), &window_attributes) == 0)
|
||||
{
|
||||
fprintf(stderr, "xf_get_pixmap_info: XGetWindowAttributes failed\n");
|
||||
DEBUG_WARN( "xf_get_pixmap_info: XGetWindowAttributes failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
vis = XGetVisualInfo(xfc->display, VisualClassMask | VisualScreenMask, &template, &vi_count);
|
||||
if(vis == NULL)
|
||||
{
|
||||
fprintf(stderr, "xf_get_pixmap_info: XGetVisualInfo failed\n");
|
||||
DEBUG_WARN( "xf_get_pixmap_info: XGetVisualInfo failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
vi = NULL;
|
||||
@ -637,7 +637,7 @@ int xf_error_handler(Display *d, XErrorEvent *ev)
|
||||
char buf[256];
|
||||
int do_abort = TRUE;
|
||||
XGetErrorText(d, ev->error_code, buf, sizeof(buf));
|
||||
fprintf(stderr, "%s", buf);
|
||||
DEBUG_WARN( "%s", buf);
|
||||
if(do_abort)
|
||||
abort();
|
||||
_def_error_handler(d, ev);
|
||||
@ -721,20 +721,20 @@ BOOL xf_pre_connect(freerdp *instance)
|
||||
{
|
||||
if(!XInitThreads())
|
||||
{
|
||||
fprintf(stderr, "warning: XInitThreads() failure\n");
|
||||
DEBUG_WARN( "warning: XInitThreads() failure\n");
|
||||
xfc->UseXThreads = FALSE;
|
||||
}
|
||||
}
|
||||
xfc->display = XOpenDisplay(NULL);
|
||||
if(!xfc->display)
|
||||
{
|
||||
fprintf(stderr, "xf_pre_connect: failed to open display: %s\n", XDisplayName(NULL));
|
||||
fprintf(stderr, "Please check that the $DISPLAY environment variable is properly set.\n");
|
||||
DEBUG_WARN( "xf_pre_connect: failed to open display: %s\n", XDisplayName(NULL));
|
||||
DEBUG_WARN( "Please check that the $DISPLAY environment variable is properly set.\n");
|
||||
return FALSE;
|
||||
}
|
||||
if(xfc->debug)
|
||||
{
|
||||
fprintf(stderr, "Enabling X11 debug mode.\n");
|
||||
DEBUG_WARN( "Enabling X11 debug mode.\n");
|
||||
XSynchronize(xfc->display, TRUE);
|
||||
_def_error_handler = XSetErrorHandler(_xf_error_handler);
|
||||
}
|
||||
@ -750,15 +750,15 @@ BOOL xf_pre_connect(freerdp *instance)
|
||||
/* Check --authonly has a username and password. */
|
||||
if(settings->Username == NULL)
|
||||
{
|
||||
fprintf(stderr, "--authonly, but no -u username. Please provide one.\n");
|
||||
DEBUG_WARN( "--authonly, but no -u username. Please provide one.\n");
|
||||
return FALSE;
|
||||
}
|
||||
if(settings->Password == NULL)
|
||||
{
|
||||
fprintf(stderr, "--authonly, but no -p password. Please provide one.\n");
|
||||
DEBUG_WARN( "--authonly, but no -p password. Please provide one.\n");
|
||||
return FALSE;
|
||||
}
|
||||
fprintf(stderr, "Authentication only. Don't connect to X.\n");
|
||||
DEBUG_WARN( "Authentication only. Don't connect to X.\n");
|
||||
/* Avoid XWindows initialization and configuration below. */
|
||||
return TRUE;
|
||||
}
|
||||
@ -1225,7 +1225,7 @@ BOOL xf_auto_reconnect(freerdp *instance)
|
||||
if(freerdp_error_info(instance) != 0)
|
||||
return FALSE;
|
||||
/* A network disconnect was detected */
|
||||
fprintf(stderr, "Network disconnect!\n");
|
||||
DEBUG_WARN( "Network disconnect!\n");
|
||||
if(!instance->settings->AutoReconnectionEnabled)
|
||||
{
|
||||
/* No auto-reconnect - just quit */
|
||||
@ -1240,7 +1240,7 @@ BOOL xf_auto_reconnect(freerdp *instance)
|
||||
return FALSE;
|
||||
}
|
||||
/* Attempt the next reconnect */
|
||||
fprintf(stderr, "Attempting reconnect (%u of %u)\n", num_retries, max_retries);
|
||||
DEBUG_WARN( "Attempting reconnect (%u of %u)\n", num_retries, max_retries);
|
||||
if(freerdp_reconnect(instance))
|
||||
{
|
||||
xfc->disconnect = FALSE;
|
||||
@ -1248,7 +1248,7 @@ BOOL xf_auto_reconnect(freerdp *instance)
|
||||
}
|
||||
sleep(5);
|
||||
}
|
||||
fprintf(stderr, "Maximum reconnect retries exceeded\n");
|
||||
DEBUG_WARN( "Maximum reconnect retries exceeded\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -1301,7 +1301,7 @@ void *xf_thread(void *param)
|
||||
if(instance->settings->AuthenticationOnly)
|
||||
{
|
||||
freerdp_disconnect(instance);
|
||||
fprintf(stderr, "Authentication only, exit status %d\n", !status);
|
||||
DEBUG_WARN( "Authentication only, exit status %d\n", !status);
|
||||
ExitThread(exit_code);
|
||||
}
|
||||
if(!status)
|
||||
@ -1352,7 +1352,7 @@ void *xf_thread(void *param)
|
||||
{
|
||||
if(freerdp_get_fds(instance, rfds, &rcount, wfds, &wcount) != TRUE)
|
||||
{
|
||||
fprintf(stderr, "Failed to get FreeRDP file descriptor\n");
|
||||
DEBUG_WARN( "Failed to get FreeRDP file descriptor\n");
|
||||
exit_code = XF_EXIT_CONN_FAILED;
|
||||
break;
|
||||
}
|
||||
@ -1361,7 +1361,7 @@ void *xf_thread(void *param)
|
||||
{
|
||||
if(freerdp_channels_get_fds(channels, instance, rfds, &rcount, wfds, &wcount) != TRUE)
|
||||
{
|
||||
fprintf(stderr, "Failed to get channel manager file descriptor\n");
|
||||
DEBUG_WARN( "Failed to get channel manager file descriptor\n");
|
||||
exit_code = XF_EXIT_CONN_FAILED;
|
||||
break;
|
||||
}
|
||||
@ -1370,7 +1370,7 @@ void *xf_thread(void *param)
|
||||
{
|
||||
if(xf_get_fds(instance, rfds, &rcount, wfds, &wcount) != TRUE)
|
||||
{
|
||||
fprintf(stderr, "Failed to get xfreerdp file descriptor\n");
|
||||
DEBUG_WARN( "Failed to get xfreerdp file descriptor\n");
|
||||
exit_code = XF_EXIT_CONN_FAILED;
|
||||
break;
|
||||
}
|
||||
@ -1407,7 +1407,7 @@ void *xf_thread(void *param)
|
||||
if(!((errno == EAGAIN) || (errno == EWOULDBLOCK) ||
|
||||
(errno == EINPROGRESS) || (errno == EINTR))) /* signal occurred */
|
||||
{
|
||||
fprintf(stderr, "xfreerdp_run: select failed\n");
|
||||
DEBUG_WARN( "xfreerdp_run: select failed\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1417,7 +1417,7 @@ void *xf_thread(void *param)
|
||||
{
|
||||
if(xf_auto_reconnect(instance))
|
||||
continue;
|
||||
fprintf(stderr, "Failed to check FreeRDP file descriptor\n");
|
||||
DEBUG_WARN( "Failed to check FreeRDP file descriptor\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1425,7 +1425,7 @@ void *xf_thread(void *param)
|
||||
{
|
||||
if(freerdp_channels_check_fds(channels, instance) != TRUE)
|
||||
{
|
||||
fprintf(stderr, "Failed to check channel manager file descriptor\n");
|
||||
DEBUG_WARN( "Failed to check channel manager file descriptor\n");
|
||||
break;
|
||||
}
|
||||
xf_process_channel_event(channels, instance);
|
||||
@ -1434,7 +1434,7 @@ void *xf_thread(void *param)
|
||||
{
|
||||
if(xf_process_x_events(instance) != TRUE)
|
||||
{
|
||||
fprintf(stderr, "Closed from X11\n");
|
||||
DEBUG_WARN( "Closed from X11\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1444,7 +1444,7 @@ void *xf_thread(void *param)
|
||||
{
|
||||
if(!freerdp_message_queue_process_pending_messages(instance, FREERDP_INPUT_MESSAGE_QUEUE))
|
||||
{
|
||||
fprintf(stderr, "User Disconnect\n");
|
||||
DEBUG_WARN( "User Disconnect\n");
|
||||
xfc->disconnect = TRUE;
|
||||
break;
|
||||
}
|
||||
@ -1559,7 +1559,7 @@ static int xfreerdp_client_start(rdpContext *context)
|
||||
rdpSettings *settings = context->settings;
|
||||
if(!settings->ServerHostname)
|
||||
{
|
||||
fprintf(stderr, "error: server hostname was not specified with /v:<server>[:port]\n");
|
||||
DEBUG_WARN( "error: server hostname was not specified with /v:<server>[:port]\n");
|
||||
return -1;
|
||||
}
|
||||
xfc->thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) xf_thread,
|
||||
|
@ -143,15 +143,15 @@ void xf_cliprdr_init(xfContext* xfc, rdpChannels* channels)
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "%s: Error querying X Fixes extension version\n", __FUNCTION__);
|
||||
DEBUG_WARN( "%s: Error querying X Fixes extension version\n", __FUNCTION__);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "%s: Error loading X Fixes extension\n", __FUNCTION__);
|
||||
DEBUG_WARN( "%s: Error loading X Fixes extension\n", __FUNCTION__);
|
||||
}
|
||||
#else
|
||||
fprintf(stderr, "Warning: Using clipboard redirection without XFIXES extension is strongly discouraged!\n");
|
||||
DEBUG_WARN( "Warning: Using clipboard redirection without XFIXES extension is strongly discouraged!\n");
|
||||
#endif
|
||||
|
||||
n = 0;
|
||||
@ -970,7 +970,7 @@ static BOOL xf_cliprdr_process_dib(clipboardContext* cb, BYTE* data, int size)
|
||||
Stream_Read_UINT16(s, bpp);
|
||||
if ((bpp < 1) || (bpp > 32))
|
||||
{
|
||||
fprintf(stderr, "%s: invalid bpp value %d", __FUNCTION__, bpp);
|
||||
DEBUG_WARN( "%s: invalid bpp value %d", __FUNCTION__, bpp);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ BOOL xf_set_rop2(xfContext* xfc, int rop2)
|
||||
{
|
||||
if ((rop2 < 0x01) || (rop2 > 0x10))
|
||||
{
|
||||
fprintf(stderr, "Unsupported ROP2: %d\n", rop2);
|
||||
DEBUG_WARN( "Unsupported ROP2: %d\n", rop2);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -204,7 +204,7 @@ BOOL xf_set_rop3(xfContext* xfc, int rop3)
|
||||
|
||||
if (function < 0)
|
||||
{
|
||||
fprintf(stderr, "Unsupported ROP3: 0x%08X\n", rop3);
|
||||
DEBUG_WARN( "Unsupported ROP3: 0x%08X\n", rop3);
|
||||
XSetFunction(xfc->display, xfc->gc, GXclear);
|
||||
return FALSE;
|
||||
}
|
||||
@ -398,7 +398,7 @@ void xf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "unimplemented brush style:%d\n", brush->style);
|
||||
DEBUG_WARN( "unimplemented brush style:%d\n", brush->style);
|
||||
}
|
||||
|
||||
if (xfc->drawing == xfc->primary)
|
||||
@ -522,7 +522,7 @@ void xf_gdi_multi_opaque_rect(rdpContext* context, MULTI_OPAQUE_RECT_ORDER* mult
|
||||
|
||||
void xf_gdi_draw_nine_grid(rdpContext* context, DRAW_NINE_GRID_ORDER* draw_nine_grid)
|
||||
{
|
||||
fprintf(stderr, "DrawNineGrid\n");
|
||||
DEBUG_WARN( "DrawNineGrid\n");
|
||||
}
|
||||
|
||||
void xf_gdi_line_to(rdpContext* context, LINE_TO_ORDER* line_to)
|
||||
@ -713,7 +713,7 @@ void xf_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "Mem3Blt unimplemented brush style:%d\n", brush->style);
|
||||
DEBUG_WARN( "Mem3Blt unimplemented brush style:%d\n", brush->style);
|
||||
}
|
||||
|
||||
XCopyArea(xfc->display, bitmap->pixmap, xfc->drawing, xfc->gc,
|
||||
@ -777,7 +777,7 @@ void xf_gdi_polygon_sc(rdpContext* context, POLYGON_SC_ORDER* polygon_sc)
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "PolygonSC unknown fillMode: %d\n", polygon_sc->fillMode);
|
||||
DEBUG_WARN( "PolygonSC unknown fillMode: %d\n", polygon_sc->fillMode);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -839,7 +839,7 @@ void xf_gdi_polygon_cb(rdpContext* context, POLYGON_CB_ORDER* polygon_cb)
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "PolygonCB unknown fillMode: %d\n", polygon_cb->fillMode);
|
||||
DEBUG_WARN( "PolygonCB unknown fillMode: %d\n", polygon_cb->fillMode);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -897,7 +897,7 @@ void xf_gdi_polygon_cb(rdpContext* context, POLYGON_CB_ORDER* polygon_cb)
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "PolygonCB unimplemented brush style:%d\n", brush->style);
|
||||
DEBUG_WARN( "PolygonCB unimplemented brush style:%d\n", brush->style);
|
||||
}
|
||||
|
||||
XSetFunction(xfc->display, xfc->gc, GXcopy);
|
||||
@ -908,12 +908,12 @@ void xf_gdi_polygon_cb(rdpContext* context, POLYGON_CB_ORDER* polygon_cb)
|
||||
|
||||
void xf_gdi_ellipse_sc(rdpContext* context, ELLIPSE_SC_ORDER* ellipse_sc)
|
||||
{
|
||||
fprintf(stderr, "EllipseSC\n");
|
||||
DEBUG_WARN( "EllipseSC\n");
|
||||
}
|
||||
|
||||
void xf_gdi_ellipse_cb(rdpContext* context, ELLIPSE_CB_ORDER* ellipse_cb)
|
||||
{
|
||||
fprintf(stderr, "EllipseCB\n");
|
||||
DEBUG_WARN( "EllipseCB\n");
|
||||
}
|
||||
|
||||
void xf_gdi_surface_frame_marker(rdpContext* context, SURFACE_FRAME_MARKER* surface_frame_marker)
|
||||
@ -1111,12 +1111,12 @@ void xf_gdi_surface_bits(rdpContext* context, SURFACE_BITS_COMMAND* surface_bits
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "Invalid bitmap size - data is %d bytes for %dx%d\n update", surface_bits_command->bitmapDataLength, surface_bits_command->width, surface_bits_command->height);
|
||||
DEBUG_WARN( "Invalid bitmap size - data is %d bytes for %dx%d\n update", surface_bits_command->bitmapDataLength, surface_bits_command->width, surface_bits_command->height);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "Unsupported codecID %d\n", surface_bits_command->codecID);
|
||||
DEBUG_WARN( "Unsupported codecID %d\n", surface_bits_command->codecID);
|
||||
}
|
||||
|
||||
xf_unlock_x11(xfc, FALSE);
|
||||
|
@ -141,7 +141,7 @@ void xf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
|
||||
switch (codec_id)
|
||||
{
|
||||
case RDP_CODEC_ID_NSCODEC:
|
||||
fprintf(stderr, "xf_Bitmap_Decompress: nsc not done\n");
|
||||
DEBUG_WARN( "xf_Bitmap_Decompress: nsc not done\n");
|
||||
break;
|
||||
|
||||
case RDP_CODEC_ID_REMOTEFX:
|
||||
@ -150,7 +150,7 @@ void xf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
|
||||
|
||||
if (!msg)
|
||||
{
|
||||
fprintf(stderr, "xf_Bitmap_Decompress: rfx Decompression Failed\n");
|
||||
DEBUG_WARN( "xf_Bitmap_Decompress: rfx Decompression Failed\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -173,7 +173,7 @@ void xf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
|
||||
case RDP_CODEC_ID_JPEG:
|
||||
if (!jpeg_decompress(data, bitmap->data, width, height, length, bpp))
|
||||
{
|
||||
fprintf(stderr, "xf_Bitmap_Decompress: jpeg Decompression Failed\n");
|
||||
DEBUG_WARN( "xf_Bitmap_Decompress: jpeg Decompression Failed\n");
|
||||
}
|
||||
break;
|
||||
|
||||
@ -184,7 +184,7 @@ void xf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
|
||||
|
||||
if (!status)
|
||||
{
|
||||
fprintf(stderr, "xf_Bitmap_Decompress: Bitmap Decompression Failed\n");
|
||||
DEBUG_WARN( "xf_Bitmap_Decompress: Bitmap Decompression Failed\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -624,7 +624,7 @@ int xf_input_touch_remote(xfContext* xfc, XIDeviceEvent* event, int evtype)
|
||||
}
|
||||
else if (evtype == XI_TouchUpdate)
|
||||
{
|
||||
printf("TouchUpdate: %d\n", touchId);
|
||||
DEBUG_MSG("TouchUpdate: %d\n", touchId);
|
||||
contactId = rdpei->TouchUpdate(rdpei, touchId, x, y);
|
||||
}
|
||||
else if (evtype == XI_TouchEnd)
|
||||
|
@ -191,18 +191,18 @@ void xf_keyboard_send_key(xfContext* xfc, BOOL down, BYTE keycode)
|
||||
|
||||
if (rdp_scancode == RDP_SCANCODE_UNKNOWN)
|
||||
{
|
||||
fprintf(stderr, "Unknown key with X keycode 0x%02x\n", keycode);
|
||||
DEBUG_WARN( "Unknown key with X keycode 0x%02x\n", keycode);
|
||||
}
|
||||
else if (rdp_scancode == RDP_SCANCODE_PAUSE &&
|
||||
!xf_keyboard_key_pressed(xfc, XK_Control_L) && !xf_keyboard_key_pressed(xfc, XK_Control_R))
|
||||
{
|
||||
/* Pause without Ctrl has to be sent as Ctrl + NumLock. */
|
||||
/* Pause without Ctrl has to be sent as a series of keycodes
|
||||
* in a single input PDU. Pause only happens on "press";
|
||||
* no code is sent on "release".
|
||||
*/
|
||||
if (down)
|
||||
{
|
||||
freerdp_input_send_keyboard_event_ex(input, TRUE, RDP_SCANCODE_LCONTROL);
|
||||
freerdp_input_send_keyboard_event_ex(input, TRUE, RDP_SCANCODE_NUMLOCK);
|
||||
freerdp_input_send_keyboard_event_ex(input, FALSE, RDP_SCANCODE_LCONTROL);
|
||||
freerdp_input_send_keyboard_event_ex(input, FALSE, RDP_SCANCODE_NUMLOCK);
|
||||
freerdp_input_send_keyboard_pause_event(input);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -497,7 +497,7 @@ void xf_process_rail_exec_result_event(xfContext* xfc, rdpChannels* channels, wM
|
||||
|
||||
if (exec_result->execResult != RAIL_EXEC_S_OK)
|
||||
{
|
||||
fprintf(stderr, "RAIL exec error: execResult=%s NtError=0x%X\n",
|
||||
DEBUG_WARN( "RAIL exec error: execResult=%s NtError=0x%X\n",
|
||||
error_code_names[exec_result->execResult], exec_result->rawResult);
|
||||
xfc->disconnect = True;
|
||||
}
|
||||
@ -660,7 +660,7 @@ void xf_process_rail_appid_resp_event(xfContext* xfc, rdpChannels* channels, wMe
|
||||
RAIL_GET_APPID_RESP_ORDER* appid_resp =
|
||||
(RAIL_GET_APPID_RESP_ORDER*) event->wParam;
|
||||
|
||||
fprintf(stderr, "Server Application ID Response PDU: windowId=0x%X "
|
||||
DEBUG_WARN( "Server Application ID Response PDU: windowId=0x%X "
|
||||
"applicationId=(length=%d dump)\n",
|
||||
appid_resp->windowId, 512);
|
||||
|
||||
@ -672,7 +672,7 @@ void xf_process_rail_langbarinfo_event(xfContext* xfc, rdpChannels* channels, wM
|
||||
RAIL_LANGBAR_INFO_ORDER* langbar =
|
||||
(RAIL_LANGBAR_INFO_ORDER*) event->wParam;
|
||||
|
||||
fprintf(stderr, "Language Bar Information PDU: languageBarStatus=0x%X\n",
|
||||
DEBUG_WARN( "Language Bar Information PDU: languageBarStatus=0x%X\n",
|
||||
langbar->languageBarStatus);
|
||||
}
|
||||
|
||||
|
@ -140,7 +140,7 @@ void xf_tsmf_init(xfContext* xfc, long xv_port)
|
||||
XFree(attr);
|
||||
|
||||
#ifdef WITH_DEBUG_XV
|
||||
fprintf(stderr, "xf_tsmf_init: pixel format ");
|
||||
DEBUG_WARN( "xf_tsmf_init: pixel format ");
|
||||
#endif
|
||||
fo = XvListImageFormats(xfc->display, xv->xv_port, &ret);
|
||||
if (ret > 0)
|
||||
@ -152,7 +152,7 @@ void xf_tsmf_init(xfContext* xfc, long xv_port)
|
||||
{
|
||||
xv->xv_pixfmts[i] = fo[i].id;
|
||||
#ifdef WITH_DEBUG_XV
|
||||
fprintf(stderr, "%c%c%c%c ", ((char*)(xv->xv_pixfmts + i))[0], ((char*)(xv->xv_pixfmts + i))[1],
|
||||
DEBUG_WARN( "%c%c%c%c ", ((char*)(xv->xv_pixfmts + i))[0], ((char*)(xv->xv_pixfmts + i))[1],
|
||||
((char*)(xv->xv_pixfmts + i))[2], ((char*)(xv->xv_pixfmts + i))[3]);
|
||||
#endif
|
||||
}
|
||||
@ -160,7 +160,7 @@ void xf_tsmf_init(xfContext* xfc, long xv_port)
|
||||
}
|
||||
XFree(fo);
|
||||
#ifdef WITH_DEBUG_XV
|
||||
fprintf(stderr, "\n");
|
||||
DEBUG_WARN( "\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <freerdp/crypto/crypto.h>
|
||||
#include <freerdp/locale/keyboard.h>
|
||||
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/client/cmdline.h>
|
||||
#include <freerdp/version.h>
|
||||
|
||||
@ -1190,7 +1191,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
|
||||
|
||||
if (compatibility)
|
||||
{
|
||||
fprintf(stderr, "WARNING: Using deprecated command-line interface!\n");
|
||||
DEBUG_WARN( "WARNING: Using deprecated command-line interface!\n");
|
||||
return freerdp_client_parse_old_command_line_arguments(argc, argv, settings);
|
||||
}
|
||||
else
|
||||
@ -1360,25 +1361,25 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
|
||||
}
|
||||
CommandLineSwitchCase(arg, "kbd")
|
||||
{
|
||||
int id;
|
||||
unsigned long int id;
|
||||
char* pEnd;
|
||||
|
||||
id = strtol(arg->Value, &pEnd, 16);
|
||||
id = strtoul(arg->Value, &pEnd, 16);
|
||||
|
||||
if (pEnd != (arg->Value + strlen(arg->Value)))
|
||||
id = 0;
|
||||
|
||||
if (id == 0)
|
||||
{
|
||||
id = freerdp_map_keyboard_layout_name_to_id(arg->Value);
|
||||
id = (unsigned long int) freerdp_map_keyboard_layout_name_to_id(arg->Value);
|
||||
|
||||
if (!id)
|
||||
{
|
||||
fprintf(stderr, "Could not identify keyboard layout: %s\n", arg->Value);
|
||||
DEBUG_WARN( "Could not identify keyboard layout: %s\n", arg->Value);
|
||||
}
|
||||
}
|
||||
|
||||
settings->KeyboardLayout = id;
|
||||
settings->KeyboardLayout = (UINT32) id;
|
||||
}
|
||||
CommandLineSwitchCase(arg, "kbd-type")
|
||||
{
|
||||
@ -1640,6 +1641,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
|
||||
CommandLineSwitchCase(arg, "gfx-progressive")
|
||||
{
|
||||
settings->GfxProgressive = arg->Value ? TRUE : FALSE;
|
||||
settings->GfxThinClient = settings->GfxProgressive ? FALSE : TRUE;
|
||||
settings->SupportGraphicsPipeline = TRUE;
|
||||
}
|
||||
CommandLineSwitchCase(arg, "gfx-h264")
|
||||
@ -1732,7 +1734,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "unknown protocol security: %s\n", arg->Value);
|
||||
DEBUG_WARN( "unknown protocol security: %s\n", arg->Value);
|
||||
}
|
||||
}
|
||||
CommandLineSwitchCase(arg, "sec-rdp")
|
||||
@ -1878,7 +1880,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "reconnect-cookie: invalid base64 '%s'\n",
|
||||
DEBUG_WARN( "reconnect-cookie: invalid base64 '%s'\n",
|
||||
arg->Value);
|
||||
}
|
||||
}
|
||||
@ -1943,7 +1945,7 @@ int freerdp_client_load_static_channel_addin(rdpChannels* channels, rdpSettings*
|
||||
{
|
||||
if (freerdp_channels_client_load(channels, settings, entry, data) == 0)
|
||||
{
|
||||
fprintf(stderr, "loading channel %s\n", name);
|
||||
DEBUG_WARN( "loading channel %s\n", name);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <freerdp/addin.h>
|
||||
#include <freerdp/settings.h>
|
||||
#include <freerdp/client/channels.h>
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/locale/keyboard.h>
|
||||
|
||||
#include <freerdp/client/cmdline.h>
|
||||
@ -121,7 +122,7 @@ int freerdp_client_old_process_plugin(rdpSettings* settings, ADDIN_ARGV* args)
|
||||
if (strcmp(args->argv[0], "cliprdr") == 0)
|
||||
{
|
||||
settings->RedirectClipboard = TRUE;
|
||||
fprintf(stderr, "--plugin cliprdr -> +clipboard\n");
|
||||
DEBUG_WARN( "--plugin cliprdr -> +clipboard\n");
|
||||
}
|
||||
else if (strcmp(args->argv[0], "rdpdr") == 0)
|
||||
{
|
||||
@ -437,37 +438,37 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
|
||||
CommandLineSwitchCase(arg, "0")
|
||||
{
|
||||
settings->ConsoleSession = TRUE;
|
||||
fprintf(stderr, "-0 -> /admin\n");
|
||||
DEBUG_WARN( "-0 -> /admin\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "a")
|
||||
{
|
||||
settings->ColorDepth = atoi(arg->Value);
|
||||
fprintf(stderr, "-a %s -> /bpp:%s\n", arg->Value, arg->Value);
|
||||
DEBUG_WARN( "-a %s -> /bpp:%s\n", arg->Value, arg->Value);
|
||||
}
|
||||
CommandLineSwitchCase(arg, "c")
|
||||
{
|
||||
settings->ShellWorkingDirectory = _strdup(arg->Value);
|
||||
fprintf(stderr, "-c %s -> /shell-dir:%s\n", arg->Value, arg->Value);
|
||||
DEBUG_WARN( "-c %s -> /shell-dir:%s\n", arg->Value, arg->Value);
|
||||
}
|
||||
CommandLineSwitchCase(arg, "D")
|
||||
{
|
||||
settings->Decorations = FALSE;
|
||||
fprintf(stderr, "-D -> -decorations\n");
|
||||
DEBUG_WARN( "-D -> -decorations\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "T")
|
||||
{
|
||||
settings->WindowTitle = _strdup(arg->Value);
|
||||
fprintf(stderr, "-T %s -> /title:%s\n", arg->Value, arg->Value);
|
||||
DEBUG_WARN( "-T %s -> /title:%s\n", arg->Value, arg->Value);
|
||||
}
|
||||
CommandLineSwitchCase(arg, "d")
|
||||
{
|
||||
settings->Domain = _strdup(arg->Value);
|
||||
fprintf(stderr, "-d %s -> /d:%s\n", arg->Value, arg->Value);
|
||||
DEBUG_WARN( "-d %s -> /d:%s\n", arg->Value, arg->Value);
|
||||
}
|
||||
CommandLineSwitchCase(arg, "f")
|
||||
{
|
||||
settings->Fullscreen = TRUE;
|
||||
fprintf(stderr, "-f -> /f\n");
|
||||
DEBUG_WARN( "-f -> /f\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "g")
|
||||
{
|
||||
@ -484,50 +485,50 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
|
||||
|
||||
free(str);
|
||||
|
||||
fprintf(stderr, "-g %s -> /size:%s or /w:%d /h:%d\n", arg->Value, arg->Value,
|
||||
DEBUG_WARN( "-g %s -> /size:%s or /w:%d /h:%d\n", arg->Value, arg->Value,
|
||||
settings->DesktopWidth, settings->DesktopHeight);
|
||||
}
|
||||
CommandLineSwitchCase(arg, "k")
|
||||
{
|
||||
sscanf(arg->Value, "%X", &(settings->KeyboardLayout));
|
||||
fprintf(stderr, "-k %s -> /kbd:%s\n", arg->Value, arg->Value);
|
||||
DEBUG_WARN( "-k %s -> /kbd:%s\n", arg->Value, arg->Value);
|
||||
}
|
||||
CommandLineSwitchCase(arg, "K")
|
||||
{
|
||||
settings->GrabKeyboard = FALSE;
|
||||
fprintf(stderr, "-K -> -grab-keyboard\n");
|
||||
DEBUG_WARN( "-K -> -grab-keyboard\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "n")
|
||||
{
|
||||
settings->ClientHostname = _strdup(arg->Value);
|
||||
fprintf(stderr, "-n -> /client-hostname:%s\n", arg->Value);
|
||||
DEBUG_WARN( "-n -> /client-hostname:%s\n", arg->Value);
|
||||
}
|
||||
CommandLineSwitchCase(arg, "o")
|
||||
{
|
||||
settings->RemoteConsoleAudio = TRUE;
|
||||
fprintf(stderr, "-o -> /audio-mode:1\n");
|
||||
DEBUG_WARN( "-o -> /audio-mode:1\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "p")
|
||||
{
|
||||
settings->Password = _strdup(arg->Value);
|
||||
fprintf(stderr, "-p ****** -> /p:******\n");
|
||||
DEBUG_WARN( "-p ****** -> /p:******\n");
|
||||
/* Hide the value from 'ps'. */
|
||||
FillMemory(arg->Value, strlen(arg->Value), '*');
|
||||
}
|
||||
CommandLineSwitchCase(arg, "s")
|
||||
{
|
||||
settings->AlternateShell = _strdup(arg->Value);
|
||||
fprintf(stderr, "-s %s -> /shell:%s\n", arg->Value, arg->Value);
|
||||
DEBUG_WARN( "-s %s -> /shell:%s\n", arg->Value, arg->Value);
|
||||
}
|
||||
CommandLineSwitchCase(arg, "t")
|
||||
{
|
||||
settings->ServerPort = atoi(arg->Value);
|
||||
fprintf(stderr, "-t %s -> /port:%s\n", arg->Value, arg->Value);
|
||||
DEBUG_WARN( "-t %s -> /port:%s\n", arg->Value, arg->Value);
|
||||
}
|
||||
CommandLineSwitchCase(arg, "u")
|
||||
{
|
||||
settings->Username = _strdup(arg->Value);
|
||||
fprintf(stderr, "-u %s -> /u:%s\n", arg->Value, arg->Value);
|
||||
DEBUG_WARN( "-u %s -> /u:%s\n", arg->Value, arg->Value);
|
||||
}
|
||||
CommandLineSwitchCase(arg, "x")
|
||||
{
|
||||
@ -555,31 +556,31 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
|
||||
freerdp_performance_flags_split(settings);
|
||||
}
|
||||
|
||||
fprintf(stderr, "-x %s -> /network:", arg->Value);
|
||||
DEBUG_WARN( "-x %s -> /network:", arg->Value);
|
||||
|
||||
if (type == CONNECTION_TYPE_MODEM)
|
||||
fprintf(stderr, "modem");
|
||||
DEBUG_WARN( "modem");
|
||||
else if (CONNECTION_TYPE_BROADBAND_HIGH)
|
||||
fprintf(stderr, "broadband");
|
||||
DEBUG_WARN( "broadband");
|
||||
else if (CONNECTION_TYPE_LAN)
|
||||
fprintf(stderr, "lan");
|
||||
DEBUG_WARN( "lan");
|
||||
|
||||
fprintf(stderr, "\n");
|
||||
DEBUG_WARN( "\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "X")
|
||||
{
|
||||
settings->ParentWindowId = strtol(arg->Value, NULL, 0);
|
||||
fprintf(stderr, "-X %s -> /parent-window:%s\n", arg->Value, arg->Value);
|
||||
DEBUG_WARN( "-X %s -> /parent-window:%s\n", arg->Value, arg->Value);
|
||||
}
|
||||
CommandLineSwitchCase(arg, "z")
|
||||
{
|
||||
settings->CompressionEnabled = TRUE;
|
||||
fprintf(stderr, "-z -> /compression\n");
|
||||
DEBUG_WARN( "-z -> /compression\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "app")
|
||||
{
|
||||
settings->RemoteApplicationMode = TRUE;
|
||||
fprintf(stderr, "--app -> /app: + program name or alias\n");
|
||||
DEBUG_WARN( "--app -> /app: + program name or alias\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "ext")
|
||||
{
|
||||
@ -588,7 +589,7 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
|
||||
CommandLineSwitchCase(arg, "no-auth")
|
||||
{
|
||||
settings->Authentication = FALSE;
|
||||
fprintf(stderr, "--no-auth -> -authentication\n");
|
||||
DEBUG_WARN( "--no-auth -> -authentication\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "authonly")
|
||||
{
|
||||
@ -602,12 +603,12 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
|
||||
{
|
||||
settings->FastPathInput = FALSE;
|
||||
settings->FastPathOutput = FALSE;
|
||||
fprintf(stderr, "--no-fastpath -> -fast-path\n");
|
||||
DEBUG_WARN( "--no-fastpath -> -fast-path\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "no-motion")
|
||||
{
|
||||
settings->MouseMotion = FALSE;
|
||||
fprintf(stderr, "--no-motion -> -mouse-motion\n");
|
||||
DEBUG_WARN( "--no-motion -> -mouse-motion\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "gdi")
|
||||
{
|
||||
@ -616,26 +617,26 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
|
||||
else if (strcmp(arg->Value, "hw") == 0)
|
||||
settings->SoftwareGdi = FALSE;
|
||||
|
||||
fprintf(stderr, "--gdi %s -> /gdi:%s\n", arg->Value, arg->Value);
|
||||
DEBUG_WARN( "--gdi %s -> /gdi:%s\n", arg->Value, arg->Value);
|
||||
}
|
||||
CommandLineSwitchCase(arg, "no-osb")
|
||||
{
|
||||
settings->OffscreenSupportLevel = FALSE;
|
||||
fprintf(stderr, "--no-osb -> -offscreen-cache\n");
|
||||
DEBUG_WARN( "--no-osb -> -offscreen-cache\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "no-bmp-cache")
|
||||
{
|
||||
settings->BitmapCacheEnabled = FALSE;
|
||||
fprintf(stderr, "--no-bmp-cache -> -bitmap-cache\n");
|
||||
DEBUG_WARN( "--no-bmp-cache -> -bitmap-cache\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "plugin")
|
||||
{
|
||||
fprintf(stderr, "--plugin -> /a, /vc, /dvc and channel-specific options\n");
|
||||
DEBUG_WARN( "--plugin -> /a, /vc, /dvc and channel-specific options\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "rfx")
|
||||
{
|
||||
settings->RemoteFxCodec = TRUE;
|
||||
fprintf(stderr, "--rfx -> /rfx\n");
|
||||
DEBUG_WARN( "--rfx -> /rfx\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "rfx-mode")
|
||||
{
|
||||
@ -644,37 +645,37 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
|
||||
else if (arg->Value[0] == 'i')
|
||||
settings->RemoteFxCodecMode = 0x02;
|
||||
|
||||
fprintf(stderr, "--rfx-mode -> /rfx-mode:%s\n", settings->RemoteFxCodecMode ? "image" : "video");
|
||||
DEBUG_WARN( "--rfx-mode -> /rfx-mode:%s\n", settings->RemoteFxCodecMode ? "image" : "video");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "nsc")
|
||||
{
|
||||
settings->NSCodec = TRUE;
|
||||
fprintf(stderr, "--nsc -> /nsc\n");
|
||||
DEBUG_WARN( "--nsc -> /nsc\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "disable-wallpaper")
|
||||
{
|
||||
settings->DisableWallpaper = TRUE;
|
||||
fprintf(stderr, "--disable-wallpaper -> -wallpaper\n");
|
||||
DEBUG_WARN( "--disable-wallpaper -> -wallpaper\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "composition")
|
||||
{
|
||||
settings->AllowDesktopComposition = TRUE;
|
||||
fprintf(stderr, "--composition -> +composition\n");
|
||||
DEBUG_WARN( "--composition -> +composition\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "disable-full-window-drag")
|
||||
{
|
||||
settings->DisableFullWindowDrag = TRUE;
|
||||
fprintf(stderr, "--disable-full-window-drag -> -window-drag\n");
|
||||
DEBUG_WARN( "--disable-full-window-drag -> -window-drag\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "disable-menu-animations")
|
||||
{
|
||||
settings->DisableMenuAnims = TRUE;
|
||||
fprintf(stderr, "--disable-menu-animations -> -menu-anims\n");
|
||||
DEBUG_WARN( "--disable-menu-animations -> -menu-anims\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "disable-theming")
|
||||
{
|
||||
settings->DisableThemes = TRUE;
|
||||
fprintf(stderr, "--disable-theming -> -themes\n");
|
||||
DEBUG_WARN( "--disable-theming -> -themes\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "ntlm")
|
||||
{
|
||||
@ -683,7 +684,7 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
|
||||
CommandLineSwitchCase(arg, "ignore-certificate")
|
||||
{
|
||||
settings->IgnoreCertificate = TRUE;
|
||||
fprintf(stderr, "--ignore-certificate -> /cert-ignore\n");
|
||||
DEBUG_WARN( "--ignore-certificate -> /cert-ignore\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "sec")
|
||||
{
|
||||
@ -709,22 +710,22 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
|
||||
settings->NlaSecurity = TRUE;
|
||||
}
|
||||
|
||||
fprintf(stderr, "--sec %s -> /sec:%s\n", arg->Value, arg->Value);
|
||||
DEBUG_WARN( "--sec %s -> /sec:%s\n", arg->Value, arg->Value);
|
||||
}
|
||||
CommandLineSwitchCase(arg, "no-rdp")
|
||||
{
|
||||
settings->RdpSecurity = FALSE;
|
||||
fprintf(stderr, "--no-rdp -> -sec-rdp\n");
|
||||
DEBUG_WARN( "--no-rdp -> -sec-rdp\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "no-tls")
|
||||
{
|
||||
settings->TlsSecurity = FALSE;
|
||||
fprintf(stderr, "--no-tls -> -sec-tls\n");
|
||||
DEBUG_WARN( "--no-tls -> -sec-tls\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "no-nla")
|
||||
{
|
||||
settings->NlaSecurity = FALSE;
|
||||
fprintf(stderr, "--no-nla -> -sec-nla\n");
|
||||
DEBUG_WARN( "--no-nla -> -sec-nla\n");
|
||||
}
|
||||
CommandLineSwitchCase(arg, "secure-checksum")
|
||||
{
|
||||
@ -739,12 +740,12 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
|
||||
}
|
||||
while ((arg = CommandLineFindNextArgumentA(arg)) != NULL);
|
||||
|
||||
fprintf(stderr, "%s -> /v:%s", settings->ServerHostname, settings->ServerHostname);
|
||||
DEBUG_WARN( "%s -> /v:%s", settings->ServerHostname, settings->ServerHostname);
|
||||
|
||||
if (settings->ServerPort != 3389)
|
||||
fprintf(stderr, " /port:%d", settings->ServerPort);
|
||||
DEBUG_WARN( " /port:%d", settings->ServerPort);
|
||||
|
||||
fprintf(stderr, "\n");
|
||||
DEBUG_WARN( "\n");
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/client/file.h>
|
||||
#include <freerdp/client/cmdline.h>
|
||||
|
||||
@ -54,7 +55,7 @@ BOOL freerdp_client_rdp_file_set_integer(rdpFile* file, const char* name, int va
|
||||
BOOL bStandard = TRUE;
|
||||
|
||||
#ifdef DEBUG_CLIENT_FILE
|
||||
fprintf(stderr, "%s:i:%d\n", name, value);
|
||||
DEBUG_WARN( "%s:i:%d\n", name, value);
|
||||
#endif
|
||||
|
||||
if (_stricmp(name, "use multimon") == 0)
|
||||
@ -240,7 +241,7 @@ BOOL freerdp_client_rdp_file_set_string(rdpFile* file, const char* name, const c
|
||||
BOOL bStandard = TRUE;
|
||||
|
||||
#ifdef DEBUG_CLIENT_FILE
|
||||
fprintf(stderr, "%s:s:%s\n", name, value);
|
||||
DEBUG_WARN( "%s:s:%s\n", name, value);
|
||||
#endif
|
||||
|
||||
if (_stricmp(name, "username") == 0)
|
||||
@ -665,7 +666,7 @@ BOOL freerdp_client_write_rdp_file(const rdpFile* file, const char* name, BOOL u
|
||||
|
||||
if (length < 0)
|
||||
{
|
||||
fprintf(stderr, "freerdp_client_write_rdp_file: error determining buffer size.\n");
|
||||
DEBUG_WARN( "freerdp_client_write_rdp_file: error determining buffer size.\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -673,7 +674,7 @@ BOOL freerdp_client_write_rdp_file(const rdpFile* file, const char* name, BOOL u
|
||||
|
||||
if (freerdp_client_write_rdp_file_buffer(file, buffer, length + 1) != length)
|
||||
{
|
||||
fprintf(stderr, "freerdp_client_write_rdp_file: error writing to output buffer\n");
|
||||
DEBUG_WARN( "freerdp_client_write_rdp_file: error writing to output buffer\n");
|
||||
free(buffer);
|
||||
return FALSE;
|
||||
}
|
||||
|
58
include/freerdp/channels/log.h
Normal file
58
include/freerdp/channels/log.h
Normal file
@ -0,0 +1,58 @@
|
||||
/**
|
||||
* FreeRDP: A Remote Desktop Protocol Implementation
|
||||
* Channel log defines
|
||||
*
|
||||
* Copyright 2014 Armin Novak <armin.novak@gmail.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef FREERDP_CHANNELS_LOG_H
|
||||
#define FREERDP_CHANNELS_LOG_H
|
||||
|
||||
#include <winpr/wlog.h>
|
||||
|
||||
#define CLOG_PRINT(level, file, fkt, line, dbg_str, fmt, ...) \
|
||||
do { \
|
||||
char tag[1024] = { 0 }; \
|
||||
wLogMessage msg; \
|
||||
wLog *log; \
|
||||
\
|
||||
strncat(tag, "com.freerdp.channels.", sizeof(tag)); \
|
||||
strncat(tag, dbg_str, sizeof(tag) - sizeof("com.freerdp.channels.")); \
|
||||
log = WLog_Get(tag); \
|
||||
\
|
||||
msg.Type = WLOG_MESSAGE_TEXT; \
|
||||
msg.Level = level; \
|
||||
msg.FormatString = fmt; \
|
||||
msg.LineNumber = line; \
|
||||
msg.FileName = file; \
|
||||
msg.FunctionName = fkt; \
|
||||
WLog_PrintMessage(log, &msg, ##__VA_ARGS__); \
|
||||
} while (0 )
|
||||
|
||||
#define CLOG_NULL(fmt, ...) do { } while (0)
|
||||
#define CLOG_CLASS(_dbg_class, fmt, ...) CLOG_PRINT(WLOG_ERROR, __FILE__, \
|
||||
__FUNCTION__, __LINE__, #_dbg_class, fmt, ## __VA_ARGS__)
|
||||
#define CLOG_DBG(fmt, ...) CLOG_PRINT(WLOG_DEBUG, __FILE__, __FUNCTION__, \
|
||||
__LINE__, __FUNCTION__, fmt, ## __VA_ARGS__)
|
||||
#define CLOG_INFO(fmt, ...) CLOG_PRINT(WLOG_INFO, __FILE__, __FUNCTION__, \
|
||||
__LINE__, __FUNCTION__, fmt, ## __VA_ARGS__)
|
||||
#define CLOG_WARN(fmt, ...) CLOG_PRINT(WLOG_WARN, __FILE__, __FUNCTION__, \
|
||||
__LINE__, __FUNCTION__, fmt, ## __VA_ARGS__)
|
||||
#define CLOG_ERR(fmt, ...) CLOG_PRINT(WLOG_ERROR, __FILE__, __FUNCTION__, \
|
||||
__LINE__, __FUNCTION__, fmt, ## __VA_ARGS__)
|
||||
#define CLOG_FATAL(fmt, ...) CLOG_PRINT(WLOG_FATAL, __FILE__, __FUNCTION__, \
|
||||
__LINE__, __FUNCTION__, fmt, ## __VA_ARGS__)
|
||||
|
||||
#endif /* FREERDP_UTILS_DEBUG_H */
|
@ -23,19 +23,62 @@
|
||||
#include <freerdp/api.h>
|
||||
#include <freerdp/types.h>
|
||||
|
||||
#include <winpr/collections.h>
|
||||
|
||||
#include <freerdp/codec/rfx.h>
|
||||
#include <freerdp/codec/color.h>
|
||||
|
||||
#define RFX_SUBBAND_DIFFING 0x01
|
||||
|
||||
#define RFX_TILE_DIFFERENCE 0x01
|
||||
|
||||
#define RFX_DWT_REDUCE_EXTRAPOLATE 0x01
|
||||
|
||||
#define PROGRESSIVE_WBT_SYNC 0xCCC0
|
||||
#define PROGRESSIVE_WBT_FRAME_BEGIN 0xCCC1
|
||||
#define PROGRESSIVE_WBT_FRAME_END 0xCCC2
|
||||
#define PROGRESSIVE_WBT_CONTEXT 0xCCC3
|
||||
#define PROGRESSIVE_WBT_REGION 0xCCC4
|
||||
#define PROGRESSIVE_WBT_TILE_SIMPLE 0xCCC5
|
||||
#define PROGRESSIVE_WBT_TILE_PROGRESSIVE_FIRST 0xCCC6
|
||||
#define PROGRESSIVE_WBT_TILE_PROGRESSIVE_UPGRADE 0xCCC7
|
||||
#define PROGRESSIVE_WBT_TILE_FIRST 0xCCC6
|
||||
#define PROGRESSIVE_WBT_TILE_UPGRADE 0xCCC7
|
||||
|
||||
struct _PROGRESSIVE_SYNC
|
||||
#define PROGRESSIVE_BLOCKS_ALL 0x0001
|
||||
#define PROGRESSIVE_BLOCKS_REGION 0x0002
|
||||
#define PROGRESSIVE_BLOCKS_TILE 0x0004
|
||||
|
||||
struct _RFX_PROGRESSIVE_CODEC_QUANT
|
||||
{
|
||||
BYTE quality;
|
||||
BYTE yQuantValues[5];
|
||||
BYTE cbQuantValues[5];
|
||||
BYTE crQuantValues[5];
|
||||
};
|
||||
typedef struct _RFX_PROGRESSIVE_CODEC_QUANT RFX_PROGRESSIVE_CODEC_QUANT;
|
||||
|
||||
struct _RFX_COMPONENT_CODEC_QUANT
|
||||
{
|
||||
BYTE LL3;
|
||||
BYTE HL3;
|
||||
BYTE LH3;
|
||||
BYTE HH3;
|
||||
BYTE HL2;
|
||||
BYTE LH2;
|
||||
BYTE HH2;
|
||||
BYTE HL1;
|
||||
BYTE LH1;
|
||||
BYTE HH1;
|
||||
};
|
||||
typedef struct _RFX_COMPONENT_CODEC_QUANT RFX_COMPONENT_CODEC_QUANT;
|
||||
|
||||
struct _PROGRESSIVE_BLOCK
|
||||
{
|
||||
UINT16 blockType;
|
||||
UINT32 blockLen;
|
||||
};
|
||||
typedef struct _PROGRESSIVE_BLOCK PROGRESSIVE_BLOCK;
|
||||
|
||||
struct _PROGRESSIVE_BLOCK_SYNC
|
||||
{
|
||||
UINT16 blockType;
|
||||
UINT32 blockLen;
|
||||
@ -43,45 +86,20 @@ struct _PROGRESSIVE_SYNC
|
||||
UINT32 magic;
|
||||
UINT16 version;
|
||||
};
|
||||
typedef struct _PROGRESSIVE_SYNC PROGRESSIVE_SYNC;
|
||||
typedef struct _PROGRESSIVE_BLOCK_SYNC PROGRESSIVE_BLOCK_SYNC;
|
||||
|
||||
struct _PROGRESSIVE_REGION
|
||||
struct _PROGRESSIVE_BLOCK_CONTEXT
|
||||
{
|
||||
UINT16 blockType;
|
||||
UINT32 blockLen;
|
||||
|
||||
BYTE tileSize;
|
||||
UINT16 numRects;
|
||||
BYTE numQuant;
|
||||
BYTE numProgQuant;
|
||||
BYTE ctxId;
|
||||
UINT16 tileSize;
|
||||
BYTE flags;
|
||||
UINT16 numTiles;
|
||||
UINT32 tileDataSize;
|
||||
RFX_RECT* rects;
|
||||
UINT32* quantVals;
|
||||
UINT32* quantProgVals;
|
||||
};
|
||||
typedef struct _PROGRESSIVE_REGION PROGRESSIVE_REGION;
|
||||
typedef struct _PROGRESSIVE_BLOCK_CONTEXT PROGRESSIVE_BLOCK_CONTEXT;
|
||||
|
||||
struct _PROGRESSIVE_FRAME_BEGIN
|
||||
{
|
||||
UINT16 blockType;
|
||||
UINT32 blockLen;
|
||||
|
||||
UINT32 frameIndex;
|
||||
UINT16 regionCount;
|
||||
PROGRESSIVE_REGION* regions;
|
||||
};
|
||||
typedef struct _PROGRESSIVE_FRAME_BEGIN PROGRESSIVE_FRAME_BEGIN;
|
||||
|
||||
struct _PROGRESSIVE_FRAME_END
|
||||
{
|
||||
UINT16 blockType;
|
||||
UINT32 blockLen;
|
||||
};
|
||||
typedef struct _PROGRESSIVE_FRAME_END PROGRESSIVE_FRAME_END;
|
||||
|
||||
struct _PROGRESSIVE_TILE_SIMPLE
|
||||
struct _PROGRESSIVE_BLOCK_TILE_SIMPLE
|
||||
{
|
||||
UINT16 blockType;
|
||||
UINT32 blockLen;
|
||||
@ -101,9 +119,9 @@ struct _PROGRESSIVE_TILE_SIMPLE
|
||||
BYTE* crData;
|
||||
BYTE* tailData;
|
||||
};
|
||||
typedef struct _PROGRESSIVE_TILE_SIMPLE PROGRESSIVE_TILE_SIMPLE;
|
||||
typedef struct _PROGRESSIVE_BLOCK_TILE_SIMPLE PROGRESSIVE_BLOCK_TILE_SIMPLE;
|
||||
|
||||
struct _PROGRESSIVE_TILE_FIRST
|
||||
struct _PROGRESSIVE_BLOCK_TILE_FIRST
|
||||
{
|
||||
UINT16 blockType;
|
||||
UINT32 blockLen;
|
||||
@ -124,9 +142,9 @@ struct _PROGRESSIVE_TILE_FIRST
|
||||
BYTE* crData;
|
||||
BYTE* tailData;
|
||||
};
|
||||
typedef struct _PROGRESSIVE_TILE_FIRST PROGRESSIVE_TILE_FIRST;
|
||||
typedef struct _PROGRESSIVE_BLOCK_TILE_FIRST PROGRESSIVE_BLOCK_TILE_FIRST;
|
||||
|
||||
struct _PROGRESSIVE_TILE_UPGRADE
|
||||
struct _PROGRESSIVE_BLOCK_TILE_UPGRADE
|
||||
{
|
||||
UINT16 blockType;
|
||||
UINT32 blockLen;
|
||||
@ -150,11 +168,103 @@ struct _PROGRESSIVE_TILE_UPGRADE
|
||||
BYTE* crSrlData;
|
||||
BYTE* crRawData;
|
||||
};
|
||||
typedef struct _PROGRESSIVE_TILE_UPGRADE PROGRESSIVE_TILE_UPGRADE;
|
||||
typedef struct _PROGRESSIVE_BLOCK_TILE_UPGRADE PROGRESSIVE_BLOCK_TILE_UPGRADE;
|
||||
|
||||
struct _RFX_PROGRESSIVE_TILE
|
||||
{
|
||||
UINT16 blockType;
|
||||
UINT32 blockLen;
|
||||
|
||||
BYTE quantIdxY;
|
||||
BYTE quantIdxCb;
|
||||
BYTE quantIdxCr;
|
||||
UINT16 xIdx;
|
||||
UINT16 yIdx;
|
||||
|
||||
BYTE flags;
|
||||
BYTE quality;
|
||||
|
||||
UINT16 yLen;
|
||||
UINT16 cbLen;
|
||||
UINT16 crLen;
|
||||
UINT16 tailLen;
|
||||
BYTE* yData;
|
||||
BYTE* cbData;
|
||||
BYTE* crData;
|
||||
BYTE* tailData;
|
||||
|
||||
UINT16 ySrlLen;
|
||||
UINT16 yRawLen;
|
||||
UINT16 cbSrlLen;
|
||||
UINT16 cbRawLen;
|
||||
UINT16 crSrlLen;
|
||||
UINT16 crRawLen;
|
||||
BYTE* ySrlData;
|
||||
BYTE* yRawData;
|
||||
BYTE* cbSrlData;
|
||||
BYTE* cbRawData;
|
||||
BYTE* crSrlData;
|
||||
BYTE* crRawData;
|
||||
};
|
||||
typedef struct _RFX_PROGRESSIVE_TILE RFX_PROGRESSIVE_TILE;
|
||||
|
||||
struct _PROGRESSIVE_BLOCK_REGION
|
||||
{
|
||||
UINT16 blockType;
|
||||
UINT32 blockLen;
|
||||
|
||||
BYTE tileSize;
|
||||
UINT16 numRects;
|
||||
BYTE numQuant;
|
||||
BYTE numProgQuant;
|
||||
BYTE flags;
|
||||
UINT16 numTiles;
|
||||
UINT32 tileDataSize;
|
||||
RFX_RECT* rects;
|
||||
RFX_COMPONENT_CODEC_QUANT* quantVals;
|
||||
RFX_PROGRESSIVE_CODEC_QUANT* quantProgVals;
|
||||
RFX_PROGRESSIVE_TILE* tiles;
|
||||
};
|
||||
typedef struct _PROGRESSIVE_BLOCK_REGION PROGRESSIVE_BLOCK_REGION;
|
||||
|
||||
struct _PROGRESSIVE_BLOCK_FRAME_BEGIN
|
||||
{
|
||||
UINT16 blockType;
|
||||
UINT32 blockLen;
|
||||
|
||||
UINT32 frameIndex;
|
||||
UINT16 regionCount;
|
||||
PROGRESSIVE_BLOCK_REGION* regions;
|
||||
};
|
||||
typedef struct _PROGRESSIVE_BLOCK_FRAME_BEGIN PROGRESSIVE_BLOCK_FRAME_BEGIN;
|
||||
|
||||
struct _PROGRESSIVE_BLOCK_FRAME_END
|
||||
{
|
||||
UINT16 blockType;
|
||||
UINT32 blockLen;
|
||||
};
|
||||
typedef struct _PROGRESSIVE_BLOCK_FRAME_END PROGRESSIVE_BLOCK_FRAME_END;
|
||||
|
||||
struct _PROGRESSIVE_CONTEXT
|
||||
{
|
||||
BOOL Compressor;
|
||||
|
||||
wBufferPool* bufferPool;
|
||||
|
||||
UINT32 cRects;
|
||||
RFX_RECT* rects;
|
||||
|
||||
UINT32 cTiles;
|
||||
RFX_PROGRESSIVE_TILE* tiles;
|
||||
|
||||
UINT32 cQuant;
|
||||
RFX_COMPONENT_CODEC_QUANT* quantVals;
|
||||
|
||||
UINT32 cProgQuant;
|
||||
RFX_PROGRESSIVE_CODEC_QUANT* quantProgVals;
|
||||
|
||||
PROGRESSIVE_BLOCK_REGION region;
|
||||
RFX_PROGRESSIVE_CODEC_QUANT quantProgValFull;
|
||||
};
|
||||
typedef struct _PROGRESSIVE_CONTEXT PROGRESSIVE_CONTEXT;
|
||||
|
||||
|
@ -146,8 +146,6 @@ struct _RFX_CONTEXT
|
||||
void (*quantization_encode)(INT16* buffer, const UINT32* quantization_values);
|
||||
void (*dwt_2d_decode)(INT16* buffer, INT16* dwt_buffer);
|
||||
void (*dwt_2d_encode)(INT16* buffer, INT16* dwt_buffer);
|
||||
int (*rlgr_decode)(RLGR_MODE mode, const BYTE* data, int data_size, INT16* buffer, int buffer_size);
|
||||
int (*rlgr_encode)(RLGR_MODE mode, const INT16* data, int data_size, BYTE* buffer, int buffer_size);
|
||||
|
||||
/* private definitions */
|
||||
RFX_CONTEXT_PRIV* priv;
|
||||
@ -159,6 +157,8 @@ FREERDP_API void rfx_context_free(RFX_CONTEXT* context);
|
||||
FREERDP_API void rfx_context_set_pixel_format(RFX_CONTEXT* context, RDP_PIXEL_FORMAT pixel_format);
|
||||
FREERDP_API void rfx_context_reset(RFX_CONTEXT* context);
|
||||
|
||||
FREERDP_API int rfx_rlgr_decode(const BYTE* pSrcData, UINT32 SrcSize, INT16* pDstData, UINT32 DstSize, int mode);
|
||||
|
||||
FREERDP_API RFX_MESSAGE* rfx_process_message(RFX_CONTEXT* context, BYTE* data, UINT32 length);
|
||||
FREERDP_API UINT16 rfx_message_get_tile_count(RFX_MESSAGE* message);
|
||||
FREERDP_API RFX_TILE* rfx_message_get_tile(RFX_MESSAGE* message, int index);
|
||||
|
@ -64,6 +64,7 @@ typedef struct rdp_input_proxy rdpInputProxy;
|
||||
|
||||
typedef void (*pSynchronizeEvent)(rdpInput* input, UINT32 flags);
|
||||
typedef void (*pKeyboardEvent)(rdpInput* input, UINT16 flags, UINT16 code);
|
||||
typedef void (*pKeyboardPauseEvent)(rdpInput* input);
|
||||
typedef void (*pUnicodeKeyboardEvent)(rdpInput* input, UINT16 flags, UINT16 code);
|
||||
typedef void (*pMouseEvent)(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
|
||||
typedef void (*pExtendedMouseEvent)(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
|
||||
@ -81,8 +82,9 @@ struct rdp_input
|
||||
pMouseEvent MouseEvent; /* 19 */
|
||||
pExtendedMouseEvent ExtendedMouseEvent; /* 20 */
|
||||
pFocusInEvent FocusInEvent; /*21 */
|
||||
pKeyboardPauseEvent KeyboardPauseEvent; /* 22 */
|
||||
|
||||
UINT32 paddingB[32 - 22]; /* 22 */
|
||||
UINT32 paddingB[32 - 23]; /* 23 */
|
||||
|
||||
/* Internal */
|
||||
|
||||
@ -98,6 +100,7 @@ extern "C" {
|
||||
FREERDP_API void freerdp_input_send_synchronize_event(rdpInput* input, UINT32 flags);
|
||||
FREERDP_API void freerdp_input_send_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code);
|
||||
FREERDP_API void freerdp_input_send_keyboard_event_ex(rdpInput* input, BOOL down, UINT32 rdp_scancode);
|
||||
FREERDP_API void freerdp_input_send_keyboard_pause_event(rdpInput* input);
|
||||
FREERDP_API void freerdp_input_send_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code);
|
||||
FREERDP_API void freerdp_input_send_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
|
||||
FREERDP_API void freerdp_input_send_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
|
||||
|
@ -536,6 +536,8 @@ typedef struct _RDPDR_PARALLEL RDPDR_PARALLEL;
|
||||
#define FreeRDP_ServerRandomLength 197
|
||||
#define FreeRDP_ServerCertificate 198
|
||||
#define FreeRDP_ServerCertificateLength 199
|
||||
#define FreeRDP_ClientRandom 200
|
||||
#define FreeRDP_ClientRandomLength 201
|
||||
#define FreeRDP_ChannelCount 256
|
||||
#define FreeRDP_ChannelDefArraySize 257
|
||||
#define FreeRDP_ChannelDefArray 258
|
||||
@ -851,11 +853,12 @@ struct rdp_settings
|
||||
ALIGN64 UINT32 ExtEncryptionMethods; /* 194 */
|
||||
ALIGN64 UINT32 EncryptionLevel; /* 195 */
|
||||
ALIGN64 BYTE* ServerRandom; /* 196 */
|
||||
ALIGN64 DWORD ServerRandomLength; /* 197 */
|
||||
ALIGN64 UINT32 ServerRandomLength; /* 197 */
|
||||
ALIGN64 BYTE* ServerCertificate; /* 198 */
|
||||
ALIGN64 DWORD ServerCertificateLength; /* 199 */
|
||||
ALIGN64 UINT32 ServerCertificateLength; /* 199 */
|
||||
ALIGN64 BYTE* ClientRandom; /* 200 */
|
||||
UINT64 padding0256[256 - 201]; /* 201 */
|
||||
ALIGN64 UINT32 ClientRandomLength; /* 201 */
|
||||
UINT64 padding0256[256 - 202]; /* 202 */
|
||||
|
||||
/* Client Network Data */
|
||||
ALIGN64 UINT32 ChannelCount; /* 256 */
|
||||
@ -1014,7 +1017,7 @@ struct rdp_settings
|
||||
|
||||
/* Credentials Cache */
|
||||
ALIGN64 BYTE* Password51; /* 1280 */
|
||||
ALIGN64 DWORD Password51Length; /* 1281 */
|
||||
ALIGN64 UINT32 Password51Length; /* 1281 */
|
||||
UINT64 padding1344[1344 - 1282]; /* 1282 */
|
||||
|
||||
/* Kerberos Authentication */
|
||||
@ -1120,8 +1123,8 @@ struct rdp_settings
|
||||
ALIGN64 char* RemoteApplicationFile; /* 2116 */
|
||||
ALIGN64 char* RemoteApplicationGuid; /* 2117 */
|
||||
ALIGN64 char* RemoteApplicationCmdLine; /* 2118 */
|
||||
ALIGN64 DWORD RemoteApplicationExpandCmdLine; /* 2119 */
|
||||
ALIGN64 DWORD RemoteApplicationExpandWorkingDir; /* 2120 */
|
||||
ALIGN64 UINT32 RemoteApplicationExpandCmdLine; /* 2119 */
|
||||
ALIGN64 UINT32 RemoteApplicationExpandWorkingDir; /* 2120 */
|
||||
ALIGN64 BOOL DisableRemoteAppCapsCheck; /* 2121 */
|
||||
ALIGN64 UINT32 RemoteAppNumIconCaches; /* 2122 */
|
||||
ALIGN64 UINT32 RemoteAppNumIconCacheEntries; /* 2123 */
|
||||
|
@ -20,41 +20,28 @@
|
||||
#ifndef FREERDP_UTILS_DEBUG_H
|
||||
#define FREERDP_UTILS_DEBUG_H
|
||||
|
||||
#include <winpr/wlog.h>
|
||||
|
||||
#define DEBUG_PRINT(level, file, fkt, line, dbg_str, fmt, ...) \
|
||||
do { \
|
||||
wLog *log = WLog_Get("com.freerdp." dbg_str); \
|
||||
wLogMessage msg; \
|
||||
\
|
||||
msg.Type = WLOG_MESSAGE_TEXT; \
|
||||
msg.Level = level; \
|
||||
msg.FormatString = fmt; \
|
||||
msg.LineNumber = line; \
|
||||
msg.FileName = file; \
|
||||
msg.FunctionName = fkt; \
|
||||
WLog_PrintMessage(log, &msg, ##__VA_ARGS__); \
|
||||
} while (0 )
|
||||
|
||||
#define DEBUG_NULL(fmt, ...) do { } while (0)
|
||||
|
||||
/* When building for android redirect all debug messages
|
||||
* to logcat. */
|
||||
#if defined(ANDROID)
|
||||
#include <android/log.h>
|
||||
|
||||
#define APP_NAME "freerdp-debug"
|
||||
|
||||
#define ANDROID_DEBUG_PRINT(_dbg_str, fmt, ...) do { \
|
||||
__android_log_print(_dbg_str, fmt, ##__VA_ARGS__); \
|
||||
} while( 0 )
|
||||
|
||||
#define DEBUG_CLASS(_dbg_class, fmt, ...) \
|
||||
ANDROID_DEBUG_PRINT(ANDROID_LOG_DEBUG, APP_NAME, \
|
||||
"DBG_" #_dbg_class " %s (%s:%d): " \
|
||||
fmt, __FUNCTION__, __FILE__, __LINE__, ## __VA_ARGS__)
|
||||
|
||||
#define DEBUG_WARN(fmt, ...) \
|
||||
ANDROID_DEBUG_PRINT(ANDROID_LOG_WARN, APP_NAME, "Warning %s (%s:%d): " \
|
||||
fmt, __FUNCTION__, __FILE__, __LINE__, ## __VA_ARGS__)
|
||||
|
||||
#else
|
||||
/* By default all log messages are written to stdout */
|
||||
#include <stdio.h>
|
||||
|
||||
#define DEBUG_PRINT(_dbg_str, fmt, ...) do { \
|
||||
fprintf(stderr, _dbg_str, __FUNCTION__, __FILE__, __LINE__); \
|
||||
fprintf(stderr, fmt, ## __VA_ARGS__); \
|
||||
fprintf(stderr, "\n"); \
|
||||
} while( 0 )
|
||||
|
||||
|
||||
#define DEBUG_CLASS(_dbg_class, fmt, ...) DEBUG_PRINT("DBG_" #_dbg_class " %s (%s:%d): ", fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_WARN(fmt, ...) DEBUG_PRINT("Warning %s (%s:%d): ", fmt, ## __VA_ARGS__)
|
||||
#endif
|
||||
#define DEBUG_CLASS(_dbg_class, fmt, ...) DEBUG_PRINT(WLOG_ERROR, __FILE__, \
|
||||
__FUNCTION__, __LINE__, #_dbg_class, fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_MSG(fmt, ...) DEBUG_PRINT(WLOG_DEBUG, __FILE__, __FUNCTION__, \
|
||||
__LINE__, "freerdp", fmt, ## __VA_ARGS__)
|
||||
#define DEBUG_WARN(fmt, ...) DEBUG_PRINT(WLOG_ERROR, __FILE__, __FUNCTION__, \
|
||||
__LINE__, "freerdp", fmt, ## __VA_ARGS__)
|
||||
|
||||
#endif /* FREERDP_UTILS_DEBUG_H */
|
||||
|
9
libfreerdp/cache/bitmap.c
vendored
9
libfreerdp/cache/bitmap.c
vendored
@ -29,6 +29,7 @@
|
||||
#include <freerdp/constants.h>
|
||||
#include <winpr/stream.h>
|
||||
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/cache/bitmap.h>
|
||||
|
||||
void update_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt)
|
||||
@ -222,7 +223,7 @@ rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmapCache, UINT32 id, UINT32 index
|
||||
|
||||
if (id > bitmapCache->maxCells)
|
||||
{
|
||||
fprintf(stderr, "get invalid bitmap cell id: %d\n", id);
|
||||
DEBUG_WARN( "get invalid bitmap cell id: %d\n", id);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -232,7 +233,7 @@ rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmapCache, UINT32 id, UINT32 index
|
||||
}
|
||||
else if (index > bitmapCache->cells[id].number)
|
||||
{
|
||||
fprintf(stderr, "get invalid bitmap index %d in cell id: %d\n", index, id);
|
||||
DEBUG_WARN( "get invalid bitmap index %d in cell id: %d\n", index, id);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -245,7 +246,7 @@ void bitmap_cache_put(rdpBitmapCache* bitmapCache, UINT32 id, UINT32 index, rdpB
|
||||
{
|
||||
if (id > bitmapCache->maxCells)
|
||||
{
|
||||
fprintf(stderr, "put invalid bitmap cell id: %d\n", id);
|
||||
DEBUG_WARN( "put invalid bitmap cell id: %d\n", id);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -255,7 +256,7 @@ void bitmap_cache_put(rdpBitmapCache* bitmapCache, UINT32 id, UINT32 index, rdpB
|
||||
}
|
||||
else if (index > bitmapCache->cells[id].number)
|
||||
{
|
||||
fprintf(stderr, "put invalid bitmap index %d in cell id: %d\n", index, id);
|
||||
DEBUG_WARN( "put invalid bitmap index %d in cell id: %d\n", index, id);
|
||||
return;
|
||||
}
|
||||
|
||||
|
11
libfreerdp/cache/brush.c
vendored
11
libfreerdp/cache/brush.c
vendored
@ -28,6 +28,7 @@
|
||||
#include <freerdp/freerdp.h>
|
||||
#include <winpr/stream.h>
|
||||
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/cache/brush.h>
|
||||
|
||||
void update_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
|
||||
@ -100,7 +101,7 @@ void* brush_cache_get(rdpBrushCache* brushCache, UINT32 index, UINT32* bpp)
|
||||
{
|
||||
if (index >= brushCache->maxMonoEntries)
|
||||
{
|
||||
fprintf(stderr, "invalid brush (%d bpp) index: 0x%04X\n", *bpp, index);
|
||||
DEBUG_WARN( "invalid brush (%d bpp) index: 0x%04X\n", *bpp, index);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -111,7 +112,7 @@ void* brush_cache_get(rdpBrushCache* brushCache, UINT32 index, UINT32* bpp)
|
||||
{
|
||||
if (index >= brushCache->maxEntries)
|
||||
{
|
||||
fprintf(stderr, "invalid brush (%d bpp) index: 0x%04X\n", *bpp, index);
|
||||
DEBUG_WARN( "invalid brush (%d bpp) index: 0x%04X\n", *bpp, index);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -121,7 +122,7 @@ void* brush_cache_get(rdpBrushCache* brushCache, UINT32 index, UINT32* bpp)
|
||||
|
||||
if (entry == NULL)
|
||||
{
|
||||
fprintf(stderr, "invalid brush (%d bpp) at index: 0x%04X\n", *bpp, index);
|
||||
DEBUG_WARN( "invalid brush (%d bpp) at index: 0x%04X\n", *bpp, index);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -136,7 +137,7 @@ void brush_cache_put(rdpBrushCache* brushCache, UINT32 index, void* entry, UINT3
|
||||
{
|
||||
if (index >= brushCache->maxMonoEntries)
|
||||
{
|
||||
fprintf(stderr, "invalid brush (%d bpp) index: 0x%04X\n", bpp, index);
|
||||
DEBUG_WARN( "invalid brush (%d bpp) index: 0x%04X\n", bpp, index);
|
||||
|
||||
if (entry)
|
||||
free(entry);
|
||||
@ -156,7 +157,7 @@ void brush_cache_put(rdpBrushCache* brushCache, UINT32 index, void* entry, UINT3
|
||||
{
|
||||
if (index >= brushCache->maxEntries)
|
||||
{
|
||||
fprintf(stderr, "invalid brush (%d bpp) index: 0x%04X\n", bpp, index);
|
||||
DEBUG_WARN( "invalid brush (%d bpp) index: 0x%04X\n", bpp, index);
|
||||
|
||||
if (entry)
|
||||
free(entry);
|
||||
|
17
libfreerdp/cache/glyph.c
vendored
17
libfreerdp/cache/glyph.c
vendored
@ -28,6 +28,7 @@
|
||||
#include <freerdp/freerdp.h>
|
||||
#include <winpr/stream.h>
|
||||
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/cache/glyph.h>
|
||||
|
||||
void update_process_glyph(rdpContext* context, BYTE* data, int* index,
|
||||
@ -367,20 +368,20 @@ rdpGlyph* glyph_cache_get(rdpGlyphCache* glyphCache, UINT32 id, UINT32 index)
|
||||
|
||||
if (id > 9)
|
||||
{
|
||||
fprintf(stderr, "invalid glyph cache id: %d\n", id);
|
||||
DEBUG_WARN( "invalid glyph cache id: %d\n", id);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (index > glyphCache->glyphCache[id].number)
|
||||
{
|
||||
fprintf(stderr, "index %d out of range for cache id: %d\n", index, id);
|
||||
DEBUG_WARN( "index %d out of range for cache id: %d\n", index, id);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
glyph = glyphCache->glyphCache[id].entries[index];
|
||||
|
||||
if (!glyph)
|
||||
fprintf(stderr, "no glyph found at cache index: %d in cache id: %d\n", index, id);
|
||||
DEBUG_WARN( "no glyph found at cache index: %d in cache id: %d\n", index, id);
|
||||
|
||||
return glyph;
|
||||
}
|
||||
@ -391,13 +392,13 @@ void glyph_cache_put(rdpGlyphCache* glyphCache, UINT32 id, UINT32 index, rdpGlyp
|
||||
|
||||
if (id > 9)
|
||||
{
|
||||
fprintf(stderr, "invalid glyph cache id: %d\n", id);
|
||||
DEBUG_WARN( "invalid glyph cache id: %d\n", id);
|
||||
return;
|
||||
}
|
||||
|
||||
if (index > glyphCache->glyphCache[id].number)
|
||||
{
|
||||
fprintf(stderr, "invalid glyph cache index: %d in cache id: %d\n", index, id);
|
||||
DEBUG_WARN( "invalid glyph cache index: %d in cache id: %d\n", index, id);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -423,7 +424,7 @@ void* glyph_cache_fragment_get(rdpGlyphCache* glyphCache, UINT32 index, UINT32*
|
||||
|
||||
if (index > 255)
|
||||
{
|
||||
fprintf(stderr, "invalid glyph cache fragment index: %d\n", index);
|
||||
DEBUG_WARN( "invalid glyph cache fragment index: %d\n", index);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -433,7 +434,7 @@ void* glyph_cache_fragment_get(rdpGlyphCache* glyphCache, UINT32 index, UINT32*
|
||||
WLog_Print(glyphCache->log, WLOG_DEBUG, "GlyphCacheFragmentGet: index: %d size: %d", index, *size);
|
||||
|
||||
if (!fragment)
|
||||
fprintf(stderr, "invalid glyph fragment at index:%d\n", index);
|
||||
DEBUG_WARN( "invalid glyph fragment at index:%d\n", index);
|
||||
|
||||
return fragment;
|
||||
}
|
||||
@ -444,7 +445,7 @@ void glyph_cache_fragment_put(rdpGlyphCache* glyphCache, UINT32 index, UINT32 si
|
||||
|
||||
if (index > 255)
|
||||
{
|
||||
fprintf(stderr, "invalid glyph cache fragment index: %d\n", index);
|
||||
DEBUG_WARN( "invalid glyph cache fragment index: %d\n", index);
|
||||
return;
|
||||
}
|
||||
|
||||
|
7
libfreerdp/cache/nine_grid.c
vendored
7
libfreerdp/cache/nine_grid.c
vendored
@ -29,6 +29,7 @@
|
||||
#include <freerdp/freerdp.h>
|
||||
#include <winpr/stream.h>
|
||||
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/cache/nine_grid.h>
|
||||
|
||||
void update_gdi_draw_nine_grid(rdpContext* context, DRAW_NINE_GRID_ORDER* draw_nine_grid)
|
||||
@ -60,7 +61,7 @@ void* nine_grid_cache_get(rdpNineGridCache* nine_grid, UINT32 index)
|
||||
|
||||
if (index >= nine_grid->maxEntries)
|
||||
{
|
||||
fprintf(stderr, "invalid NineGrid index: 0x%04X\n", index);
|
||||
DEBUG_WARN( "invalid NineGrid index: 0x%04X\n", index);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -68,7 +69,7 @@ void* nine_grid_cache_get(rdpNineGridCache* nine_grid, UINT32 index)
|
||||
|
||||
if (entry == NULL)
|
||||
{
|
||||
fprintf(stderr, "invalid NineGrid at index: 0x%04X\n", index);
|
||||
DEBUG_WARN( "invalid NineGrid at index: 0x%04X\n", index);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -81,7 +82,7 @@ void nine_grid_cache_put(rdpNineGridCache* nine_grid, UINT32 index, void* entry)
|
||||
|
||||
if (index >= nine_grid->maxEntries)
|
||||
{
|
||||
fprintf(stderr, "invalid NineGrid index: 0x%04X\n", index);
|
||||
DEBUG_WARN( "invalid NineGrid index: 0x%04X\n", index);
|
||||
return;
|
||||
}
|
||||
|
||||
|
9
libfreerdp/cache/offscreen.c
vendored
9
libfreerdp/cache/offscreen.c
vendored
@ -27,6 +27,7 @@
|
||||
|
||||
#include <winpr/stream.h>
|
||||
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/cache/offscreen.h>
|
||||
|
||||
void update_gdi_create_offscreen_bitmap(rdpContext* context, CREATE_OFFSCREEN_BITMAP_ORDER* createOffscreenBitmap)
|
||||
@ -80,7 +81,7 @@ rdpBitmap* offscreen_cache_get(rdpOffscreenCache* offscreenCache, UINT32 index)
|
||||
|
||||
if (index >= offscreenCache->maxEntries)
|
||||
{
|
||||
fprintf(stderr, "invalid offscreen bitmap index: 0x%04X\n", index);
|
||||
DEBUG_WARN( "invalid offscreen bitmap index: 0x%04X\n", index);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -88,7 +89,7 @@ rdpBitmap* offscreen_cache_get(rdpOffscreenCache* offscreenCache, UINT32 index)
|
||||
|
||||
if (!bitmap)
|
||||
{
|
||||
fprintf(stderr, "invalid offscreen bitmap at index: 0x%04X\n", index);
|
||||
DEBUG_WARN( "invalid offscreen bitmap at index: 0x%04X\n", index);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -99,7 +100,7 @@ void offscreen_cache_put(rdpOffscreenCache* offscreenCache, UINT32 index, rdpBit
|
||||
{
|
||||
if (index >= offscreenCache->maxEntries)
|
||||
{
|
||||
fprintf(stderr, "invalid offscreen bitmap index: 0x%04X\n", index);
|
||||
DEBUG_WARN( "invalid offscreen bitmap index: 0x%04X\n", index);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -113,7 +114,7 @@ void offscreen_cache_delete(rdpOffscreenCache* offscreenCache, UINT32 index)
|
||||
|
||||
if (index >= offscreenCache->maxEntries)
|
||||
{
|
||||
fprintf(stderr, "invalid offscreen bitmap index (delete): 0x%04X\n", index);
|
||||
DEBUG_WARN( "invalid offscreen bitmap index (delete): 0x%04X\n", index);
|
||||
return;
|
||||
}
|
||||
|
||||
|
7
libfreerdp/cache/palette.c
vendored
7
libfreerdp/cache/palette.c
vendored
@ -25,6 +25,7 @@
|
||||
|
||||
#include <winpr/crt.h>
|
||||
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/cache/palette.h>
|
||||
|
||||
static void update_gdi_cache_color_table(rdpContext* context, CACHE_COLOR_TABLE_ORDER* cacheColorTable)
|
||||
@ -44,7 +45,7 @@ void* palette_cache_get(rdpPaletteCache* paletteCache, UINT32 index)
|
||||
|
||||
if (index >= paletteCache->maxEntries)
|
||||
{
|
||||
fprintf(stderr, "invalid color table index: 0x%04X\n", index);
|
||||
DEBUG_WARN( "invalid color table index: 0x%04X\n", index);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -52,7 +53,7 @@ void* palette_cache_get(rdpPaletteCache* paletteCache, UINT32 index)
|
||||
|
||||
if (!entry)
|
||||
{
|
||||
fprintf(stderr, "invalid color table at index: 0x%04X\n", index);
|
||||
DEBUG_WARN( "invalid color table at index: 0x%04X\n", index);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -63,7 +64,7 @@ void palette_cache_put(rdpPaletteCache* paletteCache, UINT32 index, void* entry)
|
||||
{
|
||||
if (index >= paletteCache->maxEntries)
|
||||
{
|
||||
fprintf(stderr, "invalid color table index: 0x%04X\n", index);
|
||||
DEBUG_WARN( "invalid color table index: 0x%04X\n", index);
|
||||
|
||||
if (entry)
|
||||
free(entry);
|
||||
|
7
libfreerdp/cache/pointer.c
vendored
7
libfreerdp/cache/pointer.c
vendored
@ -28,6 +28,7 @@
|
||||
#include <winpr/stream.h>
|
||||
|
||||
#include <freerdp/cache/pointer.h>
|
||||
#include <freerdp/utils/debug.h>
|
||||
|
||||
void update_pointer_position(rdpContext* context, POINTER_POSITION_UPDATE* pointer_position)
|
||||
{
|
||||
@ -47,7 +48,7 @@ void update_pointer_system(rdpContext* context, POINTER_SYSTEM_UPDATE* pointer_s
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "Unknown system pointer type (0x%08X)\n", pointer_system->type);
|
||||
DEBUG_WARN( "Unknown system pointer type (0x%08X)\n", pointer_system->type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -140,7 +141,7 @@ rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache, UINT32 index)
|
||||
|
||||
if (index >= pointer_cache->cacheSize)
|
||||
{
|
||||
fprintf(stderr, "invalid pointer index:%d\n", index);
|
||||
DEBUG_WARN( "invalid pointer index:%d\n", index);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -155,7 +156,7 @@ void pointer_cache_put(rdpPointerCache* pointer_cache, UINT32 index, rdpPointer*
|
||||
|
||||
if (index >= pointer_cache->cacheSize)
|
||||
{
|
||||
fprintf(stderr, "invalid pointer index:%d\n", index);
|
||||
DEBUG_WARN( "invalid pointer index:%d\n", index);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
#include <winpr/crt.h>
|
||||
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/codec/audio.h>
|
||||
|
||||
UINT32 rdpsnd_compute_audio_time_length(AUDIO_FORMAT* format, int size)
|
||||
@ -57,12 +58,12 @@ UINT32 rdpsnd_compute_audio_time_length(AUDIO_FORMAT* format, int size)
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "rdpsnd_compute_audio_time_length: invalid WAVE_FORMAT_GSM610 format\n");
|
||||
DEBUG_WARN( "rdpsnd_compute_audio_time_length: invalid WAVE_FORMAT_GSM610 format\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "rdpsnd_compute_audio_time_length: unknown format %d\n", format->wFormatTag);
|
||||
DEBUG_WARN( "rdpsnd_compute_audio_time_length: unknown format %d\n", format->wFormatTag);
|
||||
}
|
||||
}
|
||||
|
||||
@ -109,7 +110,7 @@ char* rdpsnd_get_audio_tag_string(UINT16 wFormatTag)
|
||||
|
||||
void rdpsnd_print_audio_format(AUDIO_FORMAT* format)
|
||||
{
|
||||
fprintf(stderr, "%s:\t wFormatTag: 0x%04X nChannels: %d nSamplesPerSec: %d nAvgBytesPerSec: %d "
|
||||
DEBUG_WARN( "%s:\t wFormatTag: 0x%04X nChannels: %d nSamplesPerSec: %d nAvgBytesPerSec: %d "
|
||||
"nBlockAlign: %d wBitsPerSample: %d cbSize: %d\n",
|
||||
rdpsnd_get_audio_tag_string(format->wFormatTag), format->wFormatTag,
|
||||
format->nChannels, format->nSamplesPerSec, format->nAvgBytesPerSec,
|
||||
@ -123,17 +124,17 @@ void rdpsnd_print_audio_formats(AUDIO_FORMAT* formats, UINT16 count)
|
||||
|
||||
if (formats)
|
||||
{
|
||||
fprintf(stderr, "AUDIO_FORMATS (%d) =\n{\n", count);
|
||||
DEBUG_WARN( "AUDIO_FORMATS (%d) =\n{\n", count);
|
||||
|
||||
for (index = 0; index < (int) count; index++)
|
||||
{
|
||||
format = &formats[index];
|
||||
|
||||
fprintf(stderr, "\t");
|
||||
DEBUG_WARN( "\t");
|
||||
rdpsnd_print_audio_format(format);
|
||||
}
|
||||
|
||||
fprintf(stderr, "}\n");
|
||||
DEBUG_WARN( "}\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -135,14 +135,14 @@ int clear_decompress(CLEAR_CONTEXT* clear, BYTE* pSrcData, UINT32 SrcSize,
|
||||
if (!glyphData)
|
||||
return -1010;
|
||||
|
||||
if ((nWidth * nHeight) > glyphEntry->count)
|
||||
if ((nWidth * nHeight) > (int) glyphEntry->count)
|
||||
return -1011;
|
||||
|
||||
nSrcStep = nWidth * 4;
|
||||
pSrcPixel8 = glyphData;
|
||||
pDstPixel8 = &pDstData[(nYDst * nDstStep) + (nXDst * 4)];
|
||||
|
||||
for (y = 0; y < nHeight; y++)
|
||||
for (y = 0; y < (UINT32) nHeight; y++)
|
||||
{
|
||||
CopyMemory(pDstPixel8, pSrcPixel8, nSrcStep);
|
||||
pSrcPixel8 += nSrcStep;
|
||||
@ -163,7 +163,7 @@ int clear_decompress(CLEAR_CONTEXT* clear, BYTE* pSrcData, UINT32 SrcSize,
|
||||
subcodecByteCount = *((UINT32*) &pSrcData[offset + 8]);
|
||||
offset += 12;
|
||||
|
||||
//printf("residualByteCount: %d bandsByteCount: %d subcodecByteCount: %d\n",
|
||||
//DEBUG_MSG("residualByteCount: %d bandsByteCount: %d subcodecByteCount: %d\n",
|
||||
// residualByteCount, bandsByteCount, subcodecByteCount);
|
||||
|
||||
if (residualByteCount > 0)
|
||||
@ -177,7 +177,7 @@ int clear_decompress(CLEAR_CONTEXT* clear, BYTE* pSrcData, UINT32 SrcSize,
|
||||
suboffset = 0;
|
||||
residualData = &pSrcData[offset];
|
||||
|
||||
if ((nWidth * nHeight * 4) > clear->TempSize)
|
||||
if ((nWidth * nHeight * 4) > (int) clear->TempSize)
|
||||
{
|
||||
clear->TempSize = (nWidth * nHeight * 4);
|
||||
clear->TempBuffer = (BYTE*) realloc(clear->TempBuffer, clear->TempSize);
|
||||
@ -238,7 +238,7 @@ int clear_decompress(CLEAR_CONTEXT* clear, BYTE* pSrcData, UINT32 SrcSize,
|
||||
if (pixelIndex != pixelCount)
|
||||
return -1019;
|
||||
|
||||
for (y = 0; y < nHeight; y++)
|
||||
for (y = 0; y < (UINT32) nHeight; y++)
|
||||
{
|
||||
CopyMemory(pDstPixel8, pSrcPixel8, nSrcStep);
|
||||
pSrcPixel8 += nSrcStep;
|
||||
@ -528,7 +528,7 @@ int clear_decompress(CLEAR_CONTEXT* clear, BYTE* pSrcData, UINT32 SrcSize,
|
||||
subcodecId = subcodecs[suboffset + 12];
|
||||
suboffset += 13;
|
||||
|
||||
//printf("bitmapDataByteCount: %d subcodecByteCount: %d suboffset: %d subCodecId: %d\n",
|
||||
//DEBUG_MSG("bitmapDataByteCount: %d subcodecByteCount: %d suboffset: %d subCodecId: %d\n",
|
||||
// bitmapDataByteCount, subcodecByteCount, suboffset, subcodecId);
|
||||
|
||||
if ((subcodecByteCount - suboffset) < bitmapDataByteCount)
|
||||
@ -543,7 +543,7 @@ int clear_decompress(CLEAR_CONTEXT* clear, BYTE* pSrcData, UINT32 SrcSize,
|
||||
if (height > nHeight)
|
||||
return -1043;
|
||||
|
||||
if ((width * height * 4) > clear->TempSize)
|
||||
if (((UINT32) (width * height * 4)) > clear->TempSize)
|
||||
{
|
||||
clear->TempSize = (width * height * 4);
|
||||
clear->TempBuffer = (BYTE*) realloc(clear->TempBuffer, clear->TempSize);
|
||||
@ -732,7 +732,7 @@ int clear_decompress(CLEAR_CONTEXT* clear, BYTE* pSrcData, UINT32 SrcSize,
|
||||
pDstPixel8 = glyphData;
|
||||
pSrcPixel8 = &pDstData[(nYDst * nDstStep) + (nXDst * 4)];
|
||||
|
||||
for (y = 0; y < nHeight; y++)
|
||||
for (y = 0; y < (UINT32) nHeight; y++)
|
||||
{
|
||||
CopyMemory(pDstPixel8, pSrcPixel8, nSrcStep);
|
||||
pDstPixel8 += nSrcStep;
|
||||
|
@ -174,7 +174,7 @@ int h264_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize,
|
||||
return -1;
|
||||
|
||||
#if 0
|
||||
printf("h264_decompress: pSrcData=%p, SrcSize=%u, pDstData=%p, DstFormat=%lx, nDstStep=%d, nXDst=%d, nYDst=%d, nWidth=%d, nHeight=%d)\n",
|
||||
DEBUG_MSG("h264_decompress: pSrcData=%p, SrcSize=%u, pDstData=%p, DstFormat=%lx, nDstStep=%d, nXDst=%d, nYDst=%d, nWidth=%d, nHeight=%d)\n",
|
||||
pSrcData, SrcSize, *ppDstData, DstFormat, nDstStep, nXDst, nYDst, nWidth, nHeight);
|
||||
#endif
|
||||
|
||||
@ -217,7 +217,7 @@ int h264_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize,
|
||||
pSystemBuffer = &sBufferInfo.UsrData.sSystemBuffer;
|
||||
|
||||
#if 0
|
||||
printf("h264_decompress: state=%u, pYUVData=[%p,%p,%p], bufferStatus=%d, width=%d, height=%d, format=%d, stride=[%d,%d]\n",
|
||||
DEBUG_MSG("h264_decompress: state=%u, pYUVData=[%p,%p,%p], bufferStatus=%d, width=%d, height=%d, format=%d, stride=[%d,%d]\n",
|
||||
state, pYUVData[0], pYUVData[1], pYUVData[2], sBufferInfo.iBufferStatus,
|
||||
pSystemBuffer->iWidth, pSystemBuffer->iHeight, pSystemBuffer->iFormat,
|
||||
pSystemBuffer->iStride[0], pSystemBuffer->iStride[1]);
|
||||
@ -311,7 +311,7 @@ H264_CONTEXT* h264_context_new(BOOL Compressor)
|
||||
|
||||
if (!h264->pDecoder)
|
||||
{
|
||||
printf("Failed to create OpenH264 decoder\n");
|
||||
DEBUG_MSG("Failed to create OpenH264 decoder\n");
|
||||
goto EXCEPTION;
|
||||
}
|
||||
|
||||
@ -320,14 +320,14 @@ H264_CONTEXT* h264_context_new(BOOL Compressor)
|
||||
status = (*h264->pDecoder)->Initialize(h264->pDecoder, &sDecParam);
|
||||
if (status != 0)
|
||||
{
|
||||
printf("Failed to initialize OpenH264 decoder (status=%ld)\n", status);
|
||||
DEBUG_MSG("Failed to initialize OpenH264 decoder (status=%ld)\n", status);
|
||||
goto EXCEPTION;
|
||||
}
|
||||
|
||||
status = (*h264->pDecoder)->SetOption(h264->pDecoder, DECODER_OPTION_DATAFORMAT, &videoFormat);
|
||||
if (status != 0)
|
||||
{
|
||||
printf("Failed to set data format option on OpenH264 decoder (status=%ld)\n", status);
|
||||
DEBUG_MSG("Failed to set data format option on OpenH264 decoder (status=%ld)\n", status);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -413,7 +413,7 @@ int mppc_decompress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** p
|
||||
}
|
||||
|
||||
#ifdef DEBUG_MPPC
|
||||
printf("<%d,%d>\n", (int) CopyOffset, (int) LengthOfMatch);
|
||||
DEBUG_MSG("<%d,%d>\n", (int) CopyOffset, (int) LengthOfMatch);
|
||||
#endif
|
||||
|
||||
SrcPtr = HistoryPtr - CopyOffset;
|
||||
@ -555,7 +555,7 @@ int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppD
|
||||
accumulator = Sym1;
|
||||
|
||||
#ifdef DEBUG_MPPC
|
||||
printf("%c", accumulator);
|
||||
DEBUG_MSG("%c", accumulator);
|
||||
#endif
|
||||
|
||||
if (accumulator < 0x80)
|
||||
@ -589,7 +589,7 @@ int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppD
|
||||
}
|
||||
|
||||
#ifdef DEBUG_MPPC
|
||||
printf("<%d,%d>", (int) CopyOffset, (int) LengthOfMatch);
|
||||
DEBUG_MSG("<%d,%d>", (int) CopyOffset, (int) LengthOfMatch);
|
||||
#endif
|
||||
|
||||
/* Encode CopyOffset */
|
||||
@ -764,7 +764,7 @@ int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppD
|
||||
accumulator = *pSrcPtr;
|
||||
|
||||
#ifdef DEBUG_MPPC
|
||||
printf("%c", accumulator);
|
||||
DEBUG_MSG("%c", accumulator);
|
||||
#endif
|
||||
|
||||
if (accumulator < 0x80)
|
||||
@ -799,7 +799,7 @@ int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppD
|
||||
mppc->HistoryOffset = HistoryPtr - HistoryBuffer;
|
||||
|
||||
#ifdef DEBUG_MPPC
|
||||
printf("\n");
|
||||
DEBUG_MSG("\n");
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <winpr/print.h>
|
||||
#include <winpr/bitstream.h>
|
||||
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/codec/ncrush.h>
|
||||
|
||||
UINT16 HuffTableLEC[8192] =
|
||||
@ -1847,7 +1848,7 @@ int ncrush_decompress(NCRUSH_CONTEXT* ncrush, BYTE* pSrcData, UINT32 SrcSize, BY
|
||||
|
||||
if (HistoryPtr >= HistoryBufferEnd)
|
||||
{
|
||||
fprintf(stderr, "ncrush_decompress error: HistoryPtr (%p) >= HistoryBufferEnd (%p)\n",
|
||||
DEBUG_WARN( "ncrush_decompress error: HistoryPtr (%p) >= HistoryBufferEnd (%p)\n",
|
||||
HistoryPtr, HistoryBufferEnd);
|
||||
return -1003;
|
||||
}
|
||||
@ -2021,7 +2022,7 @@ int ncrush_decompress(NCRUSH_CONTEXT* ncrush, BYTE* pSrcData, UINT32 SrcSize, BY
|
||||
|
||||
if (ncrush->HistoryBufferFence != 0xABABABAB)
|
||||
{
|
||||
fprintf(stderr, "NCrushDecompress: history buffer fence was overwritten, potential buffer overflow detected!\n");
|
||||
DEBUG_WARN( "NCrushDecompress: history buffer fence was overwritten, potential buffer overflow detected!\n");
|
||||
return -1007;
|
||||
}
|
||||
|
||||
@ -2695,7 +2696,7 @@ NCRUSH_CONTEXT* ncrush_context_new(BOOL Compressor)
|
||||
ncrush->HistoryPtr = &(ncrush->HistoryBuffer[ncrush->HistoryOffset]);
|
||||
|
||||
if (ncrush_generate_tables(ncrush) < 0)
|
||||
printf("ncrush_context_new: failed to initialize tables\n");
|
||||
DEBUG_MSG("ncrush_context_new: failed to initialize tables\n");
|
||||
|
||||
ncrush_context_reset(ncrush, FALSE);
|
||||
}
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include <winpr/crt.h>
|
||||
#include <winpr/print.h>
|
||||
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/codec/bitmap.h>
|
||||
#include <freerdp/primitives.h>
|
||||
|
||||
@ -75,7 +76,7 @@ static int planar_decompress_plane_rle(BYTE* pSrcData, UINT32 SrcSize, BYTE* pDs
|
||||
|
||||
if ((srcp - pSrcData) > SrcSize)
|
||||
{
|
||||
fprintf(stderr, "planar_decompress_plane_rle: error reading input buffer\n");
|
||||
DEBUG_WARN( "planar_decompress_plane_rle: error reading input buffer\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -95,7 +96,7 @@ static int planar_decompress_plane_rle(BYTE* pSrcData, UINT32 SrcSize, BYTE* pDs
|
||||
|
||||
if (((dstp + (cRawBytes + nRunLength)) - currentScanline) > nWidth * 4)
|
||||
{
|
||||
fprintf(stderr, "planar_decompress_plane_rle: too many pixels in scanline\n");
|
||||
DEBUG_WARN( "planar_decompress_plane_rle: too many pixels in scanline\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -335,7 +336,7 @@ int planar_decompress(BITMAP_PLANAR_CONTEXT* planar, BYTE* pSrcData, UINT32 SrcS
|
||||
{
|
||||
static BOOL been_warned = FALSE;
|
||||
if (!been_warned)
|
||||
fprintf(stderr, "Chroma-Subsampling is not implemented.\n");
|
||||
DEBUG_WARN( "Chroma-Subsampling is not implemented.\n");
|
||||
been_warned = TRUE;
|
||||
}
|
||||
else
|
||||
@ -781,7 +782,7 @@ BYTE* freerdp_bitmap_compress_planar(BITMAP_PLANAR_CONTEXT* context, BYTE* data,
|
||||
context->rlePlanes[3] = &context->rlePlanesBuffer[offset];
|
||||
offset += dstSizes[3];
|
||||
|
||||
//printf("R: [%d/%d] G: [%d/%d] B: [%d/%d]\n",
|
||||
//DEBUG_MSG("R: [%d/%d] G: [%d/%d] B: [%d/%d]\n",
|
||||
// dstSizes[1], planeSize, dstSizes[2], planeSize, dstSizes[3], planeSize);
|
||||
}
|
||||
}
|
||||
|
@ -28,190 +28,635 @@
|
||||
#include <freerdp/codec/color.h>
|
||||
#include <freerdp/codec/progressive.h>
|
||||
|
||||
const char* progressive_get_block_type_string(UINT16 blockType)
|
||||
{
|
||||
switch (blockType)
|
||||
{
|
||||
case PROGRESSIVE_WBT_SYNC:
|
||||
return "PROGRESSIVE_WBT_SYNC";
|
||||
break;
|
||||
|
||||
case PROGRESSIVE_WBT_FRAME_BEGIN:
|
||||
return "PROGRESSIVE_WBT_FRAME_BEGIN";
|
||||
break;
|
||||
|
||||
case PROGRESSIVE_WBT_FRAME_END:
|
||||
return "PROGRESSIVE_WBT_FRAME_END";
|
||||
break;
|
||||
|
||||
case PROGRESSIVE_WBT_CONTEXT:
|
||||
return "PROGRESSIVE_WBT_CONTEXT";
|
||||
break;
|
||||
|
||||
case PROGRESSIVE_WBT_REGION:
|
||||
return "PROGRESSIVE_WBT_REGION";
|
||||
break;
|
||||
|
||||
case PROGRESSIVE_WBT_TILE_SIMPLE:
|
||||
return "PROGRESSIVE_WBT_TILE_SIMPLE";
|
||||
break;
|
||||
|
||||
case PROGRESSIVE_WBT_TILE_FIRST:
|
||||
return "PROGRESSIVE_WBT_TILE_FIRST";
|
||||
break;
|
||||
|
||||
case PROGRESSIVE_WBT_TILE_UPGRADE:
|
||||
return "PROGRESSIVE_WBT_TILE_UPGRADE";
|
||||
break;
|
||||
|
||||
default:
|
||||
return "PROGRESSIVE_WBT_UNKNOWN";
|
||||
break;
|
||||
}
|
||||
|
||||
return "PROGRESSIVE_WBT_UNKNOWN";
|
||||
}
|
||||
|
||||
int progressive_rfx_decode_component(PROGRESSIVE_CONTEXT* progressive,
|
||||
RFX_COMPONENT_CODEC_QUANT* quant, const BYTE* data, int length, INT16* buffer)
|
||||
{
|
||||
int status;
|
||||
|
||||
status = rfx_rlgr_decode(data, length, buffer, 4096, 1);
|
||||
|
||||
if (status < 0)
|
||||
return status;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int progressive_decompress_tile_first(PROGRESSIVE_CONTEXT* progressive, RFX_PROGRESSIVE_TILE* tile)
|
||||
{
|
||||
BYTE* pBuffer;
|
||||
INT16* pSrcDst[3];
|
||||
PROGRESSIVE_BLOCK_REGION* region;
|
||||
RFX_COMPONENT_CODEC_QUANT* quantY;
|
||||
RFX_COMPONENT_CODEC_QUANT* quantCb;
|
||||
RFX_COMPONENT_CODEC_QUANT* quantCr;
|
||||
RFX_PROGRESSIVE_CODEC_QUANT* quantProgVal;
|
||||
|
||||
printf("ProgressiveTileFirst: quantIdx Y: %d Cb: %d Cr: %d xIdx: %d yIdx: %d flags: %d quality: %d yLen: %d cbLen: %d crLen: %d tailLen: %d\n",
|
||||
tile->quantIdxY, tile->quantIdxCb, tile->quantIdxCr, tile->xIdx, tile->yIdx, tile->flags, tile->quality, tile->yLen, tile->cbLen, tile->crLen, tile->tailLen);
|
||||
|
||||
region = &(progressive->region);
|
||||
|
||||
if (tile->quantIdxY >= region->numQuant)
|
||||
return -1;
|
||||
|
||||
quantY = &(region->quantVals[tile->quantIdxY]);
|
||||
|
||||
if (tile->quantIdxCb >= region->numQuant)
|
||||
return -1;
|
||||
|
||||
quantCb = &(region->quantVals[tile->quantIdxCb]);
|
||||
|
||||
if (tile->quantIdxCr >= region->numQuant)
|
||||
return -1;
|
||||
|
||||
quantCr = &(region->quantVals[tile->quantIdxCr]);
|
||||
|
||||
if (tile->quality == 0xFF)
|
||||
{
|
||||
quantProgVal = &(progressive->quantProgValFull);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tile->quality >= region->numProgQuant)
|
||||
return -1;
|
||||
|
||||
quantProgVal = &(region->quantProgVals[tile->quality]);
|
||||
}
|
||||
|
||||
pBuffer = (BYTE*) BufferPool_Take(progressive->bufferPool, -1);
|
||||
pSrcDst[0] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 0) + 16])); /* Y/R buffer */
|
||||
pSrcDst[1] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 1) + 16])); /* Cb/G buffer */
|
||||
pSrcDst[2] = (INT16*)((BYTE*)(&pBuffer[((8192 + 32) * 2) + 16])); /* Cr/B buffer */
|
||||
|
||||
progressive_rfx_decode_component(progressive, quantY, tile->yData, tile->yLen, pSrcDst[0]); /* Y */
|
||||
progressive_rfx_decode_component(progressive, quantCb, tile->cbData, tile->cbLen, pSrcDst[1]); /* Cb */
|
||||
progressive_rfx_decode_component(progressive, quantCr, tile->crData, tile->crLen, pSrcDst[2]); /* Cr */
|
||||
|
||||
BufferPool_Return(progressive->bufferPool, pBuffer);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int progressive_decompress_tile_upgrade(PROGRESSIVE_CONTEXT* progressive, RFX_PROGRESSIVE_TILE* tile)
|
||||
{
|
||||
PROGRESSIVE_BLOCK_REGION* region;
|
||||
RFX_COMPONENT_CODEC_QUANT* quantY;
|
||||
RFX_COMPONENT_CODEC_QUANT* quantCb;
|
||||
RFX_COMPONENT_CODEC_QUANT* quantCr;
|
||||
RFX_PROGRESSIVE_CODEC_QUANT* quantProgVal;
|
||||
|
||||
printf("ProgressiveTileUpgrade: quantIdx Y: %d Cb: %d Cr: %d xIdx: %d yIdx: %d quality: %d ySrlLen: %d yRawLen: %d cbSrlLen: %d cbRawLen: %d crSrlLen: %d crRawLen: %d\n",
|
||||
tile->quantIdxY, tile->quantIdxCb, tile->quantIdxCr, tile->xIdx, tile->yIdx, tile->quality, tile->ySrlLen, tile->yRawLen, tile->cbSrlLen, tile->cbRawLen, tile->crSrlLen, tile->crRawLen);
|
||||
|
||||
region = &(progressive->region);
|
||||
|
||||
if (tile->quantIdxY >= region->numQuant)
|
||||
return -1;
|
||||
|
||||
quantY = &(region->quantVals[tile->quantIdxY]);
|
||||
|
||||
if (tile->quantIdxCb >= region->numQuant)
|
||||
return -1;
|
||||
|
||||
quantCb = &(region->quantVals[tile->quantIdxCb]);
|
||||
|
||||
if (tile->quantIdxCr >= region->numQuant)
|
||||
return -1;
|
||||
|
||||
quantCr = &(region->quantVals[tile->quantIdxCr]);
|
||||
|
||||
if (tile->quality == 0xFF)
|
||||
{
|
||||
quantProgVal = &(progressive->quantProgValFull);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tile->quality >= region->numProgQuant)
|
||||
return -1;
|
||||
|
||||
quantProgVal = &(region->quantProgVals[tile->quality]);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int progressive_process_tiles(PROGRESSIVE_CONTEXT* progressive, BYTE* blocks, UINT32 blocksLen)
|
||||
{
|
||||
BYTE* block;
|
||||
UINT16 index;
|
||||
UINT32 boffset;
|
||||
UINT32 count = 0;
|
||||
UINT32 offset = 0;
|
||||
RFX_PROGRESSIVE_TILE* tile;
|
||||
RFX_PROGRESSIVE_TILE* tiles;
|
||||
PROGRESSIVE_BLOCK_REGION* region;
|
||||
|
||||
region = &(progressive->region);
|
||||
|
||||
tiles = region->tiles;
|
||||
|
||||
while ((blocksLen - offset) >= 6)
|
||||
{
|
||||
boffset = 0;
|
||||
block = &blocks[offset];
|
||||
|
||||
tile = &tiles[count];
|
||||
|
||||
tile->blockType = *((UINT16*) &block[boffset + 0]); /* blockType (2 bytes) */
|
||||
tile->blockLen = *((UINT32*) &block[boffset + 2]); /* blockLen (4 bytes) */
|
||||
boffset += 6;
|
||||
|
||||
printf("%s\n", progressive_get_block_type_string(tile->blockType));
|
||||
|
||||
if ((blocksLen - offset) < tile->blockLen)
|
||||
return -1003;
|
||||
|
||||
switch (tile->blockType)
|
||||
{
|
||||
case PROGRESSIVE_WBT_TILE_SIMPLE:
|
||||
|
||||
if ((tile->blockLen - boffset) < 16)
|
||||
return -1022;
|
||||
|
||||
tile->quality = 0xFF; /* simple tiles use no progressive techniques */
|
||||
|
||||
tile->quantIdxY = block[boffset + 0]; /* quantIdxY (1 byte) */
|
||||
tile->quantIdxCb = block[boffset + 1]; /* quantIdxCb (1 byte) */
|
||||
tile->quantIdxCr = block[boffset + 2]; /* quantIdxCr (1 byte) */
|
||||
tile->xIdx = *((UINT16*) &block[boffset + 3]); /* xIdx (2 bytes) */
|
||||
tile->yIdx = *((UINT16*) &block[boffset + 5]); /* yIdx (2 bytes) */
|
||||
tile->flags = block[boffset + 7]; /* flags (1 byte) */
|
||||
tile->yLen = *((UINT16*) &block[boffset + 8]); /* yLen (2 bytes) */
|
||||
tile->cbLen = *((UINT16*) &block[boffset + 10]); /* cbLen (2 bytes) */
|
||||
tile->crLen = *((UINT16*) &block[boffset + 12]); /* crLen (2 bytes) */
|
||||
tile->tailLen = *((UINT16*) &block[boffset + 14]); /* tailLen (2 bytes) */
|
||||
boffset += 16;
|
||||
|
||||
if ((tile->blockLen - boffset) < tile->yLen)
|
||||
return -1023;
|
||||
|
||||
tile->yData = &block[boffset];
|
||||
boffset += tile->yLen;
|
||||
|
||||
if ((tile->blockLen - boffset) < tile->cbLen)
|
||||
return -1024;
|
||||
|
||||
tile->cbData = &block[boffset];
|
||||
boffset += tile->cbLen;
|
||||
|
||||
if ((tile->blockLen - boffset) < tile->crLen)
|
||||
return -1025;
|
||||
|
||||
tile->crData = &block[boffset];
|
||||
boffset += tile->crLen;
|
||||
|
||||
if ((tile->blockLen - boffset) < tile->tailLen)
|
||||
return -1026;
|
||||
|
||||
tile->tailData = &block[boffset];
|
||||
boffset += tile->tailLen;
|
||||
|
||||
break;
|
||||
|
||||
case PROGRESSIVE_WBT_TILE_FIRST:
|
||||
|
||||
if ((tile->blockLen - boffset) < 17)
|
||||
return -1027;
|
||||
|
||||
tile->quantIdxY = block[boffset + 0]; /* quantIdxY (1 byte) */
|
||||
tile->quantIdxCb = block[boffset + 1]; /* quantIdxCb (1 byte) */
|
||||
tile->quantIdxCr = block[boffset + 2]; /* quantIdxCr (1 byte) */
|
||||
tile->xIdx = *((UINT16*) &block[boffset + 3]); /* xIdx (2 bytes) */
|
||||
tile->yIdx = *((UINT16*) &block[boffset + 5]); /* yIdx (2 bytes) */
|
||||
tile->flags = block[boffset + 7]; /* flags (1 byte) */
|
||||
tile->quality = block[boffset + 8]; /* quality (1 byte) */
|
||||
tile->yLen = *((UINT16*) &block[boffset + 9]); /* yLen (2 bytes) */
|
||||
tile->cbLen = *((UINT16*) &block[boffset + 11]); /* cbLen (2 bytes) */
|
||||
tile->crLen = *((UINT16*) &block[boffset + 13]); /* crLen (2 bytes) */
|
||||
tile->tailLen = *((UINT16*) &block[boffset + 15]); /* tailLen (2 bytes) */
|
||||
boffset += 17;
|
||||
|
||||
if ((tile->blockLen - boffset) < tile->yLen)
|
||||
return -1028;
|
||||
|
||||
tile->yData = &block[boffset];
|
||||
boffset += tile->yLen;
|
||||
|
||||
if ((tile->blockLen - boffset) < tile->cbLen)
|
||||
return -1029;
|
||||
|
||||
tile->cbData = &block[boffset];
|
||||
boffset += tile->cbLen;
|
||||
|
||||
if ((tile->blockLen - boffset) < tile->crLen)
|
||||
return -1030;
|
||||
|
||||
tile->crData = &block[boffset];
|
||||
boffset += tile->crLen;
|
||||
|
||||
if ((tile->blockLen - boffset) < tile->tailLen)
|
||||
return -1031;
|
||||
|
||||
tile->tailData = &block[boffset];
|
||||
boffset += tile->tailLen;
|
||||
|
||||
break;
|
||||
|
||||
case PROGRESSIVE_WBT_TILE_UPGRADE:
|
||||
|
||||
if ((tile->blockLen - boffset) < 20)
|
||||
return -1032;
|
||||
|
||||
tile->quantIdxY = block[boffset + 0]; /* quantIdxY (1 byte) */
|
||||
tile->quantIdxCb = block[boffset + 1]; /* quantIdxCb (1 byte) */
|
||||
tile->quantIdxCr = block[boffset + 2]; /* quantIdxCr (1 byte) */
|
||||
tile->xIdx = *((UINT16*) &block[boffset + 3]); /* xIdx (2 bytes) */
|
||||
tile->yIdx = *((UINT16*) &block[boffset + 5]); /* yIdx (2 bytes) */
|
||||
tile->quality = block[boffset + 7]; /* quality (1 byte) */
|
||||
tile->ySrlLen = *((UINT16*) &block[boffset + 8]); /* ySrlLen (2 bytes) */
|
||||
tile->yRawLen = *((UINT16*) &block[boffset + 10]); /* yRawLen (2 bytes) */
|
||||
tile->cbSrlLen = *((UINT16*) &block[boffset + 12]); /* cbSrlLen (2 bytes) */
|
||||
tile->cbRawLen = *((UINT16*) &block[boffset + 14]); /* cbRawLen (2 bytes) */
|
||||
tile->crSrlLen = *((UINT16*) &block[boffset + 16]); /* crSrlLen (2 bytes) */
|
||||
tile->crRawLen = *((UINT16*) &block[boffset + 18]); /* crRawLen (2 bytes) */
|
||||
boffset += 20;
|
||||
|
||||
if ((tile->blockLen - boffset) < tile->ySrlLen)
|
||||
return -1033;
|
||||
|
||||
tile->ySrlData = &block[boffset];
|
||||
boffset += tile->ySrlLen;
|
||||
|
||||
if ((tile->blockLen - boffset) < tile->yRawLen)
|
||||
return -1034;
|
||||
|
||||
tile->yRawData = &block[boffset];
|
||||
boffset += tile->yRawLen;
|
||||
|
||||
if ((tile->blockLen - boffset) < tile->cbSrlLen)
|
||||
return -1035;
|
||||
|
||||
tile->cbSrlData = &block[boffset];
|
||||
boffset += tile->cbSrlLen;
|
||||
|
||||
if ((tile->blockLen - boffset) < tile->cbRawLen)
|
||||
return -1036;
|
||||
|
||||
tile->cbRawData = &block[boffset];
|
||||
boffset += tile->cbRawLen;
|
||||
|
||||
if ((tile->blockLen - boffset) < tile->crSrlLen)
|
||||
return -1037;
|
||||
|
||||
tile->crSrlData = &block[boffset];
|
||||
boffset += tile->crSrlLen;
|
||||
|
||||
if ((tile->blockLen - boffset) < tile->crRawLen)
|
||||
return -1038;
|
||||
|
||||
tile->crRawData = &block[boffset];
|
||||
boffset += tile->crRawLen;
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
return -1039;
|
||||
break;
|
||||
}
|
||||
|
||||
if (boffset != tile->blockLen)
|
||||
return -1040;
|
||||
|
||||
offset += tile->blockLen;
|
||||
count++;
|
||||
}
|
||||
|
||||
if (offset != blocksLen)
|
||||
return -1041;
|
||||
|
||||
for (index = 0; index < region->numTiles; index++)
|
||||
{
|
||||
tile = &tiles[index];
|
||||
|
||||
switch (tile->blockType)
|
||||
{
|
||||
case PROGRESSIVE_WBT_TILE_SIMPLE:
|
||||
case PROGRESSIVE_WBT_TILE_FIRST:
|
||||
progressive_decompress_tile_first(progressive, tile);
|
||||
break;
|
||||
|
||||
case PROGRESSIVE_WBT_TILE_UPGRADE:
|
||||
progressive_decompress_tile_upgrade(progressive, tile);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (int) offset;
|
||||
}
|
||||
|
||||
int progressive_decompress(PROGRESSIVE_CONTEXT* progressive, BYTE* pSrcData, UINT32 SrcSize,
|
||||
BYTE** ppDstData, DWORD DstFormat, int nDstStep, int nXDst, int nYDst, int nWidth, int nHeight)
|
||||
{
|
||||
int status;
|
||||
BYTE* block;
|
||||
BYTE* blocks;
|
||||
UINT16 index;
|
||||
UINT32 boffset;
|
||||
UINT32 ctxId;
|
||||
UINT32 flags;
|
||||
UINT32 tileSize;
|
||||
UINT32 magic;
|
||||
UINT32 version;
|
||||
UINT16 blockType;
|
||||
UINT32 blockLen;
|
||||
UINT32 blocksLen;
|
||||
UINT32 count = 0;
|
||||
UINT32 offset = 0;
|
||||
UINT32 frameIndex;
|
||||
UINT32 regionCount;
|
||||
PROGRESSIVE_REGION region;
|
||||
PROGRESSIVE_TILE_SIMPLE simple;
|
||||
PROGRESSIVE_TILE_FIRST first;
|
||||
PROGRESSIVE_TILE_UPGRADE upgrade;
|
||||
RFX_RECT* rect = NULL;
|
||||
PROGRESSIVE_BLOCK_SYNC sync;
|
||||
PROGRESSIVE_BLOCK_REGION* region;
|
||||
PROGRESSIVE_BLOCK_CONTEXT context;
|
||||
PROGRESSIVE_BLOCK_FRAME_BEGIN frameBegin;
|
||||
PROGRESSIVE_BLOCK_FRAME_END frameEnd;
|
||||
RFX_COMPONENT_CODEC_QUANT* quantVal;
|
||||
RFX_PROGRESSIVE_CODEC_QUANT* quantProgVal;
|
||||
|
||||
printf("ProgressiveDecompress\n");
|
||||
blocks = pSrcData;
|
||||
blocksLen = SrcSize;
|
||||
|
||||
while ((SrcSize - offset) > 6)
|
||||
region = &(progressive->region);
|
||||
|
||||
while ((blocksLen - offset) >= 6)
|
||||
{
|
||||
boffset = 0;
|
||||
block = &pSrcData[offset];
|
||||
block = &blocks[offset];
|
||||
|
||||
blockType = *((UINT16*) &block[boffset]); /* blockType (2 bytes) */
|
||||
blockType = *((UINT16*) &block[boffset + 0]); /* blockType (2 bytes) */
|
||||
blockLen = *((UINT32*) &block[boffset + 2]); /* blockLen (4 bytes) */
|
||||
boffset += 6;
|
||||
|
||||
printf("%s\n", progressive_get_block_type_string(blockType));
|
||||
|
||||
if ((blocksLen - offset) < blockLen)
|
||||
return -1003;
|
||||
|
||||
switch (blockType)
|
||||
{
|
||||
case PROGRESSIVE_WBT_SYNC:
|
||||
|
||||
if (blockLen != 12)
|
||||
return -1;
|
||||
sync.blockType = blockType;
|
||||
sync.blockLen = blockLen;
|
||||
|
||||
magic = (UINT32) *((UINT32*) &block[boffset]); /* magic (4 bytes) */
|
||||
version = (UINT32) *((UINT16*) &block[boffset + 4]); /* version (2 bytes) */
|
||||
if ((blockLen - boffset) != 6)
|
||||
return -1004;
|
||||
|
||||
sync.magic = (UINT32) *((UINT32*) &block[boffset + 0]); /* magic (4 bytes) */
|
||||
sync.version = (UINT32) *((UINT16*) &block[boffset + 4]); /* version (2 bytes) */
|
||||
boffset += 6;
|
||||
|
||||
if (sync.magic != 0xCACCACCA)
|
||||
return -1005;
|
||||
|
||||
if (sync.version != 0x0100)
|
||||
return -1006;
|
||||
|
||||
break;
|
||||
|
||||
case PROGRESSIVE_WBT_FRAME_BEGIN:
|
||||
|
||||
frameIndex = (UINT32) *((UINT32*) &block[boffset]); /* frameIndex (4 bytes) */
|
||||
regionCount = (UINT32) *((UINT16*) &block[boffset + 4]); /* regionCount (2 bytes) */
|
||||
frameBegin.blockType = blockType;
|
||||
frameBegin.blockLen = blockLen;
|
||||
|
||||
if ((blockLen - boffset) < 6)
|
||||
return -1007;
|
||||
|
||||
frameBegin.frameIndex = (UINT32) *((UINT32*) &block[boffset + 0]); /* frameIndex (4 bytes) */
|
||||
frameBegin.regionCount = (UINT32) *((UINT16*) &block[boffset + 4]); /* regionCount (2 bytes) */
|
||||
boffset += 6;
|
||||
|
||||
/**
|
||||
* If the number of elements specified by the regionCount field is
|
||||
* larger than the actual number of elements in the regions field,
|
||||
* the decoder SHOULD ignore this inconsistency.
|
||||
*/
|
||||
|
||||
break;
|
||||
|
||||
case PROGRESSIVE_WBT_FRAME_END:
|
||||
|
||||
if (blockLen != 6)
|
||||
return -1;
|
||||
frameEnd.blockType = blockType;
|
||||
frameEnd.blockLen = blockLen;
|
||||
|
||||
if ((blockLen - boffset) != 0)
|
||||
return -1008;
|
||||
|
||||
break;
|
||||
|
||||
case PROGRESSIVE_WBT_CONTEXT:
|
||||
|
||||
if (blockLen != 10)
|
||||
return -1;
|
||||
context.blockType = blockType;
|
||||
context.blockLen = blockLen;
|
||||
|
||||
ctxId = (UINT32) block[boffset]; /* ctxId (1 byte) */
|
||||
tileSize = (UINT32) *((UINT16*) &block[boffset + 1]); /* tileSize (2 bytes) */
|
||||
flags = (UINT32) block[boffset + 3]; /* flags (1 byte) */
|
||||
if ((blockLen - boffset) != 4)
|
||||
return -1009;
|
||||
|
||||
context.ctxId = block[boffset + 0]; /* ctxId (1 byte) */
|
||||
context.tileSize = *((UINT16*) &block[boffset + 1]); /* tileSize (2 bytes) */
|
||||
context.flags = block[boffset + 3]; /* flags (1 byte) */
|
||||
boffset += 4;
|
||||
|
||||
if (tileSize != 64)
|
||||
return -1;
|
||||
if (context.tileSize != 64)
|
||||
return -1010;
|
||||
|
||||
break;
|
||||
|
||||
case PROGRESSIVE_WBT_REGION:
|
||||
|
||||
region.tileSize = block[boffset]; /* tileSize (1 byte) */
|
||||
region.numRects = *((UINT16*) &block[boffset + 1]); /* numRects (2 bytes) */
|
||||
region.numQuant = block[boffset + 3]; /* numQuant (1 byte) */
|
||||
region.numProgQuant = block[boffset + 4]; /* numProgQuant (1 byte) */
|
||||
region.flags = block[boffset + 5]; /* flags (1 byte) */
|
||||
region.numTiles = *((UINT16*) &block[boffset + 6]); /* numTiles (2 bytes) */
|
||||
region.tileDataSize = *((UINT32*) &block[boffset + 8]); /* tileDataSize (4 bytes) */
|
||||
region->blockType = blockType;
|
||||
region->blockLen = blockLen;
|
||||
|
||||
if ((blockLen - boffset) < 12)
|
||||
return -1011;
|
||||
|
||||
region->tileSize = block[boffset + 0]; /* tileSize (1 byte) */
|
||||
region->numRects = *((UINT16*) &block[boffset + 1]); /* numRects (2 bytes) */
|
||||
region->numQuant = block[boffset + 3]; /* numQuant (1 byte) */
|
||||
region->numProgQuant = block[boffset + 4]; /* numProgQuant (1 byte) */
|
||||
region->flags = block[boffset + 5]; /* flags (1 byte) */
|
||||
region->numTiles = *((UINT16*) &block[boffset + 6]); /* numTiles (2 bytes) */
|
||||
region->tileDataSize = *((UINT32*) &block[boffset + 8]); /* tileDataSize (4 bytes) */
|
||||
boffset += 12;
|
||||
|
||||
break;
|
||||
if (region->tileSize != 64)
|
||||
return -1012;
|
||||
|
||||
case PROGRESSIVE_WBT_TILE_SIMPLE:
|
||||
if (region->numRects < 1)
|
||||
return -1013;
|
||||
|
||||
simple.quantIdxY = block[boffset]; /* quantIdxY (1 byte) */
|
||||
simple.quantIdxCb = block[boffset + 1]; /* quantIdxCb (1 byte) */
|
||||
simple.quantIdxCr = block[boffset + 2]; /* quantIdxCr (1 byte) */
|
||||
simple.xIdx = *((UINT16*) &block[boffset + 3]); /* xIdx (2 bytes) */
|
||||
simple.yIdx = *((UINT16*) &block[boffset + 5]); /* yIdx (2 bytes) */
|
||||
simple.flags = block[boffset + 7]; /* flags (1 byte) */
|
||||
simple.yLen = *((UINT16*) &block[boffset + 8]); /* yLen (2 bytes) */
|
||||
simple.cbLen = *((UINT16*) &block[boffset + 10]); /* cbLen (2 bytes) */
|
||||
simple.crLen = *((UINT16*) &block[boffset + 12]); /* crLen (2 bytes) */
|
||||
simple.tailLen = *((UINT16*) &block[boffset + 14]); /* tailLen (2 bytes) */
|
||||
boffset += 16;
|
||||
if (region->numQuant > 7)
|
||||
return -1014;
|
||||
|
||||
simple.yData = &block[boffset];
|
||||
boffset += simple.yLen;
|
||||
if ((blockLen - boffset) < (region->numRects * 8))
|
||||
return -1015;
|
||||
|
||||
simple.cbData = &block[boffset];
|
||||
boffset += simple.cbLen;
|
||||
if (region->numRects > progressive->cRects)
|
||||
{
|
||||
progressive->rects = (RFX_RECT*) realloc(progressive->rects, region->numRects * sizeof(RFX_RECT));
|
||||
progressive->cRects = region->numRects;
|
||||
}
|
||||
|
||||
simple.crData = &block[boffset];
|
||||
boffset += simple.crLen;
|
||||
region->rects = progressive->rects;
|
||||
|
||||
simple.tailData = &block[boffset];
|
||||
boffset += simple.tailLen;
|
||||
if (!region->rects)
|
||||
return -1016;
|
||||
|
||||
for (index = 0; index < region->numRects; index++)
|
||||
{
|
||||
rect = &(region->rects[index]);
|
||||
rect->x = *((UINT16*) &block[boffset + 0]);
|
||||
rect->y = *((UINT16*) &block[boffset + 2]);
|
||||
rect->width = *((UINT16*) &block[boffset + 4]);
|
||||
rect->height = *((UINT16*) &block[boffset + 6]);
|
||||
boffset += 8;
|
||||
}
|
||||
|
||||
if ((blockLen - boffset) < (region->numQuant * 5))
|
||||
return -1017;
|
||||
|
||||
if (region->numQuant > progressive->cQuant)
|
||||
{
|
||||
progressive->quantVals = (RFX_COMPONENT_CODEC_QUANT*) realloc(progressive->quantVals,
|
||||
region->numQuant * sizeof(RFX_COMPONENT_CODEC_QUANT));
|
||||
progressive->cQuant = region->numQuant;
|
||||
}
|
||||
|
||||
region->quantVals = progressive->quantVals;
|
||||
|
||||
if (!region->quantVals)
|
||||
return -1018;
|
||||
|
||||
for (index = 0; index < region->numQuant; index++)
|
||||
{
|
||||
quantVal = &(region->quantVals[index]);
|
||||
quantVal->LL3 = block[boffset + 0] & 0x0F;
|
||||
quantVal->HL3 = block[boffset + 0] >> 4;
|
||||
quantVal->LH3 = block[boffset + 1] & 0x0F;
|
||||
quantVal->HH3 = block[boffset + 1] >> 4;
|
||||
quantVal->HL2 = block[boffset + 2] & 0x0F;
|
||||
quantVal->LH2 = block[boffset + 2] >> 4;
|
||||
quantVal->HH2 = block[boffset + 3] & 0x0F;
|
||||
quantVal->HL1 = block[boffset + 3] >> 4;
|
||||
quantVal->LH1 = block[boffset + 4] & 0x0F;
|
||||
quantVal->HH1 = block[boffset + 4] >> 4;
|
||||
boffset += 5;
|
||||
}
|
||||
|
||||
if ((blockLen - boffset) < (region->numProgQuant * 16))
|
||||
return -1019;
|
||||
|
||||
if (region->numProgQuant > progressive->cProgQuant)
|
||||
{
|
||||
progressive->quantProgVals = (RFX_PROGRESSIVE_CODEC_QUANT*) realloc(progressive->quantProgVals,
|
||||
region->numProgQuant * sizeof(RFX_PROGRESSIVE_CODEC_QUANT));
|
||||
progressive->cProgQuant = region->numProgQuant;
|
||||
}
|
||||
|
||||
region->quantProgVals = progressive->quantProgVals;
|
||||
|
||||
if (!region->quantProgVals)
|
||||
return -1020;
|
||||
|
||||
for (index = 0; index < region->numProgQuant; index++)
|
||||
{
|
||||
quantProgVal = &(region->quantProgVals[index]);
|
||||
quantProgVal->quality = block[boffset + 0];
|
||||
CopyMemory(quantProgVal->yQuantValues, &block[boffset + 1], 5);
|
||||
CopyMemory(quantProgVal->cbQuantValues, &block[boffset + 6], 5);
|
||||
CopyMemory(quantProgVal->crQuantValues, &block[boffset + 11], 5);
|
||||
boffset += 16;
|
||||
}
|
||||
|
||||
if ((blockLen - boffset) < region->tileDataSize)
|
||||
return -1021;
|
||||
|
||||
if (region->numTiles > progressive->cTiles)
|
||||
{
|
||||
progressive->tiles = (RFX_PROGRESSIVE_TILE*) realloc(progressive->tiles,
|
||||
region->numTiles * sizeof(RFX_PROGRESSIVE_TILE));
|
||||
progressive->cTiles = region->numTiles;
|
||||
}
|
||||
|
||||
region->tiles = progressive->tiles;
|
||||
|
||||
if (!region->tiles)
|
||||
return -1;
|
||||
|
||||
printf("numRects: %d numTiles: %d numQuant: %d numProgQuant: %d\n",
|
||||
region->numRects, region->numTiles, region->numQuant, region->numProgQuant);
|
||||
|
||||
status = progressive_process_tiles(progressive, &block[boffset], region->tileDataSize);
|
||||
|
||||
if (status < 0)
|
||||
return status;
|
||||
|
||||
boffset += (UINT32) status;
|
||||
|
||||
break;
|
||||
|
||||
case PROGRESSIVE_WBT_TILE_PROGRESSIVE_FIRST:
|
||||
|
||||
first.quantIdxY = block[boffset]; /* quantIdxY (1 byte) */
|
||||
first.quantIdxCb = block[boffset + 1]; /* quantIdxCb (1 byte) */
|
||||
first.quantIdxCr = block[boffset + 2]; /* quantIdxCr (1 byte) */
|
||||
first.xIdx = *((UINT16*) &block[boffset + 3]); /* xIdx (2 bytes) */
|
||||
first.yIdx = *((UINT16*) &block[boffset + 5]); /* yIdx (2 bytes) */
|
||||
first.flags = block[boffset + 7]; /* flags (1 byte) */
|
||||
first.quality = block[boffset + 8]; /* quality (1 byte) */
|
||||
first.yLen = *((UINT16*) &block[boffset + 9]); /* yLen (2 bytes) */
|
||||
first.cbLen = *((UINT16*) &block[boffset + 11]); /* cbLen (2 bytes) */
|
||||
first.crLen = *((UINT16*) &block[boffset + 13]); /* crLen (2 bytes) */
|
||||
first.tailLen = *((UINT16*) &block[boffset + 15]); /* tailLen (2 bytes) */
|
||||
boffset += 17;
|
||||
|
||||
first.yData = &block[boffset];
|
||||
boffset += first.yLen;
|
||||
|
||||
first.cbData = &block[boffset];
|
||||
boffset += first.cbLen;
|
||||
|
||||
first.crData = &block[boffset];
|
||||
boffset += first.crLen;
|
||||
|
||||
first.tailData = &block[boffset];
|
||||
boffset += first.tailLen;
|
||||
|
||||
break;
|
||||
|
||||
case PROGRESSIVE_WBT_TILE_PROGRESSIVE_UPGRADE:
|
||||
|
||||
upgrade.quantIdxY = block[boffset]; /* quantIdxY (1 byte) */
|
||||
upgrade.quantIdxCb = block[boffset + 1]; /* quantIdxCb (1 byte) */
|
||||
upgrade.quantIdxCr = block[boffset + 2]; /* quantIdxCr (1 byte) */
|
||||
upgrade.xIdx = *((UINT16*) &block[boffset + 3]); /* xIdx (2 bytes) */
|
||||
upgrade.yIdx = *((UINT16*) &block[boffset + 5]); /* yIdx (2 bytes) */
|
||||
upgrade.quality = block[boffset + 7]; /* quality (1 byte) */
|
||||
upgrade.ySrlLen = *((UINT16*) &block[boffset + 8]); /* ySrlLen (2 bytes) */
|
||||
upgrade.yRawLen = *((UINT16*) &block[boffset + 10]); /* yRawLen (2 bytes) */
|
||||
upgrade.cbSrlLen = *((UINT16*) &block[boffset + 12]); /* cbSrlLen (2 bytes) */
|
||||
upgrade.cbRawLen = *((UINT16*) &block[boffset + 14]); /* cbRawLen (2 bytes) */
|
||||
upgrade.crSrlLen = *((UINT16*) &block[boffset + 16]); /* crSrlLen (2 bytes) */
|
||||
upgrade.crRawLen = *((UINT16*) &block[boffset + 18]); /* crRawLen (2 bytes) */
|
||||
boffset += 18;
|
||||
|
||||
upgrade.ySrlData = &block[boffset];
|
||||
boffset += upgrade.ySrlLen;
|
||||
|
||||
upgrade.yRawData = &block[boffset];
|
||||
boffset += upgrade.yRawLen;
|
||||
|
||||
upgrade.cbSrlData = &block[boffset];
|
||||
boffset += upgrade.cbSrlLen;
|
||||
|
||||
upgrade.cbRawData = &block[boffset];
|
||||
boffset += upgrade.cbRawLen;
|
||||
|
||||
upgrade.crSrlData = &block[boffset];
|
||||
boffset += upgrade.crSrlLen;
|
||||
|
||||
upgrade.crRawData = &block[boffset];
|
||||
boffset += upgrade.crRawLen;
|
||||
|
||||
default:
|
||||
return -1039;
|
||||
break;
|
||||
}
|
||||
|
||||
if (boffset != blockLen)
|
||||
return -1040;
|
||||
|
||||
offset += blockLen;
|
||||
count++;
|
||||
}
|
||||
|
||||
if (offset != blocksLen)
|
||||
return -1041;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -234,6 +679,37 @@ PROGRESSIVE_CONTEXT* progressive_context_new(BOOL Compressor)
|
||||
if (progressive)
|
||||
{
|
||||
progressive->Compressor = Compressor;
|
||||
|
||||
progressive->bufferPool = BufferPool_New(TRUE, (8192 + 32) * 3, 16);
|
||||
|
||||
progressive->cRects = 64;
|
||||
progressive->rects = (RFX_RECT*) malloc(progressive->cRects * sizeof(RFX_RECT));
|
||||
|
||||
if (!progressive->rects)
|
||||
return NULL;
|
||||
|
||||
progressive->cTiles = 64;
|
||||
progressive->tiles = (RFX_PROGRESSIVE_TILE*) malloc(progressive->cTiles * sizeof(RFX_PROGRESSIVE_TILE));
|
||||
|
||||
if (!progressive->tiles)
|
||||
return NULL;
|
||||
|
||||
progressive->cQuant = 8;
|
||||
progressive->quantVals = (RFX_COMPONENT_CODEC_QUANT*) malloc(progressive->cQuant * sizeof(RFX_COMPONENT_CODEC_QUANT));
|
||||
|
||||
if (!progressive->quantVals)
|
||||
return NULL;
|
||||
|
||||
progressive->cProgQuant = 8;
|
||||
progressive->quantProgVals = (RFX_PROGRESSIVE_CODEC_QUANT*) malloc(progressive->cProgQuant * sizeof(RFX_PROGRESSIVE_CODEC_QUANT));
|
||||
|
||||
if (!progressive->quantProgVals)
|
||||
return NULL;
|
||||
|
||||
ZeroMemory(&(progressive->quantProgValFull), sizeof(RFX_PROGRESSIVE_CODEC_QUANT));
|
||||
progressive->quantProgValFull.quality = 100;
|
||||
|
||||
progressive_context_reset(progressive);
|
||||
}
|
||||
|
||||
return progressive;
|
||||
@ -244,6 +720,13 @@ void progressive_context_free(PROGRESSIVE_CONTEXT* progressive)
|
||||
if (!progressive)
|
||||
return;
|
||||
|
||||
BufferPool_Free(progressive->bufferPool);
|
||||
|
||||
free(progressive->rects);
|
||||
free(progressive->tiles);
|
||||
free(progressive->quantVals);
|
||||
free(progressive->quantProgVals);
|
||||
|
||||
free(progressive);
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
#include <winpr/memory.h>
|
||||
#include <freerdp/utils/debug.h>
|
||||
#include <freerdp/codec/region.h>
|
||||
|
||||
/*
|
||||
@ -219,20 +220,20 @@ void region16_print(const REGION16 *region)
|
||||
int currentBandY = -1;
|
||||
|
||||
rects = region16_rects(region, &nbRects);
|
||||
fprintf(stderr, "nrects=%d", nbRects);
|
||||
DEBUG_WARN( "nrects=%d", nbRects);
|
||||
|
||||
for (i = 0; i < nbRects; i++, rects++)
|
||||
{
|
||||
if (rects->top != currentBandY)
|
||||
{
|
||||
currentBandY = rects->top;
|
||||
fprintf(stderr, "\nband %d: ", currentBandY);
|
||||
DEBUG_WARN( "\nband %d: ", currentBandY);
|
||||
}
|
||||
|
||||
fprintf(stderr, "(%d,%d-%d,%d)", rects->left, rects->top, rects->right, rects->bottom);
|
||||
DEBUG_WARN( "(%d,%d-%d,%d)", rects->left, rects->top, rects->right, rects->bottom);
|
||||
}
|
||||
|
||||
fprintf(stderr, "\n");
|
||||
DEBUG_WARN( "\n");
|
||||
}
|
||||
|
||||
void region16_copy_band_with_union(RECTANGLE_16 *dst,
|
||||
|
@ -330,8 +330,6 @@ RFX_CONTEXT* rfx_context_new(BOOL encoder)
|
||||
context->quantization_encode = rfx_quantization_encode;
|
||||
context->dwt_2d_decode = rfx_dwt_2d_decode;
|
||||
context->dwt_2d_encode = rfx_dwt_2d_encode;
|
||||
context->rlgr_decode = rfx_rlgr_decode;
|
||||
context->rlgr_encode = rfx_rlgr_encode;
|
||||
|
||||
RFX_INIT_SIMD(context);
|
||||
|
||||
@ -378,7 +376,7 @@ void rfx_context_free(RFX_CONTEXT* context)
|
||||
free(priv->tileWorkParams);
|
||||
|
||||
#ifdef WITH_PROFILER
|
||||
fprintf(stderr, "\nWARNING: Profiling results probably unusable with multithreaded RemoteFX codec!\n");
|
||||
DEBUG_WARN( "\nWARNING: Profiling results probably unusable with multithreaded RemoteFX codec!\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1428,7 +1426,7 @@ out_clean_tiles:
|
||||
free(message->tiles);
|
||||
region16_uninit(&tilesRegion);
|
||||
out_free_message:
|
||||
fprintf(stderr, "remoteFx error\n");
|
||||
DEBUG_WARN( "remoteFx error\n");
|
||||
region16_uninit(&rectsRegion);
|
||||
free(message);
|
||||
return 0;
|
||||
|
@ -103,7 +103,7 @@ static void rfx_decode_component(RFX_CONTEXT* context, const UINT32* quantizatio
|
||||
PROFILER_ENTER(context->priv->prof_rfx_decode_component);
|
||||
|
||||
PROFILER_ENTER(context->priv->prof_rfx_rlgr_decode);
|
||||
context->rlgr_decode(context->mode, data, size, buffer, 4096);
|
||||
rfx_rlgr_decode(data, size, buffer, 4096, (context->mode == RLGR1) ? 1 : 3);
|
||||
PROFILER_EXIT(context->priv->prof_rfx_rlgr_decode);
|
||||
|
||||
PROFILER_ENTER(context->priv->prof_rfx_differential_decode);
|
||||
|
@ -209,7 +209,7 @@ static void rfx_encode_component(RFX_CONTEXT* context, const UINT32* quantizatio
|
||||
PROFILER_EXIT(context->priv->prof_rfx_differential_encode);
|
||||
|
||||
PROFILER_ENTER(context->priv->prof_rfx_rlgr_encode);
|
||||
*size = context->rlgr_encode(context->mode, data, 4096, buffer, buffer_size);
|
||||
*size = rfx_rlgr_encode(context->mode, data, 4096, buffer, buffer_size);
|
||||
PROFILER_EXIT(context->priv->prof_rfx_rlgr_encode);
|
||||
|
||||
PROFILER_EXIT(context->priv->prof_rfx_encode_component);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user