backend and frontend: port frame sending to flatbuffers
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
// 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 * as flatbuffers from 'flatbuffers';
|
||||
|
||||
export class Setup {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):Setup {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsSetup(bb:flatbuffers.ByteBuffer, obj?:Setup):Setup {
|
||||
return (obj || new Setup()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsSetup(bb:flatbuffers.ByteBuffer, obj?:Setup):Setup {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Setup()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
videoFormat():string|null
|
||||
videoFormat(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
||||
videoFormat(optionalEncoding?:any):string|Uint8Array|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
}
|
||||
|
||||
width():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
height():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
redrawRate():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
static startSetup(builder:flatbuffers.Builder) {
|
||||
builder.startObject(4);
|
||||
}
|
||||
|
||||
static addVideoFormat(builder:flatbuffers.Builder, videoFormatOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(0, videoFormatOffset, 0);
|
||||
}
|
||||
|
||||
static addWidth(builder:flatbuffers.Builder, width:number) {
|
||||
builder.addFieldInt16(1, width, 0);
|
||||
}
|
||||
|
||||
static addHeight(builder:flatbuffers.Builder, height:number) {
|
||||
builder.addFieldInt16(2, height, 0);
|
||||
}
|
||||
|
||||
static addRedrawRate(builder:flatbuffers.Builder, redrawRate:number) {
|
||||
builder.addFieldInt16(3, redrawRate, 0);
|
||||
}
|
||||
|
||||
static endSetup(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
|
||||
static createSetup(builder:flatbuffers.Builder, videoFormatOffset:flatbuffers.Offset, width:number, height:number, redrawRate:number):flatbuffers.Offset {
|
||||
Setup.startSetup(builder);
|
||||
Setup.addVideoFormat(builder, videoFormatOffset);
|
||||
Setup.addWidth(builder, width);
|
||||
Setup.addHeight(builder, height);
|
||||
Setup.addRedrawRate(builder, redrawRate);
|
||||
return Setup.endSetup(builder);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user