transport

package
v0.0.0-...-b09c24f Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Closable

type Closable interface {
	Close() error
	Done() <-chan struct{}
}

type Codec

type Codec struct {
	MimeType    string `json:"mimeType"`
	ClockRate   uint32 `json:"clockRate"`
	Channels    uint16 `json:"channels"`
	SDPFmtpLine string `json:"sdpFmtpLine"`
}

func (Codec) TrackKind

func (c Codec) TrackKind() TrackKind

type DataTransport

type DataTransport interface {
	MessagesChannel() <-chan webrtc.DataChannelMessage
	Send(message webrtc.DataChannelMessage) <-chan error
}

type RTCPReader

type RTCPReader interface {
	ReadRTCP() ([]rtcp.Packet, interceptor.Attributes, error)
}

type RTCPWriter

type RTCPWriter interface {
	WriteRTCP([]rtcp.Packet) error
}

type SimpleTrack

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

func NewSimpleTrack

func NewSimpleTrack(id string, streamID string, codec Codec, peerID identifiers.PeerID) SimpleTrack

func (SimpleTrack) Codec

func (s SimpleTrack) Codec() Codec

func (SimpleTrack) MarshalJSON

func (s SimpleTrack) MarshalJSON() ([]byte, error)

func (SimpleTrack) PeerID

func (s SimpleTrack) PeerID() identifiers.PeerID

func (SimpleTrack) SimpleTrack

func (s SimpleTrack) SimpleTrack() SimpleTrack

func (SimpleTrack) TrackID

func (s SimpleTrack) TrackID() identifiers.TrackID

func (*SimpleTrack) UnmarshalJSON

func (s *SimpleTrack) UnmarshalJSON(data []byte) error

type Track

type Track interface {
	TrackID() identifiers.TrackID
	PeerID() identifiers.PeerID
	Codec() Codec
	SimpleTrack() SimpleTrack
}

type TrackEventType

type TrackEventType uint8
const (
	TrackEventTypeAdd TrackEventType = iota + 1
	TrackEventTypeRemove
	TrackEventTypeSub
	TrackEventTypeUnsub
)

type TrackJSON

type TrackJSON struct {
	TrackID identifiers.TrackID `json:"id"`
	PeerID  identifiers.PeerID  `json:"peerId"`
	Codec   Codec               `json:"codec"`
}

type TrackKind

type TrackKind string
const (
	TrackKindAudio TrackKind = "audio"
	TrackKindVideo TrackKind = "video"
)

func NewTrackKind

func NewTrackKind(codecType webrtc.RTPCodecType) TrackKind

func (TrackKind) RTPCodecType

func (t TrackKind) RTPCodecType() webrtc.RTPCodecType

type TrackLocal

type TrackLocal interface {
	Write([]byte) (int, error)
	WriteRTP(*rtp.Packet) error
	// contains filtered or unexported methods
}

type TrackRemote

type TrackRemote interface {
	ReadRTP() (*rtp.Packet, interceptor.Attributes, error)
	SSRC() webrtc.SSRC
	RID() string
	// contains filtered or unexported methods
}

type TrackRemoteWithRTCPReader

type TrackRemoteWithRTCPReader struct {
	TrackRemote TrackRemote
	RTCPReader  RTCPReader
}

type TrackWithMID

type TrackWithMID struct {
	Track
	// contains filtered or unexported fields
}

func NewTrackWithMID

func NewTrackWithMID(track Track, mid string) TrackWithMID

func (TrackWithMID) MID

func (t TrackWithMID) MID() string

type Transport

type Transport interface {
	ClientID() identifiers.ClientID
	Type() Type

	DataTransport

	// RemoteTracksChannel might never be closed.
	// Use Done() in select when reading from this channel to prevent deadlocks.
	RemoteTracksChannel() <-chan TrackRemoteWithRTCPReader

	LocalTracks() []TrackWithMID

	AddTrack(Track) (TrackLocal, RTCPReader, error)
	RemoveTrack(identifiers.TrackID) error

	RTCPWriter

	Closable
}

type Type

type Type int
const (
	TypeWebRTC Type = iota + 1
	TypeServer
)

Jump to

Keyboard shortcuts

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