rtmp

package
v0.0.0-...-31c0fb5 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SAVE_STATICS_INTERVAL = 5000
)

Variables

View Source
var (
	EmptyID = ""
)

Functions

This section is empty.

Types

type Client

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

func NewRtmpClient

func NewRtmpClient(h av.Handler, getter av.GetWriter) *Client

func (*Client) Dial

func (c *Client) Dial(url string, method string) error

func (*Client) GetHandle

func (c *Client) GetHandle() av.Handler

type GetInFo

type GetInFo interface {
	GetInfo() (string, string, string)
}

type PackWriterCloser

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

func (*PackWriterCloser) GetWriter

func (p *PackWriterCloser) GetWriter() av.WriteCloser

type RtmpStream

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

func NewRtmpStream

func NewRtmpStream() *RtmpStream

func (*RtmpStream) CheckAlive

func (rs *RtmpStream) CheckAlive()

func (*RtmpStream) GetStreams

func (rs *RtmpStream) GetStreams() *sync.Map

func (*RtmpStream) HandleReader

func (rs *RtmpStream) HandleReader(r av.ReadCloser)

func (*RtmpStream) HandleWriter

func (rs *RtmpStream) HandleWriter(w av.WriteCloser)

type Server

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

func NewRtmpServer

func NewRtmpServer(h av.Handler, getter av.GetWriter) *Server

func (*Server) Serve

func (s *Server) Serve(listener net.Listener) (err error)

type StaticsBW

type StaticsBW struct {
	StreamId               uint32
	VideoDatainBytes       uint64
	LastVideoDatainBytes   uint64
	VideoSpeedInBytesperMS uint64

	AudioDatainBytes       uint64
	LastAudioDatainBytes   uint64
	AudioSpeedInBytesperMS uint64

	LastTimestamp int64
}

type Stream

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

func NewStream

func NewStream() *Stream

func (*Stream) AddReader

func (s *Stream) AddReader(r av.ReadCloser)

func (*Stream) AddWriter

func (s *Stream) AddWriter(w av.WriteCloser)

func (*Stream) CheckAlive

func (s *Stream) CheckAlive() (n int)

func (*Stream) Copy

func (s *Stream) Copy(dst *Stream)

func (*Stream) GetReader

func (s *Stream) GetReader() av.ReadCloser

func (*Stream) GetWs

func (s *Stream) GetWs() *sync.Map

func (*Stream) ID

func (s *Stream) ID() string

func (*Stream) IsSendStaticPush

func (s *Stream) IsSendStaticPush() bool

func (*Stream) SendStaticPush

func (s *Stream) SendStaticPush(packet av.Packet)

func (*Stream) StartStaticPush

func (s *Stream) StartStaticPush()

检测本application下是否配置static_push, 如果配置, 启动push远端的连接

func (*Stream) StopStaticPush

func (s *Stream) StopStaticPush()

func (*Stream) TransStart

func (s *Stream) TransStart()

func (*Stream) TransStop

func (s *Stream) TransStop()

type StreamReadWriteCloser

type StreamReadWriteCloser interface {
	GetInFo
	Close(error)
	Write(core.ChunkStream) error
	Read(c *core.ChunkStream) error
}

type VirReader

type VirReader struct {
	Uid string
	av.RWBaser

	ReadBWInfo StaticsBW
	// contains filtered or unexported fields
}

func NewVirReader

func NewVirReader(conn StreamReadWriteCloser) *VirReader

func (*VirReader) Close

func (v *VirReader) Close(err error)

func (*VirReader) Info

func (v *VirReader) Info() (ret av.Info)

func (*VirReader) Read

func (v *VirReader) Read(p *av.Packet) (err error)

func (*VirReader) SaveStatics

func (v *VirReader) SaveStatics(streamid uint32, length uint64, isVideoFlag bool)

type VirWriter

type VirWriter struct {
	Uid string

	av.RWBaser

	WriteBWInfo StaticsBW
	// contains filtered or unexported fields
}

func NewVirWriter

func NewVirWriter(conn StreamReadWriteCloser) *VirWriter

func (*VirWriter) Check

func (v *VirWriter) Check()

func (*VirWriter) Close

func (v *VirWriter) Close(err error)

func (*VirWriter) DropPacket

func (v *VirWriter) DropPacket(pktQue chan *av.Packet, info av.Info)

func (*VirWriter) Info

func (v *VirWriter) Info() (ret av.Info)

func (*VirWriter) SaveStatics

func (v *VirWriter) SaveStatics(streamid uint32, length uint64, isVideoFlag bool)

func (*VirWriter) SendPacket

func (v *VirWriter) SendPacket() error

func (*VirWriter) Write

func (v *VirWriter) Write(p *av.Packet) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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