Scaffold core/OBS-adapter split, prove CMake toolchain, add 3-platform CI
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:
@@ -0,0 +1,37 @@
|
||||
# streamer-tools OBS Camera Plugin - OBS adapter
|
||||
#
|
||||
# Thin glue only, per the design doc: source registration, (eventually)
|
||||
# properties UI, and pushing frames into OBS. All real logic lives in
|
||||
# ../core. Only added to the build when find_package(libobs) succeeds
|
||||
# (see top-level CMakeLists.txt) -- see README.md for why.
|
||||
|
||||
set(STPLUGIN_PROJECT_NAME "streamer-tools-camera")
|
||||
set(STPLUGIN_PROJECT_VERSION "${PROJECT_VERSION}")
|
||||
|
||||
configure_file(
|
||||
src/plugin-support.c.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/plugin-support.c
|
||||
@ONLY
|
||||
)
|
||||
|
||||
add_library(${STPLUGIN_PROJECT_NAME} MODULE
|
||||
src/plugin-main.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/plugin-support.c
|
||||
)
|
||||
|
||||
target_include_directories(${STPLUGIN_PROJECT_NAME}
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
target_link_libraries(${STPLUGIN_PROJECT_NAME}
|
||||
PRIVATE
|
||||
OBS::libobs
|
||||
stplugin_core
|
||||
)
|
||||
|
||||
set_target_properties(${STPLUGIN_PROJECT_NAME} PROPERTIES
|
||||
PREFIX ""
|
||||
OUTPUT_NAME ${STPLUGIN_PROJECT_NAME}
|
||||
)
|
||||
@@ -0,0 +1,2 @@
|
||||
# streamer-tools OBS Camera Plugin - en-US locale
|
||||
# No user-facing strings yet -- this is scaffolding (see plugin-main.c).
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
streamer-tools OBS Camera Plugin
|
||||
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/>
|
||||
*/
|
||||
|
||||
/* SCAFFOLDING. This registers a source type so the OBS-adapter/core-
|
||||
* library split and OBS's module-loading toolchain can be proven end to
|
||||
* end, but it does not do anything real yet: no LiveKit FFI session, no
|
||||
* frames pushed via obs_source_output_video/audio, no properties UI.
|
||||
* See docs/superpowers/specs/2026-09-06-obs-camera-plugin-design.md in
|
||||
* the streamer-tools repo for what this becomes. */
|
||||
|
||||
#include <obs-module.h>
|
||||
#include <util/bmem.h>
|
||||
#include <plugin-support.h>
|
||||
#include <stplugin/core_c.h>
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
OBS_MODULE_USE_DEFAULT_LOCALE(PLUGIN_NAME, "en-US")
|
||||
|
||||
static const char *stcam_source_get_name(void *unused)
|
||||
{
|
||||
UNUSED_PARAMETER(unused);
|
||||
return "streamer-tools Camera (scaffold - not yet functional)";
|
||||
}
|
||||
|
||||
static void *stcam_source_create(obs_data_t *settings, obs_source_t *source)
|
||||
{
|
||||
UNUSED_PARAMETER(settings);
|
||||
UNUSED_PARAMETER(source);
|
||||
/* No LiveKit session, no state to speak of yet -- just proving the
|
||||
* source registers and OBS can instantiate/destroy it cleanly. */
|
||||
return bzalloc(1);
|
||||
}
|
||||
|
||||
static void stcam_source_destroy(void *data)
|
||||
{
|
||||
bfree(data);
|
||||
}
|
||||
|
||||
static struct obs_source_info streamer_tools_camera_source = {
|
||||
.id = "streamer_tools_camera_source",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_ASYNC_VIDEO,
|
||||
.get_name = stcam_source_get_name,
|
||||
.create = stcam_source_create,
|
||||
.destroy = stcam_source_destroy,
|
||||
};
|
||||
|
||||
bool obs_module_load(void)
|
||||
{
|
||||
obs_log(LOG_INFO, "streamer-tools camera plugin scaffold loaded (core library version %s)",
|
||||
stplugin_core_version());
|
||||
obs_register_source(&streamer_tools_camera_source);
|
||||
return true;
|
||||
}
|
||||
|
||||
void obs_module_unload(void)
|
||||
{
|
||||
obs_log(LOG_INFO, "streamer-tools camera plugin scaffold unloaded");
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
streamer-tools OBS Camera Plugin
|
||||
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/>
|
||||
*/
|
||||
|
||||
/* Adapted from obsproject/obs-plugintemplate (commit 3e7d7ac,
|
||||
* 2025-12-09), the standard starting point for third-party OBS
|
||||
* plugins. */
|
||||
|
||||
#include "plugin-support.h"
|
||||
|
||||
const char *PLUGIN_NAME = "@STPLUGIN_PROJECT_NAME@";
|
||||
const char *PLUGIN_VERSION = "@STPLUGIN_PROJECT_VERSION@";
|
||||
|
||||
void obs_log(int log_level, const char *format, ...)
|
||||
{
|
||||
size_t length = 4 + strlen(PLUGIN_NAME) + strlen(format);
|
||||
|
||||
char *template = malloc(length + 1);
|
||||
|
||||
snprintf(template, length, "[%s] %s", PLUGIN_NAME, format);
|
||||
|
||||
va_list(args);
|
||||
|
||||
va_start(args, format);
|
||||
blogva(log_level, template, args);
|
||||
va_end(args);
|
||||
|
||||
free(template);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
streamer-tools OBS Camera Plugin
|
||||
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/>
|
||||
*/
|
||||
|
||||
/* Adapted from obsproject/obs-plugintemplate (commit 3e7d7ac,
|
||||
* 2025-12-09), the standard starting point for third-party OBS
|
||||
* plugins. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
extern const char *PLUGIN_NAME;
|
||||
extern const char *PLUGIN_VERSION;
|
||||
|
||||
void obs_log(int log_level, const char *format, ...);
|
||||
extern void blogva(int log_level, const char *format, va_list args);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user