The squirrel, carrying messages it does not own
Ratatoskr subscribes to a CultMesh media stream and hands frames to a renderer.
First lowering target is OBS.
It exists because the receiver it replaces hand-rolled CultNet RUDP in C++
inside Mimir: acknowledgement, fragment reassembly, sockets, cultmesh:// URL
parsing, wire framing and two erasure codes, in 973 lines of headers linking no
CultLib. That made the receiving end of a protocol a separate implementation
from the sending end, in another language and another repository, and every
CultNet fix from August and September reached cultnet-rs and cultnet-ts without
reaching it.
So the constraint this repo holds is that it implements no transport. It
consumes CultNet. A sequence number or an ACK mask appearing here means
something belongs upstream in CultLib instead, where both ends can share it.
What works: the core opens a subscription over cultnet-rs, drains it, and hands
payloads across a C ABI. Nine Rust tests and fourteen C checks, the latter
loading the cdylib and verifying the header tells the truth rather than assuming
it. The MSVC staticlib is what the plugin will link; the C smoke test loads the
cdylib dynamically so the ABI is checkable with any compiler.
What does not: no reassembly, no FEC, no receiver feedback, and no plugin. It
cannot decode a real Muninn stream yet, because the wire envelope
(MuninnMediaWireRecord, encode_media_wire_record) still lives in Muninn and
needs to move to CultLib where both ends can reach it. README says so plainly
rather than implying more than exists.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 01:40:26 +02:00
/* Proves the C ABI is callable and behaves as its header claims.
*
* Loads the cdylib at runtime rather than linking it . That keeps the test
* compiler - agnostic — the production plugin is built with MSVC , this runs
* anywhere — and it exercises the library the way a host actually loads it .
*/
# include "ratatoskr.h"
# include <stdio.h>
# include <string.h>
# include <windows.h>
static int failures = 0 ;
static void check ( int ok , const char * what )
{
if ( ! ok ) { printf ( " FAIL %s \n " , what ) ; failures + + ; }
else { printf ( " ok %s \n " , what ) ; }
}
The OBS source, and the mesh side it needs
A new source type, "CultMesh Media Stream". Its properties pull every
gamecult.media_stream_advertisement Odin holds and offer each stream's
video sources, audio sources and codecs from the advertisement, with
bitrate and latency budget; activating publishes a
gamecult.media_stream_request naming this receiver's endpoint. Nothing
in the picker comes from configuration or from Muninn.
The core grows the mesh half (catalog.rs): pull the advertisements,
publish a request, read the producer's answer, all over cultmesh-rs and
tested against an Odin-shaped RUDP catalog server on loopback. The C ABI
gains the catalog and request calls, a video relay that copies each
whole access unit to a loopback UDP port as a raw byte stream, and the
producer's presentation time on every payload.
The plugin itself owns only the OBS lifecycle. Video is drawn from a
private ffmpeg_source child reading the relay — the arrangement the
previous plugin proved in the field, minus the 2,500 lines of transport
it hand-rolled underneath. Audio is PCM straight to
obs_source_output_audio.
Built against a libobs-only build of obs-studio 32.2.2 with obs-deps
2026-07-15 under .sdk/ (git-ignored; the README says how). Installed to
the per-user OBS plugins directory. Not yet exercised with a live stream.
cargo test -p ratatoskr-core -> 31 passed
abi_smoke.exe ratatoskr_core.dll -> ABI SMOKE PASSED
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-10 22:22:42 +02:00
typedef int ( * open_fn ) ( const char * , const char * , unsigned int , const char * , RatatoskrHandle * * ) ;
The squirrel, carrying messages it does not own
Ratatoskr subscribes to a CultMesh media stream and hands frames to a renderer.
First lowering target is OBS.
It exists because the receiver it replaces hand-rolled CultNet RUDP in C++
inside Mimir: acknowledgement, fragment reassembly, sockets, cultmesh:// URL
parsing, wire framing and two erasure codes, in 973 lines of headers linking no
CultLib. That made the receiving end of a protocol a separate implementation
from the sending end, in another language and another repository, and every
CultNet fix from August and September reached cultnet-rs and cultnet-ts without
reaching it.
So the constraint this repo holds is that it implements no transport. It
consumes CultNet. A sequence number or an ACK mask appearing here means
something belongs upstream in CultLib instead, where both ends can share it.
What works: the core opens a subscription over cultnet-rs, drains it, and hands
payloads across a C ABI. Nine Rust tests and fourteen C checks, the latter
loading the cdylib and verifying the header tells the truth rather than assuming
it. The MSVC staticlib is what the plugin will link; the C smoke test loads the
cdylib dynamically so the ABI is checkable with any compiler.
What does not: no reassembly, no FEC, no receiver feedback, and no plugin. It
cannot decode a real Muninn stream yet, because the wire envelope
(MuninnMediaWireRecord, encode_media_wire_record) still lives in Muninn and
needs to move to CultLib where both ends can reach it. README says so plainly
rather than implying more than exists.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 01:40:26 +02:00
typedef int ( * poll_fn ) ( RatatoskrHandle * ) ;
The OBS source, and the mesh side it needs
A new source type, "CultMesh Media Stream". Its properties pull every
gamecult.media_stream_advertisement Odin holds and offer each stream's
video sources, audio sources and codecs from the advertisement, with
bitrate and latency budget; activating publishes a
gamecult.media_stream_request naming this receiver's endpoint. Nothing
in the picker comes from configuration or from Muninn.
The core grows the mesh half (catalog.rs): pull the advertisements,
publish a request, read the producer's answer, all over cultmesh-rs and
tested against an Odin-shaped RUDP catalog server on loopback. The C ABI
gains the catalog and request calls, a video relay that copies each
whole access unit to a loopback UDP port as a raw byte stream, and the
producer's presentation time on every payload.
The plugin itself owns only the OBS lifecycle. Video is drawn from a
private ffmpeg_source child reading the relay — the arrangement the
previous plugin proved in the field, minus the 2,500 lines of transport
it hand-rolled underneath. Audio is PCM straight to
obs_source_output_audio.
Built against a libobs-only build of obs-studio 32.2.2 with obs-deps
2026-07-15 under .sdk/ (git-ignored; the README says how). Installed to
the per-user OBS plugins directory. Not yet exercised with a live stream.
cargo test -p ratatoskr-core -> 31 passed
abi_smoke.exe ratatoskr_core.dll -> ABI SMOKE PASSED
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-10 22:22:42 +02:00
typedef int ( * next_fn ) ( RatatoskrHandle * , uint8_t * , size_t , size_t * , int * , int64_t * ) ;
2026-09-10 23:03:30 +02:00
typedef int ( * attached_fn ) ( RatatoskrHandle * ) ;
The squirrel, carrying messages it does not own
Ratatoskr subscribes to a CultMesh media stream and hands frames to a renderer.
First lowering target is OBS.
It exists because the receiver it replaces hand-rolled CultNet RUDP in C++
inside Mimir: acknowledgement, fragment reassembly, sockets, cultmesh:// URL
parsing, wire framing and two erasure codes, in 973 lines of headers linking no
CultLib. That made the receiving end of a protocol a separate implementation
from the sending end, in another language and another repository, and every
CultNet fix from August and September reached cultnet-rs and cultnet-ts without
reaching it.
So the constraint this repo holds is that it implements no transport. It
consumes CultNet. A sequence number or an ACK mask appearing here means
something belongs upstream in CultLib instead, where both ends can share it.
What works: the core opens a subscription over cultnet-rs, drains it, and hands
payloads across a C ABI. Nine Rust tests and fourteen C checks, the latter
loading the cdylib and verifying the header tells the truth rather than assuming
it. The MSVC staticlib is what the plugin will link; the C smoke test loads the
cdylib dynamically so the ABI is checkable with any compiler.
What does not: no reassembly, no FEC, no receiver feedback, and no plugin. It
cannot decode a real Muninn stream yet, because the wire envelope
(MuninnMediaWireRecord, encode_media_wire_record) still lives in Muninn and
needs to move to CultLib where both ends can reach it. README says so plainly
rather than implying more than exists.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 01:40:26 +02:00
typedef void ( * delivered_fn ) ( RatatoskrHandle * , uint64_t * , uint64_t * ) ;
typedef size_t ( * err_fn ) ( char * , size_t ) ;
typedef void ( * close_fn ) ( RatatoskrHandle * ) ;
2026-09-10 02:03:41 +02:00
typedef uint64_t ( * undecodable_fn ) ( RatatoskrHandle * ) ;
The OBS source, and the mesh side it needs
A new source type, "CultMesh Media Stream". Its properties pull every
gamecult.media_stream_advertisement Odin holds and offer each stream's
video sources, audio sources and codecs from the advertisement, with
bitrate and latency budget; activating publishes a
gamecult.media_stream_request naming this receiver's endpoint. Nothing
in the picker comes from configuration or from Muninn.
The core grows the mesh half (catalog.rs): pull the advertisements,
publish a request, read the producer's answer, all over cultmesh-rs and
tested against an Odin-shaped RUDP catalog server on loopback. The C ABI
gains the catalog and request calls, a video relay that copies each
whole access unit to a loopback UDP port as a raw byte stream, and the
producer's presentation time on every payload.
The plugin itself owns only the OBS lifecycle. Video is drawn from a
private ffmpeg_source child reading the relay — the arrangement the
previous plugin proved in the field, minus the 2,500 lines of transport
it hand-rolled underneath. Audio is PCM straight to
obs_source_output_audio.
Built against a libobs-only build of obs-studio 32.2.2 with obs-deps
2026-07-15 under .sdk/ (git-ignored; the README says how). Installed to
the per-user OBS plugins directory. Not yet exercised with a live stream.
cargo test -p ratatoskr-core -> 31 passed
abi_smoke.exe ratatoskr_core.dll -> ABI SMOKE PASSED
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-10 22:22:42 +02:00
typedef uint16_t ( * free_port_fn ) ( void ) ;
The squirrel, carrying messages it does not own
Ratatoskr subscribes to a CultMesh media stream and hands frames to a renderer.
First lowering target is OBS.
It exists because the receiver it replaces hand-rolled CultNet RUDP in C++
inside Mimir: acknowledgement, fragment reassembly, sockets, cultmesh:// URL
parsing, wire framing and two erasure codes, in 973 lines of headers linking no
CultLib. That made the receiving end of a protocol a separate implementation
from the sending end, in another language and another repository, and every
CultNet fix from August and September reached cultnet-rs and cultnet-ts without
reaching it.
So the constraint this repo holds is that it implements no transport. It
consumes CultNet. A sequence number or an ACK mask appearing here means
something belongs upstream in CultLib instead, where both ends can share it.
What works: the core opens a subscription over cultnet-rs, drains it, and hands
payloads across a C ABI. Nine Rust tests and fourteen C checks, the latter
loading the cdylib and verifying the header tells the truth rather than assuming
it. The MSVC staticlib is what the plugin will link; the C smoke test loads the
cdylib dynamically so the ABI is checkable with any compiler.
What does not: no reassembly, no FEC, no receiver feedback, and no plugin. It
cannot decode a real Muninn stream yet, because the wire envelope
(MuninnMediaWireRecord, encode_media_wire_record) still lives in Muninn and
needs to move to CultLib where both ends can reach it. README says so plainly
rather than implying more than exists.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 01:40:26 +02:00
int main ( int argc , char * * argv )
{
const char * dll = argc > 1 ? argv [ 1 ] : " ratatoskr_core.dll " ;
HMODULE lib = LoadLibraryA ( dll ) ;
if ( ! lib ) { printf ( " FAIL could not load %s (error %lu) \n " , dll , GetLastError ( ) ) ; return 1 ; }
open_fn r_open = ( open_fn ) ( void * ) GetProcAddress ( lib , " ratatoskr_receiver_open " ) ;
poll_fn r_poll = ( poll_fn ) ( void * ) GetProcAddress ( lib , " ratatoskr_receiver_poll " ) ;
next_fn r_next = ( next_fn ) ( void * ) GetProcAddress ( lib , " ratatoskr_receiver_next_payload " ) ;
2026-09-10 23:03:30 +02:00
attached_fn r_attached = ( attached_fn ) ( void * ) GetProcAddress ( lib , " ratatoskr_receiver_attached " ) ;
The squirrel, carrying messages it does not own
Ratatoskr subscribes to a CultMesh media stream and hands frames to a renderer.
First lowering target is OBS.
It exists because the receiver it replaces hand-rolled CultNet RUDP in C++
inside Mimir: acknowledgement, fragment reassembly, sockets, cultmesh:// URL
parsing, wire framing and two erasure codes, in 973 lines of headers linking no
CultLib. That made the receiving end of a protocol a separate implementation
from the sending end, in another language and another repository, and every
CultNet fix from August and September reached cultnet-rs and cultnet-ts without
reaching it.
So the constraint this repo holds is that it implements no transport. It
consumes CultNet. A sequence number or an ACK mask appearing here means
something belongs upstream in CultLib instead, where both ends can share it.
What works: the core opens a subscription over cultnet-rs, drains it, and hands
payloads across a C ABI. Nine Rust tests and fourteen C checks, the latter
loading the cdylib and verifying the header tells the truth rather than assuming
it. The MSVC staticlib is what the plugin will link; the C smoke test loads the
cdylib dynamically so the ABI is checkable with any compiler.
What does not: no reassembly, no FEC, no receiver feedback, and no plugin. It
cannot decode a real Muninn stream yet, because the wire envelope
(MuninnMediaWireRecord, encode_media_wire_record) still lives in Muninn and
needs to move to CultLib where both ends can reach it. README says so plainly
rather than implying more than exists.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 01:40:26 +02:00
delivered_fn r_delivered = ( delivered_fn ) ( void * ) GetProcAddress ( lib , " ratatoskr_receiver_delivered " ) ;
err_fn r_err = ( err_fn ) ( void * ) GetProcAddress ( lib , " ratatoskr_last_error " ) ;
close_fn r_close = ( close_fn ) ( void * ) GetProcAddress ( lib , " ratatoskr_receiver_close " ) ;
2026-09-10 23:03:30 +02:00
check ( r_open & & r_poll & & r_next & & r_attached & & r_delivered & & r_err & & r_close ,
The squirrel, carrying messages it does not own
Ratatoskr subscribes to a CultMesh media stream and hands frames to a renderer.
First lowering target is OBS.
It exists because the receiver it replaces hand-rolled CultNet RUDP in C++
inside Mimir: acknowledgement, fragment reassembly, sockets, cultmesh:// URL
parsing, wire framing and two erasure codes, in 973 lines of headers linking no
CultLib. That made the receiving end of a protocol a separate implementation
from the sending end, in another language and another repository, and every
CultNet fix from August and September reached cultnet-rs and cultnet-ts without
reaching it.
So the constraint this repo holds is that it implements no transport. It
consumes CultNet. A sequence number or an ACK mask appearing here means
something belongs upstream in CultLib instead, where both ends can share it.
What works: the core opens a subscription over cultnet-rs, drains it, and hands
payloads across a C ABI. Nine Rust tests and fourteen C checks, the latter
loading the cdylib and verifying the header tells the truth rather than assuming
it. The MSVC staticlib is what the plugin will link; the C smoke test loads the
cdylib dynamically so the ABI is checkable with any compiler.
What does not: no reassembly, no FEC, no receiver feedback, and no plugin. It
cannot decode a real Muninn stream yet, because the wire envelope
(MuninnMediaWireRecord, encode_media_wire_record) still lives in Muninn and
needs to move to CultLib where both ends can reach it. README says so plainly
rather than implying more than exists.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 01:40:26 +02:00
" every documented symbol is exported " ) ;
if ( failures ) { printf ( " ABI SMOKE FAILED \n " ) ; return 1 ; }
RatatoskrHandle * handle = NULL ;
2026-09-10 23:03:30 +02:00
/* nobody listens on port 9; the dial is sent, not answered */
check ( r_open ( " 127.0.0.1:9 " , " ratatoskr-abi-smoke " , 0x0BE00001u , NULL , & handle ) = = RATATOSKR_OK ,
" open returns OK without waiting for an answer " ) ;
The squirrel, carrying messages it does not own
Ratatoskr subscribes to a CultMesh media stream and hands frames to a renderer.
First lowering target is OBS.
It exists because the receiver it replaces hand-rolled CultNet RUDP in C++
inside Mimir: acknowledgement, fragment reassembly, sockets, cultmesh:// URL
parsing, wire framing and two erasure codes, in 973 lines of headers linking no
CultLib. That made the receiving end of a protocol a separate implementation
from the sending end, in another language and another repository, and every
CultNet fix from August and September reached cultnet-rs and cultnet-ts without
reaching it.
So the constraint this repo holds is that it implements no transport. It
consumes CultNet. A sequence number or an ACK mask appearing here means
something belongs upstream in CultLib instead, where both ends can share it.
What works: the core opens a subscription over cultnet-rs, drains it, and hands
payloads across a C ABI. Nine Rust tests and fourteen C checks, the latter
loading the cdylib and verifying the header tells the truth rather than assuming
it. The MSVC staticlib is what the plugin will link; the C smoke test loads the
cdylib dynamically so the ABI is checkable with any compiler.
What does not: no reassembly, no FEC, no receiver feedback, and no plugin. It
cannot decode a real Muninn stream yet, because the wire envelope
(MuninnMediaWireRecord, encode_media_wire_record) still lives in Muninn and
needs to move to CultLib where both ends can reach it. README says so plainly
rather than implying more than exists.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 01:40:26 +02:00
check ( handle ! = NULL , " open yields a handle " ) ;
2026-09-10 23:03:30 +02:00
check ( r_attached ( handle ) = = 0 , " an unanswered dial is not attached " ) ;
The squirrel, carrying messages it does not own
Ratatoskr subscribes to a CultMesh media stream and hands frames to a renderer.
First lowering target is OBS.
It exists because the receiver it replaces hand-rolled CultNet RUDP in C++
inside Mimir: acknowledgement, fragment reassembly, sockets, cultmesh:// URL
parsing, wire framing and two erasure codes, in 973 lines of headers linking no
CultLib. That made the receiving end of a protocol a separate implementation
from the sending end, in another language and another repository, and every
CultNet fix from August and September reached cultnet-rs and cultnet-ts without
reaching it.
So the constraint this repo holds is that it implements no transport. It
consumes CultNet. A sequence number or an ACK mask appearing here means
something belongs upstream in CultLib instead, where both ends can share it.
What works: the core opens a subscription over cultnet-rs, drains it, and hands
payloads across a C ABI. Nine Rust tests and fourteen C checks, the latter
loading the cdylib and verifying the header tells the truth rather than assuming
it. The MSVC staticlib is what the plugin will link; the C smoke test loads the
cdylib dynamically so the ABI is checkable with any compiler.
What does not: no reassembly, no FEC, no receiver feedback, and no plugin. It
cannot decode a real Muninn stream yet, because the wire envelope
(MuninnMediaWireRecord, encode_media_wire_record) still lives in Muninn and
needs to move to CultLib where both ends can reach it. README says so plainly
rather than implying more than exists.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 01:40:26 +02:00
check ( r_poll ( handle ) = = 0 , " idle poll reports nothing waiting " ) ;
size_t out_len = 12345 ;
2026-09-10 02:03:41 +02:00
int kind = - 99 ;
The squirrel, carrying messages it does not own
Ratatoskr subscribes to a CultMesh media stream and hands frames to a renderer.
First lowering target is OBS.
It exists because the receiver it replaces hand-rolled CultNet RUDP in C++
inside Mimir: acknowledgement, fragment reassembly, sockets, cultmesh:// URL
parsing, wire framing and two erasure codes, in 973 lines of headers linking no
CultLib. That made the receiving end of a protocol a separate implementation
from the sending end, in another language and another repository, and every
CultNet fix from August and September reached cultnet-rs and cultnet-ts without
reaching it.
So the constraint this repo holds is that it implements no transport. It
consumes CultNet. A sequence number or an ACK mask appearing here means
something belongs upstream in CultLib instead, where both ends can share it.
What works: the core opens a subscription over cultnet-rs, drains it, and hands
payloads across a C ABI. Nine Rust tests and fourteen C checks, the latter
loading the cdylib and verifying the header tells the truth rather than assuming
it. The MSVC staticlib is what the plugin will link; the C smoke test loads the
cdylib dynamically so the ABI is checkable with any compiler.
What does not: no reassembly, no FEC, no receiver feedback, and no plugin. It
cannot decode a real Muninn stream yet, because the wire envelope
(MuninnMediaWireRecord, encode_media_wire_record) still lives in Muninn and
needs to move to CultLib where both ends can reach it. README says so plainly
rather than implying more than exists.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 01:40:26 +02:00
unsigned char buffer [ 64 ] ;
The OBS source, and the mesh side it needs
A new source type, "CultMesh Media Stream". Its properties pull every
gamecult.media_stream_advertisement Odin holds and offer each stream's
video sources, audio sources and codecs from the advertisement, with
bitrate and latency budget; activating publishes a
gamecult.media_stream_request naming this receiver's endpoint. Nothing
in the picker comes from configuration or from Muninn.
The core grows the mesh half (catalog.rs): pull the advertisements,
publish a request, read the producer's answer, all over cultmesh-rs and
tested against an Odin-shaped RUDP catalog server on loopback. The C ABI
gains the catalog and request calls, a video relay that copies each
whole access unit to a loopback UDP port as a raw byte stream, and the
producer's presentation time on every payload.
The plugin itself owns only the OBS lifecycle. Video is drawn from a
private ffmpeg_source child reading the relay — the arrangement the
previous plugin proved in the field, minus the 2,500 lines of transport
it hand-rolled underneath. Audio is PCM straight to
obs_source_output_audio.
Built against a libobs-only build of obs-studio 32.2.2 with obs-deps
2026-07-15 under .sdk/ (git-ignored; the README says how). Installed to
the per-user OBS plugins directory. Not yet exercised with a live stream.
cargo test -p ratatoskr-core -> 31 passed
abi_smoke.exe ratatoskr_core.dll -> ABI SMOKE PASSED
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-10 22:22:42 +02:00
int64_t pts = - 1 ;
check ( r_next ( handle , buffer , sizeof buffer , & out_len , & kind , & pts ) = = RATATOSKR_NONE ,
The squirrel, carrying messages it does not own
Ratatoskr subscribes to a CultMesh media stream and hands frames to a renderer.
First lowering target is OBS.
It exists because the receiver it replaces hand-rolled CultNet RUDP in C++
inside Mimir: acknowledgement, fragment reassembly, sockets, cultmesh:// URL
parsing, wire framing and two erasure codes, in 973 lines of headers linking no
CultLib. That made the receiving end of a protocol a separate implementation
from the sending end, in another language and another repository, and every
CultNet fix from August and September reached cultnet-rs and cultnet-ts without
reaching it.
So the constraint this repo holds is that it implements no transport. It
consumes CultNet. A sequence number or an ACK mask appearing here means
something belongs upstream in CultLib instead, where both ends can share it.
What works: the core opens a subscription over cultnet-rs, drains it, and hands
payloads across a C ABI. Nine Rust tests and fourteen C checks, the latter
loading the cdylib and verifying the header tells the truth rather than assuming
it. The MSVC staticlib is what the plugin will link; the C smoke test loads the
cdylib dynamically so the ABI is checkable with any compiler.
What does not: no reassembly, no FEC, no receiver feedback, and no plugin. It
cannot decode a real Muninn stream yet, because the wire envelope
(MuninnMediaWireRecord, encode_media_wire_record) still lives in Muninn and
needs to move to CultLib where both ends can reach it. README says so plainly
rather than implying more than exists.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 01:40:26 +02:00
" empty queue reports NONE, not an error " ) ;
check ( out_len = = 0 , " NONE writes a zero length " ) ;
uint64_t payloads = 7 , bytes = 7 ;
r_delivered ( handle , & payloads , & bytes ) ;
check ( payloads = = 0 & & bytes = = 0 , " delivered counts start at zero " ) ;
2026-09-10 02:03:41 +02:00
undecodable_fn r_undecodable =
( undecodable_fn ) ( void * ) GetProcAddress ( lib , " ratatoskr_receiver_undecodable " ) ;
check ( r_undecodable ! = NULL , " undecodable counter is exported " ) ;
check ( r_undecodable ( handle ) = = 0 , " nothing has failed to decode yet " ) ;
The squirrel, carrying messages it does not own
Ratatoskr subscribes to a CultMesh media stream and hands frames to a renderer.
First lowering target is OBS.
It exists because the receiver it replaces hand-rolled CultNet RUDP in C++
inside Mimir: acknowledgement, fragment reassembly, sockets, cultmesh:// URL
parsing, wire framing and two erasure codes, in 973 lines of headers linking no
CultLib. That made the receiving end of a protocol a separate implementation
from the sending end, in another language and another repository, and every
CultNet fix from August and September reached cultnet-rs and cultnet-ts without
reaching it.
So the constraint this repo holds is that it implements no transport. It
consumes CultNet. A sequence number or an ACK mask appearing here means
something belongs upstream in CultLib instead, where both ends can share it.
What works: the core opens a subscription over cultnet-rs, drains it, and hands
payloads across a C ABI. Nine Rust tests and fourteen C checks, the latter
loading the cdylib and verifying the header tells the truth rather than assuming
it. The MSVC staticlib is what the plugin will link; the C smoke test loads the
cdylib dynamically so the ABI is checkable with any compiler.
What does not: no reassembly, no FEC, no receiver feedback, and no plugin. It
cannot decode a real Muninn stream yet, because the wire envelope
(MuninnMediaWireRecord, encode_media_wire_record) still lives in Muninn and
needs to move to CultLib where both ends can reach it. README says so plainly
rather than implying more than exists.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 01:40:26 +02:00
r_close ( handle ) ;
handle = NULL ;
The OBS source, and the mesh side it needs
A new source type, "CultMesh Media Stream". Its properties pull every
gamecult.media_stream_advertisement Odin holds and offer each stream's
video sources, audio sources and codecs from the advertisement, with
bitrate and latency budget; activating publishes a
gamecult.media_stream_request naming this receiver's endpoint. Nothing
in the picker comes from configuration or from Muninn.
The core grows the mesh half (catalog.rs): pull the advertisements,
publish a request, read the producer's answer, all over cultmesh-rs and
tested against an Odin-shaped RUDP catalog server on loopback. The C ABI
gains the catalog and request calls, a video relay that copies each
whole access unit to a loopback UDP port as a raw byte stream, and the
producer's presentation time on every payload.
The plugin itself owns only the OBS lifecycle. Video is drawn from a
private ffmpeg_source child reading the relay — the arrangement the
previous plugin proved in the field, minus the 2,500 lines of transport
it hand-rolled underneath. Audio is PCM straight to
obs_source_output_audio.
Built against a libobs-only build of obs-studio 32.2.2 with obs-deps
2026-07-15 under .sdk/ (git-ignored; the README says how). Installed to
the per-user OBS plugins directory. Not yet exercised with a live stream.
cargo test -p ratatoskr-core -> 31 passed
abi_smoke.exe ratatoskr_core.dll -> ABI SMOKE PASSED
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-10 22:22:42 +02:00
check ( r_open ( " not-an-address " , " x " , 1 , NULL , & handle ) = = RATATOSKR_ERR_ARGUMENT ,
2026-09-10 23:03:30 +02:00
" a bad producer endpoint is refused " ) ;
The squirrel, carrying messages it does not own
Ratatoskr subscribes to a CultMesh media stream and hands frames to a renderer.
First lowering target is OBS.
It exists because the receiver it replaces hand-rolled CultNet RUDP in C++
inside Mimir: acknowledgement, fragment reassembly, sockets, cultmesh:// URL
parsing, wire framing and two erasure codes, in 973 lines of headers linking no
CultLib. That made the receiving end of a protocol a separate implementation
from the sending end, in another language and another repository, and every
CultNet fix from August and September reached cultnet-rs and cultnet-ts without
reaching it.
So the constraint this repo holds is that it implements no transport. It
consumes CultNet. A sequence number or an ACK mask appearing here means
something belongs upstream in CultLib instead, where both ends can share it.
What works: the core opens a subscription over cultnet-rs, drains it, and hands
payloads across a C ABI. Nine Rust tests and fourteen C checks, the latter
loading the cdylib and verifying the header tells the truth rather than assuming
it. The MSVC staticlib is what the plugin will link; the C smoke test loads the
cdylib dynamically so the ABI is checkable with any compiler.
What does not: no reassembly, no FEC, no receiver feedback, and no plugin. It
cannot decode a real Muninn stream yet, because the wire envelope
(MuninnMediaWireRecord, encode_media_wire_record) still lives in Muninn and
needs to move to CultLib where both ends can reach it. README says so plainly
rather than implying more than exists.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 01:40:26 +02:00
check ( handle = = NULL , " a refused open leaves no handle " ) ;
char message [ 256 ] ;
check ( r_err ( message , sizeof message ) > 0 , " a failure leaves a message " ) ;
check ( strstr ( message , " not-an-address " ) ! = NULL , " the message names the bad input " ) ;
2026-09-10 23:03:30 +02:00
check ( r_open ( " 127.0.0.1:9 " , " x " , 1 , " not-a-relay " , & handle ) = = RATATOSKR_ERR_ARGUMENT ,
The OBS source, and the mesh side it needs
A new source type, "CultMesh Media Stream". Its properties pull every
gamecult.media_stream_advertisement Odin holds and offer each stream's
video sources, audio sources and codecs from the advertisement, with
bitrate and latency budget; activating publishes a
gamecult.media_stream_request naming this receiver's endpoint. Nothing
in the picker comes from configuration or from Muninn.
The core grows the mesh half (catalog.rs): pull the advertisements,
publish a request, read the producer's answer, all over cultmesh-rs and
tested against an Odin-shaped RUDP catalog server on loopback. The C ABI
gains the catalog and request calls, a video relay that copies each
whole access unit to a loopback UDP port as a raw byte stream, and the
producer's presentation time on every payload.
The plugin itself owns only the OBS lifecycle. Video is drawn from a
private ffmpeg_source child reading the relay — the arrangement the
previous plugin proved in the field, minus the 2,500 lines of transport
it hand-rolled underneath. Audio is PCM straight to
obs_source_output_audio.
Built against a libobs-only build of obs-studio 32.2.2 with obs-deps
2026-07-15 under .sdk/ (git-ignored; the README says how). Installed to
the per-user OBS plugins directory. Not yet exercised with a live stream.
cargo test -p ratatoskr-core -> 31 passed
abi_smoke.exe ratatoskr_core.dll -> ABI SMOKE PASSED
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-10 22:22:42 +02:00
" a bad video relay is refused " ) ;
free_port_fn r_free_port = ( free_port_fn ) ( void * ) GetProcAddress ( lib , " ratatoskr_free_udp_port " ) ;
check ( r_free_port & & r_free_port ( ) ! = 0 , " a free loopback port can be found " ) ;
check ( GetProcAddress ( lib , " ratatoskr_catalog_pull " ) & & GetProcAddress ( lib , " ratatoskr_catalog_stream " ) & &
GetProcAddress ( lib , " ratatoskr_request_start " ) & & GetProcAddress ( lib , " ratatoskr_request_stop " ) & &
GetProcAddress ( lib , " ratatoskr_request_state " ) & & GetProcAddress ( lib , " ratatoskr_catalog_close " ) ,
" the discovery and request symbols are exported " ) ;
The squirrel, carrying messages it does not own
Ratatoskr subscribes to a CultMesh media stream and hands frames to a renderer.
First lowering target is OBS.
It exists because the receiver it replaces hand-rolled CultNet RUDP in C++
inside Mimir: acknowledgement, fragment reassembly, sockets, cultmesh:// URL
parsing, wire framing and two erasure codes, in 973 lines of headers linking no
CultLib. That made the receiving end of a protocol a separate implementation
from the sending end, in another language and another repository, and every
CultNet fix from August and September reached cultnet-rs and cultnet-ts without
reaching it.
So the constraint this repo holds is that it implements no transport. It
consumes CultNet. A sequence number or an ACK mask appearing here means
something belongs upstream in CultLib instead, where both ends can share it.
What works: the core opens a subscription over cultnet-rs, drains it, and hands
payloads across a C ABI. Nine Rust tests and fourteen C checks, the latter
loading the cdylib and verifying the header tells the truth rather than assuming
it. The MSVC staticlib is what the plugin will link; the C smoke test loads the
cdylib dynamically so the ABI is checkable with any compiler.
What does not: no reassembly, no FEC, no receiver feedback, and no plugin. It
cannot decode a real Muninn stream yet, because the wire envelope
(MuninnMediaWireRecord, encode_media_wire_record) still lives in Muninn and
needs to move to CultLib where both ends can reach it. README says so plainly
rather than implying more than exists.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 01:40:26 +02:00
r_close ( NULL ) ;
check ( r_poll ( NULL ) = = RATATOSKR_ERR_ARGUMENT , " null handle is refused " ) ;
2026-09-10 23:03:30 +02:00
check ( r_attached ( NULL ) = = 0 , " null handle is not attached " ) ;
The squirrel, carrying messages it does not own
Ratatoskr subscribes to a CultMesh media stream and hands frames to a renderer.
First lowering target is OBS.
It exists because the receiver it replaces hand-rolled CultNet RUDP in C++
inside Mimir: acknowledgement, fragment reassembly, sockets, cultmesh:// URL
parsing, wire framing and two erasure codes, in 973 lines of headers linking no
CultLib. That made the receiving end of a protocol a separate implementation
from the sending end, in another language and another repository, and every
CultNet fix from August and September reached cultnet-rs and cultnet-ts without
reaching it.
So the constraint this repo holds is that it implements no transport. It
consumes CultNet. A sequence number or an ACK mask appearing here means
something belongs upstream in CultLib instead, where both ends can share it.
What works: the core opens a subscription over cultnet-rs, drains it, and hands
payloads across a C ABI. Nine Rust tests and fourteen C checks, the latter
loading the cdylib and verifying the header tells the truth rather than assuming
it. The MSVC staticlib is what the plugin will link; the C smoke test loads the
cdylib dynamically so the ABI is checkable with any compiler.
What does not: no reassembly, no FEC, no receiver feedback, and no plugin. It
cannot decode a real Muninn stream yet, because the wire envelope
(MuninnMediaWireRecord, encode_media_wire_record) still lives in Muninn and
needs to move to CultLib where both ends can reach it. README says so plainly
rather than implying more than exists.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 01:40:26 +02:00
printf ( " %s \n " , failures ? " ABI SMOKE FAILED " : " ABI SMOKE PASSED " ) ;
return failures ? 1 : 0 ;
}