summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKujtim Shala <kshala@ford.com>2018-10-24 14:41:19 +0200
committerKujtim Shala <kshala@ford.com>2018-10-24 14:41:19 +0200
commit6289427ff3746fbae15d224ad79cc9fda968e6dd (patch)
tree6c736df136d36e0cd82bb3512f157ab077b39a8e
parent0095123ffeb9cf1d104f9c76653710a36a49b8a0 (diff)
downloadsdl_ios-6289427ff3746fbae15d224ad79cc9fda968e6dd.tar.gz
invalidates and deletes the display link if the video stream is suspended (or ready with a valid link)
-rw-r--r--SmartDeviceLink/SDLStreamingVideoLifecycleManager.m12
1 files changed, 12 insertions, 0 deletions
diff --git a/SmartDeviceLink/SDLStreamingVideoLifecycleManager.m b/SmartDeviceLink/SDLStreamingVideoLifecycleManager.m
index 5302e287d..039e45582 100644
--- a/SmartDeviceLink/SDLStreamingVideoLifecycleManager.m
+++ b/SmartDeviceLink/SDLStreamingVideoLifecycleManager.m
@@ -360,6 +360,12 @@ typedef void(^SDLVideoCapabilityResponseHandler)(SDLVideoStreamingCapability *_N
[self.videoEncoder stop];
self.videoEncoder = nil;
}
+
+ if (self.displayLink != nil) {
+ self.displayLink.paused = YES;
+ [self.displayLink invalidate];
+ self.displayLink = nil;
+ }
if (self.videoEncoder == nil) {
NSError* error = nil;
@@ -410,6 +416,12 @@ typedef void(^SDLVideoCapabilityResponseHandler)(SDLVideoStreamingCapability *_N
- (void)didEnterStateVideoStreamSuspended {
SDLLogD(@"Video stream suspended");
+ if (self.displayLink != nil) {
+ self.displayLink.paused = YES;
+ [self.displayLink invalidate];
+ self.displayLink = nil;
+ }
+
[[NSNotificationCenter defaultCenter] postNotificationName:SDLVideoStreamSuspendedNotification object:nil];
}