mp4ff

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: OSL-3.0 Imports: 5 Imported by: 0

README

mp4ff

https://godocs.io/github.com/89z/mp4ff

Done

type TrunBox struct{ ... }
type Fragment struct{ ... }
type File struct{ ... }
type SampleGroupEntry interface{ ... }
type SencBox struct{ ... }
type TrafBox struct{ ... }
type VisualSampleEntryBox struct{ ... }
type StblBox struct{ ... }

To do

type MdatBox struct{ ... }
type AlstSampleGroupEntry struct{ ... }
type AudioSampleEntryBox struct{ ... }
type Box interface{ ... }
type BoxDecoder func(hdr BoxHeader, startPos uint64, r io.Reader) (Box, error)
type BoxDecoderSR func(hdr BoxHeader, startPos uint64, sw mp4ff.SliceReader) (Box, error)
type BoxHeader struct{ ... }
type BoxStructure interface{ ... }
type BtrtBox struct{ ... }
type CTooBox struct{ ... }
type CdatBox struct{ ... }
type Chunk struct{ ... }
type ClapBox struct{ ... }
type Co64Box struct{ ... }
type ContainerBox interface{ ... }
type CslgBox struct{ ... }
type CtimBox struct{ ... }
type CttsBox struct{ ... }
type Dac3Box struct{ ... }
type DataBox struct{ ... }
type DataRange struct{ ... }
type Dec3Box struct{ ... }
type DecFileMode byte
type DinfBox struct{ ... }
type DrefBox struct{ ... }
type EC3Sub struct{ ... }
type EdtsBox struct{ ... }
type ElngBox struct{ ... }
type ElstBox struct{ ... }
type ElstEntry struct{ ... }
type EmsgBox struct{ ... }
type EncFragFileMode byte
type EncOptimize uint32
type EsdsBox struct{ ... }
type Fixed16 uint16
type Fixed32 uint32
type FreeBox struct{ ... }
type FrmaBox struct{ ... }
type FtypBox struct{ ... }
type FullSample struct{ ... }
type HdlrBox struct{ ... }
type IdenBox struct{ ... }
type IlstBox struct{ ... }
type Informer interface{ ... }
type InitSegment struct{ ... }
type InitializationVector []byte
type KindBox struct{ ... }
type MdhdBox struct{ ... }
type MdiaBox struct{ ... }
type MediaSegment struct{ ... }
type MehdBox struct{ ... }
type MetaBox struct{ ... }
type MfhdBox struct{ ... }
type MfraBox struct{ ... }
type MfroBox struct{ ... }
type MimeBox struct{ ... }
type MinfBox struct{ ... }
type MoofBox struct{ ... }
type MoovBox struct{ ... }
type MvexBox struct{ ... }
type MvhdBox struct{ ... }
type NmhdBox struct{ ... }
type Option func(f *File)
type PaspBox struct{ ... }
type PaylBox struct{ ... }
type PiffData []byte
type PrftBox struct{ ... }
type PsshBox struct{ ... }
type RapSampleGroupEntry struct{ ... }
type RollSampleGroupEntry struct{ ... }
type SaioBox struct{ ... }
type SaizBox struct{ ... }
type Sample struct{ ... }
type SampleFlags struct{ ... }
type SampleGroupEntryDecoder func(name string, length uint32, sr mp4ff.SliceReader) (SampleGroupEntry, error)
type SampleInterval struct{ ... }
type SbgpBox struct{ ... }
type SchiBox struct{ ... }
type SchmBox struct{ ... }
type SdtpBox struct{ ... }
type SdtpEntry uint8
type SeigSampleGroupEntry struct{ ... }
type SencSample struct{ ... }
type SgpdBox struct{ ... }
type SidxBox struct{ ... }
type SidxRef struct{ ... }
type SinfBox struct{ ... }
type SmhdBox struct{ ... }
type StcoBox struct{ ... }
type SthdBox struct{ ... }
type StppBox struct{ ... }
type StsdBox struct{ ... }
type StssBox struct{ ... }
type StszBox struct{ ... }
type SttgBox struct{ ... }
type SttsBox struct{ ... }
type StypBox struct{ ... }
type SubSamplePattern struct{ ... }
type SubsBox struct{ ... }
type SubsEntry struct{ ... }
type SubsSample struct{ ... }
type TencBox struct{ ... }
type TfdtBox struct{ ... }
type TfhdBox struct{ ... }
type TfraBox struct{ ... }
type TfraEntry struct{ ... }
type TfrfData struct{ ... }
type TfxdData struct{ ... }
type TkhdBox struct{ ... }
type TopBoxInfo struct{ ... }
type TrakBox struct{ ... }
type TrefBox struct{ ... }
type TrefTypeBox struct{ ... }
type TrepBox struct{ ... }
type TrexBox struct{ ... }
type URLBox struct{ ... }
type UUID []byte
type UUIDBox struct{ ... }
type UdtaBox struct{ ... }
type UnknownBox struct{ ... }
type UnknownSampleGroupEntry struct{ ... }
type VlabBox struct{ ... }
type VmhdBox struct{ ... }
type VsidBox struct{ ... }
type VttCBox struct{ ... }
type VttaBox struct{ ... }
type VttcBox struct{ ... }
type VtteBox struct{}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotReedSeeker = errors.New("reader does not support Seek")

