# FreeRDP: A Remote Desktop Protocol Client\r
# FreeRDP Windows cmake build script\r
#\r
-# Copyright 2011 O.S. Systems Software Ltda.\r
-# Copyright 2011 Otavio Salvador <otavio@ossystems.com.br>\r
-# Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>\r
+# Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>\r
#\r
# Licensed under the Apache License, Version 2.0 (the "License");\r
# you may not use this file except in compliance with the License.\r
add_executable(wfreerdp WIN32 ${FREERDP_CLIENT_WINDOWS_SRCS})\r
\r
if(WITH_MONOLITHIC_BUILD)\r
- set(FREERDP_CLIENT_WINDOWS_LIBS ${FREERDP_CLIENT_X11_LIBS} freerdp)\r
+ set(FREERDP_CLIENT_WINDOWS_LIBS ${FREERDP_CLIENT_WINDOWS_LIBS} freerdp)\r
else()\r
- set(FREERDP_CLIENT_WINDOWS_LIBS ${FREERDP_CLIENT_X11_LIBS}\r
+ set(FREERDP_CLIENT_WINDOWS_LIBS ${FREERDP_CLIENT_WINDOWS_LIBS}\r
freerdp-core\r
freerdp-gdi\r
freerdp-codec\r
freerdp-utils)\r
endif()\r
\r
-target_link_libraries(wfreerdp ${FREERDP_CLIENT_X11_LIBS})\r
+target_link_libraries(wfreerdp ${FREERDP_CLIENT_WINDOWS_LIBS})\r
install(TARGETS wfreerdp DESTINATION ${CMAKE_INSTALL_BINDIR})\r
}
void wf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
- uint8* data, int width, int height, int bpp, int length, boolean compressed)
+ uint8* data, int width, int height, int bpp, int length, boolean compressed, int codec_id)
{
uint16 size;
return;
stream_set_pos(channel->receive_data, 0);
- stream_check_size(channel->receive_data, channel->dvc_total_length);
+ stream_check_size(channel->receive_data, (int) channel->dvc_total_length);
stream_write(channel->receive_data, stream_get_tail(s), length);
}
return;
}
stream_write(channel->receive_data, stream_get_tail(s), length);
- if (stream_get_length(channel->receive_data) >= channel->dvc_total_length)
+ if (stream_get_length(channel->receive_data) >= (int) channel->dvc_total_length)
{
wts_queue_receive_data(channel, stream_get_head(channel->receive_data), channel->dvc_total_length);
channel->dvc_total_length = 0;
wts_write_drdynvc_header(s, CREATE_REQUEST_PDU, ChannelId);
len = strlen(ChannelName) + 1;
- stream_check_size(s, len);
+ stream_check_size(s, (int) len);
stream_write(s, ChannelName, len);
}
void rdp_write_frame_acknowledge_capability_set(STREAM* s, rdpSettings* settings)
{
uint8* header;
+ uint32 frame_acknowledge;
header = rdp_capability_set_start(s);
- stream_write_uint32(s, settings->frame_acknowledge); /* (4 bytes) */
+ frame_acknowledge = settings->frame_acknowledge;
+ stream_write_uint32(s, frame_acknowledge); /* (4 bytes) */
rdp_capability_set_finish(s, header, CAPSET_TYPE_FRAME_ACKNOWLEDGE);
}
void freerdp_time_zone_detect(TIME_ZONE_INFO* clientTimeZone)
{
time_t t;
- sint32 sbias;
TIME_ZONE_ENTRY* tz;
struct tm* local_time;
#ifdef HAVE_TM_GMTOFF
if (local_time->tm_gmtoff >= 0)
- {
- sbias = local_time->tm_gmtoff / 60;
- clientTimeZone->bias = (uint32) sbias;
- }
+ clientTimeZone->bias = (uint32) (local_time->tm_gmtoff / 60);
else
- {
- sbias = local_time->tm_gmtoff / 60;
- clientTimeZone->bias = (uint32) (1440 + sbias);
- }
+ clientTimeZone->bias = (uint32) (1440 + (sint32) (local_time->tm_gmtoff / 60));
#elif sun
if (local_time->tm_isdst > 0)
clientTimeZone->bias = (uint32) (altzone / 3600);
while (ready)
{
freerdp_thread_wait(thread);
+
if (freerdp_thread_is_stopped(thread))
break;
stream_set_pos(s, 0);
+
if (WTSVirtualChannelRead(audin->audin_channel, 0, stream_get_head(s),
stream_get_size(s), &bytes_returned) == false)
{
if (bytes_returned == 0)
break;
- stream_check_size(s, bytes_returned);
+
+ stream_check_size(s, (int) bytes_returned);
+
if (WTSVirtualChannelRead(audin->audin_channel, 0, stream_get_head(s),
stream_get_size(s), &bytes_returned) == false)
break;
if (rdpsnd->context.num_client_formats > 0)
{
rdpsnd->context.client_formats = xzalloc(rdpsnd->context.num_client_formats * sizeof(rdpsndFormat));
+
for (i = 0; i < rdpsnd->context.num_client_formats; i++)
{
if (stream_get_left(s) < 18)
stream_read_uint16(s, rdpsnd->context.client_formats[i].nBlockAlign);
stream_read_uint16(s, rdpsnd->context.client_formats[i].wBitsPerSample);
stream_read_uint16(s, rdpsnd->context.client_formats[i].cbSize);
+
if (rdpsnd->context.client_formats[i].cbSize > 0)
{
stream_seek(s, rdpsnd->context.client_formats[i].cbSize);
return true;
}
-
-
static void* rdpsnd_server_thread_func(void* arg)
{
void* fd;
while (1)
{
freerdp_thread_wait(thread);
+
if (freerdp_thread_is_stopped(thread))
break;
stream_set_pos(s, 0);
+
if (WTSVirtualChannelRead(rdpsnd->rdpsnd_channel, 0, stream_get_head(s),
stream_get_size(s), &bytes_returned) == false)
{
if (bytes_returned == 0)
break;
- stream_check_size(s, bytes_returned);
+
+ stream_check_size(s, (int) bytes_returned);
+
if (WTSVirtualChannelRead(rdpsnd->rdpsnd_channel, 0, stream_get_head(s),
stream_get_size(s), &bytes_returned) == false)
break;
stream_read_uint8(s, msgType);
stream_seek_uint8(s); /* bPad */
stream_read_uint16(s, BodySize);
- if (BodySize + 4 > bytes_returned)
+
+ if (BodySize + 4 > (int) bytes_returned)
continue;
- switch (msgType) {
+ switch (msgType)
+ {
case SNDC_FORMATS:
if (rdpsnd_server_recv_formats(rdpsnd, s))
{
rdpsnd_server* rdpsnd = (rdpsnd_server*) context;
rdpsnd->rdpsnd_channel = WTSVirtualChannelOpenEx(context->vcm, "rdpsnd", 0);
+
if (rdpsnd->rdpsnd_channel != NULL)
{
rdpsnd->rdpsnd_pdu = stream_new(4096);
context->selected_client_format = client_format_index;
format = &context->client_formats[client_format_index];
+
if (format->wFormatTag == 0x11)
{
bs = (format->nBlockAlign - 4 * format->nChannels) * 4;
{
rdpsnd->out_frames = 0x4000 / rdpsnd->src_bytes_per_frame;
}
+
if (format->nSamplesPerSec != context->src_format.nSamplesPerSec)
{
rdpsnd->out_frames = (rdpsnd->out_frames * context->src_format.nSamplesPerSec + format->nSamplesPerSec - 100) / format->nSamplesPerSec;
rdpsnd->out_pending_frames = 0;
out_buffer_size = rdpsnd->out_frames * rdpsnd->src_bytes_per_frame;
+
if (rdpsnd->out_buffer_size < out_buffer_size)
{
rdpsnd->out_buffer = xrealloc(rdpsnd->out_buffer, out_buffer_size);