From 89f32d6dfc9c6f1b4e6c2fd3e8f9669161f01daf Mon Sep 17 00:00:00 2001 From: Shinichi Watanabe Date: Wed, 9 Dec 2020 15:50:00 +0900 Subject: Update SDLStreamingVideoLifecycleManager and SDLVideoStreamingCapability based on the feedback from Joel Fischer --- SmartDeviceLink/public/SDLVideoStreamingCapability.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'SmartDeviceLink/public/SDLVideoStreamingCapability.m') diff --git a/SmartDeviceLink/public/SDLVideoStreamingCapability.m b/SmartDeviceLink/public/SDLVideoStreamingCapability.m index 4ebf6d005..a031bc8ca 100644 --- a/SmartDeviceLink/public/SDLVideoStreamingCapability.m +++ b/SmartDeviceLink/public/SDLVideoStreamingCapability.m @@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN @implementation SDLVideoStreamingCapability -- (instancetype)initWithPreferredResolution:(nullable SDLImageResolution *)preferredResolution maxBitrate:(int32_t)maxBitrate supportedFormats:(nullable NSArray *)supportedFormats hapticDataSupported:(BOOL)hapticDataSupported diagonalScreenSize:(float)diagonalScreenSize pixelPerInch:(float)pixelPerInch scale:(float)scale { +- (instancetype)initWithPreferredResolution:(nullable SDLImageResolution *)preferredResolution maxBitrate:(int32_t)maxBitrate supportedFormats:(nullable NSArray *)supportedFormats hapticDataSupported:(BOOL)hapticDataSupported diagonalScreenSize:(float)diagonalScreenSize pixelPerInch:(float)pixelPerInch scale:(float)scale preferredFPS:(uint32_t)preferredFPS { self = [self init]; if (!self) { return self; @@ -30,7 +30,7 @@ NS_ASSUME_NONNULL_BEGIN self.diagonalScreenSize = @(diagonalScreenSize); self.pixelPerInch = @(pixelPerInch); self.scale = @(scale); - self.preferredFPS = @(15); + self.preferredFPS = @(preferredFPS); return self; } @@ -91,11 +91,11 @@ NS_ASSUME_NONNULL_BEGIN return [self.store sdl_objectForName:SDLRPCParameterNameScale ofClass:NSNumber.class error:nil]; } -- (void)setPreferredFPS:(nullable NSNumber *)preferredFPS { +- (void)setPreferredFPS:(nullable NSNumber *)preferredFPS { [self.store sdl_setObject:preferredFPS forName:SDLRPCParameterNamePreferredFPS]; } -- (nullable NSNumber *)preferredFPS { +- (nullable NSNumber *)preferredFPS { return [self.store sdl_objectForName:SDLRPCParameterNamePreferredFPS ofClass:NSNumber.class error:nil]; } -- cgit v1.2.1 From e587c512169dba625729899c4af06c7a07d0d220 Mon Sep 17 00:00:00 2001 From: Shinichi Watanabe Date: Mon, 18 Jan 2021 19:29:50 +0900 Subject: Update the PR as per code review at https://github.com/smartdevicelink/sdl_ios/pull/1613#pullrequestreview-561772548. --- SmartDeviceLink/public/SDLVideoStreamingCapability.m | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'SmartDeviceLink/public/SDLVideoStreamingCapability.m') diff --git a/SmartDeviceLink/public/SDLVideoStreamingCapability.m b/SmartDeviceLink/public/SDLVideoStreamingCapability.m index a031bc8ca..484c7d395 100644 --- a/SmartDeviceLink/public/SDLVideoStreamingCapability.m +++ b/SmartDeviceLink/public/SDLVideoStreamingCapability.m @@ -17,6 +17,14 @@ 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 *)supportedFormats hapticDataSupported:(BOOL)hapticDataSupported diagonalScreenSize:(float)diagonalScreenSize pixelPerInch:(float)pixelPerInch scale:(float)scale { + self = [self initWithPreferredResolution:preferredResolution maxBitrate:maxBitrate supportedFormats:supportedFormats hapticDataSupported:hapticDataSupported diagonalScreenSize:diagonalScreenSize pixelPerInch:pixelPerInch scale:scale preferredFPS:DEFAULT_FRAME_RATE]; + + return self; +} + - (instancetype)initWithPreferredResolution:(nullable SDLImageResolution *)preferredResolution maxBitrate:(int32_t)maxBitrate supportedFormats:(nullable NSArray *)supportedFormats hapticDataSupported:(BOOL)hapticDataSupported diagonalScreenSize:(float)diagonalScreenSize pixelPerInch:(float)pixelPerInch scale:(float)scale preferredFPS:(uint32_t)preferredFPS { self = [self init]; if (!self) { -- cgit v1.2.1 From 6a56ea613e1c2d4a9c69edd0bef5af9dd753b5c3 Mon Sep 17 00:00:00 2001 From: Shinichi Watanabe Date: Mon, 1 Feb 2021 16:41:34 +0900 Subject: Updated SDLVideoStreamingCapability based on generated code as per review at https://github.com/smartdevicelink/sdl_ios/pull/1613#issuecomment-768279035. Also updated SDLVideoLifecycleManager, and test code accordingly. --- .../public/SDLVideoStreamingCapability.m | 24 ++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'SmartDeviceLink/public/SDLVideoStreamingCapability.m') diff --git a/SmartDeviceLink/public/SDLVideoStreamingCapability.m b/SmartDeviceLink/public/SDLVideoStreamingCapability.m index 484c7d395..9ff3eb534 100644 --- a/SmartDeviceLink/public/SDLVideoStreamingCapability.m +++ b/SmartDeviceLink/public/SDLVideoStreamingCapability.m @@ -17,29 +17,27 @@ 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 *)supportedFormats hapticDataSupported:(BOOL)hapticDataSupported diagonalScreenSize:(float)diagonalScreenSize pixelPerInch:(float)pixelPerInch scale:(float)scale { - self = [self initWithPreferredResolution:preferredResolution maxBitrate:maxBitrate supportedFormats:supportedFormats hapticDataSupported:hapticDataSupported diagonalScreenSize:diagonalScreenSize pixelPerInch:pixelPerInch scale:scale preferredFPS:DEFAULT_FRAME_RATE]; +- (instancetype)initWithPreferredResolution:(nullable SDLImageResolution *)preferredResolution maxBitrate:(nullable NSNumber *)maxBitrate supportedFormats:(nullable NSArray *)supportedFormats hapticSpatialDataSupported:(nullable NSNumber *)hapticSpatialDataSupported diagonalScreenSize:(nullable NSNumber *)diagonalScreenSize pixelPerInch:(nullable NSNumber *)pixelPerInch scale:(nullable NSNumber *)scale { + self = [self initWithPreferredResolution:preferredResolution maxBitrate:maxBitrate supportedFormats:supportedFormats hapticSpatialDataSupported:hapticSpatialDataSupported diagonalScreenSize:diagonalScreenSize pixelPerInch:pixelPerInch scale:scale preferredFPS:nil]; return self; } -- (instancetype)initWithPreferredResolution:(nullable SDLImageResolution *)preferredResolution maxBitrate:(int32_t)maxBitrate supportedFormats:(nullable NSArray *)supportedFormats hapticDataSupported:(BOOL)hapticDataSupported diagonalScreenSize:(float)diagonalScreenSize pixelPerInch:(float)pixelPerInch scale:(float)scale preferredFPS:(uint32_t)preferredFPS { + +- (instancetype)initWithPreferredResolution:(nullable SDLImageResolution *)preferredResolution maxBitrate:(nullable NSNumber *)maxBitrate supportedFormats:(nullable NSArray *)supportedFormats hapticSpatialDataSupported:(nullable NSNumber *)hapticSpatialDataSupported diagonalScreenSize:(nullable NSNumber *)diagonalScreenSize pixelPerInch:(nullable NSNumber *)pixelPerInch scale:(nullable NSNumber *)scale preferredFPS:(nullable NSNumber *)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.preferredFPS = @(preferredFPS); - + self.hapticSpatialDataSupported = hapticSpatialDataSupported; + self.diagonalScreenSize = diagonalScreenSize; + self.pixelPerInch = pixelPerInch; + self.scale = scale; + self.preferredFPS = preferredFPS; return self; } -- cgit v1.2.1 From 04621d37a0aaccd394837ba83c52b0e5e5d81e59 Mon Sep 17 00:00:00 2001 From: Shinichi Watanabe Date: Wed, 3 Feb 2021 13:53:30 +0900 Subject: Fix some erros as per PR review at https://github.com/smartdevicelink/sdl_ios/pull/1613#pullrequestreview-581450628. --- SmartDeviceLink/public/SDLVideoStreamingCapability.m | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'SmartDeviceLink/public/SDLVideoStreamingCapability.m') diff --git a/SmartDeviceLink/public/SDLVideoStreamingCapability.m b/SmartDeviceLink/public/SDLVideoStreamingCapability.m index 9ff3eb534..392b102a9 100644 --- a/SmartDeviceLink/public/SDLVideoStreamingCapability.m +++ b/SmartDeviceLink/public/SDLVideoStreamingCapability.m @@ -18,13 +18,10 @@ NS_ASSUME_NONNULL_BEGIN @implementation SDLVideoStreamingCapability // deprecated method, and will be removed in the future -- (instancetype)initWithPreferredResolution:(nullable SDLImageResolution *)preferredResolution maxBitrate:(nullable NSNumber *)maxBitrate supportedFormats:(nullable NSArray *)supportedFormats hapticSpatialDataSupported:(nullable NSNumber *)hapticSpatialDataSupported diagonalScreenSize:(nullable NSNumber *)diagonalScreenSize pixelPerInch:(nullable NSNumber *)pixelPerInch scale:(nullable NSNumber *)scale { - self = [self initWithPreferredResolution:preferredResolution maxBitrate:maxBitrate supportedFormats:supportedFormats hapticSpatialDataSupported:hapticSpatialDataSupported diagonalScreenSize:diagonalScreenSize pixelPerInch:pixelPerInch scale:scale preferredFPS:nil]; - - return self; +- (instancetype)initWithPreferredResolution:(nullable SDLImageResolution *)preferredResolution maxBitrate:(int32_t)maxBitrate supportedFormats:(nullable NSArray *)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 *)maxBitrate supportedFormats:(nullable NSArray *)supportedFormats hapticSpatialDataSupported:(nullable NSNumber *)hapticSpatialDataSupported diagonalScreenSize:(nullable NSNumber *)diagonalScreenSize pixelPerInch:(nullable NSNumber *)pixelPerInch scale:(nullable NSNumber *)scale preferredFPS:(nullable NSNumber *)preferredFPS { self = [self init]; if (!self) { -- cgit v1.2.1