mfreerdp: fix build on Mac OS X

This commit is contained in:
Marc-André Moreau 2013-03-29 00:15:29 -04:00
parent 3b0afd8b16
commit a318f8f129
5 changed files with 66 additions and 95 deletions

View File

@ -778,7 +778,7 @@ MRDPRailView* g_mrdpRailView;
apple_to_windowMove(&r, &windowMove); apple_to_windowMove(&r, &windowMove);
windowMove.windowId = self->savedWindowId; windowMove.windowId = self->savedWindowId;
mac_send_rail_client_event(self->context->channels, RDP_EVENT_TYPE_RAIL_CLIENT_WINDOW_MOVE, &windowMove); mac_send_rail_client_event(self->context->channels, RailChannel_ClientWindowMove, &windowMove);
} }
/** /**
@ -800,7 +800,7 @@ MRDPRailView* g_mrdpRailView;
apple_to_windowMove(&r, &windowMove); apple_to_windowMove(&r, &windowMove);
windowMove.windowId = self->savedWindowId; windowMove.windowId = self->savedWindowId;
mac_send_rail_client_event(self->context->channels, RDP_EVENT_TYPE_RAIL_CLIENT_WINDOW_MOVE, &windowMove); mac_send_rail_client_event(self->context->channels, RailChannel_ClientWindowMove, &windowMove);
} }
/** /**
@ -923,7 +923,7 @@ void mac_rail_send_activate(int window_id)
activate.windowId = window_id; activate.windowId = window_id;
activate.enabled = 1; activate.enabled = 1;
mac_send_rail_client_event(g_mrdpRailView->context->channels, RDP_EVENT_TYPE_RAIL_CLIENT_ACTIVATE, &activate); mac_send_rail_client_event(g_mrdpRailView->context->channels, RailChannel_ClientActivate, &activate);
} }
@end @end

View File

@ -111,7 +111,7 @@ void mf_Pointer_SetNull(rdpContext* context);
void mf_Pointer_SetDefault(rdpContext* context); void mf_Pointer_SetDefault(rdpContext* context);
int rdp_connect(void); int rdp_connect(void);
BOOL mac_pre_connect(freerdp* instance); BOOL mac_pre_connect(freerdp* instance);
BOOL mac_post_connect(freerdp* instance); BOOL mac_post_connect(freerdp* instance);
BOOL mac_authenticate(freerdp* instance, char** username, char** password, char** domain); BOOL mac_authenticate(freerdp* instance, char** username, char** password, char** domain);
void mac_context_new(freerdp* instance, rdpContext* context); void mac_context_new(freerdp* instance, rdpContext* context);
void mac_context_free(freerdp* instance, rdpContext* context); void mac_context_free(freerdp* instance, rdpContext* context);
@ -126,7 +126,7 @@ int register_fds(int* fds, int count, void* instance);
int invoke_draw_rect(rdpContext* context); int invoke_draw_rect(rdpContext* context);
int process_plugin_args(rdpSettings* settings, const char* name, RDP_PLUGIN_DATA* plugin_data, void* user_data); int process_plugin_args(rdpSettings* settings, const char* name, RDP_PLUGIN_DATA* plugin_data, void* user_data);
int receive_channel_data(freerdp* instance, int chan_id, BYTE* data, int size, int flags, int total_size); int receive_channel_data(freerdp* instance, int chan_id, BYTE* data, int size, int flags, int total_size);
void process_cliprdr_event(freerdp* instance, RDP_EVENT* event); void process_cliprdr_event(freerdp* instance, wMessage* event);
void cliprdr_process_cb_format_list_event(freerdp* instance, RDP_CB_FORMAT_LIST_EVENT* event); void cliprdr_process_cb_format_list_event(freerdp* instance, RDP_CB_FORMAT_LIST_EVENT* event);
void cliprdr_send_data_request(freerdp* instance, UINT32 format); void cliprdr_send_data_request(freerdp* instance, UINT32 format);
void cliprdr_process_cb_monitor_ready_event(freerdp* inst); void cliprdr_process_cb_monitor_ready_event(freerdp* inst);
@ -135,7 +135,7 @@ void cliprdr_process_text(freerdp* instance, BYTE* data, int len);
void cliprdr_send_supported_format_list(freerdp* instance); void cliprdr_send_supported_format_list(freerdp* instance);
int register_channel_fds(int* fds, int count, void* instance); int register_channel_fds(int* fds, int count, void* instance);
void mac_process_rail_event(freerdp* instance, RDP_EVENT* event); void mac_process_rail_event(freerdp* instance, wMessage* event);
void mac_rail_register_callbacks(freerdp* instance, rdpRail* rail); void mac_rail_register_callbacks(freerdp* instance, rdpRail* rail);
void mac_rail_CreateWindow(rdpRail* rail, rdpWindow* window); void mac_rail_CreateWindow(rdpRail* rail, rdpWindow* window);
void mac_rail_MoveWindow(rdpRail* rail, rdpWindow* window); void mac_rail_MoveWindow(rdpRail* rail, rdpWindow* window);
@ -145,14 +145,14 @@ void mac_rail_SetWindowIcon(rdpRail* rail, rdpWindow* window, rdpIcon* icon);
void mac_rail_SetWindowRects(rdpRail* rail, rdpWindow* window); void mac_rail_SetWindowRects(rdpRail* rail, rdpWindow* window);
void mac_rail_SetWindowVisibilityRects(rdpRail* rail, rdpWindow* window); void mac_rail_SetWindowVisibilityRects(rdpRail* rail, rdpWindow* window);
void mac_rail_DestroyWindow(rdpRail* rail, rdpWindow* window); void mac_rail_DestroyWindow(rdpRail* rail, rdpWindow* window);
void mac_process_rail_get_sysparams_event(rdpChannels* channels, RDP_EVENT* event); void mac_process_rail_get_sysparams_event(rdpChannels* channels, wMessage* event);
void mac_send_rail_client_event(rdpChannels* channels, UINT16 event_type, void* param); void mac_send_rail_client_event(rdpChannels* channels, UINT16 event_type, void* param);
void mac_on_free_rail_client_event(RDP_EVENT* event); void mac_on_free_rail_client_event(wMessage* event);
void mac_process_rail_server_sysparam_event(rdpChannels* channels, RDP_EVENT* event); void mac_process_rail_server_sysparam_event(rdpChannels* channels, wMessage* event);
void mac_process_rail_exec_result_event(rdpChannels* channels, RDP_EVENT* event); void mac_process_rail_exec_result_event(rdpChannels* channels, wMessage* event);
void mac_rail_enable_remoteapp_mode(void); void mac_rail_enable_remoteapp_mode(void);
void mac_process_rail_server_minmaxinfo_event(rdpChannels* channels, RDP_EVENT* event); void mac_process_rail_server_minmaxinfo_event(rdpChannels* channels, wMessage* event);
void mac_process_rail_server_localmovesize_event(freerdp* instance, RDP_EVENT* event); void mac_process_rail_server_localmovesize_event(freerdp* instance, wMessage* event);
void apple_center_window(NSRect* r); void apple_center_window(NSRect* r);
void apple_to_windowMove(NSRect* r, RAIL_WINDOW_MOVE_ORDER * windowMove); void apple_to_windowMove(NSRect* r, RAIL_WINDOW_MOVE_ORDER * windowMove);

View File

@ -1323,7 +1323,7 @@ void skt_activity_cb(CFSocketRef s, CFSocketCallBackType callbackType,
void channel_activity_cb(CFSocketRef s, CFSocketCallBackType callbackType, void channel_activity_cb(CFSocketRef s, CFSocketCallBackType callbackType,
CFDataRef address, const void* data, void* info) CFDataRef address, const void* data, void* info)
{ {
RDP_EVENT* event; wMessage* event;
freerdp* instance = (freerdp*) info; freerdp* instance = (freerdp*) info;
freerdp_channels_check_fds(instance->context->channels, instance); freerdp_channels_check_fds(instance->context->channels, instance);
@ -1331,7 +1331,7 @@ void channel_activity_cb(CFSocketRef s, CFSocketCallBackType callbackType,
if (event) if (event)
{ {
switch (event->event_class) switch (GetMessageClass(event->id))
{ {
case RailChannel_Class: case RailChannel_Class:
mac_process_rail_event(instance, event); mac_process_rail_event(instance, event);
@ -1432,7 +1432,7 @@ void cliprdr_process_cb_data_request_event(freerdp* instance)
NSArray* types; NSArray* types;
RDP_CB_DATA_RESPONSE_EVENT* event; RDP_CB_DATA_RESPONSE_EVENT* event;
event = (RDP_CB_DATA_RESPONSE_EVENT*) freerdp_event_new(RDP_EVENT_CLASS_CLIPRDR, RDP_EVENT_TYPE_CB_DATA_RESPONSE, NULL, NULL); event = (RDP_CB_DATA_RESPONSE_EVENT*) freerdp_event_new(CliprdrChannel_Class, CliprdrChannel_DataResponse, NULL, NULL);
types = [NSArray arrayWithObject:NSStringPboardType]; types = [NSArray arrayWithObject:NSStringPboardType];
NSString* str = [g_mrdpview->pasteboard_rd availableTypeFromArray:types]; NSString* str = [g_mrdpview->pasteboard_rd availableTypeFromArray:types];
@ -1451,17 +1451,17 @@ void cliprdr_process_cb_data_request_event(freerdp* instance)
event->size = len; event->size = len;
} }
freerdp_channels_send_event(instance->context->channels, (RDP_EVENT*) event); freerdp_channels_send_event(instance->context->channels, (wMessage*) event);
} }
void cliprdr_send_data_request(freerdp* instance, UINT32 format) void cliprdr_send_data_request(freerdp* instance, UINT32 format)
{ {
RDP_CB_DATA_REQUEST_EVENT* event; RDP_CB_DATA_REQUEST_EVENT* event;
event = (RDP_CB_DATA_REQUEST_EVENT*) freerdp_event_new(RDP_EVENT_CLASS_CLIPRDR, RDP_EVENT_TYPE_CB_DATA_REQUEST, NULL, NULL); event = (RDP_CB_DATA_REQUEST_EVENT*) freerdp_event_new(CliprdrChannel_Class, CliprdrChannel_DataRequest, NULL, NULL);
event->format = format; event->format = format;
freerdp_channels_send_event(instance->context->channels, (RDP_EVENT*) event); freerdp_channels_send_event(instance->context->channels, (wMessage*) event);
} }
/** /**
@ -1489,10 +1489,10 @@ void cliprdr_process_cb_data_response_event(freerdp* instance, RDP_CB_DATA_RESPO
void cliprdr_process_cb_monitor_ready_event(freerdp* instance) void cliprdr_process_cb_monitor_ready_event(freerdp* instance)
{ {
RDP_EVENT* event; wMessage* event;
RDP_CB_FORMAT_LIST_EVENT* format_list_event; RDP_CB_FORMAT_LIST_EVENT* format_list_event;
event = freerdp_event_new(RDP_EVENT_CLASS_CLIPRDR, RDP_EVENT_TYPE_CB_FORMAT_LIST, NULL, NULL); event = freerdp_event_new(CliprdrChannel_Class, CliprdrChannel_FormatList, NULL, NULL);
format_list_event = (RDP_CB_FORMAT_LIST_EVENT*) event; format_list_event = (RDP_CB_FORMAT_LIST_EVENT*) event;
format_list_event->num_formats = 0; format_list_event->num_formats = 0;
@ -1551,18 +1551,18 @@ void cliprdr_process_cb_format_list_event(freerdp* instance, RDP_CB_FORMAT_LIST_
} }
} }
void process_cliprdr_event(freerdp* instance, RDP_EVENT* event) void process_cliprdr_event(freerdp* instance, wMessage* event)
{ {
if (event) if (event)
{ {
switch (event->event_type) switch (GetMessageType(event->id))
{ {
/* /*
* Monitor Ready PDU is sent by server to indicate that it has been * Monitor Ready PDU is sent by server to indicate that it has been
* initialized and is ready. This PDU is transmitted by the server after it has sent * initialized and is ready. This PDU is transmitted by the server after it has sent
* Clipboard Capabilities PDU * Clipboard Capabilities PDU
*/ */
case RDP_EVENT_TYPE_CB_MONITOR_READY: case CliprdrChannel_MonitorReady:
cliprdr_process_cb_monitor_ready_event(instance); cliprdr_process_cb_monitor_ready_event(instance);
break; break;
@ -1572,7 +1572,7 @@ void process_cliprdr_event(freerdp* instance, RDP_EVENT* event)
* contains the Clipboard Format ID and name pairs of the new Clipboard * contains the Clipboard Format ID and name pairs of the new Clipboard
* Formats on the clipboard * Formats on the clipboard
*/ */
case RDP_EVENT_TYPE_CB_FORMAT_LIST: case CliprdrChannel_FormatList:
cliprdr_process_cb_format_list_event(instance, (RDP_CB_FORMAT_LIST_EVENT*) event); cliprdr_process_cb_format_list_event(instance, (RDP_CB_FORMAT_LIST_EVENT*) event);
break; break;
@ -1581,7 +1581,7 @@ void process_cliprdr_event(freerdp* instance, RDP_EVENT* event)
* It is used to request the data for one of the formats that was listed in the * It is used to request the data for one of the formats that was listed in the
* Format List PDU * Format List PDU
*/ */
case RDP_EVENT_TYPE_CB_DATA_REQUEST: case CliprdrChannel_DataRequest:
cliprdr_process_cb_data_request_event(instance); cliprdr_process_cb_data_request_event(instance);
break; break;
@ -1591,12 +1591,12 @@ void process_cliprdr_event(freerdp* instance, RDP_EVENT* event)
* was successful. If the processing was successful, the Format Data Response PDU * was successful. If the processing was successful, the Format Data Response PDU
* includes the contents of the requested clipboard data * includes the contents of the requested clipboard data
*/ */
case RDP_EVENT_TYPE_CB_DATA_RESPONSE: case CliprdrChannel_DataResponse:
cliprdr_process_cb_data_response_event(instance, (RDP_CB_DATA_RESPONSE_EVENT*) event); cliprdr_process_cb_data_response_event(instance, (RDP_CB_DATA_RESPONSE_EVENT*) event);
break; break;
default: default:
printf("process_cliprdr_event: unknown event type %d\n", event->event_type); printf("process_cliprdr_event: unknown event type %d\n", GetMessageType(event->id));
break; break;
} }
@ -1608,13 +1608,13 @@ void cliprdr_send_supported_format_list(freerdp* instance)
{ {
RDP_CB_FORMAT_LIST_EVENT* event; RDP_CB_FORMAT_LIST_EVENT* event;
event = (RDP_CB_FORMAT_LIST_EVENT*) freerdp_event_new(RDP_EVENT_CLASS_CLIPRDR, RDP_EVENT_TYPE_CB_FORMAT_LIST, NULL, NULL); event = (RDP_CB_FORMAT_LIST_EVENT*) freerdp_event_new(CliprdrChannel_Class, CliprdrChannel_FormatList, NULL, NULL);
event->formats = (UINT32*) malloc(sizeof(UINT32) * 1); event->formats = (UINT32*) malloc(sizeof(UINT32) * 1);
event->num_formats = 1; event->num_formats = 1;
event->formats[0] = CB_FORMAT_UNICODETEXT; event->formats[0] = CB_FORMAT_UNICODETEXT;
freerdp_channels_send_event(instance->context->channels, (RDP_EVENT*) event); freerdp_channels_send_event(instance->context->channels, (wMessage*) event);
} }
/**************************************************************************************** /****************************************************************************************
@ -1625,35 +1625,35 @@ void cliprdr_send_supported_format_list(freerdp* instance)
* * * *
****************************************************************************************/ ****************************************************************************************/
void mac_process_rail_event(freerdp* instance, RDP_EVENT* event) void mac_process_rail_event(freerdp* instance, wMessage* event)
{ {
switch (event->event_type) switch (GetMessageType(event->id))
{ {
case RDP_EVENT_TYPE_RAIL_CHANNEL_GET_SYSPARAMS: case RailChannel_GetSystemParam:
mac_process_rail_get_sysparams_event(instance->context->channels, event); mac_process_rail_get_sysparams_event(instance->context->channels, event);
break; break;
case RDP_EVENT_TYPE_RAIL_CHANNEL_EXEC_RESULTS: case RailChannel_ServerExecuteResult:
mac_process_rail_exec_result_event(instance->context->channels, event); mac_process_rail_exec_result_event(instance->context->channels, event);
break; break;
case RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_SYSPARAM: case RailChannel_ServerSystemParam:
mac_process_rail_server_sysparam_event(instance->context->channels, event); mac_process_rail_server_sysparam_event(instance->context->channels, event);
break; break;
case RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_MINMAXINFO: case RailChannel_ServerMinMaxInfo:
mac_process_rail_server_minmaxinfo_event(instance->context->channels, event); mac_process_rail_server_minmaxinfo_event(instance->context->channels, event);
break; break;
case RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_LOCALMOVESIZE: case RailChannel_ServerLocalMoveSize:
mac_process_rail_server_localmovesize_event(instance, event); mac_process_rail_server_localmovesize_event(instance, event);
break; break;
case RDP_EVENT_TYPE_RAIL_CHANNEL_APPID_RESP: case RailChannel_ServerGetAppIdResponse:
//xf_process_rail_appid_resp_event(xfi, channels, event); //xf_process_rail_appid_resp_event(xfi, channels, event);
break; break;
case RDP_EVENT_TYPE_RAIL_CHANNEL_LANGBARINFO: case RailChannel_ServerLanguageBarInfo:
//xf_process_rail_langbarinfo_event(xfi, channels, event); //xf_process_rail_langbarinfo_event(xfi, channels, event);
break; break;
} }
@ -1715,7 +1715,7 @@ void mac_rail_CreateWindow(rdpRail* rail, rdpWindow* window)
RAIL_WINDOW_MOVE_ORDER windowMove; RAIL_WINDOW_MOVE_ORDER windowMove;
apple_to_windowMove(&winFrame, &windowMove); apple_to_windowMove(&winFrame, &windowMove);
windowMove.windowId = window->windowId; windowMove.windowId = window->windowId;
mac_send_rail_client_event(g_mrdpview->rdp_instance->context->channels, RDP_EVENT_TYPE_RAIL_CLIENT_WINDOW_MOVE, &windowMove); mac_send_rail_client_event(g_mrdpview->rdp_instance->context->channels, RailChannel_ClientWindowMove, &windowMove);
} }
/* create MRDPRailView and add to above window */ /* create MRDPRailView and add to above window */
@ -1850,10 +1850,11 @@ void mac_rail_register_callbacks(freerdp* instance, rdpRail* rail)
* by the system taskbar or by application desktop toolbars * by the system taskbar or by application desktop toolbars
************************************************************************/ ************************************************************************/
void mac_process_rail_get_sysparams_event(rdpChannels* channels, RDP_EVENT* event) void mac_process_rail_get_sysparams_event(rdpChannels* channels, wMessage* event)
{ {
RAIL_SYSPARAM_ORDER * sysparam; RAIL_SYSPARAM_ORDER* sysparam;
sysparam = (RAIL_SYSPARAM_ORDER*) event->user_data;
sysparam = (RAIL_SYSPARAM_ORDER*) event->wParam;
sysparam->workArea.left = 0; sysparam->workArea.left = 0;
sysparam->workArea.top = 22; sysparam->workArea.top = 22;
@ -1867,12 +1868,12 @@ void mac_process_rail_get_sysparams_event(rdpChannels* channels, RDP_EVENT* even
sysparam->dragFullWindows = FALSE; sysparam->dragFullWindows = FALSE;
mac_send_rail_client_event(channels, RDP_EVENT_TYPE_RAIL_CLIENT_SET_SYSPARAMS, sysparam); mac_send_rail_client_event(channels, RailChannel_ClientSystemParam, sysparam);
} }
void mac_process_rail_server_sysparam_event(rdpChannels* channels, RDP_EVENT* event) void mac_process_rail_server_sysparam_event(rdpChannels* channels, wMessage* event)
{ {
RAIL_SYSPARAM_ORDER* sysparam = (RAIL_SYSPARAM_ORDER*) event->user_data; RAIL_SYSPARAM_ORDER* sysparam = (RAIL_SYSPARAM_ORDER*) event->wParam;
switch (sysparam->param) switch (sysparam->param)
{ {
@ -1888,11 +1889,11 @@ void mac_process_rail_server_sysparam_event(rdpChannels* channels, RDP_EVENT* ev
* server returned result of exec'ing remote app on server * server returned result of exec'ing remote app on server
************************************************************************/ ************************************************************************/
void mac_process_rail_exec_result_event(rdpChannels* channels, RDP_EVENT* event) void mac_process_rail_exec_result_event(rdpChannels* channels, wMessage* event)
{ {
RAIL_EXEC_RESULT_ORDER* exec_result; RAIL_EXEC_RESULT_ORDER* exec_result;
exec_result = (RAIL_EXEC_RESULT_ORDER*) event->user_data; exec_result = (RAIL_EXEC_RESULT_ORDER*) event->wParam;
if (exec_result->execResult != RAIL_EXEC_S_OK) if (exec_result->execResult != RAIL_EXEC_S_OK)
{ {
@ -1913,10 +1914,10 @@ void mac_process_rail_exec_result_event(rdpChannels* channels, RDP_EVENT* event)
* to which the window can be moved or sized * to which the window can be moved or sized
************************************************************************/ ************************************************************************/
void mac_process_rail_server_minmaxinfo_event(rdpChannels* channels, RDP_EVENT* event) void mac_process_rail_server_minmaxinfo_event(rdpChannels* channels, wMessage* event)
{ {
#if 0 #if 0
RAIL_MINMAXINFO_ORDER * minmax = (RAIL_MINMAXINFO_ORDER*) event->user_data; RAIL_MINMAXINFO_ORDER * minmax = (RAIL_MINMAXINFO_ORDER*) event->wParam;
printf("minmax_info: maxPosX=%d maxPosY=%d maxWidth=%d maxHeight=%d minTrackWidth=%d minTrackHeight=%d maxTrackWidth=%d maxTrackHeight=%d\n", printf("minmax_info: maxPosX=%d maxPosY=%d maxWidth=%d maxHeight=%d minTrackWidth=%d minTrackHeight=%d maxTrackWidth=%d maxTrackHeight=%d\n",
minmax->maxPosX, minmax->maxPosY, minmax->maxWidth, minmax->maxHeight, minmax->maxPosX, minmax->maxPosY, minmax->maxWidth, minmax->maxHeight,
minmax->minTrackWidth, minmax->minTrackHeight, minmax->maxTrackWidth, minmax->maxTrackHeight); minmax->minTrackWidth, minmax->minTrackHeight, minmax->maxTrackWidth, minmax->maxTrackHeight);
@ -1929,9 +1930,9 @@ void mac_process_rail_server_minmaxinfo_event(rdpChannels* channels, RDP_EVENT*
* corresponding local window * corresponding local window
************************************************************************/ ************************************************************************/
void mac_process_rail_server_localmovesize_event(freerdp* instance, RDP_EVENT *event) void mac_process_rail_server_localmovesize_event(freerdp* instance, wMessage *event)
{ {
RAIL_LOCALMOVESIZE_ORDER* moveSize = (RAIL_LOCALMOVESIZE_ORDER*) event->user_data; RAIL_LOCALMOVESIZE_ORDER* moveSize = (RAIL_LOCALMOVESIZE_ORDER*) event->wParam;
RAIL_WINDOW_MOVE_ORDER windowMove; RAIL_WINDOW_MOVE_ORDER windowMove;
switch (moveSize->moveSizeType) switch (moveSize->moveSizeType)
@ -1983,7 +1984,7 @@ void mac_process_rail_server_localmovesize_event(freerdp* instance, RDP_EVENT *e
[g_mrdpview->currentWindow view]->saveInitialDragLoc = NO; [g_mrdpview->currentWindow view]->saveInitialDragLoc = NO;
/* let RDP server know where this window is located */ /* let RDP server know where this window is located */
mac_send_rail_client_event(instance->context->channels, RDP_EVENT_TYPE_RAIL_CLIENT_WINDOW_MOVE, &windowMove); mac_send_rail_client_event(instance->context->channels, RailChannel_ClientWindowMove, &windowMove);
/* the event we just sent will cause an extra MoveWindow() to be invoked which we need to ignore */ /* the event we just sent will cause an extra MoveWindow() to be invoked which we need to ignore */
[g_mrdpview->currentWindow view]->skipMoveWindowOnce = YES; [g_mrdpview->currentWindow view]->skipMoveWindowOnce = YES;
@ -2008,7 +2009,7 @@ void mac_process_rail_server_localmovesize_event(freerdp* instance, RDP_EVENT *e
void mac_send_rail_client_event(rdpChannels* channels, UINT16 event_type, void* param) void mac_send_rail_client_event(rdpChannels* channels, UINT16 event_type, void* param)
{ {
void* payload = NULL; void* payload = NULL;
RDP_EVENT* out_event = NULL; wMessage* out_event = NULL;
payload = rail_clone_order(event_type, param); payload = rail_clone_order(event_type, param);
@ -2019,9 +2020,9 @@ void mac_send_rail_client_event(rdpChannels* channels, UINT16 event_type, void*
} }
} }
void mac_on_free_rail_client_event(RDP_EVENT* event) void mac_on_free_rail_client_event(wMessage* event)
{ {
rail_free_cloned_order(event->event_type, event->user_data); rail_free_cloned_order(GetMessageType(event->id), event->wParam);
} }
void mac_rail_enable_remoteapp_mode() void mac_rail_enable_remoteapp_mode()

View File

@ -25,18 +25,11 @@
#include "mf_audin.h" #include "mf_audin.h"
static const AUDIO_FORMAT audio_formats[] = static const AUDIO_FORMAT supported_audio_formats[] =
{ {
{ 0x11, 2, 22050, 1024, 4, 0, NULL }, /* IMA ADPCM, 22050 Hz, 2 channels */
{ 0x11, 1, 22050, 512, 4, 0, NULL }, /* IMA ADPCM, 22050 Hz, 1 channels */ { WAVE_FORMAT_PCM, 2, 44100, 176400, 4, 16, NULL },
{ 0x01, 2, 22050, 4, 16, 0, NULL }, /* PCM, 22050 Hz, 2 channels, 16 bits */ { WAVE_FORMAT_ALAW, 2, 22050, 44100, 2, 8, NULL }
{ 0x01, 1, 22050, 2, 16, 0, NULL }, /* PCM, 22050 Hz, 1 channels, 16 bits */
{ 0x01, 2, 44100, 4, 16, 0, NULL }, /* PCM, 44100 Hz, 2 channels, 16 bits */
{ 0x01, 1, 44100, 2, 16, 0, NULL }, /* PCM, 44100 Hz, 1 channels, 16 bits */
{ 0x01, 2, 11025, 4, 16, 0, NULL }, /* PCM, 11025 Hz, 2 channels, 16 bits */
{ 0x01, 1, 11025, 2, 16, 0, NULL }, /* PCM, 11025 Hz, 1 channels, 16 bits */
{ 0x01, 2, 8000, 4, 16, 0, NULL }, /* PCM, 8000 Hz, 2 channels, 16 bits */
{ 0x01, 1, 8000, 2, 16, 0, NULL } /* PCM, 8000 Hz, 1 channels, 16 bits */
}; };
static void mf_peer_audin_opening(audin_server_context* context) static void mf_peer_audin_opening(audin_server_context* context)
@ -61,8 +54,8 @@ void mf_peer_audin_init(mfPeerContext* context)
context->audin = audin_server_context_new(context->vcm); context->audin = audin_server_context_new(context->vcm);
context->audin->data = context; context->audin->data = context;
context->audin->server_formats = audio_formats; context->audin->server_formats = supported_audio_formats;
context->audin->num_server_formats = sizeof(audio_formats) / sizeof(audio_formats[0]); context->audin->num_server_formats = sizeof(supported_audio_formats) / sizeof(supported_audio_formats[0]);
context->audin->dst_format.wFormatTag = 1; context->audin->dst_format.wFormatTag = 1;
context->audin->dst_format.nChannels = 2; context->audin->dst_format.nChannels = 2;

View File

@ -28,30 +28,6 @@
AQRecorderState recorderState; AQRecorderState recorderState;
static const AUDIO_FORMAT audio_formats[] =
{
{ 0x11, 2, 22050, 1024, 4, 0, NULL }, /* IMA ADPCM, 22050 Hz, 2 channels */
{ 0x11, 1, 22050, 512, 4, 0, NULL }, /* IMA ADPCM, 22050 Hz, 1 channels */
{ 0x01, 2, 22050, 4, 16, 0, NULL }, /* PCM, 22050 Hz, 2 channels, 16 bits */
{ 0x01, 1, 22050, 2, 16, 0, NULL }, /* PCM, 22050 Hz, 1 channels, 16 bits */
{ 0x01, 2, 44100, 4, 16, 0, NULL }, /* PCM, 44100 Hz, 2 channels, 16 bits */
{ 0x01, 1, 44100, 2, 16, 0, NULL }, /* PCM, 44100 Hz, 1 channels, 16 bits */
{ 0x01, 2, 11025, 4, 16, 0, NULL }, /* PCM, 11025 Hz, 2 channels, 16 bits */
{ 0x01, 1, 11025, 2, 16, 0, NULL }, /* PCM, 11025 Hz, 1 channels, 16 bits */
{ 0x01, 2, 8000, 4, 16, 0, NULL }, /* PCM, 8000 Hz, 2 channels, 16 bits */
{ 0x01, 1, 8000, 2, 16, 0, NULL } /* PCM, 8000 Hz, 1 channels, 16 bits */
};
/*
UINT16 wFormatTag;
UINT16 nChannels;
UINT32 nSamplesPerSec;
UINT32 nAvgBytesPerSec;
UINT16 nBlockAlign;
UINT16 wBitsPerSample;
UINT16 cbSize;
BYTE* data;
*/
static const AUDIO_FORMAT supported_audio_formats[] = static const AUDIO_FORMAT supported_audio_formats[] =
{ {
@ -59,20 +35,21 @@ static const AUDIO_FORMAT supported_audio_formats[] =
{ WAVE_FORMAT_ALAW, 2, 22050, 44100, 2, 8, NULL } { WAVE_FORMAT_ALAW, 2, 22050, 44100, 2, 8, NULL }
}; };
static void mf_peer_rdpsnd_activated(rdpsnd_server_context* context) static void mf_peer_rdpsnd_activated(rdpsnd_server_context* context)
{ {
OSStatus status; OSStatus status;
int i, j; int i, j;
BOOL formatAgreed = FALSE; BOOL formatAgreed = FALSE;
AUDIO_FORMAT* agreedFormat = NULL; AUDIO_FORMAT* agreedFormat = NULL;
//we should actually loop through the list of client formats here //we should actually loop through the list of client formats here
//and see if we can send the client something that it supports... //and see if we can send the client something that it supports...
printf("Client supports the following %d formats: \n", context->num_client_formats); printf("Client supports the following %d formats: \n", context->num_client_formats);
for(i = 0; i < context->num_client_formats; i++)
for (i = 0; i < context->num_client_formats; i++)
{ {
//TODO: improve the way we agree on a format /* TODO: improve the way we agree on a format */
for (j = 0; j < context->num_server_formats; j++) for (j = 0; j < context->num_server_formats; j++)
{ {
if ((context->client_formats[i].wFormatTag == context->server_formats[j].wFormatTag) && if ((context->client_formats[i].wFormatTag == context->server_formats[j].wFormatTag) &&