Scaffold core/OBS-adapter split, prove CMake toolchain, add 3-platform CI
Build / Windows (windows-latest) (push) Failing after 10s
Build / macOS (macos-latest) (push) Successful in 20s
Build / Linux (ubuntu-latest) (push) Successful in 31s

First pass on the streamer-tools OBS camera plugin: a minimal but real
CMake project matching the design doc's core-library/OBS-adapter split
(docs/superpowers/specs/2026-09-06-obs-camera-plugin-design.md in the
streamer-tools repo). No LiveKit FFI integration yet -- this proves the
toolchain works.

- core/: dependency-free C++17 library (no OBS dependency), unit tested
  via CTest with no external test framework.
- obs-adapter/: adapted from obsproject/obs-plugintemplate (commit
  3e7d7ac, 2025-12-09). Registers a real, stubbed OBS source type;
  builds as a genuine dynamically-linked OBS module against Ubuntu's
  system libobs-dev (confirmed via ldd/nm, not a fake stand-in).
- Simpler hand-written top-level CMakeLists.txt in place of the
  template's full buildspec-driven bootstrap (which downloads full OBS
  source + prebuilt deps) -- find_package(libobs) alone is enough on
  Linux; falls back to core-library-only when libobs isn't found
  (expected on macOS/Windows CI for now).
- .gitea/workflows/build.yml: 3-platform matrix (ubuntu-latest,
  macos-latest, windows-latest) matching the runners confirmed
  available to this repo under the CyberCoveLLC org.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RL8abRmgFXkVASHkkqiJbE
This commit is contained in:
2026-09-06 20:46:08 -07:00
co-authored by Claude Sonnet 5
commit 105f1041ab
16 changed files with 1023 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
# streamer-tools OBS Camera Plugin - core library
#
# No OBS dependency by design (see docs/superpowers/specs/
# 2026-09-06-obs-camera-plugin-design.md in the streamer-tools repo) --
# this must build and test headlessly on every platform.
add_library(stplugin_core STATIC
src/core.cpp
)
target_include_directories(stplugin_core
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
)
set_target_properties(stplugin_core PROPERTIES
POSITION_INDEPENDENT_CODE ON
)
add_subdirectory(tests)
+57
View File
@@ -0,0 +1,57 @@
/*
streamer-tools OBS Camera Plugin - core library
Copyright (C) 2026 CyberCoveLLC <jknapp85@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program. If not, see <https://www.gnu.org/licenses/>
*/
#pragma once
#include <string>
// C++ API for the core library. Per the design doc
// (docs/superpowers/specs/2026-09-06-obs-camera-plugin-design.md in the
// streamer-tools repo), this library will eventually own: streamer-tools
// API auth, LiveKit FFI session management (connect, subscribe, decode,
// reconnect), and frame callbacks -- all with zero OBS dependency, so it
// can be built and tested headlessly.
//
// THIS IS SCAFFOLDING. Nothing below talks to a real server or to
// livekit-ffi yet. It exists to prove the core-library/OBS-adapter split
// builds, links, and is unit-testable, ahead of a later phase that
// implements the real logic.
namespace stplugin {
// Returns the core library's version string. Placeholder for a real
// version scheme once the library does something.
const char *core_version();
// Minimal connection configuration the future core library will use to
// authenticate against the streamer-tools API
// (see apps/server/src/rooms/join.routes.ts and
// apps/server/src/livekit/tokens.ts in the streamer-tools repo for the
// existing read-key-authed token pattern this will follow) and mint a
// scoped LiveKit subscriber token. Validation here is intentionally
// trivial -- it exists to prove the core library is unit-testable
// headlessly, not to implement the real API client.
struct ConnectionConfig {
std::string server_url;
std::string room_slug;
std::string read_key;
bool is_valid() const;
};
} // namespace stplugin
+38
View File
@@ -0,0 +1,38 @@
/*
streamer-tools OBS Camera Plugin - core library
Copyright (C) 2026 CyberCoveLLC <jknapp85@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program. If not, see <https://www.gnu.org/licenses/>
*/
#pragma once
// Minimal C ABI surface of the core library, for the OBS adapter (plain
// C, per the obs-plugintemplate convention) to call into the core
// library (C++) without needing a C++ compiler in that translation unit.
//
// This mirrors the boundary the real integration will cross in the
// other direction: livekit-ffi is a Rust library exposing a C ABI that
// the C++ core library will link against. Proving a small, deliberate
// C ABI seam works cleanly here is part of what this scaffold is for.
#ifdef __cplusplus
extern "C" {
#endif
const char *stplugin_core_version(void);
#ifdef __cplusplus
}
#endif
+36
View File
@@ -0,0 +1,36 @@
/*
streamer-tools OBS Camera Plugin - core library
Copyright (C) 2026 CyberCoveLLC <jknapp85@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program. If not, see <https://www.gnu.org/licenses/>
*/
#include "stplugin/core.h"
#include "stplugin/core_c.h"
namespace stplugin {
const char *core_version() {
return "0.0.1-scaffold";
}
bool ConnectionConfig::is_valid() const {
return !server_url.empty() && !room_slug.empty() && !read_key.empty();
}
} // namespace stplugin
extern "C" const char *stplugin_core_version(void) {
return stplugin::core_version();
}
+7
View File
@@ -0,0 +1,7 @@
add_executable(stplugin_core_tests
test_core.cpp
)
target_link_libraries(stplugin_core_tests PRIVATE stplugin_core)
add_test(NAME stplugin_core_tests COMMAND stplugin_core_tests)
+59
View File
@@ -0,0 +1,59 @@
/*
streamer-tools OBS Camera Plugin - core library tests
Copyright (C) 2026 CyberCoveLLC <jknapp85@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program. If not, see <https://www.gnu.org/licenses/>
*/
// Deliberately dependency-free (no gtest/catch2 etc.) so this test target
// has no network fetch or package-manager step in CI -- proving the
// "core library builds and tests headlessly, no OBS required" claim
// without adding another moving part to this scaffolding pass.
#include <cassert>
#include <cstdio>
#include <cstring>
#include "stplugin/core.h"
#include "stplugin/core_c.h"
int main() {
// core_version() should return a non-empty string, via both the
// C++ API and the C ABI wrapper the OBS adapter will actually call.
const char *cpp_version = stplugin::core_version();
assert(cpp_version != nullptr);
assert(std::strlen(cpp_version) > 0);
const char *c_version = stplugin_core_version();
assert(c_version != nullptr);
assert(std::strcmp(cpp_version, c_version) == 0);
// ConnectionConfig::is_valid() -- trivial non-empty checks, but
// exercised through all four combinations to prove the core library
// is genuinely testable in isolation.
stplugin::ConnectionConfig valid{"https://streamers.example.com", "main-room", "readkey123"};
assert(valid.is_valid());
stplugin::ConnectionConfig missing_url{"", "main-room", "readkey123"};
assert(!missing_url.is_valid());
stplugin::ConnectionConfig missing_slug{"https://streamers.example.com", "", "readkey123"};
assert(!missing_slug.is_valid());
stplugin::ConnectionConfig missing_key{"https://streamers.example.com", "main-room", ""};
assert(!missing_key.is_valid());
std::printf("core: all tests passed\n");
return 0;
}