diff options
author | Kujtim Shala <kshala@ford.com> | 2018-10-24 14:41:19 +0200 |
---|---|---|
committer | Kujtim Shala <kshala@ford.com> | 2018-10-24 14:41:19 +0200 |
commit | 6289427ff3746fbae15d224ad79cc9fda968e6dd (patch) | |
tree | 6c736df136d36e0cd82bb3512f157ab077b39a8e | |
parent | 0095123ffeb9cf1d104f9c76653710a36a49b8a0 (diff) | |
download | sdl_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.m | 12 |
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]; } |