libfreerdp-core: added debug output for surface commands

This commit is contained in:
Marc-André Moreau 2013-10-08 20:40:58 -04:00
parent ac2444ab50
commit a0c0d7b998
6 changed files with 30 additions and 2 deletions

View File

@ -23,6 +23,7 @@
typedef struct rdp_update rdpUpdate; typedef struct rdp_update rdpUpdate;
#include <winpr/crt.h> #include <winpr/crt.h>
#include <winpr/wlog.h>
#include <winpr/synch.h> #include <winpr/synch.h>
#include <winpr/thread.h> #include <winpr/thread.h>
#include <winpr/stream.h> #include <winpr/stream.h>
@ -199,6 +200,8 @@ struct rdp_update
/* internal */ /* internal */
wLog* log;
BOOL dump_rfx; BOOL dump_rfx;
BOOL play_rfx; BOOL play_rfx;
rdpPcap* pcap_rfx; rdpPcap* pcap_rfx;

View File

@ -65,6 +65,9 @@ static void nsc_decode(NSC_CONTEXT* context)
rw = ROUND_UP_TO(context->width, 8); rw = ROUND_UP_TO(context->width, 8);
shift = context->nsc_stream.ColorLossLevel - 1; /* colorloss recovery + YCoCg shift */ shift = context->nsc_stream.ColorLossLevel - 1; /* colorloss recovery + YCoCg shift */
WLog_Print(context->priv->log, WLOG_DEBUG, "NscDecode: width: %d height: %d ChromaSubSamplingLevel: %d",
context->width, context->height, context->nsc_stream.ChromaSubSamplingLevel);
for (y = 0; y < context->height; y++) for (y = 0; y < context->height; y++)
{ {
if (context->nsc_stream.ChromaSubSamplingLevel > 0) if (context->nsc_stream.ChromaSubSamplingLevel > 0)
@ -257,6 +260,11 @@ NSC_CONTEXT* nsc_context_new(void)
context = (NSC_CONTEXT*) calloc(1, sizeof(NSC_CONTEXT)); context = (NSC_CONTEXT*) calloc(1, sizeof(NSC_CONTEXT));
context->priv = (NSC_CONTEXT_PRIV*) calloc(1, sizeof(NSC_CONTEXT_PRIV)); context->priv = (NSC_CONTEXT_PRIV*) calloc(1, sizeof(NSC_CONTEXT_PRIV));
WLog_Init();
context->priv->log = WLog_Get("com.freerdp.codec.nsc");
WLog_OpenAppender(context->priv->log);
for (i = 0; i < 5; ++i) for (i = 0; i < 5; ++i)
{ {
context->priv->PlaneBuffers[i] = NULL; context->priv->PlaneBuffers[i] = NULL;

View File

@ -26,6 +26,7 @@
#endif #endif
#include <winpr/crt.h> #include <winpr/crt.h>
#include <winpr/wlog.h>
#include <winpr/collections.h> #include <winpr/collections.h>
#include <freerdp/utils/debug.h> #include <freerdp/utils/debug.h>
@ -36,6 +37,8 @@
struct _NSC_CONTEXT_PRIV struct _NSC_CONTEXT_PRIV
{ {
wLog* log;
wBufferPool* PlanePool; wBufferPool* PlanePool;
BYTE* PlaneBuffers[5]; /* Decompressed Plane Buffers in the respective order */ BYTE* PlaneBuffers[5]; /* Decompressed Plane Buffers in the respective order */

View File

@ -365,8 +365,6 @@ void rfx_context_free(RFX_CONTEXT* context)
BufferPool_Free(context->priv->BufferPool); BufferPool_Free(context->priv->BufferPool);
WLog_Uninit();
free(context->priv); free(context->priv);
free(context); free(context);
} }

View File

@ -53,6 +53,12 @@ static int update_recv_surfcmd_surface_bits(rdpUpdate* update, wStream* s, UINT3
Stream_SetPosition(s, pos); Stream_SetPosition(s, pos);
*length = 20 + cmd->bitmapDataLength; *length = 20 + cmd->bitmapDataLength;
WLog_Print(update->log, WLOG_DEBUG,
"SurfaceBits: destLeft: %d destTop: %d destRight: %d destBottom: %d "
"bpp: %d codecId: %d width: %d height: %d bitmapDataLength: %d",
cmd->destLeft, cmd->destTop, cmd->destRight, cmd->destBottom,
cmd->bpp, cmd->codecID, cmd->width, cmd->height, cmd->bitmapDataLength);
IFCALL(update->SurfaceBits, update->context, cmd); IFCALL(update->SurfaceBits, update->context, cmd);
return 0; return 0;
@ -68,6 +74,10 @@ static int update_recv_surfcmd_frame_marker(rdpUpdate* update, wStream* s, UINT3
Stream_Read_UINT16(s, marker->frameAction); Stream_Read_UINT16(s, marker->frameAction);
Stream_Read_UINT32(s, marker->frameId); Stream_Read_UINT32(s, marker->frameId);
WLog_Print(update->log, WLOG_DEBUG, "SurfaceFrameMarker: action: %s (%d) id: %d",
(!marker->frameAction) ? "Begin" : "End",
marker->frameAction, marker->frameId);
IFCALL(update->SurfaceFrameMarker, update->context, marker); IFCALL(update->SurfaceFrameMarker, update->context, marker);
*length = 6; *length = 6;

View File

@ -1556,6 +1556,12 @@ rdpUpdate* update_new(rdpRdp* rdp)
ZeroMemory(update, sizeof(rdpUpdate)); ZeroMemory(update, sizeof(rdpUpdate));
WLog_Init();
update->log = WLog_Get("com.freerdp.update");
WLog_OpenAppender(update->log);
//WLog_SetLogLevel(update->log, WLOG_DEBUG);
update->bitmap_update.count = 64; update->bitmap_update.count = 64;
update->bitmap_update.rectangles = (BITMAP_DATA*) malloc(sizeof(BITMAP_DATA) * update->bitmap_update.count); update->bitmap_update.rectangles = (BITMAP_DATA*) malloc(sizeof(BITMAP_DATA) * update->bitmap_update.count);
ZeroMemory(update->bitmap_update.rectangles, sizeof(BITMAP_DATA) * update->bitmap_update.count); ZeroMemory(update->bitmap_update.rectangles, sizeof(BITMAP_DATA) * update->bitmap_update.count);