rtmp

package
v0.0.0-...-a2f1760 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const FlvTimestampMax = 0xFFFFFF

Variables

View Source
var (
	Debug                bool
	MaxChunkSize         = 10 * 1024 * 1024
	ReadDeadlineTimeout  = 20 * time.Second
	WriteDeadlineTimeout = 20 * time.Second
)
View Source
var CodecTypes = flv.CodecTypes

Functions

func Handler

func Handler(h *avutil.RegisterHandler)

func ParseURL

func ParseURL(uri string) (u *url.URL, err error)

func SplitPath

func SplitPath(u *url.URL) (app, stream string)

Types

type Conn

type Conn struct {
	URL             *url.URL
	OnPlayOrPublish func(string, flvio.AMFMap) error

	Prober *flv.Prober

	TCUrl string
	// contains filtered or unexported fields
}

func Dial

func Dial(uri string) (conn *Conn, err error)

func DialTimeout

func DialTimeout(uri string, timeout time.Duration) (conn *Conn, err error)

func NewConn

func NewConn(netconn net.Conn) *Conn

func (*Conn) Close

func (self *Conn) Close() (err error)

func (*Conn) Metadata

func (self *Conn) Metadata() (map[string]interface{}, error)

func (*Conn) NetConn

func (self *Conn) NetConn() net.Conn

func (*Conn) Prepare

func (self *Conn) Prepare() (err error)

func (*Conn) ReadPacket

func (self *Conn) ReadPacket() (pkt av.Packet, err error)

func (*Conn) RxBytes

func (self *Conn) RxBytes() uint64

func (*Conn) Streams

func (self *Conn) Streams() (streams []av.CodecData, err error)

func (*Conn) TxBytes

func (self *Conn) TxBytes() uint64

func (*Conn) WriteHeader

func (self *Conn) WriteHeader(streams []av.CodecData) (err error)

func (*Conn) WritePacket

func (self *Conn) WritePacket(pkt av.Packet) (err error)

func (*Conn) WriteTrailer

func (self *Conn) WriteTrailer() (err error)

type Server

type Server struct {
	Addr          string
	HandlePublish func(*Conn)
	HandlePlay    func(*Conn)
	HandleConn    func(*Conn)
	CreateConn    func(net.Conn) *Conn
}

func (*Server) Accept

func (self *Server) Accept(listener *net.TCPListener) (conn *Conn, err error)

func (*Server) HandleConnection

func (self *Server) HandleConnection(conn *Conn) (err error)

func (*Server) Listen

func (self *Server) Listen() (listener *net.TCPListener, err error)

func (*Server) ListenAndServe

func (self *Server) ListenAndServe() error

func (*Server) Serve

func (self *Server) Serve(listener *net.TCPListener) (err error)

Jump to

Keyboard shortcuts

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