mfreerdp-server: cleanup

This commit is contained in:
C-o-r-E 2013-02-19 16:26:06 -05:00
parent 43f2ab1c5c
commit 4639ea6c2c
4 changed files with 9 additions and 68 deletions

View File

@ -184,6 +184,7 @@ void mf_info_peer_register(mfInfo* mfi, mfPeerContext* context)
}
//look trhough the array of peers until an empty slot
peerId = NULL;
for(i=0; i<MF_INFO_MAXPEERS; ++i)
{
//empty index will be our peer id
@ -197,7 +198,7 @@ void mf_info_peer_register(mfInfo* mfi, mfPeerContext* context)
mfi->peers[peerId] = ((rdpContext*) context)->peer;
mfi->peers[peerId]->pId = peerId;
mfi->peerCount++;
printf("Registering Peer: id=%d #=%d\n", peerId, mfi->peerCount);
//printf("Registering Peer: id=%d #=%d\n", peerId, mfi->peerCount);
mf_info_unlock(mfi);
@ -215,7 +216,7 @@ void mf_info_peer_unregister(mfInfo* mfi, mfPeerContext* context)
mfi->peers[peerId] = NULL;
mfi->peerCount--;
printf("Unregistering Peer: id=%d, #=%d\n", peerId, mfi->peerCount);
//printf("Unregistering Peer: id=%d, #=%d\n", peerId, mfi->peerCount);
//screen capture cleanup
if (mfi->peerCount == 0)

View File

@ -34,13 +34,6 @@ CGDisplayStreamUpdateRef lastUpdate = NULL;
BYTE* localBuf = NULL;
//CVPixelBufferRef pxbuffer = NULL;
//void *baseAddress = NULL;
//CGContextRef bitmapcontext = NULL;
//CGImageRef image = NULL;
BOOL ready = FALSE;
void (^streamHandler)(CGDisplayStreamFrameStatus, uint64_t, IOSurfaceRef, CGDisplayStreamUpdateRef) = ^(CGDisplayStreamFrameStatus status, uint64_t displayTime, IOSurfaceRef frameSurface, CGDisplayStreamUpdateRef updateRef)
@ -96,7 +89,8 @@ void (^streamHandler)(CGDisplayStreamFrameStatus, uint64_t, IOSurfaceRef, CGDisp
break;
case kCGDisplayStreamFrameStatusStopped:
printf("kCGDisplayStreamFrameStatusStopped\n");
//we dont need to clean up
//printf("kCGDisplayStreamFrameStatusStopped\n");
break;
case kCGDisplayStreamFrameStatusFrameBlank:
@ -149,7 +143,6 @@ int mf_mlion_display_info(UINT32* disp_width, UINT32* disp_height, UINT32* scale
int mf_mlion_screen_updates_init()
{
printf("mf_mlion_screen_updates_init()\n");
CGDirectDisplayID display_id;
display_id = CGMainDisplayID();
@ -218,11 +211,6 @@ int mf_mlion_get_dirty_region(RFX_RECT* invalid)
if (lastUpdate != NULL)
{
mf_mlion_peek_dirty_region(invalid);
//CFRelease(lastUpdate);
//lastUpdate = NULL;
}
@ -237,11 +225,8 @@ int mf_mlion_peek_dirty_region(RFX_RECT* invalid)
CGRect dirtyRegion;
const CGRect * rects = CGDisplayStreamUpdateGetRects(lastUpdate, kCGDisplayStreamUpdateDirtyRects, &num_rects);
//printf("\trectangles: %zd\n", num_rects);
if (num_rects == 0) {
//dispatch_semaphore_signal(region_sem);
return 0;
}
@ -284,23 +269,6 @@ int mf_mlion_get_pixelData(long x, long y, long width, long height, BYTE** pxDat
*pxData = localBuf;
dispatch_semaphore_signal(data_sem);
/*
if (image != NULL) {
CGImageRelease(image);
}
image = CGDisplayCreateImageForRect(
kCGDirectMainDisplay,
CGRectMake(x, y, width, height) );
CGContextDrawImage(
bitmapcontext,
CGRectMake(0, 1800 - height, width, height),
image);
*pxData = baseAddress;
*/
return 0;
}

View File

@ -72,7 +72,6 @@ BOOL mf_peer_check_fds(freerdp_peer* client)
{
mfPeerContext* context = (mfPeerContext*) client->context;
mfEvent* event;
//HGDI_RGN invalid_region;
if (context->activated == FALSE)
return TRUE;
@ -84,9 +83,6 @@ BOOL mf_peer_check_fds(freerdp_peer* client)
if (event->type == MF_EVENT_TYPE_REGION)
{
printf("unhandled event\n");
/*mfEventRegion* region = (mfEventRegion*) mf_event_pop(info_event_queue);
gdi_InvalidateRegion(xfp->hdc, region->x, region->y, region->width, region->height);
xf_event_region_free(region);*/
}
else if (event->type == MF_EVENT_TYPE_FRAME_TICK)
{
@ -170,19 +166,8 @@ void mf_peer_rfx_update(freerdp_peer* client)
update->SurfaceBits(update->context, cmd);
//clean up
//clean up... maybe?
// note: need to stop getting new dirty rects until here
/*
CGColorSpaceRelease(rgbColorSpace);
CGImageRelease(image);
CGContextRelease(context);
CVPixelBufferUnlockBaseAddress(pxbuffer, 0);
CVPixelBufferRelease(pxbuffer);
*/
}
/* Called when we have a new peer connecting */

View File

@ -44,12 +44,7 @@ static const rdpsndFormat audio_formats[] =
static void mf_peer_rdpsnd_activated(rdpsnd_server_context* context)
{
printf("RDPSND Activated\n");
printf("Let's create an audio queue for input!\n");
OSStatus status;
recorderState.dataFormat.mSampleRate = 44100.0;
@ -87,9 +82,7 @@ static void mf_peer_rdpsnd_activated(rdpsnd_server_context* context)
mf_rdpsnd_derive_buffer_size(recorderState.queue, &recorderState.dataFormat, 0.05, &recorderState.bufferByteSize);
printf("Preparing a set of buffers...");
for (int i = 0; i < snd_numBuffers; ++i)
{
AudioQueueAllocateBuffer(recorderState.queue,
@ -102,11 +95,6 @@ static void mf_peer_rdpsnd_activated(rdpsnd_server_context* context)
NULL);
}
printf("done\n");
printf("recording...\n");
recorderState.currentPacket = 0;
recorderState.isRunning = true;
@ -120,7 +108,6 @@ static void mf_peer_rdpsnd_activated(rdpsnd_server_context* context)
BOOL mf_peer_rdpsnd_init(mfPeerContext* context)
{
//printf("RDPSND INIT\n");
context->rdpsnd = rdpsnd_server_context_new(context->vcm);
context->rdpsnd->data = context;