channels: continue event refactoring
This commit is contained in:
parent
72bf8ea032
commit
8ad5932a3d
@ -1156,15 +1156,6 @@ int freerdp_channels_data(freerdp* instance, int channel_id, void* data, int dat
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const char* event_class_to_name_table[] =
|
||||
{
|
||||
"rdpdbg", /* RDP_EVENT_CLASS_DEBUG */
|
||||
"", /* RDP_EVENT_CLASS_CLIPRDR */
|
||||
"tsmf", /* RDP_EVENT_CLASS_TSMF */
|
||||
"rail", /* RDP_EVENT_CLASS_RAIL */
|
||||
NULL
|
||||
};
|
||||
|
||||
/**
|
||||
* Send a plugin-defined event to the plugin.
|
||||
* called only from main thread
|
||||
@ -1177,8 +1168,6 @@ FREERDP_API int freerdp_channels_send_event(rdpChannels* channels, RDP_EVENT* ev
|
||||
const char* name = NULL;
|
||||
struct channel_data* lchannel_data;
|
||||
|
||||
name = event_class_to_name_table[event->event_class];
|
||||
|
||||
switch (GetMessageClass(event->id))
|
||||
{
|
||||
case DebugChannel_Class:
|
||||
|
@ -64,7 +64,7 @@ void rail_send_channel_event(void* rail_object, UINT16 event_type, void* param)
|
||||
|
||||
if (payload != NULL)
|
||||
{
|
||||
out_event = freerdp_event_new(RDP_EVENT_CLASS_RAIL, event_type,
|
||||
out_event = freerdp_event_new(RailChannel_Class, event_type,
|
||||
on_free_rail_channel_event, payload);
|
||||
|
||||
svc_plugin_send_event((rdpSvcPlugin*) plugin, out_event);
|
||||
|
@ -310,16 +310,19 @@ static void tsmf_presentation_restore_last_video_frame(TSMF_PRESENTATION* presen
|
||||
|
||||
if (presentation->last_width && presentation->last_height)
|
||||
{
|
||||
revent = (RDP_REDRAW_EVENT*) freerdp_event_new(RDP_EVENT_CLASS_TSMF, RDP_EVENT_TYPE_TSMF_REDRAW,
|
||||
revent = (RDP_REDRAW_EVENT*) freerdp_event_new(TsmfChannel_Class, TsmfChannel_Redraw,
|
||||
NULL, NULL);
|
||||
|
||||
revent->x = presentation->last_x;
|
||||
revent->y = presentation->last_y;
|
||||
revent->width = presentation->last_width;
|
||||
revent->height = presentation->last_height;
|
||||
|
||||
if (!tsmf_push_event(presentation->channel_callback, (RDP_EVENT*) revent))
|
||||
{
|
||||
freerdp_event_free((RDP_EVENT*) revent);
|
||||
}
|
||||
|
||||
presentation->last_x = 0;
|
||||
presentation->last_y = 0;
|
||||
presentation->last_width = 0;
|
||||
@ -383,8 +386,9 @@ static void tsmf_sample_playback_video(TSMF_SAMPLE* sample)
|
||||
}
|
||||
}
|
||||
|
||||
vevent = (RDP_VIDEO_FRAME_EVENT*) freerdp_event_new(RDP_EVENT_CLASS_TSMF, RDP_EVENT_TYPE_TSMF_VIDEO_FRAME,
|
||||
vevent = (RDP_VIDEO_FRAME_EVENT*) freerdp_event_new(TsmfChannel_Class, TsmfChannel_VideoFrame,
|
||||
NULL, NULL);
|
||||
|
||||
vevent->frame_data = sample->data;
|
||||
vevent->frame_size = sample->decoded_size;
|
||||
vevent->frame_pixfmt = sample->pixfmt;
|
||||
|
@ -316,7 +316,7 @@ void android_process_channel_event(rdpChannels* channels, freerdp* instance)
|
||||
{
|
||||
/* switch (event->event_class)
|
||||
{
|
||||
case RDP_EVENT_CLASS_RAIL:
|
||||
case RailChannel_Class:
|
||||
xf_process_rail_event(ai, chanman, event);
|
||||
break;
|
||||
|
||||
|
@ -1333,11 +1333,11 @@ void channel_activity_cb(CFSocketRef s, CFSocketCallBackType callbackType,
|
||||
{
|
||||
switch (event->event_class)
|
||||
{
|
||||
case RDP_EVENT_CLASS_RAIL:
|
||||
case RailChannel_Class:
|
||||
mac_process_rail_event(instance, event);
|
||||
break;
|
||||
|
||||
case RDP_EVENT_CLASS_CLIPRDR:
|
||||
case CliprdrChannel_Class:
|
||||
process_cliprdr_event(instance, event);
|
||||
break;
|
||||
}
|
||||
@ -2014,17 +2014,14 @@ void mac_send_rail_client_event(rdpChannels* channels, UINT16 event_type, void*
|
||||
|
||||
if (payload)
|
||||
{
|
||||
out_event = freerdp_event_new(RDP_EVENT_CLASS_RAIL, event_type, mac_on_free_rail_client_event, payload);
|
||||
out_event = freerdp_event_new(RailChannel_Class, event_type, mac_on_free_rail_client_event, payload);
|
||||
freerdp_channels_send_event(channels, out_event);
|
||||
}
|
||||
}
|
||||
|
||||
void mac_on_free_rail_client_event(RDP_EVENT* event)
|
||||
{
|
||||
if (event->event_class == RDP_EVENT_CLASS_RAIL)
|
||||
{
|
||||
rail_free_cloned_order(event->event_type, event->user_data);
|
||||
}
|
||||
}
|
||||
|
||||
void mac_rail_enable_remoteapp_mode()
|
||||
|
@ -119,13 +119,14 @@ void tf_process_channel_event(rdpChannels* channels, freerdp* instance)
|
||||
|
||||
if (event)
|
||||
{
|
||||
switch (event->event_type)
|
||||
switch (GetMessageType(event->id))
|
||||
{
|
||||
case RDP_EVENT_TYPE_CB_MONITOR_READY:
|
||||
case CliprdrChannel_MonitorReady:
|
||||
tf_process_cb_monitor_ready_event(channels, instance);
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("tf_process_channel_event: unknown event type %d\n", event->event_type);
|
||||
printf("tf_process_channel_event: unknown event type %d\n", GetMessageType(event->id));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -204,8 +205,8 @@ int tfreerdp_run(freerdp* instance)
|
||||
fd_set wfds_set;
|
||||
rdpChannels* channels;
|
||||
|
||||
memset(rfds, 0, sizeof(rfds));
|
||||
memset(wfds, 0, sizeof(wfds));
|
||||
ZeroMemory(rfds, sizeof(rfds));
|
||||
ZeroMemory(wfds, sizeof(wfds));
|
||||
|
||||
channels = instance->context->channels;
|
||||
|
||||
|
@ -256,7 +256,7 @@ static void xf_send_rail_client_event(rdpChannels* channels, UINT16 event_type,
|
||||
|
||||
if (payload != NULL)
|
||||
{
|
||||
out_event = freerdp_event_new(RDP_EVENT_CLASS_RAIL, event_type,
|
||||
out_event = freerdp_event_new(RailChannel_Class, event_type,
|
||||
xf_on_free_rail_client_event, payload);
|
||||
|
||||
freerdp_channels_send_event(channels, out_event);
|
||||
|
@ -377,13 +377,13 @@ static void xf_process_tsmf_redraw_event(xfInfo* xfi, RDP_REDRAW_EVENT* revent)
|
||||
|
||||
void xf_process_tsmf_event(xfInfo* xfi, RDP_EVENT* event)
|
||||
{
|
||||
switch (event->event_type)
|
||||
switch (GetMessageType(event->id))
|
||||
{
|
||||
case RDP_EVENT_TYPE_TSMF_VIDEO_FRAME:
|
||||
case TsmfChannel_VideoFrame:
|
||||
xf_process_tsmf_video_frame_event(xfi, (RDP_VIDEO_FRAME_EVENT*) event);
|
||||
break;
|
||||
|
||||
case RDP_EVENT_TYPE_TSMF_REDRAW:
|
||||
case TsmfChannel_Redraw:
|
||||
xf_process_tsmf_redraw_event(xfi, (RDP_REDRAW_EVENT*) event);
|
||||
break;
|
||||
|
||||
|
@ -979,11 +979,11 @@ void xf_process_channel_event(rdpChannels* channels, freerdp* instance)
|
||||
{
|
||||
switch (GetMessageClass(event->id))
|
||||
{
|
||||
case RDP_EVENT_CLASS_RAIL:
|
||||
case RailChannel_Class:
|
||||
xf_process_rail_event(xfi, channels, event);
|
||||
break;
|
||||
|
||||
case RDP_EVENT_CLASS_TSMF:
|
||||
case TsmfChannel_Class:
|
||||
xf_process_tsmf_event(xfi, event);
|
||||
break;
|
||||
|
||||
|
@ -20,15 +20,6 @@
|
||||
#ifndef FREERDP_CHANNEL_CLIENT_TSMF_H
|
||||
#define FREERDP_CHANNEL_CLIENT_TSMF_H
|
||||
|
||||
/**
|
||||
* Event Types
|
||||
*/
|
||||
enum RDP_EVENT_TYPE_TSMF
|
||||
{
|
||||
RDP_EVENT_TYPE_TSMF_VIDEO_FRAME = 1,
|
||||
RDP_EVENT_TYPE_TSMF_REDRAW
|
||||
};
|
||||
|
||||
struct _RDP_VIDEO_FRAME_EVENT
|
||||
{
|
||||
RDP_EVENT event;
|
||||
|
@ -20,6 +20,7 @@
|
||||
#ifndef FREERDP_CHANNEL_AUDIN_SERVER_H
|
||||
#define FREERDP_CHANNEL_AUDIN_SERVER_H
|
||||
|
||||
#include <freerdp/codec/audio.h>
|
||||
#include <freerdp/channels/wtsvc.h>
|
||||
#include <freerdp/channels/rdpsnd.h>
|
||||
|
||||
|
@ -76,11 +76,4 @@ struct _RDP_EVENT
|
||||
void* user_data;
|
||||
};
|
||||
|
||||
enum RDP_EVENT_CLASS
|
||||
{
|
||||
RDP_EVENT_CLASS_DEBUG = 0,
|
||||
RDP_EVENT_CLASS_TSMF,
|
||||
RDP_EVENT_CLASS_RAIL
|
||||
};
|
||||
|
||||
#endif /* __RDP_TYPES_H */
|
||||
|
@ -73,12 +73,12 @@ static RDP_EVENT* freerdp_tsmf_event_new(UINT16 event_type)
|
||||
|
||||
switch (event_type)
|
||||
{
|
||||
case RDP_EVENT_TYPE_TSMF_VIDEO_FRAME:
|
||||
case TsmfChannel_VideoFrame:
|
||||
event = (RDP_EVENT*) malloc(sizeof(RDP_VIDEO_FRAME_EVENT));
|
||||
ZeroMemory(event, sizeof(RDP_VIDEO_FRAME_EVENT));
|
||||
break;
|
||||
|
||||
case RDP_EVENT_TYPE_TSMF_REDRAW:
|
||||
case TsmfChannel_Redraw:
|
||||
event = (RDP_EVENT*) malloc(sizeof(RDP_REDRAW_EVENT));
|
||||
ZeroMemory(event, sizeof(RDP_REDRAW_EVENT));
|
||||
break;
|
||||
@ -104,7 +104,7 @@ RDP_EVENT* freerdp_event_new(UINT16 event_class, UINT16 event_type,
|
||||
|
||||
switch (event_class)
|
||||
{
|
||||
case RDP_EVENT_CLASS_DEBUG:
|
||||
case DebugChannel_Class:
|
||||
event = (RDP_EVENT*) malloc(sizeof(RDP_EVENT));
|
||||
ZeroMemory(event, sizeof(RDP_EVENT));
|
||||
break;
|
||||
@ -113,11 +113,11 @@ RDP_EVENT* freerdp_event_new(UINT16 event_class, UINT16 event_type,
|
||||
event = freerdp_cliprdr_event_new(event_type);
|
||||
break;
|
||||
|
||||
case RDP_EVENT_CLASS_TSMF:
|
||||
case TsmfChannel_Class:
|
||||
event = freerdp_tsmf_event_new(event_type);
|
||||
break;
|
||||
|
||||
case RDP_EVENT_CLASS_RAIL:
|
||||
case RailChannel_Class:
|
||||
event = freerdp_rail_event_new(event_type);
|
||||
break;
|
||||
}
|
||||
@ -158,9 +158,9 @@ static void freerdp_cliprdr_event_free(RDP_EVENT* event)
|
||||
|
||||
static void freerdp_tsmf_event_free(RDP_EVENT* event)
|
||||
{
|
||||
switch (event->event_type)
|
||||
switch (GetMessageType(event->id))
|
||||
{
|
||||
case RDP_EVENT_TYPE_TSMF_VIDEO_FRAME:
|
||||
case TsmfChannel_VideoFrame:
|
||||
{
|
||||
RDP_VIDEO_FRAME_EVENT* vevent = (RDP_VIDEO_FRAME_EVENT*)event;
|
||||
free(vevent->frame_data);
|
||||
@ -188,11 +188,11 @@ void freerdp_event_free(RDP_EVENT* event)
|
||||
freerdp_cliprdr_event_free(event);
|
||||
break;
|
||||
|
||||
case RDP_EVENT_CLASS_TSMF:
|
||||
case TsmfChannel_Class:
|
||||
freerdp_tsmf_event_free(event);
|
||||
break;
|
||||
|
||||
case RDP_EVENT_CLASS_RAIL:
|
||||
case RailChannel_Class:
|
||||
freerdp_rail_event_free(event);
|
||||
break;
|
||||
}
|
||||
|
@ -27,16 +27,8 @@
|
||||
|
||||
static const AUDIO_FORMAT test_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 */
|
||||
{ WAVE_FORMAT_PCM, 2, 44100, 176400, 4, 16, 0, NULL },
|
||||
{ WAVE_FORMAT_ALAW, 2, 22050, 44100, 2, 8, 0, NULL }
|
||||
};
|
||||
|
||||
static void sf_peer_audin_opening(audin_server_context* context)
|
||||
|
@ -27,16 +27,8 @@
|
||||
|
||||
static const AUDIO_FORMAT test_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 */
|
||||
{ WAVE_FORMAT_PCM, 2, 44100, 176400, 4, 16, 0, NULL },
|
||||
{ WAVE_FORMAT_ALAW, 2, 22050, 44100, 2, 8, 0, NULL }
|
||||
};
|
||||
|
||||
static void sf_peer_rdpsnd_activated(rdpsnd_server_context* context)
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include <freerdp/listener.h>
|
||||
#include <freerdp/codec/rfx.h>
|
||||
#include <freerdp/codec/nsc.h>
|
||||
#include <freerdp/utils/thread.h>
|
||||
#include <freerdp/channels/wtsvc.h>
|
||||
#include <freerdp/server/audin.h>
|
||||
#include <freerdp/server/rdpsnd.h>
|
||||
|
Loading…
x
Reference in New Issue
Block a user