diff --git a/Limelight/Crypto/CryptoManager.h b/Limelight/Crypto/CryptoManager.h index f716083..30ca57e 100644 --- a/Limelight/Crypto/CryptoManager.h +++ b/Limelight/Crypto/CryptoManager.h @@ -6,8 +6,6 @@ // Copyright (c) 2014 Moonlight Stream. All rights reserved. // -#import - @interface CryptoManager : NSObject + (void) generateKeyPairUsingSSl; diff --git a/Limelight/Crypto/IdManager.h b/Limelight/Crypto/IdManager.h index 3fc5fae..1e5aaeb 100644 --- a/Limelight/Crypto/IdManager.h +++ b/Limelight/Crypto/IdManager.h @@ -6,8 +6,6 @@ // Copyright © 2015 Moonlight Stream. All rights reserved. // -#import - @interface IdManager : NSObject + (NSString*) getUniqueId; diff --git a/Limelight/Database/App.h b/Limelight/Database/App.h index 660dab7..eff2182 100644 --- a/Limelight/Database/App.h +++ b/Limelight/Database/App.h @@ -6,9 +6,6 @@ // Copyright © 2015 Limelight Stream. All rights reserved. // -#import -#import - @class Host; @interface App : NSManagedObject diff --git a/Limelight/Database/DataManager.h b/Limelight/Database/DataManager.h index 0258a5d..327c58e 100644 --- a/Limelight/Database/DataManager.h +++ b/Limelight/Database/DataManager.h @@ -6,7 +6,6 @@ // Copyright (c) 2014 Moonlight Stream. All rights reserved. // -#import #import "AppDelegate.h" #import "TemporaryHost.h" #import "TemporaryApp.h" diff --git a/Limelight/Database/DataManager.m b/Limelight/Database/DataManager.m index d59ba91..986171d 100644 --- a/Limelight/Database/DataManager.m +++ b/Limelight/Database/DataManager.m @@ -27,7 +27,7 @@ } else { dispatch_sync(dispatch_get_main_queue(), ^{ - _appDelegate = (AppDelegate *)[[OSApplication sharedApplication] delegate]; + self->_appDelegate = (AppDelegate *)[[OSApplication sharedApplication] delegate]; }); } @@ -76,8 +76,8 @@ // Add a new persistent managed object if one doesn't exist Host* parent = [self getHostForTemporaryHost:host withHostRecords:[self fetchRecords:@"Host"]]; if (parent == nil) { - NSEntityDescription* entity = [NSEntityDescription entityForName:@"Host" inManagedObjectContext:_managedObjectContext]; - parent = [[Host alloc] initWithEntity:entity insertIntoManagedObjectContext:_managedObjectContext]; + NSEntityDescription* entity = [NSEntityDescription entityForName:@"Host" inManagedObjectContext:self->_managedObjectContext]; + parent = [[Host alloc] initWithEntity:entity insertIntoManagedObjectContext:self->_managedObjectContext]; } // Push changes from the temp host to the persistent one @@ -101,8 +101,8 @@ // Add a new persistent managed object if one doesn't exist App* parentApp = [self getAppForTemporaryApp:app withAppRecords:appRecords]; if (parentApp == nil) { - NSEntityDescription* entity = [NSEntityDescription entityForName:@"App" inManagedObjectContext:_managedObjectContext]; - parentApp = [[App alloc] initWithEntity:entity insertIntoManagedObjectContext:_managedObjectContext]; + NSEntityDescription* entity = [NSEntityDescription entityForName:@"App" inManagedObjectContext:self->_managedObjectContext]; + parentApp = [[App alloc] initWithEntity:entity insertIntoManagedObjectContext:self->_managedObjectContext]; } [app propagateChangesToParent:parentApp withHost:parent]; @@ -158,7 +158,7 @@ [_managedObjectContext performBlockAndWait:^{ App* managedApp = [self getAppForTemporaryApp:app withAppRecords:[self fetchRecords:@"App"]]; if (managedApp != nil) { - [_managedObjectContext deleteObject:managedApp]; + [self->_managedObjectContext deleteObject:managedApp]; [self saveData]; } }]; @@ -168,7 +168,7 @@ [_managedObjectContext performBlockAndWait:^{ Host* managedHost = [self getHostForTemporaryHost:host withHostRecords:[self fetchRecords:@"Host"]]; if (managedHost != nil) { - [_managedObjectContext deleteObject:managedHost]; + [self->_managedObjectContext deleteObject:managedHost]; [self saveData]; } }]; diff --git a/Limelight/Database/Host.h b/Limelight/Database/Host.h index d2cb19a..aea728b 100644 --- a/Limelight/Database/Host.h +++ b/Limelight/Database/Host.h @@ -6,8 +6,6 @@ // Copyright © 2015 Limelight Stream. All rights reserved. // -#import -#import #import "Utils.h" @interface Host : NSManagedObject diff --git a/Limelight/Database/Settings.h b/Limelight/Database/Settings.h index ebd3ca0..ca4e748 100644 --- a/Limelight/Database/Settings.h +++ b/Limelight/Database/Settings.h @@ -6,10 +6,6 @@ // Copyright (c) 2014 Moonlight Stream. All rights reserved. // -#import -#import - - @interface Settings : NSManagedObject @property (nonatomic, retain) NSNumber * bitrate; diff --git a/Limelight/Database/TemporaryApp.h b/Limelight/Database/TemporaryApp.h index 15a8208..54b314f 100644 --- a/Limelight/Database/TemporaryApp.h +++ b/Limelight/Database/TemporaryApp.h @@ -6,7 +6,6 @@ // Copyright © 2015 Moonlight Stream. All rights reserved. // -#import #import "TemporaryHost.h" #import "App.h" diff --git a/Limelight/Database/TemporaryHost.h b/Limelight/Database/TemporaryHost.h index ffb5cdc..5e2bc2d 100644 --- a/Limelight/Database/TemporaryHost.h +++ b/Limelight/Database/TemporaryHost.h @@ -6,7 +6,6 @@ // Copyright © 2015 Moonlight Stream. All rights reserved. // -#import #import "Utils.h" #import "Host.h" diff --git a/Limelight/Database/TemporarySettings.h b/Limelight/Database/TemporarySettings.h index 38e248b..0afc2ed 100644 --- a/Limelight/Database/TemporarySettings.h +++ b/Limelight/Database/TemporarySettings.h @@ -6,7 +6,6 @@ // Copyright © 2015 Moonlight Stream. All rights reserved. // -#import #import "Settings.h" @interface TemporarySettings : NSObject diff --git a/Limelight/Input/ControllerSupport.h b/Limelight/Input/ControllerSupport.h index 7bdbf3e..b11cf18 100644 --- a/Limelight/Input/ControllerSupport.h +++ b/Limelight/Input/ControllerSupport.h @@ -6,8 +6,6 @@ // Copyright (c) 2014 Moonlight Stream. All rights reserved. // -#import - // Swift #import "Moonlight-Swift.h" #if !TARGET_OS_IPHONE diff --git a/Limelight/Input/ControllerSupport.m b/Limelight/Input/ControllerSupport.m index 796abe0..71ab3fa 100644 --- a/Limelight/Input/ControllerSupport.m +++ b/Limelight/Input/ControllerSupport.m @@ -177,7 +177,7 @@ { if (controller != NULL) { controller.controllerPausedHandler = ^(GCController *controller) { - Controller* limeController = [_controllers objectForKey:[NSNumber numberWithInteger:controller.playerIndex]]; + Controller* limeController = [self->_controllers objectForKey:[NSNumber numberWithInteger:controller.playerIndex]]; [self setButtonFlag:limeController flags:PLAY_FLAG]; [self updateFinished:limeController]; @@ -190,7 +190,7 @@ if (controller.extendedGamepad != NULL) { controller.extendedGamepad.valueChangedHandler = ^(GCExtendedGamepad *gamepad, GCControllerElement *element) { - Controller* limeController = [_controllers objectForKey:[NSNumber numberWithInteger:gamepad.controller.playerIndex]]; + Controller* limeController = [self->_controllers objectForKey:[NSNumber numberWithInteger:gamepad.controller.playerIndex]]; short leftStickX, leftStickY; short rightStickX, rightStickY; char leftTrigger, rightTrigger; @@ -225,7 +225,7 @@ } else if (controller.gamepad != NULL) { controller.gamepad.valueChangedHandler = ^(GCGamepad *gamepad, GCControllerElement *element) { - Controller* limeController = [_controllers objectForKey:[NSNumber numberWithInteger:gamepad.controller.playerIndex]]; + Controller* limeController = [self->_controllers objectForKey:[NSNumber numberWithInteger:gamepad.controller.playerIndex]]; UPDATE_BUTTON_FLAG(limeController, A_FLAG, gamepad.buttonA.pressed); UPDATE_BUTTON_FLAG(limeController, B_FLAG, gamepad.buttonB.pressed); UPDATE_BUTTON_FLAG(limeController, X_FLAG, gamepad.buttonX.pressed); @@ -408,12 +408,12 @@ GCController* controller = note.object; [self unregisterControllerCallbacks:controller]; - _controllerNumbers &= ~(1 << controller.playerIndex); + self->_controllerNumbers &= ~(1 << controller.playerIndex); Log(LOG_I, @"Unassigning controller index: %ld", (long)controller.playerIndex); // Inform the server of the updated active gamepads before removing this controller - [self updateFinished:[_controllers objectForKey:[NSNumber numberWithInteger:controller.playerIndex]]]; - [_controllers removeObjectForKey:[NSNumber numberWithInteger:controller.playerIndex]]; + [self updateFinished:[self->_controllers objectForKey:[NSNumber numberWithInteger:controller.playerIndex]]]; + [self->_controllers removeObjectForKey:[NSNumber numberWithInteger:controller.playerIndex]]; // Re-evaluate the on-screen control mode [self updateAutoOnScreenControlMode]; diff --git a/Limelight/Network/AppAssetManager.h b/Limelight/Network/AppAssetManager.h index 42f7720..1d05ce9 100644 --- a/Limelight/Network/AppAssetManager.h +++ b/Limelight/Network/AppAssetManager.h @@ -6,7 +6,6 @@ // Copyright (c) 2014 Moonlight Stream. All rights reserved. // -#import #import "TemporaryApp.h" #import "HttpManager.h" #import "TemporaryHost.h" diff --git a/Limelight/Network/AppAssetResponse.h b/Limelight/Network/AppAssetResponse.h index 4e9ac7b..ad225f8 100644 --- a/Limelight/Network/AppAssetResponse.h +++ b/Limelight/Network/AppAssetResponse.h @@ -6,7 +6,6 @@ // Copyright (c) 2015 Moonlight Stream. All rights reserved. // -#import #import "HttpResponse.h" @interface AppAssetResponse : NSObject diff --git a/Limelight/Network/AppAssetRetriever.h b/Limelight/Network/AppAssetRetriever.h index b897a0f..07ee687 100644 --- a/Limelight/Network/AppAssetRetriever.h +++ b/Limelight/Network/AppAssetRetriever.h @@ -6,7 +6,6 @@ // Copyright (c) 2015 Moonlight Stream. All rights reserved. // -#import #import "TemporaryHost.h" #import "TemporaryApp.h" #import "AppAssetManager.h" diff --git a/Limelight/Network/ConnectionHelper.h b/Limelight/Network/ConnectionHelper.h index 7c25b09..65cc0d3 100644 --- a/Limelight/Network/ConnectionHelper.h +++ b/Limelight/Network/ConnectionHelper.h @@ -2,11 +2,10 @@ // ConnectionHelper.h // Moonlight macOS // -// Created by Felix on 22.03.18. -// Copyright © 2018 Felix. All rights reserved. +// Created by Felix Kratz on 22.03.18. +// Copyright © 2018 Felix Kratz. All rights reserved. // -#import #import "AppListResponse.h" #ifndef ConnectionHelper_h diff --git a/Limelight/Network/ConnectionHelper.m b/Limelight/Network/ConnectionHelper.m index 50aee29..83cc3bf 100644 --- a/Limelight/Network/ConnectionHelper.m +++ b/Limelight/Network/ConnectionHelper.m @@ -2,8 +2,8 @@ // ConnectionHelper.m // Moonlight macOS // -// Created by Felix on 22.03.18. -// Copyright © 2018 Felix. All rights reserved. +// Created by Felix Kratz on 22.03.18. +// Copyright © 2018 Felix Kratz. All rights reserved. // #import "ConnectionHelper.h" diff --git a/Limelight/Network/DiscoveryManager.h b/Limelight/Network/DiscoveryManager.h index 7d5dfcc..dfe4535 100644 --- a/Limelight/Network/DiscoveryManager.h +++ b/Limelight/Network/DiscoveryManager.h @@ -6,7 +6,6 @@ // Copyright (c) 2015 Moonlight Stream. All rights reserved. // -#import #import "MDNSManager.h" #import "TemporaryHost.h" diff --git a/Limelight/Network/DiscoveryManager.m b/Limelight/Network/DiscoveryManager.m index 286fa34..3d849af 100644 --- a/Limelight/Network/DiscoveryManager.m +++ b/Limelight/Network/DiscoveryManager.m @@ -153,7 +153,7 @@ [worker discoverHost]; if ([self addHostToDiscovery:host]) { Log(LOG_I, @"Adding host to discovery: %@", host.name); - [_callback updateAllHosts:_hostQueue]; + [self->_callback updateAllHosts:self->_hostQueue]; } else { Log(LOG_I, @"Not adding host to discovery: %@", host.name); } diff --git a/Limelight/Network/DiscoveryWorker.h b/Limelight/Network/DiscoveryWorker.h index c8d2a6c..40c4711 100644 --- a/Limelight/Network/DiscoveryWorker.h +++ b/Limelight/Network/DiscoveryWorker.h @@ -6,7 +6,6 @@ // Copyright (c) 2015 Moonlight Stream. All rights reserved. // -#import #import "TemporaryHost.h" @interface DiscoveryWorker : NSOperation diff --git a/Limelight/Network/HttpManager.h b/Limelight/Network/HttpManager.h index 1a5f198..6eb9ddb 100644 --- a/Limelight/Network/HttpManager.h +++ b/Limelight/Network/HttpManager.h @@ -6,7 +6,6 @@ // Copyright (c) 2014 Moonlight Stream. All rights reserved. // -#import #import "HttpResponse.h" #import "HttpRequest.h" diff --git a/Limelight/Network/HttpManager.m b/Limelight/Network/HttpManager.m index 945bc6b..30ba876 100644 --- a/Limelight/Network/HttpManager.m +++ b/Limelight/Network/HttpManager.m @@ -69,23 +69,23 @@ static const NSString* HTTPS_PORT = @"47984"; if (error != NULL) { Log(LOG_D, @"Connection error: %@", error); - _errorOccurred = true; + self->_errorOccurred = true; } else { Log(LOG_D, @"Received response: %@", response); if (data != NULL) { Log(LOG_D, @"\n\nReceived data: %@\n\n", [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]); - [_respData appendData:data]; - if ([[NSString alloc] initWithData:_respData encoding:NSUTF8StringEncoding] != nil) { - _requestResp = [HttpManager fixXmlVersion:_respData]; + [self->_respData appendData:data]; + if ([[NSString alloc] initWithData:self->_respData encoding:NSUTF8StringEncoding] != nil) { + self->_requestResp = [HttpManager fixXmlVersion:self->_respData]; } else { - _requestResp = _respData; + self->_requestResp = self->_respData; } } } - dispatch_semaphore_signal(_requestLock); + dispatch_semaphore_signal(self->_requestLock); }] resume]; dispatch_semaphore_wait(_requestLock, DISPATCH_TIME_FOREVER); diff --git a/Limelight/Network/HttpRequest.h b/Limelight/Network/HttpRequest.h index 743b58b..ace3da2 100644 --- a/Limelight/Network/HttpRequest.h +++ b/Limelight/Network/HttpRequest.h @@ -6,7 +6,6 @@ // Copyright (c) 2015 Moonlight Stream. All rights reserved. // -#import #import "HttpResponse.h" @interface HttpRequest : NSObject diff --git a/Limelight/Network/HttpResponse.h b/Limelight/Network/HttpResponse.h index 28d2636..70478a5 100644 --- a/Limelight/Network/HttpResponse.h +++ b/Limelight/Network/HttpResponse.h @@ -6,8 +6,6 @@ // Copyright (c) 2015 Moonlight Stream. All rights reserved. // -#import - static NSString* TAG_STATUS_CODE = @"status_code"; static NSString* TAG_STATUS_MESSAGE = @"status_message"; diff --git a/Limelight/Network/MDNSManager.h b/Limelight/Network/MDNSManager.h index c0932c4..83c81d4 100644 --- a/Limelight/Network/MDNSManager.h +++ b/Limelight/Network/MDNSManager.h @@ -6,8 +6,6 @@ // Copyright (c) 2014 Moonlight Stream. All rights reserved. // -#import - @protocol MDNSCallback - (void) updateHosts:(NSArray*)hosts; diff --git a/Limelight/Network/PairManager.h b/Limelight/Network/PairManager.h index 144eb7d..bf1e84f 100644 --- a/Limelight/Network/PairManager.h +++ b/Limelight/Network/PairManager.h @@ -6,7 +6,6 @@ // Copyright (c) 2014 Moonlight Stream. All rights reserved. // -#import #import "HttpManager.h" @protocol PairCallback diff --git a/Limelight/Network/WakeOnLanManager.h b/Limelight/Network/WakeOnLanManager.h index a3da81e..f1d0828 100644 --- a/Limelight/Network/WakeOnLanManager.h +++ b/Limelight/Network/WakeOnLanManager.h @@ -6,7 +6,6 @@ // Copyright (c) 2015 Moonlight Stream. All rights reserved. // -#import #import "TemporaryHost.h" @interface WakeOnLanManager : NSObject diff --git a/Limelight/Stream/Connection.h b/Limelight/Stream/Connection.h index 62b1774..8713e73 100644 --- a/Limelight/Stream/Connection.h +++ b/Limelight/Stream/Connection.h @@ -6,7 +6,6 @@ // Copyright (c) 2014 Moonlight Stream. All rights reserved. // -#import #import "VideoDecoderRenderer.h" #import "StreamConfiguration.h" diff --git a/Limelight/Stream/StreamConfiguration.h b/Limelight/Stream/StreamConfiguration.h index ce977a9..d3a6b28 100644 --- a/Limelight/Stream/StreamConfiguration.h +++ b/Limelight/Stream/StreamConfiguration.h @@ -6,8 +6,6 @@ // Copyright (c) 2014 Moonlight Stream. All rights reserved. // -#import - @interface StreamConfiguration : NSObject @property NSString* host; diff --git a/Limelight/Stream/StreamManager.h b/Limelight/Stream/StreamManager.h index 951d2a6..4495456 100644 --- a/Limelight/Stream/StreamManager.h +++ b/Limelight/Stream/StreamManager.h @@ -6,7 +6,6 @@ // Copyright (c) 2014 Moonlight Stream. All rights reserved. // -#import #import "StreamConfiguration.h" #import "Connection.h" diff --git a/Limelight/Stream/VideoDecoderRenderer.h b/Limelight/Stream/VideoDecoderRenderer.h index e7c3b65..82c77d4 100644 --- a/Limelight/Stream/VideoDecoderRenderer.h +++ b/Limelight/Stream/VideoDecoderRenderer.h @@ -6,8 +6,6 @@ // Copyright (c) 2014 Moonlight Stream. All rights reserved. // -#import - @import AVFoundation; @interface VideoDecoderRenderer : NSObject diff --git a/Limelight/Stream/VideoDecoderRenderer.m b/Limelight/Stream/VideoDecoderRenderer.m index 0e823c7..96b852c 100644 --- a/Limelight/Stream/VideoDecoderRenderer.m +++ b/Limelight/Stream/VideoDecoderRenderer.m @@ -7,11 +7,12 @@ // #import "VideoDecoderRenderer.h" +#import "StreamView.h" #include "Limelight.h" @implementation VideoDecoderRenderer { - OSView *_view; + StreamView* _view; AVSampleBufferDisplayLayer* displayLayer; Boolean waitingForSps, waitingForPps, waitingForVps; @@ -54,7 +55,7 @@ } } -- (id)initWithView:(OSView*)view +- (id)initWithView:(StreamView*)view { self = [super init]; @@ -68,6 +69,9 @@ - (void)setupWithVideoFormat:(int)videoFormat { self->videoFormat = videoFormat; +#if !TARGET_OS_IPHONE + _view.codec = videoFormat; +#endif } #define FRAME_START_PREFIX_SIZE 4 @@ -335,7 +339,9 @@ } [displayLayer enqueueSampleBuffer:sampleBuffer]; - +#if !TARGET_OS_IPHONE + _view.frameCount++; +#endif // Dereference the buffers CFRelease(blockBuffer); CFRelease(sampleBuffer); diff --git a/Limelight/Utility/Utils.h b/Limelight/Utility/Utils.h index 2ec0ab1..c387b53 100644 --- a/Limelight/Utility/Utils.h +++ b/Limelight/Utility/Utils.h @@ -6,8 +6,6 @@ // Copyright (c) 2014 Moonlight Stream. All rights reserved. // -#import - @interface Utils : NSObject typedef NS_ENUM(int, PairState) { @@ -29,4 +27,4 @@ FOUNDATION_EXPORT NSString *const deviceName; - (NSString*) trim; -@end \ No newline at end of file +@end diff --git a/Mac.storyboard b/Mac.storyboard index 5d94614..74e6cbe 100644 --- a/Mac.storyboard +++ b/Mac.storyboard @@ -1,7 +1,7 @@ - + - + @@ -832,38 +832,26 @@ - + - + - - - - - - - - - - - - - + @@ -875,6 +863,7 @@ + Any resolution different from 1080p/720p may not be supported by the host and could result in worse picture quality. Setup a custom resolution on the host PC that matches the aspect ratio of the client PC to get full-screen rendering. @@ -883,6 +872,7 @@ + This will be the bitrate for the video stream. Note that if not streaming remotely and using HEVC the effective video bitrate will be lower. Also note that this is only the video bitrate and there will be ~1Mbps for audio traffic. @@ -944,7 +934,7 @@ - + @@ -952,7 +942,7 @@ -