Files
lpmsdemo/stream/hls.go
2020-05-14 09:27:49 +08:00

23 lines
552 B
Go

package stream
import (
"context"
"errors"
"github.com/oscar-davids/lpmsdemo/m3u8"
)
var ErrNotFound = errors.New("Not Found")
var ErrBadHLSBuffer = errors.New("BadHLSBuffer")
var ErrEOF = errors.New("ErrEOF")
type HLSDemuxer interface {
PollPlaylist(ctx context.Context) (m3u8.MediaPlaylist, error)
WaitAndPopSegment(ctx context.Context, name string) ([]byte, error)
WaitAndGetSegment(ctx context.Context, name string) ([]byte, error)
}
type HLSMuxer interface {
WriteSegment(seqNo uint64, name string, duration float64, s []byte) error
}