backend and frontend: port frame sending to flatbuffers

This commit is contained in:
2025-08-10 21:02:03 -06:00
parent 209c1cffc4
commit 7afd8db8d8
17 changed files with 1230 additions and 79 deletions
@@ -0,0 +1,38 @@
// automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
import { DecodeUnit } from '../video-update/decode-unit.js';
import { Setup } from '../video-update/setup.js';
export enum Update {
NONE = 0,
Setup = 1,
DecodeUnit = 2
}
export function unionToUpdate(
type: Update,
accessor: (obj:DecodeUnit|Setup) => DecodeUnit|Setup|null
): DecodeUnit|Setup|null {
switch(Update[type]) {
case 'NONE': return null;
case 'Setup': return accessor(new Setup())! as Setup;
case 'DecodeUnit': return accessor(new DecodeUnit())! as DecodeUnit;
default: return null;
}
}
export function unionListToUpdate(
type: Update,
accessor: (index: number, obj:DecodeUnit|Setup) => DecodeUnit|Setup|null,
index: number
): DecodeUnit|Setup|null {
switch(Update[type]) {
case 'NONE': return null;
case 'Setup': return accessor(index, new Setup())! as Setup;
case 'DecodeUnit': return accessor(index, new DecodeUnit())! as DecodeUnit;
default: return null;
}
}