ESBPReader errors

View Source
var ErrSliceRead = fmt.Errorf("Read too far in SliceReader")

SliceReader errors

View Source
var ErrSliceWriter = errors.New("overflow in SliceWriter")

Functions

This section is empty.

Types

type AccErrByteWriter

type AccErrByteWriter struct {
	// contains filtered or unexported fields
}

AccErrByteWriter - writer that wraps an io.Writer and accumulates error

func NewAccErrByteWriter

func NewAccErrByteWriter(w io.Writer) *AccErrByteWriter

NewAccErrByteWriter - create accumulated error writer around io.Writer

func (*AccErrByteWriter) AccError

func (a *AccErrByteWriter) AccError() error

AccError - return accumulated error

func (*AccErrByteWriter) WriteUint16

func (a *AccErrByteWriter) WriteUint16(u uint16)

WriteUint16 - write uint16

func (*AccErrByteWriter) WriteUint32

func (a *AccErrByteWriter) WriteUint32(u uint32)

WriteUint32 - write uint32

func (*AccErrByteWriter) WriteUint8

func (a *AccErrByteWriter) WriteUint8(b byte)

WriteUint8 - write a byte

type AccErrEBSPReader

type AccErrEBSPReader struct {
	// contains filtered or unexported fields
}

AccErrEBSPReader - Reader that drops start code emulation 0x03 after two bytes of 0x00

func NewAccErrEBSPReader

func NewAccErrEBSPReader(rd io.Reader) *AccErrEBSPReader

NewAccErrEBSPReader - return a new reader accumulating errors.

func (*AccErrEBSPReader) AccError

func (r *AccErrEBSPReader) AccError() error

AccError - accumulated error

func (*AccErrEBSPReader) Read

func (r *AccErrEBSPReader) Read(n int) uint

Read - read n bits and return 0 if (previous) error

func (*AccErrEBSPReader) SetError

func (r *AccErrEBSPReader) SetError(err error)

SetError - set an error if not already set.

type AccErrReader

type AccErrReader struct {
	// contains filtered or unexported fields
}

AccErrReader - bit reader that accumulates error First error can be fetched as reader.AccError()

func NewAccErrReader

func NewAccErrReader(rd io.Reader) *AccErrReader

NewAccErrReader - return a new Reader

func (*AccErrReader) AccError

func (r *AccErrReader) AccError() error

AccError - accumulated error is first error that occurred

func (*AccErrReader) Read

func (r *AccErrReader) Read(n int) uint

Read - read n bits. Return 0, if error now or previously

func (*AccErrReader) ReadFlag

func (r *AccErrReader) ReadFlag() bool

ReadFlag - read 1 bit into flag. Return false if error now or previously

func (*AccErrReader) ReadRemainingBytes

func (r *AccErrReader) ReadRemainingBytes() []byte

ReadRemainingBytes - read remaining bytes if byte-aligned

func (*AccErrReader) ReadVInt

func (r *AccErrReader) ReadVInt(n int) int

ReadFlag - Read i(v) which is 2-complement of n bits

type EBSPReader

type EBSPReader struct {
	// contains filtered or unexported fields
}

EBSPReader - Reader that drops start code emulation 0x03 after two bytes of 0x00

func NewEBSPReader

func NewEBSPReader(rd io.Reader) *EBSPReader

NewEBSPReader - return a new Reader.

