joy4: github.com/nareix/joy4/av/pubsub Index | Files

package pubsub

import "github.com/nareix/joy4/av/pubsub"

Packege pubsub implements publisher-subscribers model used in multi-channel streaming.

Index

Package Files

queue.go

type Queue Uses

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

One publisher and multiple subscribers thread-safe packet buffer queue.

func NewQueue Uses

func NewQueue() *Queue

func (*Queue) Close Uses

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

After Close() called, all QueueCursor's ReadPacket will return io.EOF.

func (*Queue) DelayedGopCount Uses

func (self *Queue) DelayedGopCount(n int) *QueueCursor

Create cursor position at specific delayed GOP count in buffered packets.

func (*Queue) DelayedTime Uses

func (self *Queue) DelayedTime(dur time.Duration) *QueueCursor

Create cursor position at specific time in buffered packets.

func (*Queue) Latest Uses

func (self *Queue) Latest() *QueueCursor

Create cursor position at latest packet.

func (*Queue) Oldest Uses

func (self *Queue) Oldest() *QueueCursor

Create cursor position at oldest buffered packet.

func (*Queue) SetMaxGopCount Uses

func (self *Queue) SetMaxGopCount(n int)

func (*Queue) WriteHeader Uses

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

func (*Queue) WritePacket Uses

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

Put packet into buffer, old packets will be discared.

func (*Queue) WriteTrailer Uses

func (self *Queue) WriteTrailer() error

type QueueCursor Uses

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

func (*QueueCursor) ReadPacket Uses

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

ReadPacket will not consume packets in Queue, it's just a cursor.

func (*QueueCursor) Streams Uses

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

Package pubsub imports 5 packages (graph) and is imported by 4 packages. Updated 2018-03-29. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).