package sofia

import "41.neocities.org/sofia"

Index

Types

type Appender

type Appender interface {
	Append([]byte) ([]byte, error)
}

type Box

type Box struct {
	BoxHeader BoxHeader
	Payload   []byte
}

ISO/IEC 14496-12

aligned(8) class Box (
   unsigned int(32) boxtype,
   optional unsigned int(8)[16] extended_type
) {
   BoxHeader(boxtype, extended_type);
   // the remaining bytes are the BoxPayload
}

func (*Box) Append

func (b *Box) Append(buf []byte) ([]byte, error)

func (*Box) Read

func (b *Box) Read(buf []byte) error

type BoxHeader

type BoxHeader struct {
	Size     uint32
	Type     Type
	UserType *Uuid
}

ISO/IEC 14496-12

aligned(8) class BoxHeader (
   unsigned int(32) boxtype,
   optional unsigned int(8)[16] extended_type
) {
   unsigned int(32) size;
   unsigned int(32) type = boxtype;
   if (size==1) {
      unsigned int(64) largesize;
   } else if (size==0) {
      // box extends to end of file
   }
   if (boxtype=='uuid') {
      unsigned int(8)[16] usertype = extended_type;
   }
}

func (*BoxHeader) Append

func (b *BoxHeader) Append(buf []byte) ([]byte, error)

func (*BoxHeader) Decode

func (b *BoxHeader) Decode(buf []byte) (int, error)

func (*BoxHeader) GetSize

func (b *BoxHeader) GetSize() int

type Decoder

type Decoder interface {
	Decode([]byte) (int, error)
}

type Error

type Error struct {
	Container BoxHeader
	Box       BoxHeader
}

func (*Error) Error

func (e *Error) Error() string

type FullBoxHeader

type FullBoxHeader struct {
	Version uint8
	Flags   [3]byte
}

ISO/IEC 14496-12

aligned(8) class FullBoxHeader(unsigned int(8) v, bit(24) f) {
   unsigned int(8) version = v;
   bit(24) flags = f;
}

func (*FullBoxHeader) Append

func (f *FullBoxHeader) Append(buf []byte) ([]byte, error)

func (*FullBoxHeader) Decode

func (f *FullBoxHeader) Decode(buf []byte) (int, error)

func (*FullBoxHeader) GetFlags

func (f *FullBoxHeader) GetFlags() uint32

type Reader

type Reader interface {
	Read([]byte) error
}

type SampleEntry

type SampleEntry struct {
	BoxHeader          BoxHeader
	Reserved           [6]uint8
	DataReferenceIndex uint16
}

ISO/IEC 14496-12

aligned(8) abstract class SampleEntry(
   unsigned int(32) format
) extends Box(format) {
   const unsigned int(8)[6] reserved = 0;
   unsigned int(16) data_reference_index;
}

func (*SampleEntry) Append

func (s *SampleEntry) Append(buf []byte) ([]byte, error)

func (*SampleEntry) Decode

func (s *SampleEntry) Decode(buf []byte) (int, error)

type SizeGetter

type SizeGetter interface {
	GetSize() int
}

type Type

type Type [4]uint8

func (Type) String

func (t Type) String() string

type Uuid

type Uuid [16]uint8

func (Uuid) String

func (u Uuid) String() string

Directories

container
enca
encv
frma
mdat
mdia
minf
moof
moov
pssh
schi
senc
sidx
sinf
stbl
stsd
tenc
tfhd
traf
trak
trun