func (*EBSPReader) IsSeeker

func (r *EBSPReader) IsSeeker() bool

IsSeeker - does reader support Seek

func (*EBSPReader) Read

func (r *EBSPReader) Read(n int) (uint, error)

Read - read n bits and return error if not possible

type FixedSliceReader

type FixedSliceReader struct {
	// contains filtered or unexported fields
}

FixedSliceReader - read integers and other data from a fixed slice. Accumulates error, and the first error can be retrieved. If err != nil, 0 or empty string is returned

func NewFixedSliceReader

func NewFixedSliceReader(data []byte) *FixedSliceReader

bits.NewFixedSliceReader - create a new slice reader reading from data

func NewFixedSliceReaderWithSize

func NewFixedSliceReaderWithSize(size int) *FixedSliceReader

bits.NewFixedSliceReader - create a new slice reader reading from data

func (*FixedSliceReader) AccError

func (s *FixedSliceReader) AccError() error

AccError - get accumulated error after read operations

func (*FixedSliceReader) GetPos

func (s *FixedSliceReader) GetPos() int

GetPos - get read position is slice

func (*FixedSliceReader) Length

func (s *FixedSliceReader) Length() int

Length - get length of slice

func (*FixedSliceReader) NrRemainingBytes

func (s *FixedSliceReader) NrRemainingBytes() int

NrRemainingBytes - return number of bytes remaining

func (*FixedSliceReader) ReadBytes

func (s *FixedSliceReader) ReadBytes(n int) []byte

ReadBytes - read a slice of n bytes Return empty slice if n bytes not available

func (*FixedSliceReader) ReadFixedLengthString

func (s *FixedSliceReader) ReadFixedLengthString(n int) string

ReadFixedLengthString - read string of specified length n. Sets err and returns empty string if full length not available

func (*FixedSliceReader) ReadInt16

func (s *FixedSliceReader) ReadInt16() int16

ReadInt16 - read int16 from slice

func (*FixedSliceReader) ReadInt32

func (s *FixedSliceReader) ReadInt32() int32

ReadInt32 - read int32 from slice

func (*FixedSliceReader) ReadInt64

func (s *FixedSliceReader) ReadInt64() int64

ReadInt64 - read int64 from slice

func (*FixedSliceReader) ReadUint16

func (s *FixedSliceReader) ReadUint16() uint16

ReadUint16 - read uint16 from slice

func (*FixedSliceReader) ReadUint24

func (s *FixedSliceReader) ReadUint24() uint32

ReadUint24 - read uint24 from slice

func (*FixedSliceReader) ReadUint32

func (s *FixedSliceReader) ReadUint32() uint32

ReadUint32 - read uint32 from slice

func (*FixedSliceReader) ReadUint64

func (s *FixedSliceReader) ReadUint64() uint64

ReadUint64 - read uint64 from slice

func (*FixedSliceReader) ReadUint8

func (s *FixedSliceReader) ReadUint8() byte

ReadUint8 - read uint8 from slice

func (*FixedSliceReader) ReadZeroTerminatedString

func (s *FixedSliceReader) ReadZeroTerminatedString(maxLen int) string

ReadZeroTerminatedString - read string until zero byte but at most maxLen Set err and return empty string if no zero byte found

func (*FixedSliceReader) RemainingBytes

func (s *FixedSliceReader) RemainingBytes() []byte

RemainingBytes - return remaining bytes of this slice

func (*FixedSliceReader) SetPos

func (s *FixedSliceReader) SetPos(pos int)

SetPos - set read position is slice

func (*FixedSliceReader) SkipBytes

func (s *FixedSliceReader) SkipBytes(n int)

SkipBytes - skip passed n bytes

type FixedSliceWriter

type FixedSliceWriter struct {
	// contains filtered or unexported fields
}

FixedSliceWriter - write numbers to a fixed []byte slice

func NewFixedSliceWriter

func NewFixedSliceWriter(size int) *FixedSliceWriter

NewSliceWriter - create slice writer with fixed size.

func NewFixedSliceWriterFromSlice

func NewFixedSliceWriterFromSlice(data []byte) *FixedSliceWriter

NewFixedSliceWriter - create writer around slice. The slice will not grow, but stay the same size. If too much data is written, there will be an accumuluated error. Can be retrieved with AccError()

func (*FixedSliceWriter) AccError

