av

package
v0.0.0-...-16c6af5 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 4 Imported by: 52

Documentation

Index

Constants

View Source
const (
	TAG_AUDIO          = 8
	TAG_VIDEO          = 9
	TAG_SCRIPTDATAAMF0 = 18
	TAG_SCRIPTDATAAMF3 = 0xf
)
View Source
const (
	MetadatAMF0  = 0x12
	MetadataAMF3 = 0xf
)
View Source
const (
	SOUND_MP3                   = 2
	SOUND_NELLYMOSER_16KHZ_MONO = 4
	SOUND_NELLYMOSER_8KHZ_MONO  = 5
	SOUND_NELLYMOSER            = 6
	SOUND_ALAW                  = 7
	SOUND_MULAW                 = 8
	SOUND_AAC                   = 10
	SOUND_SPEEX                 = 11

	SOUND_5_5Khz = 0
	SOUND_11Khz  = 1
	SOUND_22Khz  = 2
	SOUND_44Khz  = 3

	SOUND_8BIT  = 0
	SOUND_16BIT = 1

	SOUND_MONO   = 0
	SOUND_STEREO = 1

	AAC_SEQHDR = 0
	AAC_RAW    = 1
)
View Source
const (
	AVC_SEQHDR = 0
	AVC_NALU   = 1
	AVC_EOS    = 2

	FRAME_KEY   = 1
	FRAME_INTER = 2

	VIDEO_H264 = 7
)

Variables

View Source
var (
	PUBLISH = "publish"
	PLAY    = "play"
)

Functions

This section is empty.

Types

type Alive

type Alive interface {
	Alive() bool
}

type AudioPacketHeader

type AudioPacketHeader interface {
	PacketHeader
	SoundFormat() uint8
	AACPacketType() uint8
}

type CalcTime

type CalcTime interface {
	CalcBaseTimestamp()
}

type Closer

type Closer interface {
	Info() Info
	Close(error)
}

type CodecParser

type CodecParser interface {
	SampleRater
	Parse(*Packet, io.Writer) error
}

type Demuxer

type Demuxer interface {
	Demux(*Packet) (ret *Packet, err error)
}

type GetWriter

type GetWriter interface {
	GetWriter(Info) WriteCloser
}

type Handler

type Handler interface {
	HandleReader(ReadCloser)
	HandleWriter(WriteCloser)
}

type Info

type Info struct {
	Key   string
	URL   string
	UID   string
	Inter bool
}

func (Info) IsInterval

func (info Info) IsInterval() bool

func (Info) String

func (info Info) String() string

type Muxer

type Muxer interface {
	Mux(*Packet, io.Writer) error
}

type Packet

type Packet struct {
	IsAudio    bool
	IsVideo    bool
	IsMetadata bool
	TimeStamp  uint32 // dts
	StreamID   uint32
	Header     PacketHeader
	Data       []byte
}

Header can be converted to AudioHeaderInfo or VideoHeaderInfo

type PacketHeader

type PacketHeader interface {
}

type RWBaser

type RWBaser struct {
	PreTime            time.Time
	BaseTimestamp      uint32
	LastVideoTimestamp uint32
	LastAudioTimestamp uint32
	// contains filtered or unexported fields
}

func NewRWBaser

func NewRWBaser(duration time.Duration) RWBaser

func (*RWBaser) Alive

func (rw *RWBaser) Alive() bool

func (*RWBaser) BaseTimeStamp

func (rw *RWBaser) BaseTimeStamp() uint32

func (*RWBaser) CalcBaseTimestamp

func (rw *RWBaser) CalcBaseTimestamp()

func (*RWBaser) RecTimeStamp

func (rw *RWBaser) RecTimeStamp(timestamp, typeID uint32)

func (*RWBaser) SetPreTime

func (rw *RWBaser) SetPreTime()

type ReadCloser

type ReadCloser interface {
	Closer
	Alive
	Read(*Packet) error
}

type SampleRater

type SampleRater interface {
	SampleRate() (int, error)
}

type VideoPacketHeader

type VideoPacketHeader interface {
	PacketHeader
	IsKeyFrame() bool
	IsSeq() bool
	CodecID() uint8
	CompositionTime() int32
}

type WriteCloser

type WriteCloser interface {
	Closer
	Alive
	CalcTime
	Write(*Packet) error
}

Jump to

Keyboard shortcuts

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