dfi->primary->Blit(dfi->primary, dfi->surface, &(dfi->update_rect), dfi->update_rect.x, dfi->update_rect.y);
}
-void df_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_command)
-{
-#if 0
- printf("df_surface_bits: destLeft %d destTop %d destRight %d destBottom %d "
- "bpp %d codecID %d width %d height %d length %d\n",
- surface_bits_command->destLeft, surface_bits_command->destTop,
- surface_bits_command->destRight, surface_bits_command->destBottom,
- surface_bits_command->bpp, surface_bits_command->codecID,
- surface_bits_command->width, surface_bits_command->height,
- surface_bits_command->bitmapDataLength);
-#endif
-}
-
boolean df_get_fds(freerdp* instance, void** rfds, int* rcount, void** wfds, int* wcount)
{
dfInfo* dfi;
instance->update->BeginPaint = df_begin_paint;
instance->update->EndPaint = df_end_paint;
- instance->update->SurfaceBits = df_surface_bits;
df_keyboard_init();
void* wfds[32];
fd_set rfds_set;
fd_set wfds_set;
+ dfInfo* dfi;
rdpChanMan* chanman;
memset(rfds, 0, sizeof(rfds));
memset(wfds, 0, sizeof(wfds));
+ dfi = GET_DFI(instance);
chanman = GET_CHANMAN(instance);
instance->Connect(instance);
freerdp_chanman_close(chanman, instance);
freerdp_chanman_free(chanman);
+ xfree(dfi);
+ gdi_free(instance);
freerdp_free(instance);
return 0;
set(FREERDP_GDI_SRCS
color.c
color.h
- decode.c
- decode.h
gdi_8bpp.c
gdi_8bpp.h
gdi_16bpp.c
add_library(freerdp-gdi SHARED ${FREERDP_GDI_SRCS})
target_link_libraries(freerdp-gdi freerdp-cache)
+target_link_libraries(freerdp-gdi freerdp-rfx)
set_target_properties(freerdp-gdi PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION})
+++ /dev/null
-/**
- * FreeRDP: A Remote Desktop Protocol Client
- * GDI RemoteFX Decoder
- *
- * Copyright 2011 Marc-Andre Moreau <marcandre.moreau@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.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <freerdp/freerdp.h>
-#include <freerdp/utils/stream.h>
-
-#include "gdi.h"
-#include "gdi_bitmap.h"
-#include "gdi_region.h"
-#include "gdi_clipping.h"
-
-#include "decode.h"
-
-void gdi_decode_frame(GDI *gdi, int x, int y, uint8 * data, uint32 length)
-{
-
-}
-
-void gdi_decode_data(GDI *gdi, uint8 * data, int data_size)
-{
-
-}
+++ /dev/null
-/**
- * FreeRDP: A Remote Desktop Protocol Client
- * GDI RemoteFX Decoder
- *
- * Copyright 2011 Marc-Andre Moreau <marcandre.moreau@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 __DECODE_H
-#define __DECODE_H
-
-#include <freerdp/freerdp.h>
-
-#include "gdi.h"
-
-void gdi_decode_frame(GDI *gdi, int x, int y, uint8 * data, uint32 length);
-void gdi_decode_data(GDI *gdi, uint8 * data, int data_size);
-
-#endif /* __DECODE_H */
#include <string.h>
#include <stdlib.h>
#include <freerdp/freerdp.h>
+#include <freerdp/constants.h>
+#include <freerdp/rfx.h>
#include "color.h"
-#include "decode.h"
#include "gdi_dc.h"
#include "gdi_pen.h"
brush_put(gdi->cache->brush, cache_brush->index, cache_brush->data, cache_brush->bpp);
}
+void gdi_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_command)
+{
+ GDI* gdi = GET_GDI(update);
+ RFX_CONTEXT* context = (RFX_CONTEXT*)gdi->rfx_context;
+ RFX_MESSAGE* message;
+ STREAM* s;
+
+ DEBUG_GDI("gdi_surface_bits: destLeft %d destTop %d destRight %d destBottom %d "
+ "bpp %d codecID %d width %d height %d length %d",
+ surface_bits_command->destLeft, surface_bits_command->destTop,
+ surface_bits_command->destRight, surface_bits_command->destBottom,
+ surface_bits_command->bpp, surface_bits_command->codecID,
+ surface_bits_command->width, surface_bits_command->height,
+ surface_bits_command->bitmapDataLength);
+
+ if (surface_bits_command->codecID == CODEC_ID_REMOTEFX)
+ {
+ s = stream_new(0);
+ stream_attach(s, surface_bits_command->bitmapData, surface_bits_command->bitmapDataLength);
+
+ message = rfx_process_message(context, s);
+ rfx_message_free(context, message);
+
+ stream_detach(s);
+ stream_free(s);
+ }
+ else
+ {
+ printf("Unsupported codecID %d\n", surface_bits_command->codecID);
+ }
+}
+
/**
* Register GDI callbacks with libfreerdp-core.
* @param inst current instance
update->CacheBitmapV2 = gdi_cache_bitmap_v2;
update->CacheColorTable = gdi_cache_color_table;
update->CacheBrush = gdi_cache_brush;
+
+ update->SurfaceBits = gdi_surface_bits;
}
/**
gdi->cache = cache_new(instance->settings);
+ gdi->rfx_context = rfx_context_new();
+
return 0;
}
{
gdi_bitmap_free(gdi->primary);
gdi_DeleteDC(gdi->hdc);
+ rfx_context_free((RFX_CONTEXT*)gdi->rfx_context);
free(gdi->clrconv);
free(gdi);
}