diff --git a/include/freerdp/update.h b/include/freerdp/update.h index a6aa8caa9..b311e07e5 100644 --- a/include/freerdp/update.h +++ b/include/freerdp/update.h @@ -23,6 +23,7 @@ typedef struct rdp_update rdpUpdate; #include +#include #include #include #include @@ -199,6 +200,8 @@ struct rdp_update /* internal */ + wLog* log; + BOOL dump_rfx; BOOL play_rfx; rdpPcap* pcap_rfx; diff --git a/libfreerdp/codec/nsc.c b/libfreerdp/codec/nsc.c index b869b028f..f04bac779 100644 --- a/libfreerdp/codec/nsc.c +++ b/libfreerdp/codec/nsc.c @@ -65,6 +65,9 @@ static void nsc_decode(NSC_CONTEXT* context) rw = ROUND_UP_TO(context->width, 8); 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++) { 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->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) { context->priv->PlaneBuffers[i] = NULL; diff --git a/libfreerdp/codec/nsc_types.h b/libfreerdp/codec/nsc_types.h index 0964167a2..fe5cfd2f6 100644 --- a/libfreerdp/codec/nsc_types.h +++ b/libfreerdp/codec/nsc_types.h @@ -26,6 +26,7 @@ #endif #include +#include #include #include @@ -36,6 +37,8 @@ struct _NSC_CONTEXT_PRIV { + wLog* log; + wBufferPool* PlanePool; BYTE* PlaneBuffers[5]; /* Decompressed Plane Buffers in the respective order */ diff --git a/libfreerdp/codec/rfx.c b/libfreerdp/codec/rfx.c index 2c1024598..f8e736d88 100644 --- a/libfreerdp/codec/rfx.c +++ b/libfreerdp/codec/rfx.c @@ -365,8 +365,6 @@ void rfx_context_free(RFX_CONTEXT* context) BufferPool_Free(context->priv->BufferPool); - WLog_Uninit(); - free(context->priv); free(context); } diff --git a/libfreerdp/core/surface.c b/libfreerdp/core/surface.c index 7d0fb229a..93f659607 100644 --- a/libfreerdp/core/surface.c +++ b/libfreerdp/core/surface.c @@ -53,6 +53,12 @@ static int update_recv_surfcmd_surface_bits(rdpUpdate* update, wStream* s, UINT3 Stream_SetPosition(s, pos); *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); 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_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); *length = 6; diff --git a/libfreerdp/core/update.c b/libfreerdp/core/update.c index de7a4468e..126439cac 100644 --- a/libfreerdp/core/update.c +++ b/libfreerdp/core/update.c @@ -1556,6 +1556,12 @@ rdpUpdate* update_new(rdpRdp* rdp) 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.rectangles = (BITMAP_DATA*) malloc(sizeof(BITMAP_DATA) * update->bitmap_update.count); ZeroMemory(update->bitmap_update.rectangles, sizeof(BITMAP_DATA) * update->bitmap_update.count);