rtmp

package
v0.0.0-...-1298b52 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const FlvTimestampMax = 0xFFFFFF

Variables

View Source
var CodecTypes = flv.CodecTypes
View Source
var Debug bool

Functions

func GetSupportCodec

func GetSupportCodec() []rawmedia.DataType

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
	// 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 (selfConn *Conn) Close() (err error)

func (*Conn) NetConn

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

func (*Conn) Prepare

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

func (*Conn) ReadPacket

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

func (*Conn) RxBytes

func (selfConn *Conn) RxBytes() uint64

func (*Conn) Streams

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

func (*Conn) TxBytes

func (selfConn *Conn) TxBytes() uint64

func (*Conn) WriteHeader

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

func (*Conn) WritePacket

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

func (*Conn) WriteStreamsHeader

func (selfConn *Conn) WriteStreamsHeader(streams []*rawmedia.Stream) (err error)

func (*Conn) WriteTrailer

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

type EventCode

type EventCode int32
const (
	RTMP_EVENT_CLOSED EventCode = -1
)

type RtmpClient

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

func NewRtmpClient

func NewRtmpClient() *RtmpClient

func (*RtmpClient) Close

func (rc *RtmpClient) Close()

func (*RtmpClient) Init

func (rc *RtmpClient) Init(url string, streams []*rawmedia.Stream, OnEvent func(eCode EventCode)) error

func (*RtmpClient) Sendpacket

func (rc *RtmpClient) Sendpacket(pkt av.Packet) (err error)

func (*RtmpClient) Serve

func (rc *RtmpClient) Serve()

func (*RtmpClient) SetMediaDir

func (rc *RtmpClient) SetMediaDir(mediaDir rawmedia.MediaDir)

func (*RtmpClient) StartPublish

func (rc *RtmpClient) StartPublish()

start rtmp publish

func (*RtmpClient) StopPublish

func (rc *RtmpClient) StopPublish()

stop rtmp publish

func (*RtmpClient) WritePacket

func (rc *RtmpClient) WritePacket(packet rawmedia.Packet) error

type Server

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

func (*Server) ListenAndServe

func (selfConn *Server) ListenAndServe() (err error)

Jump to

Keyboard shortcuts

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