NDI Output filter - Performance tweaks#1266
Closed
Trouffman wants to merge 6 commits into
Closed
Conversation
…oser to Preview Output
Collaborator
Author
|
This PR is very similar to #1232 |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the NDI offscreen rendering code to align it more closely with the existing NDI Preview Output handling, aiming to improve performance and update the implementation.
- Replace the direct usage of video_frame with a struct declaration
- Introduce a conditional check around the mapping process with associated memory copy improvements
| uint32_t src_offset = f->video_linesize * i; | ||
| memcpy(output_frame.data[0] + dst_offset, f->video_data + src_offset, linesize); | ||
| } | ||
| if (gs_stagesurface_map(f->stagesurface, &f->video_data, &f->video_linesize)) { |
There was a problem hiding this comment.
Handle the scenario where gs_stagesurface_map returns false by adding necessary cleanup or logging, to improve the overall robustness and maintainability of the code.
| } | ||
| if (gs_stagesurface_map(f->stagesurface, &f->video_data, &f->video_linesize)) { | ||
| uint32_t linesize = output_frame.linesize[0]; | ||
| for (uint32_t i = 0; i < f->known_height; i++) { |
There was a problem hiding this comment.
[nitpick] Consider using the pre-increment operator (++i) for consistency with the rest of the code style and any potential minor performance benefits.
Suggested change
| for (uint32_t i = 0; i < f->known_height; i++) { | |
| for (uint32_t i = 0; i < f->known_height; ++i) { |
Collaborator
Author
|
This is superseeded by #1279 |
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.
Refactor video frame handling in ndi_filter_offscreen_render to be closer to Preview Output
Goal
Update the NDI filer codebase to be updated and more similar to the NDI Preview Output rendering.
Context
Disclosure : I do not understand it all for the logic (i am not skilled in anything using gs / drawing textures, etc).
This will stay as a draft until more pairs of eyes can review it.2