Repository navigation
libobs: Extract obs_encoder_get_name without behavior changes - #5044
Merged
Merged
Conversation
Pin obs_encoder_get_name against the unchanged C before its body moves out of obs-encoder.c.h: the NULL encoder returns NULL with exactly one debug log naming the function and parameter, and a valid encoder returns its own context name pointer without logging, for a given name, the name generated for an empty one, and the new name after a rename. Refs #4239 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Move the obs_encoder_get_name body verbatim from obs-encoder.c.h into libobs/obs-encoder-get-name.c.h, in sorted position in the core-output unity group, ahead of its Rust port. No code changes: the function keeps its exported signature and its NULL-parameter debug log. Refs #4239 Co-Authored-By: Claude Opus 5.5 <[email protected]> Ci-Attestation: {"at":1794975622,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["3c07377a58278988df5bdd1f877b9cd838d59a88"],"secs":56,"stamp":"6bd87bc99a527338ecc4465c8d737269","tree":"d1a0a133ff5f1c6d91474947e5cc8c7b64690b28","v":1,"via":"run"} Ci-Attestation: {"at":1794975622,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["3c07377a58278988df5bdd1f877b9cd838d59a88"],"secs":56,"stamp":"2f91a8f95d75e24e208df6d52bc9f6b0","tree":"d1a0a133ff5f1c6d91474947e5cc8c7b64690b28","v":1,"via":"run"} Ci-Attestation: {"at":1794975622,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["3c07377a58278988df5bdd1f877b9cd838d59a88"],"secs":56,"stamp":"fbbe0cdb04a9e0befe1441fa197e7128","tree":"d1a0a133ff5f1c6d91474947e5cc8c7b64690b28","v":1,"via":"run"} Ci-Attestation: {"at":1794975622,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["3c07377a58278988df5bdd1f877b9cd838d59a88"],"secs":56,"stamp":"35cdb37a62ee0cae4dbe6bd7f8f4b10c","tree":"d1a0a133ff5f1c6d91474947e5cc8c7b64690b28","v":1,"via":"run"} Ci-Attestation: {"at":1794975565,"gate":"general/all/client-lint","host":"linux-x86_64","key":"1b80c1c487eb116aa80e187d291b7cd5e09ca9528ee4d9603735d30b9f976609","lane":"client-lint","parents":["3c07377a58278988df5bdd1f877b9cd838d59a88"],"secs":88,"stamp":"df0dec095958b658054c62bf541f77eb","tree":"d1a0a133ff5f1c6d91474947e5cc8c7b64690b28","v":1,"via":"run"} Ci-Attestation: {"at":1794975622,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["3c07377a58278988df5bdd1f877b9cd838d59a88"],"secs":56,"stamp":"889fcd7f281d23a1ab049bcc584fbd47","tree":"d1a0a133ff5f1c6d91474947e5cc8c7b64690b28","v":1,"via":"run"} Ci-Attestation: {"at":1794975565,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"1b80c1c487eb116aa80e187d291b7cd5e09ca9528ee4d9603735d30b9f976609","lane":"client-lint","parents":["3c07377a58278988df5bdd1f877b9cd838d59a88"],"secs":88,"stamp":"dd43e98c4d5a7edb30b8247a701ea712","tree":"d1a0a133ff5f1c6d91474947e5cc8c7b64690b28","v":1,"via":"run"} Ci-Attestation: {"at":1794975565,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"1b80c1c487eb116aa80e187d291b7cd5e09ca9528ee4d9603735d30b9f976609","lane":"client-lint","parents":["3c07377a58278988df5bdd1f877b9cd838d59a88"],"secs":88,"stamp":"560a6a0b6440ccb217870480d8da8cde","tree":"d1a0a133ff5f1c6d91474947e5cc8c7b64690b28","v":1,"via":"run"} Ci-Attestation: {"at":1794975565,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"1b80c1c487eb116aa80e187d291b7cd5e09ca9528ee4d9603735d30b9f976609","lane":"client-lint","parents":["3c07377a58278988df5bdd1f877b9cd838d59a88"],"secs":88,"stamp":"06ffc5a2f10076bbaedac25de74a6829","tree":"d1a0a133ff5f1c6d91474947e5cc8c7b64690b28","v":1,"via":"run"} Ci-Attestation: {"at":1794975565,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"1b80c1c487eb116aa80e187d291b7cd5e09ca9528ee4d9603735d30b9f976609","lane":"client-lint","parents":["3c07377a58278988df5bdd1f877b9cd838d59a88"],"secs":88,"stamp":"5f69c8f7df73f874508dd8315ad29ba9","tree":"d1a0a133ff5f1c6d91474947e5cc8c7b64690b28","v":1,"via":"run"} Ci-Attestation: {"at":1794975565,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"1b80c1c487eb116aa80e187d291b7cd5e09ca9528ee4d9603735d30b9f976609","lane":"client-lint","parents":["3c07377a58278988df5bdd1f877b9cd838d59a88"],"secs":88,"stamp":"3da2aefdca7aa2a5070e5ac354205ab2","tree":"d1a0a133ff5f1c6d91474947e5cc8c7b64690b28","v":1,"via":"run"} Ci-Attestation: {"at":1794975565,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"1b80c1c487eb116aa80e187d291b7cd5e09ca9528ee4d9603735d30b9f976609","lane":"client-lint","parents":["3c07377a58278988df5bdd1f877b9cd838d59a88"],"secs":88,"stamp":"43057d40c13f082683c2b0eceb2f1446","tree":"d1a0a133ff5f1c6d91474947e5cc8c7b64690b28","v":1,"via":"run"} Ci-Attestation: {"at":1794975565,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"1b80c1c487eb116aa80e187d291b7cd5e09ca9528ee4d9603735d30b9f976609","lane":"client-lint","parents":["3c07377a58278988df5bdd1f877b9cd838d59a88"],"secs":88,"stamp":"57c825bb29afc053ea058632b01652f2","tree":"d1a0a133ff5f1c6d91474947e5cc8c7b64690b28","v":1,"via":"run"} Ci-Attestation: {"at":1794975565,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"1b80c1c487eb116aa80e187d291b7cd5e09ca9528ee4d9603735d30b9f976609","lane":"client-lint","parents":["3c07377a58278988df5bdd1f877b9cd838d59a88"],"secs":88,"stamp":"dd2d5b3eb96d66160a09bc558b89ae9a","tree":"d1a0a133ff5f1c6d91474947e5cc8c7b64690b28","v":1,"via":"run"} Ci-Attestation: {"at":1794975565,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"1b80c1c487eb116aa80e187d291b7cd5e09ca9528ee4d9603735d30b9f976609","lane":"client-lint","parents":["3c07377a58278988df5bdd1f877b9cd838d59a88"],"secs":88,"stamp":"5dbeefde3de6c382f27259f8f5a11057","tree":"d1a0a133ff5f1c6d91474947e5cc8c7b64690b28","v":1,"via":"run"} Ci-Attestation: {"at":1794975565,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"1b80c1c487eb116aa80e187d291b7cd5e09ca9528ee4d9603735d30b9f976609","lane":"client-lint","parents":["3c07377a58278988df5bdd1f877b9cd838d59a88"],"secs":88,"stamp":"cb01b33b31c321ea1ab920c7699d711b","tree":"d1a0a133ff5f1c6d91474947e5cc8c7b64690b28","v":1,"via":"run"} Ci-Attestation: {"at":1794975565,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"1b80c1c487eb116aa80e187d291b7cd5e09ca9528ee4d9603735d30b9f976609","lane":"client-lint","parents":["3c07377a58278988df5bdd1f877b9cd838d59a88"],"secs":88,"stamp":"3cc89c13a39b49cc5e32e6455cd562bc","tree":"d1a0a133ff5f1c6d91474947e5cc8c7b64690b28","v":1,"via":"run"} Ci-Attestation: {"at":1794975565,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"1b80c1c487eb116aa80e187d291b7cd5e09ca9528ee4d9603735d30b9f976609","lane":"client-lint","parents":["3c07377a58278988df5bdd1f877b9cd838d59a88"],"secs":88,"stamp":"830ca3f21bb38c1471013f2810132ab0","tree":"d1a0a133ff5f1c6d91474947e5cc8c7b64690b28","v":1,"via":"run"} Ci-Attestation: {"at":1794975824,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"3613fd7a077275629f154941090941430a9c00a3f35fda3fe8f1b0f9303885f1","lane":"client-test-x86_64-unknown-linux-gnu","parents":["3c07377a58278988df5bdd1f877b9cd838d59a88"],"secs":201,"stamp":"93b532557abc6a080ff5baf8161d4981","tree":"d1a0a133ff5f1c6d91474947e5cc8c7b64690b28","v":1,"via":"run"} Client-Checks: {"checks":{"base":"428904c09ca8b3ac457888c6ea57cd9c13b0e820","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.core-output+.h.c","libobs/obs-encoder-get-name.c.h","libobs/obs-encoder.c.h","test/cmocka/test_encoder_get_name.c","test/cmocka/tests.d/test_encoder_get_name.cmake"],"head":"4417a28996b7fd9d3f4ac95c55ae9d1815ed73e8","tools":{"orchestrator-python":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]","schema-dependencies":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]\n{'jsonschema': '4.26.0', 'json_source_map': '1.0.5'}","uv":"uv 0.13.5 (x86_64-unknown-linux-gnu)","xmllint":"xmllint: using libxml version 21504-GITv2.15.4\n compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ICU ISO8859X Regexps Automata RelaxNG Schemas Schematron Modules Debug Zlib"},"tracked-digest":"ee91927457a52be261e353a06d504e4894506eae4208bc6a9fca67346203ed16","tree":"d1a0a133ff5f1c6d91474947e5cc8c7b64690b28"}}
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.
Moves
obs_encoder_get_nameverbatim fromlibobs/obs-encoder.c.hintolibobs/obs-encoder-get-name.c.h, in sorted position in the core-output unity group, ahead of its obs-output port. No behaviour, signature, public header or existing test changes.Refs #4239 (stays open for the Rust port).
Commits
test/cmocka/test_encoder_get_name.c.test_context_namesalready covers generated and duplicate names, but nothing covered the NULL path. The new test pins it: NULL in, NULL out, exactly oneLOG_DEBUGlineobs_encoder_get_name: Null 'encoder' parameter. It also checks that a valid encoder returns its owncontext.namepointer without logging, for a given name, the name generated for an empty one, and the new name afterobs_encoder_set_name.Evidence
This is an extraction, so the characterization has to pass on unchanged C before and after the move.
Before the move (commit 1 only, on master
0ac589d30):After the move (rebased on
428904c09):ctest reports a cmocka
skip()as Passed, so I also ran the binary from the build volume underxvfb-runagainst each library. All four cases ran on both:The first draft of the test called
obs_video_encoder_create(id, NULL, ...)for the unnamed case and failed on both builds, because a NULL name is refused before a name is generated. The test now uses"", which is whattest_context_namesdoes.🤖 Generated with Claude Code