sofia package

import "41.neocities.org/sofia"

Index

func Decrypt

Decrypt decrypts a segment's mdat boxes in-place using the provided key. It self-determines if decryption is needed by checking for 'senc' boxes within the segment. This function has a side effect: it modifies the Payload of the MdatBox structs within the segmentBoxes slice.

type Box

func Parse

func (*Box) Encode

type BoxHeader

func (*BoxHeader) Encode

func (*BoxHeader) Parse

type EdtsBox

func (*EdtsBox) Encode

func (*EdtsBox) Parse

type EncaBox

func (*EncaBox) Encode

func (*EncaBox) Parse

type EncaChild

type EncvBox

func (*EncvBox) Encode

func (*EncvBox) Parse

type EncvChild

type FrmaBox

FrmaBox represents the 'frma' box (Original Format Box).

func (*FrmaBox) Encode

Encode returns the raw byte data to ensure a perfect round trip.

func (*FrmaBox) Parse

Parse parses the 'frma' box from a byte slice.

type MdatBox

func (*MdatBox) Encode

func (*MdatBox) Parse

type MdhdBox

MdhdBox represents the 'mdhd' box (Media Header Box).

func (*MdhdBox) Encode

Encode returns the raw byte data to ensure a perfect round trip.

func (*MdhdBox) Parse

Parse parses the 'mdhd' box from a byte slice.

type MdiaBox

func (*MdiaBox) Encode

func (*MdiaBox) Mdhd

Mdhd finds the MdhdBox child and returns it, along with a boolean indicating if it was found.

func (*MdiaBox) Minf

Minf finds the MinfBox child and returns it, along with a boolean indicating if it was found.

func (*MdiaBox) Parse

type MdiaChild

type MinfBox

func (*MinfBox) Encode

func (*MinfBox) Parse

func (*MinfBox) Stbl

Stbl finds the StblBox child and returns it, along with a boolean indicating if it was found.

type MinfChild

type Missing

Missing is an error type used when a required child box is not found.

func (Missing) Error

type MoofBox

func AllMoof

AllMoof finds all MoofBoxes in a slice of generic boxes.

func (*MoofBox) Encode

func (*MoofBox) Parse

func (*MoofBox) Sanitize

func (*MoofBox) Traf

Traf returns the first traf box found and a boolean indicating if it was found.

type MoofChild

type MoovBox

func FindMoov

FindMoov finds the first MoovBox in a slice of generic boxes.

func (*MoovBox) Encode

func (*MoovBox) FindPssh

FindPssh finds the first PsshBox child with a matching SystemID.

func (*MoovBox) Parse

func (*MoovBox) Sanitize

func (*MoovBox) Trak

type MoovChild

type PsshBox

func (*PsshBox) Encode

func (*PsshBox) Parse

type SampleEncryptionInfo

SampleEncryptionInfo contains the IV and subsample data for one sample.

type SampleInfo

SampleInfo holds details about a single sample in a track run.

type SchiBox

func (*SchiBox) Encode

func (*SchiBox) Parse

func (*SchiBox) Tenc

Tenc finds the TencBox child and returns it, along with a boolean indicating if it was found.

type SchiChild

type SencBox

SencBox represents the 'senc' box (Sample Encryption Box).

func (*SencBox) Encode

Encode returns the raw byte data to ensure a perfect round trip.

func (*SencBox) Parse

Parse parses the 'senc' box from a byte slice.

type SidxBox

SidxBox represents the 'sidx' box (Segment Index Box).

func FindSidx

FindSidx finds the first SidxBox in a slice of generic boxes.

func (*SidxBox) Encode

Encode returns the raw byte data to ensure a perfect round trip.

func (*SidxBox) Parse

Parse parses the 'sidx' box from a byte slice.

type SidxReference

SidxReference holds the data for a single entry in the sidx list.

type SinfBox

func (*SinfBox) Encode

func (*SinfBox) Frma

Frma finds and returns the first FrmaBox child.

func (*SinfBox) Parse

func (*SinfBox) Schi

Schi finds the SchiBox child and returns it, along with a boolean indicating if it was found.

type SinfChild

type StblBox

func (*StblBox) Encode

func (*StblBox) Parse

func (*StblBox) Stsd

Stsd finds the StsdBox child and returns it, along with a boolean indicating if it was found.

type StblChild

type StsdBox

func (*StsdBox) Encode

func (*StsdBox) Parse

func (*StsdBox) Sinf

Sinf finds the first protected sample entry and returns its SinfBox, its header, and a boolean indicating if it was found.

type StsdChild

type SubsampleInfo

SubsampleInfo defines the size of clear and protected data blocks.

type TencBox

TencBox represents the 'tenc' box (Track Encryption Box).

func (*TencBox) Encode

Encode returns the raw byte data to ensure a perfect round trip.

func (*TencBox) Parse

Parse parses the 'tenc' box from a byte slice.

type TfhdBox

TfhdBox now includes all possible fields from the header.

func (*TfhdBox) Encode

func (*TfhdBox) Parse

Parse is now a full parser that respects all flags.

type TrafBox

func (*TrafBox) Encode

func (*TrafBox) Parse

func (*TrafBox) Senc

func (*TrafBox) Tfhd

func (*TrafBox) Totals

Totals calculates the total byte size and duration of all samples in a traf.

func (*TrafBox) Trun

type TrafChild

type TrakBox

func (*TrakBox) Encode

func (*TrakBox) Mdia

Mdia finds the MdiaBox child and returns it, along with a boolean indicating if it was found.

func (*TrakBox) Parse

func (*TrakBox) ReplaceEdts

type TrakChild

type TrunBox

TrunBox represents the 'trun' box (Track Run Box).

func (*TrunBox) Encode

Encode returns the raw byte data to ensure a perfect round trip.

func (*TrunBox) Parse

Parse parses the 'trun' box from a byte slice.

Source Files

edts.go enca.go encv.go frma.go mdat.go mdhd.go mdia.go minf.go moof.go moov.go pssh.go schi.go senc.go sidx.go sinf.go sofia.go stbl.go stsd.go tenc.go tfhd.go traf.go trak.go trun.go

Directories

Path Synopsis
internal/2024/os-test
internal/2024/write-at

Forge

https://github.com/3052/sofia

git clone
https://github.com/3052/sofia.git
git@github.com:3052/sofia.git