summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2021-03-18 15:32:57 -0400
committerNicoleYarroch <nicole@livio.io>2021-03-18 15:32:57 -0400
commit5c7c6cffe50a8eb04434552f218b515bea97f865 (patch)
tree6eff7f48248072eab5751f3de078c5e2bfce8f82
parent323562910580c553d83cc17d4a3ca149b5100a9f (diff)
downloadsdl_ios-5c7c6cffe50a8eb04434552f218b515bea97f865.tar.gz
Added slight delay before sending a start service
Signed-off-by: NicoleYarroch <nicole@livio.io>
-rw-r--r--SmartDeviceLink/private/SDLStreamingVideoLifecycleManager.m9
1 files changed, 6 insertions, 3 deletions
diff --git a/SmartDeviceLink/private/SDLStreamingVideoLifecycleManager.m b/SmartDeviceLink/private/SDLStreamingVideoLifecycleManager.m
index f778a80e5..78b25b2f2 100644
--- a/SmartDeviceLink/private/SDLStreamingVideoLifecycleManager.m
+++ b/SmartDeviceLink/private/SDLStreamingVideoLifecycleManager.m
@@ -575,8 +575,7 @@ typedef void(^SDLVideoCapabilityResponseHandler)(SDLVideoStreamingCapability *_N
// Figure out the definitive format that will be used. If the protocol / codec weren't passed in the payload, it's probably a system that doesn't support those properties, which also means it's a system that requires H.264 RAW encoding
self.videoFormat = [[SDLVideoStreamingFormat alloc] initWithCodec:videoAckPayload.videoCodec ?: SDLVideoStreamingCodecH264 protocol:videoAckPayload.videoProtocol ?: SDLVideoStreamingProtocolRAW];
- SDLVideoStreamManagerState *nextState = [self.currentAppState isEqualToEnum:SDLAppStateInactive] ? SDLVideoStreamManagerStateSuspended : SDLVideoStreamManagerStateReady;
- [self.videoStreamStateMachine transitionToState:nextState];
+ [self.videoStreamStateMachine transitionToState:SDLVideoStreamManagerStateReady];
}
- (void)protocol:(SDLProtocol *)protocol didReceiveStartServiceNAK:(SDLProtocolMessage *)startServiceNAK {
@@ -748,7 +747,11 @@ typedef void(^SDLVideoCapabilityResponseHandler)(SDLVideoStreamingCapability *_N
self.focusableItemManager.enableHapticDataRequests = NO;
}
SDLLogD(@"Using generic video capabilites, preferred formats: %@, resolutions: %@, haptics disabled", self.preferredFormats, self.preferredResolutions);
- [self sdl_useVideoCapability:nil];
+
+ // HAX to support legacy head units (SYNC 3.0) as a slight delay is needed between getting the SDLOnHMIStatus notification and starting the video service. Otherwise, video will stream but the screen will be black. Add the delay here as legacy head units doe not support `videoStreamingCapability`.
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.25 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
+ [self sdl_useVideoCapability:nil];
+ });
}
}