roq

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 12 Imported by: 3

README

RTP over QUIC (RoQ)

Go Reference

RTP over QUIC (RoQ) implementation in Go.

Example applications using the library can be found in the examples directory.

Documentation

Index

Constants

View Source
const (
	ErrRoQNoError = iota
	ErrRoQGeneralError
	ErrRoQInternalError
	ErrRoQPacketError
	ErrRoQStreamCreationError
	ErrRoQFrameCancelled
	ErrRoQUnknownFlowID
	ErrRoQExpectationUnmet
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection interface {
	SendDatagram(payload []byte) error
	ReceiveDatagram(context.Context) ([]byte, error)
	OpenUniStreamSync(context.Context) (SendStream, error)
	AcceptUniStream(context.Context) (ReceiveStream, error)
	CloseWithError(uint64, string) error
}

type QUICGoConnection

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

func NewQUICGoConnection

func NewQUICGoConnection(conn quic.Connection) *QUICGoConnection

func (*QUICGoConnection) AcceptUniStream

func (c *QUICGoConnection) AcceptUniStream(ctx context.Context) (ReceiveStream, error)

func (*QUICGoConnection) CloseWithError

func (c *QUICGoConnection) CloseWithError(code uint64, reason string) error

func (*QUICGoConnection) OpenUniStreamSync

func (c *QUICGoConnection) OpenUniStreamSync(ctx context.Context) (SendStream, error)

func (*QUICGoConnection) ReceiveDatagram

func (c *QUICGoConnection) ReceiveDatagram(ctx context.Context) ([]byte, error)

func (*QUICGoConnection) SendDatagram

func (c *QUICGoConnection) SendDatagram(payload []byte) error

type RTPSendStream

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

func (*RTPSendStream) CancelStream

func (s *RTPSendStream) CancelStream(errorCode uint64)

CancelStream closes the stream with the given error code.

func (*RTPSendStream) Close

func (s *RTPSendStream) Close() error

Close closes the stream gracefully.

func (*RTPSendStream) WriteRTPBytes

func (s *RTPSendStream) WriteRTPBytes(packet []byte) (int, error)

WriteRTPBytes sends an RTP or RTCP packet on the stream.

type ReceiveFlow

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

func (*ReceiveFlow) Close

func (f *ReceiveFlow) Close() error

func (*ReceiveFlow) ID

func (f *ReceiveFlow) ID() uint64

func (*ReceiveFlow) Read

func (f *ReceiveFlow) Read(buf []byte) (int, error)

func (*ReceiveFlow) SetReadDeadline

func (f *ReceiveFlow) SetReadDeadline(t time.Time) error

type ReceiveStream

type ReceiveStream interface {
	io.Reader
	ID() int64
	CancelRead(uint64)
}

type SendFlow

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

func (*SendFlow) Close

func (f *SendFlow) Close() error

Close closes the flow and all associated streams.

func (*SendFlow) NewSendStream

func (f *SendFlow) NewSendStream(ctx context.Context) (*RTPSendStream, error)

NewSendStream creates a new Stream for sending outgoing RTP and RTCP packets over a QUIC stream.

func (*SendFlow) WriteRTPBytes

func (f *SendFlow) WriteRTPBytes(packet []byte) error

WriteRTP sends an RTP or RTCP packet as a QUIC Datagram.

type SendStream

type SendStream interface {
	io.Writer
	io.Closer
	ID() int64
	CancelWrite(uint64)
}

type Session

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

func NewSession

func NewSession(conn Connection, acceptDatagrams bool, qlogger *qlog.Logger) (*Session, error)

func (*Session) Close

func (s *Session) Close() error

func (*Session) NewReceiveFlow

func (s *Session) NewReceiveFlow(id uint64) (*ReceiveFlow, error)

func (*Session) NewSendFlow

func (s *Session) NewSendFlow(id uint64) (*SendFlow, error)

type SessionError added in v0.3.0

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

func (SessionError) Error added in v0.3.0

func (e SessionError) Error() string

Directories

Path Synopsis
examples
interop command
playfromdisk command
savetodisk command

Jump to

Keyboard shortcuts

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