media

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package media defines the core frame types that flow through the Prism processing pipeline, from demuxing through distribution.

Index

Constants

View Source
const (
	VideoBufferSize   = 60
	AudioBufferSize   = 120
	CaptionBufferSize = 30
)

Channel buffer sizes used by both the demuxer (producer) and viewer sessions (consumer) to decouple frame production from consumption. Sized to absorb jitter without excessive memory: ~2 seconds of video, ~2.5s of audio.

Variables

This section is empty.

Functions

This section is empty.

Types

type AudioFrame

type AudioFrame struct {
	PTS        int64
	Data       []byte
	SampleRate int
	Channels   int
	TrackIndex int
}

AudioFrame represents a single AAC audio frame (ADTS-wrapped) belonging to a specific audio track. Multi-track streams produce separate AudioFrames with distinct TrackIndex values.

type VideoFrame

type VideoFrame struct {
	PTS        int64
	DTS        int64
	IsKeyframe bool
	NALUs      [][]byte
	SPS        []byte
	PPS        []byte
	VPS        []byte
	Codec      string // "h264" or "h265"
	GroupID    uint32
	WireData   []byte // pre-serialized AVC1 (length-prefixed) NALUs for distribution
}

VideoFrame represents a single decoded video access unit (one picture) ready for relay to viewers. It carries the raw NAL units in Annex B format along with parameter sets needed by decoders to initialize or reconfigure.

Jump to

Keyboard shortcuts

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