Versions in this module Expand all Collapse all v1 v1.1.0 Jan 19, 2021 v1.0.0 Jan 9, 2021 Changes in this version + const StreamClosed + const StreamNoConsumer + const StreamOK + const StreamReplaced + var ErrStreamClosed = errors.New("stream is closed") + var ErrStreamReplaced = errors.New("stream is replaced") + func Count() (sc, cc int) + func Regist(s *Stream) + func RegistPullStreamFactory(f PullStreamFactory) + func Unregist(s *Stream) + func UnregistAll() + type CID uint32 + func NewCID(packetType PacketType, consumerSequenceSeed *uint32) CID + func (id CID) Sequence() uint32 + func (id CID) Type() PacketType + type Consumer interface + Consume func(pack Pack) + type ConsumptionInfo struct + Extra string + Flow stats.FlowSample + ID uint32 + PacketType string + StartOn string + type Hlsable interface + LastAccessTime func() time.Time + M3u8 func(token string) ([]byte, error) + Segment func(seq int) (io.Reader, int, error) + type Multicastable interface + AddMember func(io.Closer) + MulticastIP func() string + Port func(index int) int + ReleaseMember func(io.Closer) + SourceIP func() string + TTL func() int + type Option interface + func Attr(k, v string) Option + func Hls(hls Hlsable) Option + func Multicast(multicast Multicastable) Option + type Pack = format.Packet + type PacketType uint32 + const FLVPacket + const RTPPacket + func (t PacketType) String() string + type PullStreamFactory interface + Can func(remoteURL string) bool + Create func(localPath, remoteURL string) (*Stream, error) + type Stream struct + Audio codec.AudioMeta + Video codec.VideoMeta + func Get(path string) *Stream + func GetOrCreate(path string) *Stream + func NewStream(path string, rawsdp string, options ...Option) *Stream + func (s *Stream) Attr(key string) string + func (s *Stream) Close() error + func (s *Stream) ConsumerCount() int + func (s *Stream) FlvTypeFlags() byte + func (s *Stream) GetConsumption(cid CID) (ConsumptionInfo, bool) + func (s *Stream) Hlsable() Hlsable + func (s *Stream) Info(includeCS bool) *StreamInfo + func (s *Stream) Multicastable() Multicastable + func (s *Stream) Path() string + func (s *Stream) Sdp() string + func (s *Stream) StartConsume(consumer Consumer, packetType PacketType, extra string) CID + func (s *Stream) StartConsumeNoGopCache(consumer Consumer, packetType PacketType, extra string) CID + func (s *Stream) StopConsume(cid CID) + func (s *Stream) WriteFlvTag(tag *flv.Tag) error + func (s *Stream) WriteFrame(frame *codec.Frame) error + func (s *Stream) WriteRtpPacket(packet *rtp.Packet) error + type StreamInfo struct + Addr string + Audio *codec.AudioMeta + ConsumptionCount int + Consumptions []ConsumptionInfo + Path string + Size int + StartOn string + Video *codec.VideoMeta + func Infos(pagetoken string, pagesize int, includeCS bool) (int, []*StreamInfo)