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 1 commit
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
7 changes: 5 additions & 2 deletions SmartDeviceLink/SDLCarWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#import "SDLStreamingMediaConfiguration.h"
#import "SDLStreamingVideoLifecycleManager.h"
#import "SDLStreamingMediaManagerConstants.h"
#import "SDLVideoStreamingCapability.h"

NS_ASSUME_NONNULL_BEGIN

Expand Down Expand Up @@ -56,7 +55,7 @@ - (instancetype)initWithStreamManager:(SDLStreamingVideoLifecycleManager *)strea
self = [super init];
if (!self) { return nil; }

_sdl_scale = simd_clamp(scale, 1.f, 10.f);
[self setScale:scale];
_streamManager = streamManager;
_renderingType = configuration.carWindowRenderingType;
_allowMultipleOrientations = configuration.allowMultipleViewControllerOrientations;
Expand Down Expand Up @@ -177,6 +176,10 @@ - (void)setRootViewController:(nullable UIViewController *)rootViewController {
});
}

- (void)setScale:(float)scale {
_sdl_scale = simd_clamp(scale, 1.f, 10.f);
}

#pragma mark - Private Helpers
+ (nullable CVPixelBufferRef)sdl_pixelBufferForImageRef:(CGImageRef)imageRef usingPool:(CVPixelBufferPoolRef)pool {
size_t imageWidth = CGImageGetWidth(imageRef);
Expand Down
6 changes: 6 additions & 0 deletions SmartDeviceLink/SDLFocusableItemLocatorType.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (void)updateInterfaceLayout;

/**
update scale value
@param scale is the scale factor value
*/
- (void)setScale:(float)scale;

@end

NS_ASSUME_NONNULL_END
15 changes: 14 additions & 1 deletion SmartDeviceLink/SDLStreamingVideoLifecycleManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ @interface SDLStreamingVideoLifecycleManager() <SDLVideoEncoderDelegate>

@end

/**
Disclose car window private interface
*/
@interface SDLCarWindow (scale)

- (void)setScale:(float)scale;

@end


@implementation SDLStreamingVideoLifecycleManager

- (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager configuration:(SDLConfiguration *)configuration {
Expand Down Expand Up @@ -741,7 +751,10 @@ - (void)sdl_requestVideoCapabilities:(SDLVideoCapabilityResponseHandler)response

SDLVideoStreamingCapability *videoCapability = ((SDLGetSystemCapabilityResponse *)response).systemCapability.videoStreamingCapability;
self.videoStreamingCapability = videoCapability;
self.touchManager.scale = self.sdl_scale;
const float scale = self.sdl_scale;
self.touchManager.scale = scale;
[self.carWindow setScale:scale];
[self.focusableItemManager setScale:scale];
yLeonid marked this conversation as resolved.
Show resolved Hide resolved
SDLLogD(@"Video capabilities response received: %@", videoCapability);
responseHandler(videoCapability);
}];
Expand Down