summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2018-01-04 13:17:58 -0500
committerJoel Fischer <joeljfischer@gmail.com>2018-01-04 13:17:58 -0500
commitb2085b9112015483342190e18ace5b5e74bb6284 (patch)
tree16b1fcf5e4c47b8ebe301cb495c0e2d52fb773da
parent8b6d8dd7d55bf31a2bd27251008204f9f6b0cf40 (diff)
downloadsdl_ios-b2085b9112015483342190e18ace5b5e74bb6284.tar.gz
Default to layer rendering with an option for view rendering
-rw-r--r--SmartDeviceLink/SDLStreamingMediaConfiguration.h12
-rw-r--r--SmartDeviceLink/SDLStreamingMediaConfiguration.m10
2 files changed, 19 insertions, 3 deletions
diff --git a/SmartDeviceLink/SDLStreamingMediaConfiguration.h b/SmartDeviceLink/SDLStreamingMediaConfiguration.h
index 1c3912dfd..d68642116 100644
--- a/SmartDeviceLink/SDLStreamingMediaConfiguration.h
+++ b/SmartDeviceLink/SDLStreamingMediaConfiguration.h
@@ -16,6 +16,11 @@
NS_ASSUME_NONNULL_BEGIN
+typedef NS_ENUM(NSUInteger, SDLCarWindowRenderingType) {
+ SDLCarWindowRenderingTypeLayer,
+ SDLCarWindowRenderingTypeView
+};
+
@interface SDLStreamingMediaConfiguration : NSObject <NSCopying>
/**
@@ -65,11 +70,16 @@ NS_ASSUME_NONNULL_BEGIN
@property (strong, nonatomic, nullable) UIViewController *rootViewController;
/**
- Declares if CarWindow will wait until after the screen updates to draw. Defaults to YES.
+ Declares if CarWindow will wait until after the screen updates to draw. Only applies to view rendering. Defaults to NO.
*/
@property (assign, nonatomic) BOOL carWindowDrawsAfterScreenUpdates;
/**
+ Declares if CarWindow will use layer rendering or view rendering. Defaults to layer rendering.
+ */
+@property (assign, nonatomic) SDLCarWindowRenderingType carWindowRenderingType;
+
+/**
When YES, the StreamingMediaManager will run a CADisplayLink with the framerate set to the video encoder settings kVTCompressionPropertyKey_ExpectedFrameRate. This then forces TouchManager (and CarWindow, if used) to sync their callbacks to the framerate. If using CarWindow, this *must* be YES. If NO, `enableSyncedPanning` on SDLTouchManager will be set to NO. Defaults to YES.
*/
@property (assign, nonatomic) BOOL enableForcedFramerateSync;
diff --git a/SmartDeviceLink/SDLStreamingMediaConfiguration.m b/SmartDeviceLink/SDLStreamingMediaConfiguration.m
index 1682c0f4a..1d619fae9 100644
--- a/SmartDeviceLink/SDLStreamingMediaConfiguration.m
+++ b/SmartDeviceLink/SDLStreamingMediaConfiguration.m
@@ -38,7 +38,8 @@ NS_ASSUME_NONNULL_BEGIN
_customVideoEncoderSettings = videoSettings;
_dataSource = dataSource;
_rootViewController = rootViewController;
- _carWindowDrawsAfterScreenUpdates = YES;
+ _carWindowRenderingType = SDLCarWindowRenderingTypeLayer;
+ _carWindowDrawsAfterScreenUpdates = NO;
_enableForcedFramerateSync = YES;
return self;
@@ -74,7 +75,12 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark NSCopying
- (id)copyWithZone:(nullable NSZone *)zone {
- return [[self.class allocWithZone:zone] initWithSecurityManagers:_securityManagers encryptionFlag:_maximumDesiredEncryption videoSettings:_customVideoEncoderSettings dataSource:_dataSource rootViewController:_rootViewController];
+ SDLStreamingMediaConfiguration *newConfig = [[self.class allocWithZone:zone] initWithSecurityManagers:_securityManagers encryptionFlag:_maximumDesiredEncryption videoSettings:_customVideoEncoderSettings dataSource:_dataSource rootViewController:_rootViewController];
+
+ newConfig.carWindowRenderingType = self.carWindowRenderingType;
+ newConfig.carWindowDrawsAfterScreenUpdates = self.carWindowDrawsAfterScreenUpdates;
+
+ return newConfig;
}
@end