Documentation ¶
Overview ¶
Package pubsub implements publisher-subscribers model used in multi-channel streaming.
Index ¶
- type Queue
- func (instance *Queue) Close() (err error)
- func (instance *Queue) DelayedGopCount(n int) *QueueCursor
- func (instance *Queue) DelayedTime(dur time.Duration) *QueueCursor
- func (instance *Queue) Latest() *QueueCursor
- func (instance *Queue) Oldest() *QueueCursor
- func (instance *Queue) SetMaxGopCount(n int)
- func (instance *Queue) WriteHeader(streams []av.CodecData) error
- func (instance *Queue) WritePacket(pkt av.Packet) (err error)
- func (instance *Queue) WriteTrailer() error
- type QueueCursor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue struct One publisher and multiple subscribers thread-safe packet buffer queue.
func (*Queue) DelayedGopCount ¶
func (instance *Queue) DelayedGopCount(n int) *QueueCursor
DelayedGopCount Create cursor position at specific delayed GOP count in buffered packets.
func (*Queue) DelayedTime ¶
func (instance *Queue) DelayedTime(dur time.Duration) *QueueCursor
DelayedTime Create cursor position at specific time in buffered packets.
func (*Queue) Latest ¶
func (instance *Queue) Latest() *QueueCursor
Latest Create cursor position at latest packet.
func (*Queue) Oldest ¶
func (instance *Queue) Oldest() *QueueCursor
Oldest Create cursor position at oldest buffered packet.
func (*Queue) WriteHeader ¶
WriteHeader func
func (*Queue) WritePacket ¶
WritePacket Put packet into buffer, old packets will be discared.
type QueueCursor ¶
type QueueCursor struct {
// contains filtered or unexported fields
}
QueueCursor struct
func (*QueueCursor) ReadPacket ¶
func (instance *QueueCursor) ReadPacket() (pkt av.Packet, err error)
ReadPacket will not consume packets in Queue, it's just a cursor.
Click to show internal directories.
Click to hide internal directories.