perf(golive/spike): binding addTrack + TS port of @dank074 media stack
Phase 1 spike: replace @dank074/discord-video-stream + node-datachannel +
node-av (1.3GB) with minimal libdatachannel N-API binding + native RTP
packetizers (H264 FU-A, RTCP SR/NACK, pacer) + pure-TS GoLive stack.
Binding v0.4: addTrack (m=audio/video SDP), TrackWrap w/ setPacketizer +
sendFrame (raw RTP to transport) + addTimestamp — verified by two-peer
handshake emitting SDP with audio(opus 120)+video(H264 101) and 8-frame
RTP roundtrip.
TS layer (src/goLive/, 21 files): CodecPayloadType, VoiceOpCodes,
GatewayOpCodes, utils, BaseMediaConnection (voice WS + DAVE + heartbeat),
VoiceConnection, StreamConnection, Streamer, WebRtcWrapper (SDP mungling,
DAVE encrypt, packetizer chain), BaseMediaStream (pacing/sync), VideoStream,
AudioStream, Demuxer (ffmpeg-spawn NUT/AnnexB, no node-av 114M binary),
Encoders, prepareStream/playStream.
Integration: screenShareController.ts now imports from ../../goLive/index.js —
prepareStream(prepared, ...) + playStream(prepared, streamer, {...}).
Tests: tests/goLive-port.test.ts (8/8 pass). tsc --noEmit clean. biome clean.
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
/** Discord voice WebSocket opcodes — ported from @dank074/discord-video-stream. */
|
||||
export enum VoiceOpCodes {
|
||||
IDENTIFY = 0,
|
||||
SELECT_PROTOCOL = 1,
|
||||
READY = 2,
|
||||
HEARTBEAT = 3,
|
||||
SELECT_PROTOCOL_ACK = 4,
|
||||
SPEAKING = 5,
|
||||
HEARTBEAT_ACK = 6,
|
||||
RESUME = 7,
|
||||
HELLO = 8,
|
||||
RESUMED = 9,
|
||||
CLIENTS_CONNECT = 11,
|
||||
VIDEO = 12,
|
||||
CLIENT_DISCONNECT = 13,
|
||||
SESSION_UPDATE = 14,
|
||||
MEDIA_SINK_WANTS = 15,
|
||||
VOICE_BACKEND_VERSION = 16,
|
||||
CHANNEL_OPTIONS_UPDATE = 17,
|
||||
FLAGS = 18,
|
||||
SPEED_TEST = 19,
|
||||
PLATFORM = 20,
|
||||
DAVE_PREPARE_TRANSITION = 21,
|
||||
DAVE_EXECUTE_TRANSITION = 22,
|
||||
DAVE_TRANSITION_READY = 23,
|
||||
DAVE_PREPARE_EPOCH = 24,
|
||||
MLS_INVALID_COMMIT_WELCOME = 31,
|
||||
}
|
||||
|
||||
/** Binary voice WebSocket opcodes (DAVE / MLS). */
|
||||
export enum VoiceOpCodesBinary {
|
||||
MLS_EXTERNAL_SENDER = 25,
|
||||
MLS_KEY_PACKAGE = 26,
|
||||
MLS_PROPOSALS = 27,
|
||||
MLS_COMMIT_WELCOME = 28,
|
||||
MLS_ANNOUNCE_COMMIT_TRANSITION = 29,
|
||||
MLS_WELCOME = 30,
|
||||
}
|
||||
Reference in New Issue
Block a user