rtp

package
v0.0.0-...-b172891 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PayloadType

type PayloadType struct {
	// Payload type number (<= 127) assigned by the SDP `rtpmap` attribute.
	Number uint8

	// Encoding name, from the SDP `rtpmap` attribute (e.g. "H264").
	Name string

	// Clock rate in Hz, from the SDP `rtpmap` attribute (e.g. 90000).
	ClockRate int

	// Codec-specific format parameters, from the SDP `fmtp` attribute.
	Format string

	// Supported feedback RTCP options, from the SDP `rtcp-fb` attributes.
	FeedbackOptions []string
}

Payload type description, as provided via SDP.

type Session

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

A Session represents an established RTP/RTCP connection to a remote peer. It contains one or more streams, each represented by their own SSRC.

func NewSession

func NewSession(opts SessionOptions) *Session

func (*Session) AddStream

func (s *Session) AddStream(opts StreamOptions) *Stream

func (*Session) Close

func (s *Session) Close() error

func (*Session) RemoveStream

func (s *Session) RemoveStream(stream *Stream)

type SessionOptions

type SessionOptions struct {
	// Single connection over which RTP and RTCP are muxed.
	MuxConn net.Conn

	// Separate connections for RTP and RTCP.
	DataConn    net.Conn
	ControlConn net.Conn

	// SRTP master key material.
	ReadKey   []byte
	ReadSalt  []byte
	WriteKey  []byte
	WriteSalt []byte

	// Maximum size of outgoing packets, factoring in MTU and protocol overhead.
	MaxPacketSize int
}

type Stream

type Stream struct {
	StreamOptions
	// contains filtered or unexported fields
}

func (*Stream) Close

func (s *Stream) Close() error

func (*Stream) ReceiveVideo

func (s *Stream) ReceiveVideo(quit <-chan struct{}, consume func(buf *packet.SharedBuffer) error) error

func (*Stream) SendVideo

func (s *Stream) SendVideo(quit <-chan struct{}, payloadType byte, src media.VideoSource) error

type StreamOptions

type StreamOptions struct {
	LocalSSRC  uint32
	LocalCNAME string

	RemoteSSRC  uint32
	RemoteCNAME string

	// sendonly, recvonly, or sendrecv
	Direction string

	// Negotiated payload types, keyed by 7-bit dynamic payload type number.
	PayloadTypes map[byte]PayloadType

	// Maximum size of outgoing packets, factoring in MTU and protocol overhead.
	MaxPacketSize int
}

Jump to

Keyboard shortcuts

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