From 8c0e9689641c450e40b93a56d93158ec3dde9de5 Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Thu, 19 Nov 2026 00:11:18 -0800 Subject: [PATCH 1/3] test: characterize encoder texture-input activity in C (Refs #5212) --- test/cmocka/test_encoder_video_tex_active.c | 113 ++++++++++++++++++ .../test_encoder_video_tex_active.cmake | 32 +++++ 2 files changed, 145 insertions(+) create mode 100644 test/cmocka/test_encoder_video_tex_active.c create mode 100644 test/cmocka/tests.d/test_encoder_video_tex_active.cmake diff --git a/test/cmocka/test_encoder_video_tex_active.c b/test/cmocka/test_encoder_video_tex_active.c new file mode 100644 index 0000000000..834955ed69 --- /dev/null +++ b/test/cmocka/test_encoder_video_tex_active.c @@ -0,0 +1,113 @@ +/* C-source characterization of obs_encoder_video_tex_active (#5212). + * Compile the current production body with a recording mix lookup and real + * private layouts. This does not characterize GPU support or replace the + * unchanged shared-library checks in test_encoder_tex_active_null.c. A later + * Rust swap must relink this fixture through real private field adapters. */ +#include +#include +#include +#include +#include +#include "obs-internal.h" + +static struct obs_encoder encoder; +static struct obs_core_video_mix mix; +static unsigned char video_token; +static video_t *expected_media; +static struct obs_core_video_mix *lookup_result; +static unsigned lookup_calls; +static bool nv12_after_lookup, p010_after_lookup; + +struct obs_core_video_mix *get_mix_for_video(video_t *video) +{ + assert_ptr_equal(video, expected_media); + lookup_calls++; + /* The query must read flags after the lookup returns its selected mix. */ + mix.using_nv12_tex = nv12_after_lookup; + mix.using_p010_tex = p010_after_lookup; + return lookup_result; +} + +static void check_query(enum video_format format, bool expected) +{ + unsigned char encoder_before[sizeof(encoder)], mix_before[sizeof(mix)]; + mix.using_nv12_tex = nv12_after_lookup; + mix.using_p010_tex = p010_after_lookup; + memcpy(encoder_before, &encoder, sizeof(encoder)); + memcpy(mix_before, &mix, sizeof(mix)); + lookup_calls = 0; + assert_int_equal(obs_encoder_video_tex_active(&encoder, format), expected); + assert_int_equal(lookup_calls, 1); + assert_memory_equal(&encoder, encoder_before, sizeof(encoder)); + assert_memory_equal(&mix, mix_before, sizeof(mix)); +} + +static int setup(void **state) +{ + (void)state; + memset(&encoder, 0, sizeof(encoder)); + memset(&mix, 0, sizeof(mix)); + expected_media = (video_t *)&video_token; + encoder.media = expected_media; + lookup_result = &mix; + nv12_after_lookup = p010_after_lookup = false; + lookup_calls = 0; + return 0; +} + +static void missing_mix(void **state) +{ + (void)state; + lookup_result = NULL; + nv12_after_lookup = p010_after_lookup = true; + check_query(VIDEO_FORMAT_NV12, false); + check_query(VIDEO_FORMAT_P010, false); + check_query(VIDEO_FORMAT_RGBA, false); + /* A live encoder with no video still performs the exact NULL lookup. */ + encoder.media = expected_media = NULL; + check_query(VIDEO_FORMAT_NV12, false); + check_query(VIDEO_FORMAT_P010, false); + check_query(VIDEO_FORMAT_NONE, false); +} + +static void format_and_flag_matrix(void **state) +{ + (void)state; + for (unsigned flags = 0; flags < 4; flags++) { + nv12_after_lookup = (flags & 1) != 0; + p010_after_lookup = (flags & 2) != 0; + /* The real enum is contiguous, NONE through R10L; no host defaults. */ + for (enum video_format format = VIDEO_FORMAT_NONE; format <= VIDEO_FORMAT_R10L; format++) { + bool expected = (format == VIDEO_FORMAT_NV12 && nv12_after_lookup) || + (format == VIDEO_FORMAT_P010 && p010_after_lookup); + check_query(format, expected); + } + } +} + +static void reads_selected_mix_after_lookup(void **state) +{ + (void)state; + for (unsigned flags = 0; flags < 4; flags++) { + nv12_after_lookup = (flags & 1) != 0; + p010_after_lookup = (flags & 2) != 0; + mix.using_nv12_tex = !nv12_after_lookup; + mix.using_p010_tex = !p010_after_lookup; + lookup_calls = 0; + assert_int_equal(obs_encoder_video_tex_active(&encoder, VIDEO_FORMAT_NV12), nv12_after_lookup); + assert_int_equal(lookup_calls, 1); + mix.using_nv12_tex = !nv12_after_lookup; + mix.using_p010_tex = !p010_after_lookup; + lookup_calls = 0; + assert_int_equal(obs_encoder_video_tex_active(&encoder, VIDEO_FORMAT_P010), p010_after_lookup); + assert_int_equal(lookup_calls, 1); + } +} + +int main(void) +{ + const struct CMUnitTest tests[] = {cmocka_unit_test_setup(missing_mix, setup), + cmocka_unit_test_setup(format_and_flag_matrix, setup), + cmocka_unit_test_setup(reads_selected_mix_after_lookup, setup)}; + return cmocka_run_group_tests(tests, NULL, NULL); +} diff --git a/test/cmocka/tests.d/test_encoder_video_tex_active.cmake b/test/cmocka/tests.d/test_encoder_video_tex_active.cmake new file mode 100644 index 0000000000..da115c5194 --- /dev/null +++ b/test/cmocka/tests.d/test_encoder_video_tex_active.cmake @@ -0,0 +1,32 @@ +include("${CMAKE_CURRENT_LIST_DIR}/../write-if-different.cmake") +# Characterize the original C body before its behavior-neutral extraction. +set(_tex_active_source "${CMAKE_SOURCE_DIR}/libobs/obs-encoder.c.h") +set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${_tex_active_source}") +file(READ "${_tex_active_source}" _tex_active_text) +string(FIND "${_tex_active_text}" "bool obs_encoder_video_tex_active(" _tex_active_start) +if(_tex_active_start LESS 0) + message(FATAL_ERROR "Cannot locate obs_encoder_video_tex_active") +endif() +string(SUBSTRING "${_tex_active_text}" ${_tex_active_start} -1 _tex_active_tail) +string(FIND "${_tex_active_tail}" "\n}\n" _tex_active_end) +math(EXPR _tex_active_length "${_tex_active_end} + 3") +string(SUBSTRING "${_tex_active_tail}" 0 ${_tex_active_length} _tex_active_body) +obs_test_write_file( + "${CMAKE_CURRENT_BINARY_DIR}/encoder-video-tex-active-under-test.c" + "#include \"libobs/build/libobs.pch.h\"\n${_tex_active_body}" +) +add_executable( + test_encoder_video_tex_active + test_encoder_video_tex_active.c + "${CMAKE_CURRENT_BINARY_DIR}/encoder-video-tex-active-under-test.c" +) +target_compile_definitions(test_encoder_video_tex_active PRIVATE get_mix_for_video=tex_active_recording_mix_lookup) +target_link_libraries( + test_encoder_video_tex_active + PRIVATE OBS::libobs OBS::caption Uthash::Uthash OBS::native-test-cmocka +) +if(OS_WINDOWS) + target_link_libraries(test_encoder_video_tex_active PRIVATE OBS::w32-pthreads) +endif() +add_dependencies(cmocka-tests test_encoder_video_tex_active) +add_test(NAME test_encoder_video_tex_active COMMAND test_encoder_video_tex_active) From d487c1d78c61bebadace27335ea75d05a4d671c0 Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Thu, 19 Nov 2026 00:11:41 -0800 Subject: [PATCH 2/3] test: require extracted encoder texture-input query unit (RED, Refs #5212) --- libobs/build/libobs.core-output+.h.c | 1 + test/cmocka/build/test-graph.json | 25 ++++++++++++++ .../test_encoder_video_tex_active.cmake | 33 +------------------ 3 files changed, 27 insertions(+), 32 deletions(-) diff --git a/libobs/build/libobs.core-output+.h.c b/libobs/build/libobs.core-output+.h.c index c90a3691c4..6589ee65e5 100644 --- a/libobs/build/libobs.core-output+.h.c +++ b/libobs/build/libobs.core-output+.h.c @@ -37,6 +37,7 @@ #include "libobs/obs-encoder-settings-fields.c.h" #include "libobs/obs-encoder-state-queries-fields.c.h" #include "libobs/obs-encoder-type-info-fields.c.h" +#include "libobs/obs-encoder-video-tex-active.c.h" #include "libobs/obs-encoder.c.h" #include "libobs/obs-output-active-fields.c.h" #include "libobs/obs-output-can-pause-fields.c.h" diff --git a/test/cmocka/build/test-graph.json b/test/cmocka/build/test-graph.json index 2028cfc8f8..a1746ee807 100644 --- a/test/cmocka/build/test-graph.json +++ b/test/cmocka/build/test-graph.json @@ -4037,6 +4037,25 @@ "libobs/data" ] }, + "test_encoder_video_tex_active": { + "sources": [ + "test/cmocka/test_encoder_video_tex_active.c", + "libobs/obs-encoder-video-tex-active.c.h" + ], + "definitions": [ + "get_mix_for_video=tex_active_recording_mix_lookup" + ], + "libraries": [ + "OBS::libobs", + "OBS::caption", + "Uthash::Uthash", + "OBS::native-test-cmocka", + { + "name": "OBS::w32-pthreads", + "requires": "OS_WINDOWS" + } + ] + }, "test_encoding_lag_rescale": { "sources": [ "test/cmocka/test_encoding_lag_rescale.c" @@ -22954,6 +22973,12 @@ "working_directory": "${runtime}", "timeout_seconds": 120 }, + "test_encoder_video_tex_active": { + "target": "test_encoder_video_tex_active", + "command": [ + "${target}" + ] + }, "test_encoding_lag_rescale": { "target": "test_encoding_lag_rescale", "command": [ diff --git a/test/cmocka/tests.d/test_encoder_video_tex_active.cmake b/test/cmocka/tests.d/test_encoder_video_tex_active.cmake index da115c5194..d85a840326 100644 --- a/test/cmocka/tests.d/test_encoder_video_tex_active.cmake +++ b/test/cmocka/tests.d/test_encoder_video_tex_active.cmake @@ -1,32 +1 @@ -include("${CMAKE_CURRENT_LIST_DIR}/../write-if-different.cmake") -# Characterize the original C body before its behavior-neutral extraction. -set(_tex_active_source "${CMAKE_SOURCE_DIR}/libobs/obs-encoder.c.h") -set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${_tex_active_source}") -file(READ "${_tex_active_source}" _tex_active_text) -string(FIND "${_tex_active_text}" "bool obs_encoder_video_tex_active(" _tex_active_start) -if(_tex_active_start LESS 0) - message(FATAL_ERROR "Cannot locate obs_encoder_video_tex_active") -endif() -string(SUBSTRING "${_tex_active_text}" ${_tex_active_start} -1 _tex_active_tail) -string(FIND "${_tex_active_tail}" "\n}\n" _tex_active_end) -math(EXPR _tex_active_length "${_tex_active_end} + 3") -string(SUBSTRING "${_tex_active_tail}" 0 ${_tex_active_length} _tex_active_body) -obs_test_write_file( - "${CMAKE_CURRENT_BINARY_DIR}/encoder-video-tex-active-under-test.c" - "#include \"libobs/build/libobs.pch.h\"\n${_tex_active_body}" -) -add_executable( - test_encoder_video_tex_active - test_encoder_video_tex_active.c - "${CMAKE_CURRENT_BINARY_DIR}/encoder-video-tex-active-under-test.c" -) -target_compile_definitions(test_encoder_video_tex_active PRIVATE get_mix_for_video=tex_active_recording_mix_lookup) -target_link_libraries( - test_encoder_video_tex_active - PRIVATE OBS::libobs OBS::caption Uthash::Uthash OBS::native-test-cmocka -) -if(OS_WINDOWS) - target_link_libraries(test_encoder_video_tex_active PRIVATE OBS::w32-pthreads) -endif() -add_dependencies(cmocka-tests test_encoder_video_tex_active) -add_test(NAME test_encoder_video_tex_active COMMAND test_encoder_video_tex_active) +# Registered in the canonical native test graph (test/cmocka/build/test-graph.json). From 9d24ec5d8e9522d9d8ba3c933c058bb294f33926 Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Thu, 19 Nov 2026 00:12:11 -0800 Subject: [PATCH 3/3] libobs: extract encoder texture-input activity query verbatim (Refs #5212) Ci-Attestation: {"at":1795077286,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["d487c1d78c61bebadace27335ea75d05a4d671c0"],"secs":184,"stamp":"4cee68d490929cc7096dcba7370c54c2","tree":"6ca525e954deb9fbdef39c87519a84980d6dabf6","v":1,"via":"run"} Ci-Attestation: {"at":1795077286,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["d487c1d78c61bebadace27335ea75d05a4d671c0"],"secs":184,"stamp":"86627913251e703d2501d8ec5ebdc11e","tree":"6ca525e954deb9fbdef39c87519a84980d6dabf6","v":1,"via":"run"} Ci-Attestation: {"at":1795077286,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["d487c1d78c61bebadace27335ea75d05a4d671c0"],"secs":184,"stamp":"02933e14a8c3469991d11beccad3e47c","tree":"6ca525e954deb9fbdef39c87519a84980d6dabf6","v":1,"via":"run"} Ci-Attestation: {"at":1795077286,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["d487c1d78c61bebadace27335ea75d05a4d671c0"],"secs":184,"stamp":"707a928a3cba9f59cde8f1494ea52467","tree":"6ca525e954deb9fbdef39c87519a84980d6dabf6","v":1,"via":"run"} Ci-Attestation: {"at":1795077099,"gate":"general/all/client-lint","host":"linux-x86_64","key":"4c38981d1aee1ef26c47555cff7be028630e11ce8af291a894e3db9d11f94499","lane":"client-lint","parents":["d487c1d78c61bebadace27335ea75d05a4d671c0"],"secs":125,"stamp":"80948fc4abee5de1b977608af73664fb","tree":"6ca525e954deb9fbdef39c87519a84980d6dabf6","v":1,"via":"run"} Ci-Attestation: {"at":1795077286,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["d487c1d78c61bebadace27335ea75d05a4d671c0"],"secs":184,"stamp":"242c23fefab6dcb5d7320ac3478190a3","tree":"6ca525e954deb9fbdef39c87519a84980d6dabf6","v":1,"via":"run"} Ci-Attestation: {"at":1795077100,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"4c38981d1aee1ef26c47555cff7be028630e11ce8af291a894e3db9d11f94499","lane":"client-lint","parents":["d487c1d78c61bebadace27335ea75d05a4d671c0"],"secs":125,"stamp":"6dbf0ea42e3ab8aab69c8e28502a6006","tree":"6ca525e954deb9fbdef39c87519a84980d6dabf6","v":1,"via":"run"} Ci-Attestation: {"at":1795077100,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"4c38981d1aee1ef26c47555cff7be028630e11ce8af291a894e3db9d11f94499","lane":"client-lint","parents":["d487c1d78c61bebadace27335ea75d05a4d671c0"],"secs":125,"stamp":"bbb5080da1127de8605e07a00ace9831","tree":"6ca525e954deb9fbdef39c87519a84980d6dabf6","v":1,"via":"run"} Ci-Attestation: {"at":1795077099,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"4c38981d1aee1ef26c47555cff7be028630e11ce8af291a894e3db9d11f94499","lane":"client-lint","parents":["d487c1d78c61bebadace27335ea75d05a4d671c0"],"secs":125,"stamp":"4dffc923dafb6a3a20b585fd11074952","tree":"6ca525e954deb9fbdef39c87519a84980d6dabf6","v":1,"via":"run"} Ci-Attestation: {"at":1795077099,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"4c38981d1aee1ef26c47555cff7be028630e11ce8af291a894e3db9d11f94499","lane":"client-lint","parents":["d487c1d78c61bebadace27335ea75d05a4d671c0"],"secs":125,"stamp":"e5e02473b7b116081bad8423f45d15e5","tree":"6ca525e954deb9fbdef39c87519a84980d6dabf6","v":1,"via":"run"} Ci-Attestation: {"at":1795077099,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"4c38981d1aee1ef26c47555cff7be028630e11ce8af291a894e3db9d11f94499","lane":"client-lint","parents":["d487c1d78c61bebadace27335ea75d05a4d671c0"],"secs":125,"stamp":"fb0d101ca2620924603d9ee5b456d577","tree":"6ca525e954deb9fbdef39c87519a84980d6dabf6","v":1,"via":"run"} Ci-Attestation: {"at":1795077099,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"4c38981d1aee1ef26c47555cff7be028630e11ce8af291a894e3db9d11f94499","lane":"client-lint","parents":["d487c1d78c61bebadace27335ea75d05a4d671c0"],"secs":125,"stamp":"484e65b81d76bf55fc3ed76571797f50","tree":"6ca525e954deb9fbdef39c87519a84980d6dabf6","v":1,"via":"run"} Ci-Attestation: {"at":1795077100,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"4c38981d1aee1ef26c47555cff7be028630e11ce8af291a894e3db9d11f94499","lane":"client-lint","parents":["d487c1d78c61bebadace27335ea75d05a4d671c0"],"secs":125,"stamp":"d7b9f1dff668ead4fe25d6c017654b03","tree":"6ca525e954deb9fbdef39c87519a84980d6dabf6","v":1,"via":"run"} Ci-Attestation: {"at":1795077100,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"4c38981d1aee1ef26c47555cff7be028630e11ce8af291a894e3db9d11f94499","lane":"client-lint","parents":["d487c1d78c61bebadace27335ea75d05a4d671c0"],"secs":125,"stamp":"bc2f083f688ec4fa7db800f5e7fbe7a5","tree":"6ca525e954deb9fbdef39c87519a84980d6dabf6","v":1,"via":"run"} Ci-Attestation: {"at":1795077099,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"4c38981d1aee1ef26c47555cff7be028630e11ce8af291a894e3db9d11f94499","lane":"client-lint","parents":["d487c1d78c61bebadace27335ea75d05a4d671c0"],"secs":125,"stamp":"ad3267936cf7991ec8f71f7ed6cfbca0","tree":"6ca525e954deb9fbdef39c87519a84980d6dabf6","v":1,"via":"run"} Ci-Attestation: {"at":1795077099,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"4c38981d1aee1ef26c47555cff7be028630e11ce8af291a894e3db9d11f94499","lane":"client-lint","parents":["d487c1d78c61bebadace27335ea75d05a4d671c0"],"secs":125,"stamp":"866bf600075aa0b800211d2d93a12a71","tree":"6ca525e954deb9fbdef39c87519a84980d6dabf6","v":1,"via":"run"} Ci-Attestation: {"at":1795077099,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"4c38981d1aee1ef26c47555cff7be028630e11ce8af291a894e3db9d11f94499","lane":"client-lint","parents":["d487c1d78c61bebadace27335ea75d05a4d671c0"],"secs":125,"stamp":"ab31642db064e3ff352a80517249d4bf","tree":"6ca525e954deb9fbdef39c87519a84980d6dabf6","v":1,"via":"run"} Ci-Attestation: {"at":1795077099,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"4c38981d1aee1ef26c47555cff7be028630e11ce8af291a894e3db9d11f94499","lane":"client-lint","parents":["d487c1d78c61bebadace27335ea75d05a4d671c0"],"secs":125,"stamp":"fd06b165e1ce9e790cef345acbe63dc7","tree":"6ca525e954deb9fbdef39c87519a84980d6dabf6","v":1,"via":"run"} Ci-Attestation: {"at":1795078390,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"c8ba1d71a54e9681bc8a39f0f9f7ef1b62323872a55d6437b7ffc1e36b3f1a47","lane":"client-test-x86_64-unknown-linux-gnu","parents":["d487c1d78c61bebadace27335ea75d05a4d671c0"],"secs":1102,"stamp":"69a1b6b3aaa6f56d171bfcc7cc5b6766","tree":"6ca525e954deb9fbdef39c87519a84980d6dabf6","v":1,"via":"run"} Client-Checks: {"checks":{"base":"9d7600e74b6e68efb03259f1b1809835638b9139","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.core+.h.c","libobs/build/libobs.core-output+.h.c","libobs/build/libobs.ported-hotkey-inject-entry+.h.c","libobs/build/ported-source-sets/hotkey-inject-entry.json","libobs/cmake/rust-exports.d/obs-hotkey-inject_entry.txt","libobs/cmake/rust-hidden.d/obs-hotkey-inject_entry.txt","libobs/obs-encoder-video-tex-active.c.h","libobs/obs-encoder.c.h","libobs/obs-hotkey-inject-entry-fields.c.h","rust/README.md","rust/obs-build/tests/native/registration/headless_characterizations_expected.json","rust/obs-build/tests/native/registration/portal_output_expected.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_background_enum.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_background_press.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_background_trigger.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_binding_press_steps.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_getters_characterization.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_inject_entry.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_load.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_pair_steps.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_press_steps.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_unregister_entry.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_portal_shortcuts.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_wayland_hotkeys.json","rust/obs-c-oracle/oracle/hotkey_inject_entry.c","rust/obs-c-oracle/oracle/hotkey_inject_entry_fields.c","rust/obs-hotkey/src/ffi/inject_entry.rs","rust/obs-hotkey/src/ffi/mod.rs","rust/obs-hotkey/src/inject_entry.rs","rust/obs-hotkey/src/lib.rs","rust/obs-hotkey/tests/hotkey/inject_entry.rs","rust/obs-hotkey/tests/hotkey/inject_entry_parity.rs","rust/obs-hotkey/tests/hotkey/main.rs","test/cmocka/build/test-graph.json","test/cmocka/hotkey-inject-entry-link-support.c","test/cmocka/test_encoder_video_tex_active.c","test/cmocka/tests.d/hotkey_inject_entry_link_support.cmake","test/cmocka/tests.d/test_encoder_video_tex_active.cmake"],"head":"934fa4c4f706ab7ccae5b3164b768acd87c858d6","tools":{"orchestrator-python":"3.13.15 (main, Aug 14 2026, 15:34:59) [Clang 22.1.3 ]","schema-dependencies":"3.13.15 (main, Aug 14 2026, 15:34:59) [Clang 22.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\n compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ISO8859X Regexps Automata RelaxNG Schemas Modules Debug"},"tracked-digest":"e4037f7e41d686b842bb22bb2437c3cec23fdb47dcb14cdc821a3011c103aeef","tree":"6ca525e954deb9fbdef39c87519a84980d6dabf6"}} --- libobs/obs-encoder-video-tex-active.c.h | 17 +++++++++++++++++ libobs/obs-encoder.c.h | 16 ---------------- 2 files changed, 17 insertions(+), 16 deletions(-) create mode 100644 libobs/obs-encoder-video-tex-active.c.h diff --git a/libobs/obs-encoder-video-tex-active.c.h b/libobs/obs-encoder-video-tex-active.c.h new file mode 100644 index 0000000000..ca8b01c852 --- /dev/null +++ b/libobs/obs-encoder-video-tex-active.c.h @@ -0,0 +1,17 @@ +#include "libobs/build/libobs.pch.h" + +bool obs_encoder_video_tex_active(const obs_encoder_t *encoder, enum video_format format) +{ + /* No mix owns the video of an encoder with no video set, or of one + * whose canvas mix is gone (#2267): no texture input then. */ + const struct obs_core_video_mix *mix = get_mix_for_video(encoder->media); + if (!mix) + return false; + + if (format == VIDEO_FORMAT_NV12) + return mix->using_nv12_tex; + if (format == VIDEO_FORMAT_P010) + return mix->using_p010_tex; + + return false; +} diff --git a/libobs/obs-encoder.c.h b/libobs/obs-encoder.c.h index 7156b8bfb6..a66e984d60 100644 --- a/libobs/obs-encoder.c.h +++ b/libobs/obs-encoder.c.h @@ -1645,22 +1645,6 @@ void obs_encoder_enum_roi(obs_encoder_t *encoder, void (*enum_proc)(void *, stru pthread_mutex_unlock(&encoder->roi_mutex); } -bool obs_encoder_video_tex_active(const obs_encoder_t *encoder, enum video_format format) -{ - /* No mix owns the video of an encoder with no video set, or of one - * whose canvas mix is gone (#2267): no texture input then. */ - const struct obs_core_video_mix *mix = get_mix_for_video(encoder->media); - if (!mix) - return false; - - if (format == VIDEO_FORMAT_NV12) - return mix->using_nv12_tex; - if (format == VIDEO_FORMAT_P010) - return mix->using_p010_tex; - - return false; -} - /* File-local macros: keep them out of the next source of a unity build. */ #undef get_weak