func (sw *FixedSliceWriter) AccError() error

AccError - return accumulated erro

func (*FixedSliceWriter) Bytes

func (sw *FixedSliceWriter) Bytes() []byte

Bytes - return buf up to what's written

func (*FixedSliceWriter) Offset

func (sw *FixedSliceWriter) Offset() int

Offset - offset for writing in FixedSliceWriter buffer

func (*FixedSliceWriter) WriteBits

func (sw *FixedSliceWriter) WriteBits(bits uint, n int)

func (*FixedSliceWriter) WriteBytes

func (sw *FixedSliceWriter) WriteBytes(byteSlice []byte)

WriteBytes - write []byte

func (*FixedSliceWriter) WriteInt16

func (sw *FixedSliceWriter) WriteInt16(n int16)

WriteInt16 - write int16 to slice

func (*FixedSliceWriter) WriteInt32

func (sw *FixedSliceWriter) WriteInt32(n int32)

WriteInt32 - write int32 to slice

func (*FixedSliceWriter) WriteInt64

func (sw *FixedSliceWriter) WriteInt64(n int64)

WriteInt64 - write int64 to slice

func (*FixedSliceWriter) WriteString

func (sw *FixedSliceWriter) WriteString(s string, addZeroEnd bool)

WriteString - write string to slice with or without zero end

func (*FixedSliceWriter) WriteUint16

func (sw *FixedSliceWriter) WriteUint16(n uint16)

WriteUint16 - write uint16 to slice

func (*FixedSliceWriter) WriteUint32

func (sw *FixedSliceWriter) WriteUint32(n uint32)

WriteUint32 - write uint32 to slice

func (*FixedSliceWriter) WriteUint64

func (sw *FixedSliceWriter) WriteUint64(n uint64)

WriteUint64 - write uint64 to slice

func (*FixedSliceWriter) WriteUint8

func (sw *FixedSliceWriter) WriteUint8(n byte)

WriteUint8 - write byte to slice

func (*FixedSliceWriter) WriteZeroBytes

func (sw *FixedSliceWriter) WriteZeroBytes(n int)

WriteZeroBytes - write n byte of zeroes

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader - read bits from the given io.Reader

func NewReader

func NewReader(rd io.Reader) *Reader

NewReader - return a new Reader

func (*Reader) MustRead

func (r *Reader) MustRead(n int) uint

MustRead - Read bits and panic if not possible

func (*Reader) MustReadFlag

func (r *Reader) MustReadFlag() bool

MustReadFlag - read 1 bit into flag and panic if not possible

func (*Reader) Read

func (r *Reader) Read(n int) (uint, error)

Read - read n bits

func (*Reader) ReadFlag

func (r *Reader) ReadFlag() (bool, error)

ReadFlag - read 1 bit into flag

type SliceReader

type SliceReader interface {
	AccError() error
	GetPos() int
	NrRemainingBytes() int
	ReadBytes(n int) []byte
	ReadFixedLengthString(n int) string
	ReadInt32() int32
	ReadInt64() int64
	ReadUint16() uint16
	ReadUint32() uint32
	ReadUint64() uint64
	ReadUint8() byte
	ReadZeroTerminatedString(maxLen int) string
	SkipBytes(n int)
}

type SliceWriter

type SliceWriter interface {
	AccError() error
	WriteBits(bits uint, n int)
	WriteBytes(byteSlice []byte)
	WriteInt16(n int16)
	WriteInt32(n int32)
	WriteInt64(n int64)
	WriteString(s string, addZeroEnd bool)
	WriteUint16(n uint16)
	WriteUint32(n uint32)
	WriteUint64(n uint64)
	WriteUint8(n byte)
}

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer writes bits into underlying io.Writer. Stops writing at first error. Errors that have occurred can later be checked with Error().

func NewWriter

func NewWriter(w io.Writer) *Writer

NewWriter - returns a new Writer

func (*Writer) Error

func (w *Writer) Error() error

Error - error that has occurred and stopped writing

func (*Writer) Flush

func (w *Writer) Flush()

Flush - write remaining bits to the underlying io.Writer. bits will be left-shifted.

func (*Writer) Write

func (w *Writer) Write(bits uint, n int)

Write - write n bits from bits and save error state

Directories

Path Synopsis
create command

Jump to

Keyboard shortcuts

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