diff options
Diffstat (limited to 'SmartDeviceLink/public/SDLVideoStreamingCapability.m')
-rw-r--r-- | SmartDeviceLink/public/SDLVideoStreamingCapability.m | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/SmartDeviceLink/public/SDLVideoStreamingCapability.m b/SmartDeviceLink/public/SDLVideoStreamingCapability.m index ec4f2c591..392b102a9 100644 --- a/SmartDeviceLink/public/SDLVideoStreamingCapability.m +++ b/SmartDeviceLink/public/SDLVideoStreamingCapability.m @@ -17,20 +17,24 @@ NS_ASSUME_NONNULL_BEGIN @implementation SDLVideoStreamingCapability +// deprecated method, and will be removed in the future - (instancetype)initWithPreferredResolution:(nullable SDLImageResolution *)preferredResolution maxBitrate:(int32_t)maxBitrate supportedFormats:(nullable NSArray<SDLVideoStreamingFormat *> *)supportedFormats hapticDataSupported:(BOOL)hapticDataSupported diagonalScreenSize:(float)diagonalScreenSize pixelPerInch:(float)pixelPerInch scale:(float)scale { + return [self initWithPreferredResolution:preferredResolution maxBitrate:@(maxBitrate) supportedFormats:supportedFormats hapticSpatialDataSupported:@(hapticDataSupported) diagonalScreenSize:@(diagonalScreenSize) pixelPerInch:@(pixelPerInch) scale:@(scale) preferredFPS:nil]; +} + +- (instancetype)initWithPreferredResolution:(nullable SDLImageResolution *)preferredResolution maxBitrate:(nullable NSNumber<SDLUInt> *)maxBitrate supportedFormats:(nullable NSArray<SDLVideoStreamingFormat *> *)supportedFormats hapticSpatialDataSupported:(nullable NSNumber<SDLBool> *)hapticSpatialDataSupported diagonalScreenSize:(nullable NSNumber<SDLFloat> *)diagonalScreenSize pixelPerInch:(nullable NSNumber<SDLFloat> *)pixelPerInch scale:(nullable NSNumber<SDLFloat> *)scale preferredFPS:(nullable NSNumber<SDLUInt> *)preferredFPS { self = [self init]; if (!self) { - return self; + return nil; } - - self.maxBitrate = @(maxBitrate); self.preferredResolution = preferredResolution; + self.maxBitrate = maxBitrate; self.supportedFormats = supportedFormats; - self.hapticSpatialDataSupported = @(hapticDataSupported); - self.diagonalScreenSize = @(diagonalScreenSize); - self.pixelPerInch = @(pixelPerInch); - self.scale = @(scale); - + self.hapticSpatialDataSupported = hapticSpatialDataSupported; + self.diagonalScreenSize = diagonalScreenSize; + self.pixelPerInch = pixelPerInch; + self.scale = scale; + self.preferredFPS = preferredFPS; return self; } @@ -90,6 +94,14 @@ NS_ASSUME_NONNULL_BEGIN return [self.store sdl_objectForName:SDLRPCParameterNameScale ofClass:NSNumber.class error:nil]; } +- (void)setPreferredFPS:(nullable NSNumber<SDLUInt> *)preferredFPS { + [self.store sdl_setObject:preferredFPS forName:SDLRPCParameterNamePreferredFPS]; +} + +- (nullable NSNumber<SDLUInt> *)preferredFPS { + return [self.store sdl_objectForName:SDLRPCParameterNamePreferredFPS ofClass:NSNumber.class error:nil]; +} + @end NS_ASSUME_NONNULL_END |