hls

package
v0.0.0-...-6f888eb Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a HLS client.

func NewClient

func NewClient(
	primaryPlaylistURLStr string,
	fingerprint string,
	onTracks func(gortsplib.Track, gortsplib.Track) error,
	onPacket func(bool, []byte),
	parent ClientParent,
) (*Client, error)

NewClient allocates a Client.

func (*Client) Close

func (c *Client) Close()

Close closes all the Client resources.

func (*Client) Wait

func (c *Client) Wait() chan error

Wait waits for any error of the Client.

type ClientParent

type ClientParent interface {
	Log(level logger.Level, format string, args ...interface{})
}

ClientParent is the parent of a Client.

type Muxer

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

Muxer is a HLS muxer.

func NewMuxer

func NewMuxer(
	hlsSegmentCount int,
	hlsSegmentDuration time.Duration,
	hlsSegmentMaxSize uint64,
	videoTrack *gortsplib.TrackH264,
	audioTrack *gortsplib.TrackAAC) (*Muxer, error)

NewMuxer allocates a Muxer.

func (*Muxer) Close

func (m *Muxer) Close()

Close closes a Muxer.

func (*Muxer) PrimaryPlaylist

func (m *Muxer) PrimaryPlaylist() io.Reader

PrimaryPlaylist returns a reader to read the primary playlist.

func (*Muxer) Segment

func (m *Muxer) Segment(fname string) io.Reader

Segment returns a reader to read a segment listed in the stream playlist.

func (*Muxer) StreamPlaylist

func (m *Muxer) StreamPlaylist() io.Reader

StreamPlaylist returns a reader to read the stream playlist.

func (*Muxer) WriteAAC

func (m *Muxer) WriteAAC(pts time.Duration, aus [][]byte) error

WriteAAC writes AAC AUs, grouped by PTS, into the muxer.

func (*Muxer) WriteH264

func (m *Muxer) WriteH264(pts time.Duration, nalus [][]byte) error

WriteH264 writes H264 NALUs, grouped by PTS, into the muxer.

Jump to

Keyboard shortcuts

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