Skip to content

Commit

Permalink
Merge pull request #1357 from t-yoshii/feature/issue-1304-SDL0237-add…
Browse files Browse the repository at this point in the history
…-feature-to-disable-video-streaming-backgrounded-string

Implement SDL-0237 Add Feature to Disable "Video Streaming Backgrounded String" Feature
  • Loading branch information
joeljfischer committed Aug 9, 2019
2 parents 91be08e + 3eb24df commit 81e0c29
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
5 changes: 5 additions & 0 deletions SmartDeviceLink/SDLStreamingMediaManager.h
Expand Up @@ -109,6 +109,11 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (assign, nonatomic) SDLStreamingEncryptionFlag requestedEncryptionType;

/**
When YES, the StreamingMediaManager will send a black screen with "Video Backgrounded String". Defaults to YES.
*/
@property (assign, nonatomic) BOOL showVideoBackgroundDisplay;

- (instancetype)init NS_UNAVAILABLE;

/**
Expand Down
9 changes: 9 additions & 0 deletions SmartDeviceLink/SDLStreamingMediaManager.m
Expand Up @@ -163,6 +163,11 @@ - (SDLStreamingEncryptionFlag)requestedEncryptionType {
return self.videoLifecycleManager.requestedEncryptionType;
}

- (BOOL)showVideoBackgroundDisplay {
// both audio and video managers should have same type
return self.videoLifecycleManager.showVideoBackgroundDisplay;
}

#pragma mark - Setters
- (void)setRootViewController:(nullable UIViewController *)rootViewController {
self.videoLifecycleManager.rootViewController = rootViewController;
Expand All @@ -173,6 +178,10 @@ - (void)setRequestedEncryptionType:(SDLStreamingEncryptionFlag)requestedEncrypti
self.audioLifecycleManager.requestedEncryptionType = requestedEncryptionType;
}

- (void)setShowVideoBackgroundDisplay:(BOOL)showVideoBackgroundDisplay {
self.videoLifecycleManager.showVideoBackgroundDisplay = showVideoBackgroundDisplay;
}

@end

NS_ASSUME_NONNULL_END
6 changes: 6 additions & 0 deletions SmartDeviceLink/SDLStreamingVideoLifecycleManager.h
Expand Up @@ -130,6 +130,12 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (assign, nonatomic) SDLStreamingEncryptionFlag requestedEncryptionType;

/**
When YES, the StreamingMediaManager will send a black screen with "Video Backgrounded String". Defaults to YES.
*/
@property (assign, nonatomic) BOOL showVideoBackgroundDisplay;


- (instancetype)init NS_UNAVAILABLE;

/**
Expand Down
5 changes: 4 additions & 1 deletion SmartDeviceLink/SDLStreamingVideoLifecycleManager.m
Expand Up @@ -122,6 +122,7 @@ - (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connecti
_useDisplayLink = configuration.streamingMediaConfig.enableForcedFramerateSync;
_screenSize = SDLDefaultScreenSize;
_backgroundingPixelBuffer = NULL;
_showVideoBackgroundDisplay = YES;
_preferredFormatIndex = 0;
_preferredResolutionIndex = 0;

Expand Down Expand Up @@ -272,7 +273,9 @@ - (void)didEnterStateAppInactive {
SDLLogD(@"App became inactive");
if (!self.protocol) { return; }

[self sdl_sendBackgroundFrames];
if (_showVideoBackgroundDisplay) {
[self sdl_sendBackgroundFrames];
}
[self.touchManager cancelPendingTouches];

if (self.isVideoConnected) {
Expand Down
Expand Up @@ -90,6 +90,7 @@ __block void (^sendNotificationForHMILevel)(SDLHMILevel hmiLevel, SDLVideoStream
expect(@(CGSizeEqualToSize(streamingLifecycleManager.screenSize, CGSizeZero))).to(equal(@YES));
expect(@(streamingLifecycleManager.pixelBufferPool == NULL)).to(equal(@YES));
expect(@(streamingLifecycleManager.requestedEncryptionType)).to(equal(@(SDLStreamingEncryptionFlagNone)));
expect(@(streamingLifecycleManager.showVideoBackgroundDisplay)).to(equal(@YES));
expect(streamingLifecycleManager.currentAppState).to(equal(SDLAppStateActive));
expect(streamingLifecycleManager.currentVideoStreamState).to(equal(SDLVideoStreamManagerStateStopped));
expect(streamingLifecycleManager.videoFormat).to(beNil());
Expand Down

0 comments on commit 81e0c29

Please sign in to comment.