fix: Render a synchronous parent with the default effect when capturing filter input directly above it - #198
Merged
Conversation
…ng filter input directly above it
Merged
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.
Summary
Fixes the black output reported in #170. In filter input mode, when Branch Output is the filter closest to its parent source and the parent is a synchronous source that is neither custom-draw nor async (for example an Image source), the branch output now shows the source and the source stays visible in the main preview.
effect_setval_inline: invalid paramanddevice_draw (D3D11): No vertex shader specifiedare no longer logged on every frame.FilterVideoCapture::captureFilterInput()renders the filter target withobs_source_default_render()when the target is the parent itself and the parent has neitherOBS_SOURCE_CUSTOM_DRAWnorOBS_SOURCE_ASYNC. Otherwise it keepsobs_source_video_render().obs_source_process_filter_begin_with_color_space()andobs_source_skip_video_filter().obs_filter_get_parent()on every frame, next toobs_filter_get_target(), so the branch follows the filter's current position in the list.renderTexture(), which drives the parent's filter chain while the source is not rendered by the main mix, reachescaptureFilterInput()through that chain and is fixed by the same change.Only
src/video/filter-video-capture.cppis changed.Root cause
captureFilterInput()rendered the target withobs_source_video_render(). Inside the parent's own filter chain, that call goes toobs_source_main_render(), which passes the current effect (gs_get_effect()) to the parent'svideo_render. No technique is active at that point, so the parent receivesNULL.image_source, then draws nothing. The texrender stays transparent, butcaptureFilterInput()still returnedtrue, so the transparent texture replaced the source in the main mix and was also encoded as the branch output.Design notes
renderTexture()keepsobs_source_video_render(parentSource).obs_source_default_render()would draw the parent without its filter chain, socaptureFilterInput()would never be called from that path.Known limitations
devand applies to any source that releases its content while hidden.NULLeffect. Effect filters placed there are affected the same way in libobs itself, so this is not handled here.Verification
Manual testing
Set the video source to "Filter Input (Experimental)" and enable any output (recording is enough). Keep "Unload image when not showing" off on the Image source. Watch the log for
effect_setval_inline: invalid paramanddevice_draw (D3D11): No vertex shader specified.Image source parent:
dev.Other parents and modes:
dev.dev.Shutdown:
Environments:
Fixes #170
🤖 Generated with Claude Code