From 21a69e071fcba9703ad660e43ab63174c2f3c779 Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Thu, 19 Nov 2026 17:20:18 -0800 Subject: [PATCH 1/2] test: characterize encoder group started-count seam (Refs #5316) Ci-Attestation: {"at":1795137944,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["3b8563940504be9c25e19d594fa5667996cb13b6"],"secs":202,"stamp":"e711c2360914a3842b4cddd97cb02cc7","tree":"6516f0881926e0c01468875f6b63bf683d21013e","v":1,"via":"run"} Ci-Attestation: {"at":1795137944,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["3b8563940504be9c25e19d594fa5667996cb13b6"],"secs":202,"stamp":"67ef608a69ace7700b86ab6044c0aaf8","tree":"6516f0881926e0c01468875f6b63bf683d21013e","v":1,"via":"run"} Ci-Attestation: {"at":1795137944,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["3b8563940504be9c25e19d594fa5667996cb13b6"],"secs":202,"stamp":"ec2be14a198b8e26a507f06a2a0c16db","tree":"6516f0881926e0c01468875f6b63bf683d21013e","v":1,"via":"run"} Ci-Attestation: {"at":1795137944,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["3b8563940504be9c25e19d594fa5667996cb13b6"],"secs":202,"stamp":"9befa76df5cdccc24c4069d9189ce635","tree":"6516f0881926e0c01468875f6b63bf683d21013e","v":1,"via":"run"} Ci-Attestation: {"at":1795137735,"gate":"general/all/client-lint","host":"linux-x86_64","key":"d5bda900661ad573d5008e72ce8caf4e48c6296f552bb4e3bc2ff6ac89401830","lane":"client-lint","parents":["3b8563940504be9c25e19d594fa5667996cb13b6"],"secs":90,"stamp":"fa647068edc83e7ce468a20b7bf4b34f","tree":"6516f0881926e0c01468875f6b63bf683d21013e","v":1,"via":"run"} Ci-Attestation: {"at":1795137944,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["3b8563940504be9c25e19d594fa5667996cb13b6"],"secs":202,"stamp":"a7bb79171be35009cb44c3ba24c3b8ab","tree":"6516f0881926e0c01468875f6b63bf683d21013e","v":1,"via":"run"} Ci-Attestation: {"at":1795137737,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"d5bda900661ad573d5008e72ce8caf4e48c6296f552bb4e3bc2ff6ac89401830","lane":"client-lint","parents":["3b8563940504be9c25e19d594fa5667996cb13b6"],"secs":90,"stamp":"9ef0c6f38bcfdc06b981e2cebfaf91a3","tree":"6516f0881926e0c01468875f6b63bf683d21013e","v":1,"via":"run"} Ci-Attestation: {"at":1795137738,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"d5bda900661ad573d5008e72ce8caf4e48c6296f552bb4e3bc2ff6ac89401830","lane":"client-lint","parents":["3b8563940504be9c25e19d594fa5667996cb13b6"],"secs":90,"stamp":"f54b6ba101a7820218a43f8773c94763","tree":"6516f0881926e0c01468875f6b63bf683d21013e","v":1,"via":"run"} Ci-Attestation: {"at":1795137737,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"d5bda900661ad573d5008e72ce8caf4e48c6296f552bb4e3bc2ff6ac89401830","lane":"client-lint","parents":["3b8563940504be9c25e19d594fa5667996cb13b6"],"secs":90,"stamp":"045817c29a71f184d3e8eb41e0206d7a","tree":"6516f0881926e0c01468875f6b63bf683d21013e","v":1,"via":"run"} Ci-Attestation: {"at":1795137737,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"d5bda900661ad573d5008e72ce8caf4e48c6296f552bb4e3bc2ff6ac89401830","lane":"client-lint","parents":["3b8563940504be9c25e19d594fa5667996cb13b6"],"secs":90,"stamp":"174409566626f23c490d9ae6f15ab6af","tree":"6516f0881926e0c01468875f6b63bf683d21013e","v":1,"via":"run"} Ci-Attestation: {"at":1795137735,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"d5bda900661ad573d5008e72ce8caf4e48c6296f552bb4e3bc2ff6ac89401830","lane":"client-lint","parents":["3b8563940504be9c25e19d594fa5667996cb13b6"],"secs":90,"stamp":"37d02d12be030caf950cf14c9ed2f93a","tree":"6516f0881926e0c01468875f6b63bf683d21013e","v":1,"via":"run"} Ci-Attestation: {"at":1795137736,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"d5bda900661ad573d5008e72ce8caf4e48c6296f552bb4e3bc2ff6ac89401830","lane":"client-lint","parents":["3b8563940504be9c25e19d594fa5667996cb13b6"],"secs":90,"stamp":"12f901fce69e3760f087a61395b9c0c4","tree":"6516f0881926e0c01468875f6b63bf683d21013e","v":1,"via":"run"} Ci-Attestation: {"at":1795137737,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"d5bda900661ad573d5008e72ce8caf4e48c6296f552bb4e3bc2ff6ac89401830","lane":"client-lint","parents":["3b8563940504be9c25e19d594fa5667996cb13b6"],"secs":90,"stamp":"9f0ea157ed5658e02cf10010bd0bd519","tree":"6516f0881926e0c01468875f6b63bf683d21013e","v":1,"via":"run"} Ci-Attestation: {"at":1795137737,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"d5bda900661ad573d5008e72ce8caf4e48c6296f552bb4e3bc2ff6ac89401830","lane":"client-lint","parents":["3b8563940504be9c25e19d594fa5667996cb13b6"],"secs":90,"stamp":"032076d8e7e40e0f58f61a5164977e6e","tree":"6516f0881926e0c01468875f6b63bf683d21013e","v":1,"via":"run"} Ci-Attestation: {"at":1795137736,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"d5bda900661ad573d5008e72ce8caf4e48c6296f552bb4e3bc2ff6ac89401830","lane":"client-lint","parents":["3b8563940504be9c25e19d594fa5667996cb13b6"],"secs":90,"stamp":"7998567ae76962d93397dd94751a9836","tree":"6516f0881926e0c01468875f6b63bf683d21013e","v":1,"via":"run"} Ci-Attestation: {"at":1795137736,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"d5bda900661ad573d5008e72ce8caf4e48c6296f552bb4e3bc2ff6ac89401830","lane":"client-lint","parents":["3b8563940504be9c25e19d594fa5667996cb13b6"],"secs":90,"stamp":"c00f224f7365c6fe226f09d39e27da7d","tree":"6516f0881926e0c01468875f6b63bf683d21013e","v":1,"via":"run"} Ci-Attestation: {"at":1795137735,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"d5bda900661ad573d5008e72ce8caf4e48c6296f552bb4e3bc2ff6ac89401830","lane":"client-lint","parents":["3b8563940504be9c25e19d594fa5667996cb13b6"],"secs":90,"stamp":"a4070bdded248d5fe2acb1d65ce14d9e","tree":"6516f0881926e0c01468875f6b63bf683d21013e","v":1,"via":"run"} Ci-Attestation: {"at":1795137735,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"d5bda900661ad573d5008e72ce8caf4e48c6296f552bb4e3bc2ff6ac89401830","lane":"client-lint","parents":["3b8563940504be9c25e19d594fa5667996cb13b6"],"secs":90,"stamp":"208e96a9919d013bb2bbf49529730aba","tree":"6516f0881926e0c01468875f6b63bf683d21013e","v":1,"via":"run"} --- test/cmocka/build/test-graph.json | 26 +++++ test/cmocka/test_encoder_group_num_started.c | 104 ++++++++++++++++++ .../test_encoder_group_num_started.cmake | 1 + 3 files changed, 131 insertions(+) create mode 100644 test/cmocka/test_encoder_group_num_started.c create mode 100644 test/cmocka/tests.d/test_encoder_group_num_started.cmake diff --git a/test/cmocka/build/test-graph.json b/test/cmocka/build/test-graph.json index e2cffe4267..3129ce52a4 100644 --- a/test/cmocka/build/test-graph.json +++ b/test/cmocka/build/test-graph.json @@ -3754,6 +3754,26 @@ "OBS::native-test-cmocka" ] }, + "test_encoder_group_num_started": { + "sources": [ + "test/cmocka/test_encoder_group_num_started.c", + "libobs/obs-encoder-group-num-started.c.h" + ], + "definitions": [ + "pthread_mutex_lock=encoder_group_count_record_lock", + "pthread_mutex_unlock=encoder_group_count_record_unlock" + ], + "libraries": [ + "OBS::libobs", + "OBS::caption", + "Uthash::Uthash", + "OBS::native-test-cmocka", + { + "name": "OBS::w32-pthreads", + "requires": "OS_WINDOWS" + } + ] + }, "test_encoder_group_reconfig_steps": { "sources": [ "test/cmocka/test_encoder_group_reconfig_steps.c", @@ -23713,6 +23733,12 @@ ], "optional_prefixes_requires": "OS_LINUX" }, + "test_encoder_group_num_started": { + "target": "test_encoder_group_num_started", + "command": [ + "${target}" + ] + }, "test_encoder_group_reconfig_steps": { "target": "test_encoder_group_reconfig_steps", "command": [ diff --git a/test/cmocka/test_encoder_group_num_started.c b/test/cmocka/test_encoder_group_num_started.c new file mode 100644 index 0000000000..6de909b87f --- /dev/null +++ b/test/cmocka/test_encoder_group_num_started.c @@ -0,0 +1,104 @@ +/* C-source characterization of the hidden encoder-group count accessor. + * Record mutex calls using the real private layout, without threads or waits. + * NULL groups are outside the C precondition. A Rust swap must relink this + * unchanged fixture to its replacement and real group-field adapter. */ +#include +#include +#include +#include +#include +#include +#include "obs-internal.h" + +static struct obs_encoder_group groups[2]; +static struct obs_encoder_group *selected; +static unsigned lock_calls, unlock_calls; +static bool locked, change_on_lock, change_on_unlock; +static uint32_t locked_value, unlocked_value; + +int pthread_mutex_lock(pthread_mutex_t *mutex) +{ + assert_ptr_equal(mutex, &selected->mutex); + assert_false(locked); + assert_int_equal(lock_calls, 0); + assert_int_equal(unlock_calls, 0); + lock_calls++; + locked = true; + if (change_on_lock) + selected->num_encoders_started = locked_value; + return 0; +} + +int pthread_mutex_unlock(pthread_mutex_t *mutex) +{ + assert_ptr_equal(mutex, &selected->mutex); + assert_true(locked); + assert_int_equal(lock_calls, 1); + assert_int_equal(unlock_calls, 0); + unlock_calls++; + if (change_on_unlock) + selected->num_encoders_started = unlocked_value; + locked = false; + return 0; +} + +static uint32_t query(struct obs_encoder_group *group) +{ + selected = group; + lock_calls = unlock_calls = 0; + uint32_t result = obs_encoder_group_num_started(group); + assert_int_equal(lock_calls, 1); + assert_int_equal(unlock_calls, 1); + assert_false(locked); + return result; +} + +static int setup(void **state) +{ + (void)state; + memset(groups, 0, sizeof(groups)); + selected = NULL; + locked = change_on_lock = change_on_unlock = false; + lock_calls = unlock_calls = 0; + locked_value = unlocked_value = 0; + return 0; +} + +static void exact_count_and_group(void **state) +{ + (void)state; + const uint32_t values[] = {0, 1, 2, 32, UINT32_MAX - 1, UINT32_MAX}; + for (size_t i = 0; i < sizeof(values) / sizeof(values[0]); i++) { + groups[0].num_encoders_started = values[i]; + groups[1].num_encoders_started = ~values[i]; + /* Unrelated lifecycle state must not clamp or gate the count. */ + groups[0].destroy_on_stop = true; + groups[1].frame_rate_divisors_lcm = UINT32_MAX; + unsigned char before[sizeof(groups)]; + memcpy(before, groups, sizeof(groups)); + assert_int_equal(query(&groups[0]), values[i]); + assert_int_equal(query(&groups[1]), (uint32_t)~values[i]); + assert_memory_equal(groups, before, sizeof(groups)); + } +} + +static void snapshot_inside_mutex_calls(void **state) +{ + (void)state; + const uint32_t values[] = {0, 1, UINT32_MAX}; + change_on_lock = change_on_unlock = true; + for (size_t i = 0; i < sizeof(values) / sizeof(values[0]); i++) { + locked_value = values[i]; + unlocked_value = ~locked_value; + groups[0].num_encoders_started = unlocked_value; + assert_int_equal(query(&groups[0]), locked_value); + assert_int_equal(groups[0].num_encoders_started, unlocked_value); + } +} + +int main(void) +{ + const struct CMUnitTest tests[] = {cmocka_unit_test_setup(exact_count_and_group, setup), + cmocka_unit_test_setup(snapshot_inside_mutex_calls, setup)}; + return cmocka_run_group_tests(tests, NULL, NULL); +} diff --git a/test/cmocka/tests.d/test_encoder_group_num_started.cmake b/test/cmocka/tests.d/test_encoder_group_num_started.cmake new file mode 100644 index 0000000000..d85a840326 --- /dev/null +++ b/test/cmocka/tests.d/test_encoder_group_num_started.cmake @@ -0,0 +1 @@ +# Registered in the canonical native test graph (test/cmocka/build/test-graph.json). From 9cd76f12d7d8df790736f53c6fb5a3d433533642 Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Thu, 19 Nov 2026 17:43:25 -0800 Subject: [PATCH 2/2] libobs: extract encoder group started-count accessor verbatim (Refs #5316) Ci-Attestation: {"at":1795139776,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["21a69e071fcba9703ad660e43ab63174c2f3c779"],"secs":275,"stamp":"80f1cb579782bd068f8ffcb626cf6844","tree":"61c7561c17cae51ee2cf8358de9525b65f27e58c","v":1,"via":"run"} Ci-Attestation: {"at":1795139776,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["21a69e071fcba9703ad660e43ab63174c2f3c779"],"secs":275,"stamp":"ed8fbb05d0f432920184cc538199a708","tree":"61c7561c17cae51ee2cf8358de9525b65f27e58c","v":1,"via":"run"} Ci-Attestation: {"at":1795139776,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["21a69e071fcba9703ad660e43ab63174c2f3c779"],"secs":275,"stamp":"c27e53a6047522bc1c1da03a1c103473","tree":"61c7561c17cae51ee2cf8358de9525b65f27e58c","v":1,"via":"run"} Ci-Attestation: {"at":1795139776,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["21a69e071fcba9703ad660e43ab63174c2f3c779"],"secs":275,"stamp":"3958346234958fb2fb4fea4424a5c58e","tree":"61c7561c17cae51ee2cf8358de9525b65f27e58c","v":1,"via":"run"} Ci-Attestation: {"at":1795139490,"gate":"general/all/client-lint","host":"linux-x86_64","key":"91825073de189b359e1ddd05420bb3cda487a7a692c49a3056c1c06a51c72ca2","lane":"client-lint","parents":["21a69e071fcba9703ad660e43ab63174c2f3c779"],"secs":75,"stamp":"bceb37e30e0ca9f2e04a242974d43855","tree":"61c7561c17cae51ee2cf8358de9525b65f27e58c","v":1,"via":"run"} Ci-Attestation: {"at":1795139776,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["21a69e071fcba9703ad660e43ab63174c2f3c779"],"secs":275,"stamp":"bb7971e71004a989a157d5142f9cdc77","tree":"61c7561c17cae51ee2cf8358de9525b65f27e58c","v":1,"via":"run"} Ci-Attestation: {"at":1795139494,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"91825073de189b359e1ddd05420bb3cda487a7a692c49a3056c1c06a51c72ca2","lane":"client-lint","parents":["21a69e071fcba9703ad660e43ab63174c2f3c779"],"secs":75,"stamp":"212fa427ebc7ca4a680e37afa291b294","tree":"61c7561c17cae51ee2cf8358de9525b65f27e58c","v":1,"via":"run"} Ci-Attestation: {"at":1795139494,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"91825073de189b359e1ddd05420bb3cda487a7a692c49a3056c1c06a51c72ca2","lane":"client-lint","parents":["21a69e071fcba9703ad660e43ab63174c2f3c779"],"secs":75,"stamp":"75050bc178a7066e374da53549e43633","tree":"61c7561c17cae51ee2cf8358de9525b65f27e58c","v":1,"via":"run"} Ci-Attestation: {"at":1795139492,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"91825073de189b359e1ddd05420bb3cda487a7a692c49a3056c1c06a51c72ca2","lane":"client-lint","parents":["21a69e071fcba9703ad660e43ab63174c2f3c779"],"secs":75,"stamp":"7c7c5c581824837b321897eead920500","tree":"61c7561c17cae51ee2cf8358de9525b65f27e58c","v":1,"via":"run"} Ci-Attestation: {"at":1795139492,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"91825073de189b359e1ddd05420bb3cda487a7a692c49a3056c1c06a51c72ca2","lane":"client-lint","parents":["21a69e071fcba9703ad660e43ab63174c2f3c779"],"secs":75,"stamp":"58a7be860a06ad0f12d63c3a69108388","tree":"61c7561c17cae51ee2cf8358de9525b65f27e58c","v":1,"via":"run"} Ci-Attestation: {"at":1795139491,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"91825073de189b359e1ddd05420bb3cda487a7a692c49a3056c1c06a51c72ca2","lane":"client-lint","parents":["21a69e071fcba9703ad660e43ab63174c2f3c779"],"secs":75,"stamp":"ac4df0b34d3cd4358c83309487fc59c2","tree":"61c7561c17cae51ee2cf8358de9525b65f27e58c","v":1,"via":"run"} Ci-Attestation: {"at":1795139491,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"91825073de189b359e1ddd05420bb3cda487a7a692c49a3056c1c06a51c72ca2","lane":"client-lint","parents":["21a69e071fcba9703ad660e43ab63174c2f3c779"],"secs":75,"stamp":"c6990b108933b933190fdbdc86532842","tree":"61c7561c17cae51ee2cf8358de9525b65f27e58c","v":1,"via":"run"} Ci-Attestation: {"at":1795139492,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"91825073de189b359e1ddd05420bb3cda487a7a692c49a3056c1c06a51c72ca2","lane":"client-lint","parents":["21a69e071fcba9703ad660e43ab63174c2f3c779"],"secs":75,"stamp":"d874c591e5f617a76a2020c1c8ece519","tree":"61c7561c17cae51ee2cf8358de9525b65f27e58c","v":1,"via":"run"} Ci-Attestation: {"at":1795139493,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"91825073de189b359e1ddd05420bb3cda487a7a692c49a3056c1c06a51c72ca2","lane":"client-lint","parents":["21a69e071fcba9703ad660e43ab63174c2f3c779"],"secs":75,"stamp":"97ed8776f8fa37c4492d7ea20c1ef699","tree":"61c7561c17cae51ee2cf8358de9525b65f27e58c","v":1,"via":"run"} Ci-Attestation: {"at":1795139491,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"91825073de189b359e1ddd05420bb3cda487a7a692c49a3056c1c06a51c72ca2","lane":"client-lint","parents":["21a69e071fcba9703ad660e43ab63174c2f3c779"],"secs":75,"stamp":"8247c8260300455bc8d92b6a1ac16c51","tree":"61c7561c17cae51ee2cf8358de9525b65f27e58c","v":1,"via":"run"} Ci-Attestation: {"at":1795139491,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"91825073de189b359e1ddd05420bb3cda487a7a692c49a3056c1c06a51c72ca2","lane":"client-lint","parents":["21a69e071fcba9703ad660e43ab63174c2f3c779"],"secs":75,"stamp":"46192f5403b831c681b85841bd364259","tree":"61c7561c17cae51ee2cf8358de9525b65f27e58c","v":1,"via":"run"} Ci-Attestation: {"at":1795139491,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"91825073de189b359e1ddd05420bb3cda487a7a692c49a3056c1c06a51c72ca2","lane":"client-lint","parents":["21a69e071fcba9703ad660e43ab63174c2f3c779"],"secs":75,"stamp":"6e3e17c9be083f5ac74772340b858a61","tree":"61c7561c17cae51ee2cf8358de9525b65f27e58c","v":1,"via":"run"} Ci-Attestation: {"at":1795139491,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"91825073de189b359e1ddd05420bb3cda487a7a692c49a3056c1c06a51c72ca2","lane":"client-lint","parents":["21a69e071fcba9703ad660e43ab63174c2f3c779"],"secs":75,"stamp":"a0376f9451bb6ff1c3090d8aefb99b8b","tree":"61c7561c17cae51ee2cf8358de9525b65f27e58c","v":1,"via":"run"} --- libobs/build/libobs.core-output+.h.c | 1 + libobs/obs-encoder-group-num-started.c.h | 12 ++++++++++++ libobs/obs-encoder.c.h | 11 ----------- 3 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 libobs/obs-encoder-group-num-started.c.h diff --git a/libobs/build/libobs.core-output+.h.c b/libobs/build/libobs.core-output+.h.c index 48aabb5dc5..aa1608dca4 100644 --- a/libobs/build/libobs.core-output+.h.c +++ b/libobs/build/libobs.core-output+.h.c @@ -16,6 +16,7 @@ #include "libobs/obs-encoder-get-name-fields.c.h" #include "libobs/obs-encoder-gpu-scaling-getters-fields.c.h" #include "libobs/obs-encoder-group-lifecycle-fields.c.h" +#include "libobs/obs-encoder-group-num-started.c.h" #include "libobs/obs-encoder-init-fields.c.h" #include "libobs/obs-encoder-last-error-fields.c.h" #include "libobs/obs-encoder-media-getters-fields.c.h" diff --git a/libobs/obs-encoder-group-num-started.c.h b/libobs/obs-encoder-group-num-started.c.h new file mode 100644 index 0000000000..e09d3e7f69 --- /dev/null +++ b/libobs/obs-encoder-group-num-started.c.h @@ -0,0 +1,12 @@ +#include "libobs/build/libobs.pch.h" + +uint32_t obs_encoder_group_num_started(struct obs_encoder_group *group) +{ + uint32_t num_started; + + pthread_mutex_lock(&group->mutex); + num_started = group->num_encoders_started; + pthread_mutex_unlock(&group->mutex); + + return num_started; +} diff --git a/libobs/obs-encoder.c.h b/libobs/obs-encoder.c.h index a66e984d60..f80807034c 100644 --- a/libobs/obs-encoder.c.h +++ b/libobs/obs-encoder.c.h @@ -461,17 +461,6 @@ struct obs_encoder_interleave_info obs_encoder_interleave_info(const obs_encoder return info; } -uint32_t obs_encoder_group_num_started(struct obs_encoder_group *group) -{ - uint32_t num_started; - - pthread_mutex_lock(&group->mutex); - num_started = group->num_encoders_started; - pthread_mutex_unlock(&group->mutex); - - return num_started; -} - void obs_encoder_update(obs_encoder_t *encoder, obs_data_t *settings) { if (!obs_encoder_valid(encoder, "obs_encoder_update"))