/* Called when a new client connects */ BOOL mf_peer_init(freerdp_peer* client) { client->ContextSize = sizeof(mfPeerContext); client->ContextNew = (psPeerContextNew) mf_peer_context_new; client->ContextFree = (psPeerContextFree) mf_peer_context_free; if (!freerdp_peer_context_new(client)) return FALSE; info_event_queue = mf_event_queue_new(); info_queue = dispatch_queue_create("FreeRDP.update.timer", DISPATCH_QUEUE_SERIAL); info_timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, info_queue); if(info_timer) { //DEBUG_WARN( "created timer\n"); dispatch_source_set_timer(info_timer, DISPATCH_TIME_NOW, 42ull * NSEC_PER_MSEC, 100ull * NSEC_PER_MSEC); dispatch_source_set_event_handler(info_timer, ^{ //DEBUG_WARN( "dispatch\n"); mfEvent* event = mf_event_new(MF_EVENT_TYPE_FRAME_TICK); mf_event_push(info_event_queue, (mfEvent*) event);} ); dispatch_resume(info_timer); }
/* Called when a new client connects */ void mf_peer_init(freerdp_peer* client) { client->context_size = sizeof(mfPeerContext); client->ContextNew = (psPeerContextNew) mf_peer_context_new; client->ContextFree = (psPeerContextFree) mf_peer_context_free; freerdp_peer_context_new(client); info_event_queue = mf_event_queue_new(); info_queue = dispatch_queue_create("testing.101", DISPATCH_QUEUE_SERIAL); info_timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, info_queue); if(info_timer) { //printf("created timer\n"); dispatch_source_set_timer(info_timer, DISPATCH_TIME_NOW, 42ull * NSEC_PER_MSEC, 100ull * NSEC_PER_MSEC); dispatch_source_set_event_handler(info_timer, ^{ //printf("dispatch\n"); mfEvent* event = mf_event_new(MF_EVENT_TYPE_FRAME_TICK); mf_event_push(info_event_queue, (mfEvent*) event);} ); dispatch_resume(info_timer); }