media

package
v1.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 0 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package media holds tiny hardcoded payloads used as send-side filler so the SFU sees periodic RTP and doesn't tear down our publisher PC for inactivity.

These are NOT meant to decode to anything sensible. The SFU forwards bytes verbatim and other peers' decoders may complain — that's fine for PoC #1, where the only success criterion is that goloom keeps the connection alive.

Index

Constants

This section is empty.

Variables

View Source
var OpusSilence = []byte{0xf8, 0xff, 0xfe}

OpusSilence is a single 20 ms Opus packet with the SILK NB mode TOC byte (0xf8 = config 31, mono, code 0) followed by a one-byte filler payload. Decoders interpret this as a frame of silence.

View Source
var VP8BlackKeyframe = []byte{
	0x10, 0x02, 0x00, 0x9d, 0x01, 0x2a, 0x10, 0x00, 0x10, 0x00,
	0x00, 0x47, 0x08, 0x85, 0x85, 0x88, 0x85, 0x84, 0x88, 0x02,
	0x02, 0x00, 0x0c, 0x0d, 0x60, 0x00, 0xfe, 0xfc, 0x5c, 0xd0,
}

VP8BlackKeyframe is a minimal valid VP8 I-frame for a 16×16 black image, pre-encoded by libvpx with default settings. We push it down our publisher video track during warmup so the SFU sees a "real" keyframe and starts forwarding subsequent packets to other subscribers. Without this, our tunnel frames (which look like inter-frames to a VP8 parser because payload byte 0 happens to have key_frame=1 set in RFC 6386's inverted convention) are dropped by goloom's keyframe-gated forwarder.

Source: equivalent to `ffmpeg -f lavfi -i color=black:s=16x16:r=1 -t 1 -c:v vp8 out.ivf` then extracting the first frame's payload (byte range after the 32-byte IVF file header + 12-byte IVF frame header).

View Source
var VP8Stub = make([]byte, 64)

VP8Stub is a placeholder payload sent in the video track at low frame rate solely to keep the publisher transceiver "active" from the SFU's liveness perspective. It is NOT a valid VP8 keyframe — downstream decoders will drop it. PoC #1 only needs the SFU to keep the connection open; once we move to PoC #2 (real media tunneling) this gets replaced by a proper encoder pipeline.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL