Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement SDL 0179 - Pixel density and Scale #1401

Closed
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
6d00081
Adding new properties 'pixel', 'density' and 'scale' in 'SDLVideoStre…
lnafarrateluxoft Jul 23, 2019
addae68
Accessing SDLVideoStreamingCapability from SDLCarWindow, to apply cha…
lnafarrateluxoft Jul 23, 2019
a115a48
Calculating the correct coordinates by dividing the incoming coords w…
lnafarrateluxoft Jul 25, 2019
4e5b88c
Fixing tests for new changes in implementation for 'Pixel density and…
lnafarrateluxoft Jul 25, 2019
6f46e1e
Adding Unit Tests for Pixel density and Scale proposal.
lnafarrateluxoft Jul 25, 2019
e4a8547
Merge remote-tracking branch 'upstream/develop' into feature/pixel_de…
lnafarrateluxoft Jul 25, 2019
05ed747
Fixing unit tests.
lnafarrateluxoft Jul 25, 2019
f138bd5
Merge remote-tracking branch 'upstream/develop' into feature/0179_pix…
lnafarrateluxoft Aug 5, 2019
fcf51e3
Addressing comment in PR to copy OnTouchEvent before modification.
lnafarrateluxoft Aug 5, 2019
d499eff
Merge remote-tracking branch 'upstream/develop' into feature/0179_pix…
lnafarrateluxoft Aug 9, 2019
31d9165
Fixing video frame dimensions, applying scale. Now video frame and vi…
lnafarrateluxoft Aug 9, 2019
505ca7f
Merge remote-tracking branch 'upstream/develop' into feature/0179_pix…
lnafarrateluxoft Aug 26, 2019
4cd321e
Addressing comments in PR.
lnafarrateluxoft Aug 27, 2019
a0a3269
update Travis script (sdk-ios12.2)
yLeonid Sep 12, 2019
b04a22b
fixing warnings in Tests (wrong or incompatible data types)
yLeonid Sep 12, 2019
3b3d553
fixing 6 errors in Tests (expanded macro in SDLStreamingVideoLifecycl…
yLeonid Sep 12, 2019
eb85bd2
fixing warnings in Tests (wrong or incompatible data types)
yLeonid Sep 13, 2019
abcc998
hot fix SDLTouchManagerSpec (FIXIT: SDLTouchManager must unsubscribe …
yLeonid Sep 13, 2019
7e1ffcb
tmp: try to fix SDLTouchManagerSpec
yLeonid Sep 13, 2019
e55dfb0
tmp fixed SDLStreamingVideoLifecycleManagerSpec
yLeonid Sep 13, 2019
7600d81
update if statement using early return as proposed at:
yLeonid Sep 13, 2019
91b30ce
update CarWindow and TouchManager to use scale from StreamingVideoLif…
yLeonid Sep 13, 2019
8f0dca9
update private property of tested class in test to meet its declaration
yLeonid Sep 13, 2019
c551769
update scale in SDLVideoStreamingCapability.m, it can be nil
yLeonid Sep 13, 2019
046c0b9
update SDLVideoStreamingCapabilitySpec tests as requested
yLeonid Sep 13, 2019
9c94d3e
fixing warnings in Tests (wrong or incompatible data types)
yLeonid Sep 12, 2019
4e35c82
fixing warnings in Tests (wrong or incompatible data types)
yLeonid Sep 13, 2019
f26c4d8
update if statement using early return as proposed at:
yLeonid Sep 14, 2019
3aa7be8
hot fix SDLTouchManagerSpec (FIXIT: SDLTouchManager must unsubscribe …
yLeonid Sep 14, 2019
c8a9e5e
update SDLVideoStreamingCapabilitySpec tests as requested
yLeonid Sep 14, 2019
476234e
update scale in SDLVideoStreamingCapability.m, it can be nil
yLeonid Sep 14, 2019
ec2e1ba
Prepare merge into DEVELOP : Merge branch 'feature/0179_pixel_density…
yLeonid Sep 17, 2019
a8b54df
apply code review comments @NicoleYarroch :
yLeonid Sep 18, 2019
01262e2
fix test cases with test review comments @NicoleYarroch :
yLeonid Sep 18, 2019
4feb98d
fix review comments in SDLTouchManagerSpec
yLeonid Sep 19, 2019
17a73f9
fix a review comment @NicoleYarroch
yLeonid Sep 19, 2019
6bf3478
Replace Travis script with its version from develop branch 0e7d70b8
yLeonid Sep 20, 2019
53bf335
Merge branch '0179_pixel_density_and_scale' into develop, fix conflic…
yLeonid Sep 20, 2019
a32f571
Merge branch 'develop' of https://github.com/smartdevicelink/sdl_ios …
yLeonid Sep 23, 2019
e944477
Update SmartDeviceLink/SDLVideoStreamingCapability.h
yLeonid Sep 24, 2019
46ed0f0
0179_pixel_density_and_scale: handle haptic rectangles frames in Focu…
yLeonid Sep 24, 2019
47551a8
SDL 0179 - Pixel density and Scale : update SDLCarWindow and SDLFocus…
yLeonid Sep 27, 2019
8a4cdff
SDL 0179 - Pixel density and Scale : add scale property for SDLCarWin…
yLeonid Sep 27, 2019
9baffbb
0179_pixel_density_and_scale: add CGGeometry extensions for CGRect an…
yLeonid Sep 29, 2019
39dac48
0179_pixel_density_and_scale: fix FocusableItemLocator : scale the re…
yLeonid Sep 29, 2019
a86b539
0179_pixel_density_and_scale: update CGGeometry+SDL
yLeonid Sep 29, 2019
7ae5a2e
0179_pixel_density_and_scale : fix UI tests for HapticManager aka SDL…
yLeonid Sep 29, 2019
2fd9e09
0179_pixel_density_and_scale : discard fallen test
yLeonid Sep 29, 2019
710ad4f
0179_pixel_density_and_scale_v2 : minor update in CGGeometry+SDL
yLeonid Sep 30, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion SmartDeviceLink/SDLCarWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,20 @@ NS_ASSUME_NONNULL_BEGIN
@param configuration The streaming media configuration
@return An instance of this class
*/
- (instancetype)initWithStreamManager:(SDLStreamingVideoLifecycleManager *)streamManager configuration:(SDLStreamingMediaConfiguration *)configuration;
- (instancetype)initWithStreamManager:(SDLStreamingVideoLifecycleManager *)streamManager
configuration:(SDLStreamingMediaConfiguration *)configuration;

/**
Initialize the CarWindow automatic streamer.

@param streamManager The stream manager to use for retrieving head unit dimension details and forwarding video frame data
@param configuration The streaming media configuration
@param scale The scale factor value to scale coordinates from one coordinate space to another
@return An instance of this class
*/
- (instancetype)initWithStreamManager:(SDLStreamingVideoLifecycleManager *)streamManager
configuration:(nonnull SDLStreamingMediaConfiguration *)configuration
scale:(float)scale;

/**
* View Controller that will be streamed.
Expand Down
24 changes: 20 additions & 4 deletions SmartDeviceLink/SDLCarWindow.m
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#import <CommonCrypto/CommonDigest.h>
#import <ImageIO/ImageIO.h>
#import <MobileCoreServices/MobileCoreServices.h>
#import <simd/simd.h>

#import "SDLCarWindow.h"
#import "SDLGlobals.h"
Expand All @@ -21,6 +22,7 @@
#import "SDLStreamingMediaConfiguration.h"
#import "SDLStreamingVideoLifecycleManager.h"
#import "SDLStreamingMediaManagerConstants.h"
#import "SDLVideoStreamingCapability.h"

NS_ASSUME_NONNULL_BEGIN

Expand All @@ -37,14 +39,24 @@ @interface SDLCarWindow ()

@property (assign, nonatomic, getter=isVideoStreamStarted) BOOL videoStreamStarted;

@property (assign, nonatomic) float sdl_scale;
yLeonid marked this conversation as resolved.
Show resolved Hide resolved

@end

@implementation SDLCarWindow

- (instancetype)initWithStreamManager:(SDLStreamingVideoLifecycleManager *)streamManager configuration:(nonnull SDLStreamingMediaConfiguration *)configuration {
- (instancetype)initWithStreamManager:(SDLStreamingVideoLifecycleManager *)streamManager
configuration:(nonnull SDLStreamingMediaConfiguration *)configuration {
return [self initWithStreamManager:streamManager configuration:configuration scale:1.f];
}

- (instancetype)initWithStreamManager:(SDLStreamingVideoLifecycleManager *)streamManager
configuration:(nonnull SDLStreamingMediaConfiguration *)configuration
scale:(float)scale {
self = [super init];
if (!self) { return nil; }

_sdl_scale = simd_clamp(scale, 1.f, 10.f);
_streamManager = streamManager;
_renderingType = configuration.carWindowRenderingType;
_allowMultipleOrientations = configuration.allowMultipleViewControllerOrientations;
Expand All @@ -71,7 +83,7 @@ - (void)syncFrame {
return;
}

CGRect bounds = self.rootViewController.view.bounds;
CGRect bounds = self.sdl_getScaledScreenSizeFrame;

UIGraphicsBeginImageContextWithOptions(bounds.size, YES, 1.0f);
switch (self.renderingType) {
Expand Down Expand Up @@ -120,13 +132,17 @@ - (void)sdl_didReceiveVideoStreamStarted:(NSNotification *)notification {

dispatch_async(dispatch_get_main_queue(), ^{
// If the video stream has started, we want to resize the streamingViewController to the size from the RegisterAppInterface
self.rootViewController.view.frame = CGRectMake(0, 0, self.streamManager.screenSize.width, self.streamManager.screenSize.height);
self.rootViewController.view.frame = self.sdl_getScaledScreenSizeFrame;
self.rootViewController.view.bounds = self.rootViewController.view.frame;

SDLLogD(@"Video stream started, setting CarWindow frame to: %@", NSStringFromCGRect(self.rootViewController.view.bounds));
});
}

- (CGRect)sdl_getScaledScreenSizeFrame {
return CGRectMake(0, 0, self.streamManager.screenSize.width / self.sdl_scale, self.streamManager.screenSize.height / self.sdl_scale);
}

- (void)sdl_didReceiveVideoStreamStopped:(NSNotification *)notification {
self.videoStreamStarted = false;

Expand Down
3 changes: 3 additions & 0 deletions SmartDeviceLink/SDLRPCParameterNames.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameDestinationETA;
extern SDLRPCParameterName const SDLRPCParameterNameDetails;
extern SDLRPCParameterName const SDLRPCParameterNameDeviceInfo;
extern SDLRPCParameterName const SDLRPCParameterNameDeviceStatus;
extern SDLRPCParameterName const SDLRPCParameterNameDiagonalScreenSize;
extern SDLRPCParameterName const SDLRPCParameterNameDialNumberEnabled;
extern SDLRPCParameterName const SDLRPCParameterNameDIDLocation;
extern SDLRPCParameterName const SDLRPCParameterNameDIDResult;
Expand Down Expand Up @@ -460,6 +461,7 @@ extern SDLRPCParameterName const SDLRPCParameterNamePhoneCall;
extern SDLRPCParameterName const SDLRPCParameterNamePhoneCapability;
extern SDLRPCParameterName const SDLRPCParameterNamePhoneNumber;
extern SDLRPCParameterName const SDLRPCParameterNamePhoneRoaming;
extern SDLRPCParameterName const SDLRPCParameterNamePixelPerInch;
extern SDLRPCParameterName const SDLRPCParameterNamePlaylistName;
extern SDLRPCParameterName const SDLRPCParameterNamePlayTone;
extern SDLRPCParameterName const SDLRPCParameterNamePosition;
Expand Down Expand Up @@ -534,6 +536,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameRPM;
extern SDLRPCParameterName const SDLRPCParameterNameRadioText;
extern SDLRPCParameterName const SDLRPCParameterNameSamplingRate;
extern SDLRPCParameterName const SDLRPCParameterNameSatellites;
extern SDLRPCParameterName const SDLRPCParameterNameScale;
extern SDLRPCParameterName const SDLRPCParameterNameScreenParams;
extern SDLRPCParameterName const SDLRPCParameterNameScrollableMessageBody;
extern SDLRPCParameterName const SDLRPCParameterNameSDLVersion;
Expand Down
3 changes: 3 additions & 0 deletions SmartDeviceLink/SDLRPCParameterNames.m
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
SDLRPCParameterName const SDLRPCParameterNameDeviceInfo = @"deviceInfo";
SDLRPCParameterName const SDLRPCParameterNameDeviceStatus = @"deviceStatus";
SDLRPCParameterName const SDLRPCParameterNameDetails = @"details";
SDLRPCParameterName const SDLRPCParameterNameDiagonalScreenSize = @"diagonalScreenSize";
SDLRPCParameterName const SDLRPCParameterNameDialNumberEnabled = @"dialNumberEnabled";
SDLRPCParameterName const SDLRPCParameterNameDIDLocation = @"didLocation";
SDLRPCParameterName const SDLRPCParameterNameDIDResult = @"didResult";
Expand Down Expand Up @@ -454,6 +455,7 @@
SDLRPCParameterName const SDLRPCParameterNamePhoneCapability = @"phoneCapability";
SDLRPCParameterName const SDLRPCParameterNamePhoneNumber = @"phoneNumber";
SDLRPCParameterName const SDLRPCParameterNamePhoneRoaming = @"phoneRoaming";
SDLRPCParameterName const SDLRPCParameterNamePixelPerInch = @"pixelPerInch";
SDLRPCParameterName const SDLRPCParameterNamePrimaryColor = @"primaryColor";
SDLRPCParameterName const SDLRPCParameterNamePlaylistName = @"playlistName";
SDLRPCParameterName const SDLRPCParameterNamePlayTone = @"playTone";
Expand Down Expand Up @@ -529,6 +531,7 @@
SDLRPCParameterName const SDLRPCParameterNameRadioText = @"RT";
SDLRPCParameterName const SDLRPCParameterNameSamplingRate = @"samplingRate";
SDLRPCParameterName const SDLRPCParameterNameSatellites = @"satellites";
SDLRPCParameterName const SDLRPCParameterNameScale = @"scale";
SDLRPCParameterName const SDLRPCParameterNameScreenParams = @"screenParams";
SDLRPCParameterName const SDLRPCParameterNameScrollableMessageBody = @"scrollableMessageBody";
SDLRPCParameterName const SDLRPCParameterNameSDLVersion = @"sdlVersion";
Expand Down
2 changes: 2 additions & 0 deletions SmartDeviceLink/SDLStreamingVideoLifecycleManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
@class SDLStateMachine;
@class SDLStreamingMediaConfiguration;
@class SDLTouchManager;
@class SDLVideoStreamingCapability;

@protocol SDLConnectionManagerType;
@protocol SDLFocusableItemLocatorType;
Expand All @@ -35,6 +36,7 @@ NS_ASSUME_NONNULL_BEGIN

@property (strong, nonatomic, readonly) SDLStateMachine *videoStreamStateMachine;
@property (strong, nonatomic, readonly) SDLVideoStreamManagerState *currentVideoStreamState;
@property (nullable, strong, nonatomic, readonly) SDLVideoStreamingCapability *videoStreamingCapability;

@property (strong, nonatomic, readonly) SDLStateMachine *appStateMachine;
@property (strong, nonatomic, readonly) SDLAppState *currentAppState;
Expand Down
17 changes: 14 additions & 3 deletions SmartDeviceLink/SDLStreamingVideoLifecycleManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ @interface SDLStreamingVideoLifecycleManager() <SDLVideoEncoderDelegate>
@property (assign, nonatomic, readonly, getter=isAppStateVideoStreamCapable) BOOL appStateVideoStreamCapable;
@property (assign, nonatomic, readonly, getter=isHmiStateVideoStreamCapable) BOOL hmiStateVideoStreamCapable;

@property (nullable, strong, nonatomic, readwrite) SDLVideoStreamingCapability *videoStreamingCapability;

@property (strong, nonatomic, readwrite) SDLStateMachine *videoStreamStateMachine;
@property (strong, nonatomic, readwrite) SDLStateMachine *appStateMachine;

Expand Down Expand Up @@ -112,11 +114,11 @@ - (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connecti
}

SDLLogD(@"Initializing CarWindow");
_carWindow = [[SDLCarWindow alloc] initWithStreamManager:self configuration:configuration.streamingMediaConfig];
_carWindow = [[SDLCarWindow alloc] initWithStreamManager:self configuration:configuration.streamingMediaConfig scale:self.sdl_scale];
yLeonid marked this conversation as resolved.
Show resolved Hide resolved
_carWindow.rootViewController = configuration.streamingMediaConfig.rootViewController;
}

_touchManager = [[SDLTouchManager alloc] initWithHitTester:(id)_focusableItemManager];
_touchManager = [[SDLTouchManager alloc] initWithHitTester:(id)_focusableItemManager scale:self.sdl_scale];

_requestedEncryptionType = configuration.streamingMediaConfig.maximumDesiredEncryption;
_dataSource = configuration.streamingMediaConfig.dataSource;
Expand Down Expand Up @@ -252,6 +254,11 @@ - (SDLVideoStreamManagerState *)currentVideoStreamState {
return self.videoStreamStateMachine.currentState;
}

- (float)sdl_scale {
const float scale = self.videoStreamingCapability.scale.floatValue;
return (scale > 1.0) ? scale : 1.0;
}

#pragma mark - State Machines
#pragma mark App State
+ (NSDictionary<SDLState *, SDLAllowableStateTransitions *> *)sdl_appStateTransitionDictionary {
Expand Down Expand Up @@ -403,7 +410,9 @@ - (void)didEnterStateVideoStreamReady {
NSAssert(self.videoFormat != nil, @"No video format is known, but it must be if we got a protocol start service response");

SDLLogD(@"Attempting to create video encoder");
self.videoEncoder = [[SDLH264VideoEncoder alloc] initWithProtocol:self.videoFormat.protocol dimensions:self.screenSize ssrc:self.ssrc properties:self.videoEncoderSettings delegate:self error:&error];
const float scale = self.sdl_scale;
CGSize scaledScreenSize = CGSizeMake(self.screenSize.width / scale, self.screenSize.height / scale);
self.videoEncoder = [[SDLH264VideoEncoder alloc] initWithProtocol:self.videoFormat.protocol dimensions:scaledScreenSize ssrc:self.ssrc properties:self.videoEncoderSettings delegate:self error:&error];

if (error || self.videoEncoder == nil) {
SDLLogE(@"Could not create a video encoder: %@", error);
Expand Down Expand Up @@ -728,6 +737,8 @@ - (void)sdl_requestVideoCapabilities:(SDLVideoCapabilityResponseHandler)response
}

SDLVideoStreamingCapability *videoCapability = ((SDLGetSystemCapabilityResponse *)response).systemCapability.videoStreamingCapability;
self.videoStreamingCapability = videoCapability;
self.touchManager.scale = self.sdl_scale;
SDLLogD(@"Video capabilities response received: %@", videoCapability);
responseHandler(videoCapability);
}];
Expand Down
15 changes: 15 additions & 0 deletions SmartDeviceLink/SDLTouchManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ typedef void(^SDLTouchEventHandler)(SDLTouch *touch, SDLTouchType type);
*/
@property (nonatomic, assign, getter=isTouchEnabled) BOOL touchEnabled;

/**
* @abstract
The scale factor value to scale coordinates from one coordinate space to another
*/
@property (nonatomic, assign) float scale;

/**
* @abstract
* Cancels pending touch event timers that may be in progress.
Expand All @@ -96,6 +102,15 @@ typedef void(^SDLTouchEventHandler)(SDLTouch *touch, SDLTouchType type);
*/
- (instancetype)initWithHitTester:(nullable id<SDLFocusableItemHitTester>)hitTester;

/**
Initialize a touch manager with a hit tester if available and a scale factor

@param hitTester The hit tester to be used to correlate a point with a view
@param scale The scale factor value to scale coordinates from one coordinate space to another
@return The initialized touch manager
*/
- (instancetype)initWithHitTester:(nullable id<SDLFocusableItemHitTester>)hitTester scale:(float)scale;

/**
Called by SDLStreamingMediaManager in sync with the streaming framerate. This helps to moderate panning gestures by allowing the UI to be modified in time with the framerate.
*/
Expand Down
41 changes: 35 additions & 6 deletions SmartDeviceLink/SDLTouchManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
// Copyright © 2016 smartdevicelink. All rights reserved.
//

#import "SDLTouchManager.h"
#import <simd/simd.h>

#import "SDLTouchManager.h"
#import "CGPoint_Util.h"

#import "SDLGlobals.h"
Expand Down Expand Up @@ -102,25 +103,31 @@ @interface SDLTouchManager ()

@implementation SDLTouchManager

- (instancetype)initWithHitTester:(nullable id<SDLFocusableItemHitTester>)hitTester {
self = [super init];
if (!self) {
- (instancetype)initWithHitTester:(nullable id<SDLFocusableItemHitTester>)hitTester
scale:(float)scale {
if (!(self = [super init])) {
return nil;
}

_hitTester = hitTester;
_scale = simd_clamp(scale, 1.f, 10.f);
_movementTimeThreshold = 0.05f;
_tapTimeThreshold = 0.4f;
_tapDistanceThreshold = 50.0f;
_panDistanceThreshold = 8.0f;
_touchEnabled = YES;
_enableSyncedPanning = YES;

//TODO: unsubscribe from notifications somewhere
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_onTouchEvent:) name:SDLDidReceiveTouchEventNotification object:nil];

return self;
}

- (instancetype)initWithHitTester:(nullable id<SDLFocusableItemHitTester>)hitTester {
return [self initWithHitTester:hitTester scale:1.f];
}

#pragma mark - Public
- (void)cancelPendingTouches {
[self sdl_cancelSingleTapTimer];
Expand Down Expand Up @@ -184,7 +191,8 @@ - (void)sdl_onTouchEvent:(SDLRPCNotificationNotification *)notification {
return;
}

SDLOnTouchEvent* onTouchEvent = (SDLOnTouchEvent*)notification.notification;
SDLOnTouchEvent *onTouchEvent = (SDLOnTouchEvent *)notification.notification;
onTouchEvent = [self sdl_applyScaleToEventCoordinates:onTouchEvent.copy];

SDLTouchType touchType = onTouchEvent.type;
[onTouchEvent.event enumerateObjectsUsingBlock:^(SDLTouchEvent *touchEvent, NSUInteger idx, BOOL *stop) {
Expand Down Expand Up @@ -212,6 +220,27 @@ - (void)sdl_onTouchEvent:(SDLRPCNotificationNotification *)notification {
}];
}

/**
* Modifies the existing coordinates of the SDLOnTouchEvent, based on the received 'scale' value.

* This will match the coordinates to the scaled resolution of the video.

* @param onTouchEvent A SDLOnTouchEvent with coordinates.
*/
- (SDLOnTouchEvent *)sdl_applyScaleToEventCoordinates:(SDLOnTouchEvent *)onTouchEvent {
const float scale = self.scale;
if (scale <= 1.f) {
return onTouchEvent;
}
for (SDLTouchEvent *touchEvent in onTouchEvent.event) {
for (SDLTouchCoord *coord in touchEvent.coord) {
coord.x = @(coord.x.floatValue / scale);
coord.y = @(coord.y.floatValue / scale);
}
}
return onTouchEvent;
}

#pragma mark - Private
/**
* Handles a BEGIN touch event sent by Core
Expand Down
28 changes: 27 additions & 1 deletion SmartDeviceLink/SDLVideoStreamingCapability.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface SDLVideoStreamingCapability : SDLRPCStruct

- (instancetype)initWithPreferredResolution:(nullable SDLImageResolution *)preferredResolution maxBitrate:(int32_t)maxBitrate supportedFormats:(nullable NSArray<SDLVideoStreamingFormat *> *)supportedFormats hapticDataSupported:(BOOL)hapticDataSupported;
- (instancetype)initWithPreferredResolution:(nullable SDLImageResolution *)preferredResolution maxBitrate:(int32_t)maxBitrate supportedFormats:(nullable NSArray<SDLVideoStreamingFormat *> *)supportedFormats hapticDataSupported:(BOOL)hapticDataSupported __deprecated_msg("Use initWithPreferredResolution:maxBitrate:supportedFormats:hapticDataSupported:diagonalScreenSize:pixelPerInch:scale: instead");;
yLeonid marked this conversation as resolved.
Show resolved Hide resolved

/**
Contains information about this system's video streaming capabilities
*/
- (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;

/**
The preferred resolution of a video stream for decoding and rendering on HMI
Expand Down Expand Up @@ -48,6 +53,27 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nullable, strong, nonatomic) NSNumber<SDLBool> *hapticSpatialDataSupported;

/**
The diagonal screen size in inches.

Optional
*/
@property (nullable, strong, nonatomic) NSNumber<SDLFloat> *diagonalScreenSize;

/**
PPI is the diagonal resolution in pixels divided by the diagonal screen size in inches.

Optional
*/
@property (nullable, strong, nonatomic) NSNumber<SDLFloat> *pixelPerInch;

/**
The scaling factor the app should use to change the size of the projecting view.

Optional
*/
@property (nullable, strong, nonatomic) NSNumber<SDLFloat> *scale;

@end

NS_ASSUME_NONNULL_END
Loading