dc

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: AGPL-3.0, Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLockTimeout     = errors.New("lock timeout")
	ErrAlreadyUnlocked = errors.New("already unlocked")
)

Functions

func EncodeMessage

func EncodeMessage(mt MessageType, payload any) ([]byte, error)

Types

type Lock added in v1.1.0

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

func NewLock added in v1.1.0

func NewLock() *Lock

func (*Lock) Lock added in v1.1.0

func (l *Lock) Lock(timeout time.Duration) error

func (*Lock) TryLock added in v1.1.0

func (l *Lock) TryLock() bool

func (*Lock) Unlock added in v1.1.0

func (l *Lock) Unlock() error

type MediaMap added in v1.2.2

type MediaMap map[string]TrackInfo

type MessageSDP

type MessageSDP []byte // payload is zlib compressed data of a JSON serialized webrtc.SessionDescription

Supported payloads

type MessageType

type MessageType uint8
const (
	MessageTypePing          MessageType = iota + 1 // no payload
	MessageTypePong                                 // no payload
	MessageTypeSDP                                  // MessageSDP
	MessageTypeLossRate                             // float64
	MessageTypeRoundTripTime                        // float64
	MessageTypeJitter                               // float64
	MessageTypeLock                                 // bool
	MessageTypeUnlock                               // no payload
	MessageTypeMediaMap                             // MediaMap
)

func DecodeMessage

func DecodeMessage(msg []byte) (MessageType, any, error)

type TrackInfo added in v1.2.2

type TrackInfo struct {
	Type     string `msgpack:"type"`      // "voice", "screen", "screen-audio", "video"
	SenderID string `msgpack:"sender_id"` // the session ID of the sender
}

Jump to

Keyboard shortcuts

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