Open
Conversation
Co-authored-by: Jose Olivera Ortega <joseantonio.oliveraortega@vonage.com>
| // Clean up screen capturer if any | ||
| OTScreenCapturer sc = sharedState.getScreenCapturers().remove(sessionId); | ||
| if (sc != null) { | ||
| try { sc.stopCapture(); } catch (Throwable ignored) {} |
There was a problem hiding this comment.
What happens if this fails? Can we just put both stopCapture and destroy in the same try/catch?
Maybe we should log something in the catch at least?
Contributor
Author
There was a problem hiding this comment.
Yes, it makes sense, thank you @igorperunovicvonage. I have combined both method invocations into a single try/catch block. Regarding Logging, I'm not sure we need it here since this is just a guard, and even if it fails JAVAs garbage collector should remove it from memory anyway.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new OpenTok video renderer to enable accurate screen sharing overlays by capturing subscriber video frames as Bitmaps. It also adds infrastructure to manage screen capturers per session and wires up subscriber overlays so their video can be composited into screen capture streams. The most important changes are grouped below:
Screen Capture Infrastructure:
screenCapturersmap to theOTRNsingleton, with a getter for accessing all activeOTScreenCapturerinstances by session ID. [1] [2]OTRNPublisher, when using the "screen" video source, anOTScreenCaptureris created, stored in the shared state, and cleaned up on view detachment. [1] [2] [3]Subscriber Video Frame Capture and Overlay:
OTCaptureBmpVideoRenderer, a custom OpenTok renderer that displays subscriber video in aGLSurfaceViewand captures each frame as a Bitmap for overlay during screen sharing.OTRNSubscriberto useOTCaptureBmpVideoRendererfor each subscriber, wiring itsonBitmapFramecallback to update the correspondingOTScreenCapturerwith the latest video frame Bitmap.Overlay Wiring and Lifecycle:
OTRNSubscriberto wire up subscriber overlays to the appropriateOTScreenCapturerwhenever a subscriber view is created or when the subscriber is connected. [1] [2] [3]Feature screenshots are attached