fix: 1181 fix colorspace changes when session clear and fix memory leak with orphaned sessions#1182
Open
mcoliver wants to merge 2 commits intoAcademySoftwareFoundation:mainfrom
Conversation
…onal frame cleanup. Signed-off-by: Michael Oliver <mcoliver@gmail.com>
…cio_source_setup` plugins to reset internal states after session clear. Signed-off-by: Michael Oliver <mcoliver@gmail.com>
Contributor
|
Two great catches ! Thank you @mcoliver ! |
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.
source_setup.pyandocio_source_setup.pyscripts track whether a new Display Group has been created using a variable named _haveNewDisplayGroups. When you open OpenRV normally, this is configured correctly, and properties like sRGB output on the#RVDisplayColornode get activated. However, when you runFile -> Clear, the C++Session::clear()function destroys and immediately recreates theDisplay Group. The python scripts were failing to track this recreation because of missing event listeners.When I loaded an MP4 file immediately after clearing the session, the C++ code successfully identified the MP4 as sRGB and enabled the
RVLinearizestep (darkening the image), but the python scripts skipped setting up the#RVDisplayColornode. Because#RVDisplayColorremained off, the linear image was never lifted back into display color space, rendering it way too dark.I fixed this by adding an explicit listener for the
after-clear-sessionevent in bothsource_setup.pyandocio_source_setup.py. Now, immediately following a session clear, the internal Python flags are properly reset ensuring that the display color setup happens properly when the next file is loaded.Also included a fix for a hardware memory leak. Every time you open an MP4 and then
File -> Clear, OpenRV leaks a VideoToolbox hardware decoding session in macOS. Once you hit the macOS limit for concurrent hardware decoder sessions, FFmpeg will silently fail to allocate a new hardware decoder and fall back to the much slower software decoder (libx264). This fix frees up hardware decoding sessions so they can be available again.Fixes #1181
Linked issues
Summarize your change.
Describe the reason for the change.
Describe what you have tested and on which operating system.
Add a list of changes, and note any that might need special attention during the review.
If possible, provide screenshots.