mediaserver

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPsData = errors.New("invalid mpegps data")
)

Functions

This section is empty.

Types

type Conn

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

func NewConn

func NewConn(conn net.Conn, observer IGbObserver, lal logic.ILalServer) *Conn

func (*Conn) Close added in v0.3.3

func (c *Conn) Close()

func (*Conn) Demuxer

func (c *Conn) Demuxer(data []byte) error

func (*Conn) OnFrame

func (c *Conn) OnFrame(frame []byte, cid mpegps.PsStreamType, pts uint64, dts uint64)

func (*Conn) Serve

func (c *Conn) Serve() (err error)

func (*Conn) SetKey

func (c *Conn) SetKey(key string)

func (*Conn) SetMediaServer added in v0.3.3

func (c *Conn) SetMediaServer(mediaServer *GB28181MediaServer)

func (*Conn) SetPreferMediaKeyLookup added in v0.3.6

func (c *Conn) SetPreferMediaKeyLookup(prefer bool)

func (*Conn) SetReadTimeout added in v0.3.6

func (c *Conn) SetReadTimeout(timeout time.Duration)

type Frame

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

type GB28181MediaServer

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

func NewGB28181MediaServer

func NewGB28181MediaServer(listenPort int, mediaKey string, observer IGbObserver, lal logic.ILalServer) *GB28181MediaServer

func (*GB28181MediaServer) CloseConn added in v0.3.3

func (s *GB28181MediaServer) CloseConn(streamName string)

func (*GB28181MediaServer) Dispose

func (s *GB28181MediaServer) Dispose()

func (*GB28181MediaServer) GetListenerPort

func (s *GB28181MediaServer) GetListenerPort() uint16

func (*GB28181MediaServer) Start

func (s *GB28181MediaServer) Start(listener net.Listener) (err error)

func (*GB28181MediaServer) WithPreferMediaKeyLookup added in v0.3.6

func (s *GB28181MediaServer) WithPreferMediaKeyLookup(prefer bool) *GB28181MediaServer

func (*GB28181MediaServer) WithReadTimeout added in v0.3.6

func (s *GB28181MediaServer) WithReadTimeout(timeout time.Duration) *GB28181MediaServer

type IGbObserver

type IGbObserver interface {
	CheckSsrc(ssrc uint32) (*MediaInfo, bool)
	GetMediaInfoByKey(key string) (*MediaInfo, bool)
	NotifyClose(streamName string)
	OnRtpPacket(streamName string, mediaKey string)
}

type MediaInfo

type MediaInfo struct {
	IsInvite     bool
	Ssrc         uint32
	StreamName   string
	SinglePort   bool
	DumpFileName string
	MediaKey     string
}

func (*MediaInfo) Clear

func (m *MediaInfo) Clear() (err error)

Jump to

Keyboard shortcuts

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