hls

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: MIT Imports: 14 Imported by: 2

Documentation

Index

Constants

View Source
const (
	CrossdomainXML = `` /* 160-byte string literal not displayed */

	M3U8ContentType = "application/x-mpegURL"
	TSContentType   = "video/mp2ts"
)

Variables

View Source
var (
	ErrNoPublisher         = fmt.Errorf("no publisher")
	ErrInvalidReq          = fmt.Errorf("invalid req url path")
	ErrNoSupportVideoCodec = fmt.Errorf("no support video codec")
	ErrNoSupportAudioCodec = fmt.Errorf("no support audio codec")
)

Functions

func DefaultGenTsNameFunc added in v0.3.0

func DefaultGenTsNameFunc() string

Types

type Source

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

func NewSource

func NewSource(conf ...SourceConf) *Source

func (*Source) Close

func (source *Source) Close() error

func (*Source) Closed

func (source *Source) Closed() bool

func (*Source) GetCacheInc

func (source *Source) GetCacheInc() *TSCache

func (*Source) SendPacket

func (source *Source) SendPacket() error

func (*Source) Write

func (source *Source) Write(p *av.Packet) (err error)

type SourceConf added in v0.3.0

type SourceConf func(*Source)

func WithGenTsNameFunc added in v0.3.0

func WithGenTsNameFunc(f func() string) SourceConf

type TSCache

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

func NewTSCacheItem

func NewTSCacheItem() *TSCache

func (*TSCache) GenM3U8File added in v0.2.2

func (tc *TSCache) GenM3U8File(tsPath func(tsName string) (tsPath string)) ([]byte, error)

func (*TSCache) GetItem

func (tc *TSCache) GetItem(tsName string) (*TSItem, error)

func (*TSCache) PushItem

func (tc *TSCache) PushItem(item *TSItem)

type TSItem

type TSItem struct {
	TsName   string
	SeqNum   int64
	Duration int64
	Data     []byte
}

func NewTSItem

func NewTSItem(tsName string, duration, seqNum int64, b []byte) *TSItem

Directories

Path Synopsis
aac
mp3

Jump to

Keyboard shortcuts

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