stream

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2020 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrHadAdd        = errors.New("had add")
	ErrNotAdd        = errors.New("not add")
	ErrNameIncorrect = errors.New("name is incorrect")
)
View Source
var (
	Tslength = tslen * 2
)

Functions

This section is empty.

Types

type Handler

type Handler interface {
	AddStreams(s *Stream) error
	DelStreams(id string)
	HandlerStream(w http.ResponseWriter, req *http.Request)
	HandlerIndex(w http.ResponseWriter, req *http.Request)
	Stop()
}

func NewHlsHandler

func NewHlsHandler(preroute string) Handler

type HlsHandler

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

func (*HlsHandler) AddStreams

func (h *HlsHandler) AddStreams(s *Stream) error

func (*HlsHandler) DelStreams

func (h *HlsHandler) DelStreams(id string)

func (*HlsHandler) HandlerIndex

func (h *HlsHandler) HandlerIndex(w http.ResponseWriter, req *http.Request)

handle index html

func (*HlsHandler) HandlerStream

func (h *HlsHandler) HandlerStream(w http.ResponseWriter, req *http.Request)

handle m3u8(m3u),ts request

func (*HlsHandler) Stop

func (h *HlsHandler) Stop()

type SaveMp4

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

func (*SaveMp4) Start

func (m *SaveMp4) Start(s *Stream)

func (*SaveMp4) Stop

func (m *SaveMp4) Stop()

type Saveconf

type Saveconf struct {
	Dir      string
	Maxtime  time.Duration
	Fragtime time.Duration
}

type Saver

type Saver interface {
	Start(s *Stream)
	Stop()
}

func NewSaveMp4

func NewSaveMp4(c *Saveconf) (Saver, error)

type Stream

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

func NewStream

func NewStream(s string, pool *ants.Pool) (*Stream, error)

func (*Stream) Clone

func (s *Stream) Clone() *Stream

func (*Stream) Id

func (s *Stream) Id() string

func (*Stream) Path

func (s *Stream) Path() string

func (*Stream) Start

func (s *Stream) Start()

func (*Stream) Stop

func (s *Stream) Stop()

func (*Stream) WriteTo

func (s *Stream) WriteTo(mux av.Muxer, duration time.Duration) error

Jump to

Keyboard shortcuts

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