1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-25 01:55:57 +01:00
galene/conn/conn.go

45 lines
1.1 KiB
Go
Raw Normal View History

2020-09-13 11:04:16 +02:00
// 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)
2020-09-13 11:04:16 +02:00
}
// Type UpTrack represents a track in the client to server direction.
type UpTrack interface {
AddLocal(DownTrack) error
DelLocal(DownTrack) bool
Kind() webrtc.RTPCodecType
2021-04-29 17:03:25 +02:00
Label() string
2020-12-04 01:15:52 +01:00
Codec() webrtc.RTPCodecCapability
// GetPacket fetches a recent packet. Returns 0 if the packet is
// not in cache, and, in that case, optionally schedules a NACK.
GetPacket(seqno uint16, result []byte, nack bool) uint16
RequestKeyframe() error
2020-09-13 11:04:16 +02:00
}
// 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)
2020-09-13 11:04:16 +02:00
SetTimeOffset(ntp uint64, rtp uint32)
SetCname(string)
GetMaxBitrate() (uint64, int, int)
2020-09-13 11:04:16 +02:00
}