1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-12-22 23:35:46 +01:00
galene/conn/conn.go
Juliusz Chroboczek 22585e9d10 Handle spatial scalability.
Maintain spatial layer information, and drop lower layers when
possible.  Yields a 20% saving with VP9.
2021-05-17 18:17:43 +02:00

44 lines
1.1 KiB
Go

// Package conn defines interfaces for connections and tracks.
package conn
import (
"errors"
"github.com/pion/webrtc/v3"
)
var ErrConnectionClosed = errors.New("connection is closed")
// Type Up represents a connection in the client to server direction.
type Up interface {
AddLocal(Down) error
DelLocal(Down) bool
Id() string
Label() string
User() (string, string)
}
// Type UpTrack represents a track in the client to server direction.
type UpTrack interface {
AddLocal(DownTrack) error
DelLocal(DownTrack) bool
Kind() webrtc.RTPCodecType
Label() string
Codec() webrtc.RTPCodecCapability
// get a recent packet. Returns 0 if the packet is not in cache.
GetRTP(seqno uint16, result []byte) uint16
Nack(conn Up, seqnos []uint16) error
RequestKeyframe() error
}
// Type Down represents a connection in the server to client direction.
type Down interface {
}
// Type DownTrack represents a track in the server to client direction.
type DownTrack interface {
Write(buf []byte) (int, error)
SetTimeOffset(ntp uint64, rtp uint32)
SetCname(string)
GetMaxBitrate() (uint64, int, int)
}