package sidx

import "41.neocities.org/sofia/sidx"

Index

Types

type Box

type Box struct {
	BoxHeader                sofia.BoxHeader
	FullBoxHeader            sofia.FullBoxHeader
	ReferenceId              uint32
	Timescale                uint32
	EarliestPresentationTime []byte
	FirstOffset              []byte
	Reserved                 uint16
	ReferenceCount           uint16
	Reference                []Reference
}

ISO/IEC 14496-12

aligned(8) class SegmentIndexBox extends FullBox('sidx', version, 0) {
   unsigned int(32) reference_ID;
   unsigned int(32) timescale;
   if (version==0) {
      unsigned int(32) earliest_presentation_time;
      unsigned int(32) first_offset;
   } else {
      unsigned int(64) earliest_presentation_time;
      unsigned int(64) first_offset;
   }
   unsigned int(16) reserved = 0;
   unsigned int(16) reference_count;
   for(i=1; i <= reference_count; i++) {
      bit (1) reference_type;
      unsigned int(31) referenced_size;
      unsigned int(32) subsegment_duration;
      bit(1) starts_with_SAP;
      unsigned int(3) SAP_type;
      unsigned int(28) SAP_delta_time;
   }
}

func (*Box) Append

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

func (*Box) GetSize

func (b *Box) GetSize() int

func (*Box) Read

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

type Reference

type Reference [3]uint32

func (Reference) Append

func (r Reference) Append(buf []byte) ([]byte, error)

func (*Reference) Decode

func (r *Reference) Decode(buf []byte) (int, error)

func (*Reference) SetSize

func (r *Reference) SetSize(size uint32)

func (Reference) Size

func (r Reference) Size() uint32

this is the size of the fragment, typically `moof` + `mdat`