client consumes provided track

This commit is contained in:
David Zhao
2020-11-13 12:31:01 -08:00
parent 256328c4ff
commit c618f8c42f
13 changed files with 388 additions and 211 deletions
+54 -5
View File
@@ -12,10 +12,12 @@ import (
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
"github.com/pion/randutil" "github.com/pion/randutil"
"github.com/pion/webrtc/v3" "github.com/pion/webrtc/v3"
"github.com/pkg/errors"
"google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
"github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/logger"
"github.com/livekit/livekit-server/pkg/rtc"
"github.com/livekit/livekit-server/pkg/service" "github.com/livekit/livekit-server/pkg/service"
"github.com/livekit/livekit-server/proto/livekit" "github.com/livekit/livekit-server/proto/livekit"
) )
@@ -30,6 +32,8 @@ type RTCClient struct {
connected bool connected bool
iceConnected bool iceConnected bool
paused bool paused bool
me *rtc.MediaEngine // optional, populated only when receiving tracks
receivers []*rtc.Receiver
// pending actions to start after connected to peer // pending actions to start after connected to peer
pendingCandidates []*webrtc.ICECandidate pendingCandidates []*webrtc.ICECandidate
@@ -81,7 +85,6 @@ func NewRTCClient(conn *websocket.Conn) (*RTCClient, error) {
} }
c.ctx, c.cancel = context.WithCancel(context.Background()) c.ctx, c.cancel = context.WithCancel(context.Background())
// TODO: set up callbacks
peerConn.OnICECandidate(func(ic *webrtc.ICECandidate) { peerConn.OnICECandidate(func(ic *webrtc.ICECandidate) {
if ic == nil { if ic == nil {
return return
@@ -101,9 +104,19 @@ func NewRTCClient(conn *websocket.Conn) (*RTCClient, error) {
} }
}) })
peerConn.OnTrack(func(track *webrtc.Track, r *webrtc.RTPReceiver) { peerConn.OnTrack(func(track *webrtc.Track, rtpReceiver *webrtc.RTPReceiver) {
c.AppendLog("track received", "label", track.Label(), "id", track.ID()) c.AppendLog("track received", "label", track.Label(), "id", track.ID())
// TODO: set up track consumer to read peerId, _ := rtc.UnpackPeerTrack(track.ID())
tccExt := 0
if c.me != nil {
tccExt = c.me.TCCExt
}
r := rtc.NewReceiver(c.ctx, peerId, rtpReceiver, rtc.ReceiverConfig{}, tccExt)
c.lock.Lock()
c.receivers = append(c.receivers, r)
r.Start()
go c.consumeReceiver(r)
c.lock.Unlock()
}) })
peerConn.OnNegotiationNeeded(func() { peerConn.OnNegotiationNeeded(func() {
@@ -214,7 +227,7 @@ func (c *RTCClient) Run() error {
c.pendingCandidates = nil c.pendingCandidates = nil
c.lock.Unlock() c.lock.Unlock()
case *livekit.SignalResponse_Negotiate: case *livekit.SignalResponse_Negotiate:
c.AppendLog("received negotate answer", c.AppendLog("received negotiate",
"type", msg.Negotiate.Type) "type", msg.Negotiate.Type)
desc := service.FromProtoSessionDescription(msg.Negotiate) desc := service.FromProtoSessionDescription(msg.Negotiate)
if err := c.handleNegotiate(desc); err != nil { if err := c.handleNegotiate(desc); err != nil {
@@ -323,12 +336,19 @@ func (c *RTCClient) Negotiate() error {
} }
func (c *RTCClient) handleNegotiate(desc webrtc.SessionDescription) error { func (c *RTCClient) handleNegotiate(desc webrtc.SessionDescription) error {
// always set remote description // always set remote description for both offer and answer
if err := c.PeerConn.SetRemoteDescription(desc); err != nil { if err := c.PeerConn.SetRemoteDescription(desc); err != nil {
return err return err
} }
// if we received an offer, we'd have to answer
if desc.Type == webrtc.SDPTypeOffer { if desc.Type == webrtc.SDPTypeOffer {
// create media engine
c.me = &rtc.MediaEngine{}
if err := c.me.PopulateFromSDP(desc); err != nil {
return errors.Wrapf(err, "could not parse SDP")
}
answer, err := c.PeerConn.CreateAnswer(nil) answer, err := c.PeerConn.CreateAnswer(nil)
if err != nil { if err != nil {
return err return err
@@ -419,3 +439,32 @@ func (c *RTCClient) logLoop() {
} }
} }
} }
func (c *RTCClient) consumeReceiver(r *rtc.Receiver) {
lastUpdate := time.Time{}
peerId, trackId := rtc.UnpackPeerTrack(r.TrackId())
numBytes := 0
for {
select {
case packet, ok := <-r.RTPChan():
if !ok {
// channel closed, we are done
return
}
numBytes += packet.MarshalSize()
if time.Now().Sub(lastUpdate) > 30*time.Second {
c.AppendLog("consumed from peer",
"track", trackId, "peer", peerId,
"size", numBytes)
numBytes = 0
lastUpdate = time.Now()
}
case <-c.ctx.Done():
return
}
if c.ctx.Err() != nil {
return
}
}
}
+8
View File
@@ -15,6 +15,8 @@ import (
"github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/logger"
) )
// Writes a file to an RTP track.
// makes it easier to debug and create RTP streams
type TrackWriter struct { type TrackWriter struct {
ctx context.Context ctx context.Context
track *webrtc.Track track *webrtc.Track
@@ -72,6 +74,9 @@ func (w *TrackWriter) writeOgg() {
// Keep track of last granule, the difference is the amount of samples in the buffer // Keep track of last granule, the difference is the amount of samples in the buffer
var lastGranule uint64 var lastGranule uint64
for { for {
if w.ctx.Err() != nil {
return
}
pageData, pageHeader, err := w.ogg.ParseNextPage() pageData, pageHeader, err := w.ogg.ParseNextPage()
if err == io.EOF { if err == io.EOF {
logger.GetLogger().Infow("all audio samples parsed and sent") logger.GetLogger().Infow("all audio samples parsed and sent")
@@ -103,6 +108,9 @@ func (w *TrackWriter) writeVP8() {
// This isn't required since the video is timestamped, but we will such much higher loss if we send all at once. // This isn't required since the video is timestamped, but we will such much higher loss if we send all at once.
sleepTime := time.Millisecond * time.Duration((float32(w.ivfheader.TimebaseNumerator)/float32(w.ivfheader.TimebaseDenominator))*1000) sleepTime := time.Millisecond * time.Duration((float32(w.ivfheader.TimebaseNumerator)/float32(w.ivfheader.TimebaseDenominator))*1000)
for { for {
if w.ctx.Err() != nil {
return
}
frame, _, err := w.ivf.ParseNextFrame() frame, _, err := w.ivf.ParseNextFrame()
if err == io.EOF { if err == io.EOF {
logger.GetLogger().Infow("all video frames parsed and sent") logger.GetLogger().Infow("all video frames parsed and sent")
+2 -2
View File
@@ -159,7 +159,7 @@ func handleAddMedia(rc *client.RTCClient, isAudio bool) error {
mediaPath = ExpandUser(mediaPath) mediaPath = ExpandUser(mediaPath)
// TODO: see what the ID should be // TODO: see what the ID should be
err = rc.AddTrack(mediaPath, codecType, filepath.Base(mediaPath), "livekit") err = rc.AddTrack(mediaPath, codecType, codecType.String(), filepath.Base(mediaPath))
if err != nil { if err != nil {
return err return err
} }
@@ -177,7 +177,7 @@ func handleAddMedia(rc *client.RTCClient, isAudio bool) error {
audioPath := mediaPath[0:len(mediaPath)-len(videoExt)] + ".ogg" audioPath := mediaPath[0:len(mediaPath)-len(videoExt)] + ".ogg"
if _, err = os.Stat(audioPath); err == nil { if _, err = os.Stat(audioPath); err == nil {
err = rc.AddTrack(audioPath, webrtc.RTPCodecTypeAudio, filepath.Base(audioPath), "livekit") err = rc.AddTrack(audioPath, webrtc.RTPCodecTypeAudio, codecType.String(), filepath.Base(audioPath))
if err != nil { if err != nil {
fmt.Printf("added audio track: %s\n", audioPath) fmt.Printf("added audio track: %s\n", audioPath)
} }
+2 -2
View File
@@ -18,7 +18,7 @@ const (
type MediaEngine struct { type MediaEngine struct {
webrtc.MediaEngine webrtc.MediaEngine
feedbackTypes []webrtc.RTCPFeedback feedbackTypes []webrtc.RTCPFeedback
tCCExt int TCCExt int
} }
// PopulateFromSDP finds all codecs in sd and adds them to m, using the dynamic // PopulateFromSDP finds all codecs in sd and adds them to m, using the dynamic
@@ -40,7 +40,7 @@ func (e *MediaEngine) PopulateFromSDP(sd webrtc.SessionDescription) error {
for _, att := range md.Attributes { for _, att := range md.Attributes {
if att.Key == sdp.AttrKeyExtMap && strings.HasSuffix(att.Value, sdp.TransportCCURI) { if att.Key == sdp.AttrKeyExtMap && strings.HasSuffix(att.Value, sdp.TransportCCURI) {
e.tCCExt, _ = strconv.Atoi(att.Value[:1]) e.TCCExt, _ = strconv.Atoi(att.Value[:1])
break break
} }
} }
+2 -2
View File
@@ -98,7 +98,7 @@ func (p *WebRTCPeer) Answer(sdp webrtc.SessionDescription) (answer webrtc.Sessio
// only set after answered // only set after answered
p.conn.OnNegotiationNeeded(func() { p.conn.OnNegotiationNeeded(func() {
logger.GetLogger().Debugw("negotiation needed") logger.GetLogger().Debugw("negotiation needed", "peerId", p.ID())
offer, err := p.conn.CreateOffer(nil) offer, err := p.conn.CreateOffer(nil)
if err != nil { if err != nil {
// TODO: log // TODO: log
@@ -182,7 +182,7 @@ func (p *WebRTCPeer) onTrack(track *webrtc.Track, rtpReceiver *webrtc.RTPReceive
logger.GetLogger().Debugw("track added", "peerId", p.ID(), "track", track.Label()) logger.GetLogger().Debugw("track added", "peerId", p.ID(), "track", track.Label())
// create Receiver // create Receiver
receiver := NewReceiver(p.ctx, p.id, rtpReceiver, p.receiverConfig, p.mediaEngine) receiver := NewReceiver(p.ctx, p.id, rtpReceiver, p.receiverConfig, p.mediaEngine.TCCExt)
pt := NewPeerTrack(p.ctx, p.id, p.conn, track, receiver) pt := NewPeerTrack(p.ctx, p.id, p.conn, track, receiver)
p.lock.Lock() p.lock.Lock()
+11 -3
View File
@@ -34,7 +34,7 @@ type Receiver struct {
onCloseHandler func(r *Receiver) onCloseHandler func(r *Receiver)
} }
func NewReceiver(ctx context.Context, peerId string, rtpReceiver *webrtc.RTPReceiver, conf ReceiverConfig, me *MediaEngine) *Receiver { func NewReceiver(ctx context.Context, peerId string, rtpReceiver *webrtc.RTPReceiver, conf ReceiverConfig, tccExt int) *Receiver {
ctx, cancel := context.WithCancel(ctx) ctx, cancel := context.WithCancel(ctx)
track := rtpReceiver.Track() track := rtpReceiver.Track()
return &Receiver{ return &Receiver{
@@ -47,12 +47,20 @@ func NewReceiver(ctx context.Context, peerId string, rtpReceiver *webrtc.RTPRece
buffer: sfu.NewBuffer(track, sfu.BufferOptions{ buffer: sfu.NewBuffer(track, sfu.BufferOptions{
BufferTime: conf.maxBufferTime, BufferTime: conf.maxBufferTime,
MaxBitRate: conf.maxBandwidth * 1000, MaxBitRate: conf.maxBandwidth * 1000,
TCCExt: me.tCCExt, TCCExt: tccExt,
}), }),
once: sync.Once{}, once: sync.Once{},
} }
} }
func (r *Receiver) PeerId() string {
return r.peerId
}
func (r *Receiver) TrackId() string {
return r.track.ID()
}
// starts reading RTP and push to buffer // starts reading RTP and push to buffer
func (r *Receiver) Start() { func (r *Receiver) Start() {
r.once.Do(func() { r.once.Do(func() {
@@ -69,7 +77,7 @@ func (r *Receiver) Close() {
r.cancel() r.cancel()
} }
// reaturns channel to read rtp packets // returns channel to read rtp packets
func (r *Receiver) RTPChan() <-chan *rtp.Packet { func (r *Receiver) RTPChan() <-chan *rtp.Packet {
return r.rtpChan return r.rtpChan
} }
+4 -1
View File
@@ -58,8 +58,11 @@ func (t *PeerTrack) AddSubscriber(peer *WebRTCPeer) error {
return ErrUnsupportedPayloadType return ErrUnsupportedPayloadType
} }
// pack ID to identify all tracks
packedId := PackPeerTrack(t.peerId, t.track.ID())
// use existing SSRC with simple forwarders. adaptive forwarders require unique SSRC per layer // use existing SSRC with simple forwarders. adaptive forwarders require unique SSRC per layer
outTrack, err := peer.conn.NewTrack(codecs[0].PayloadType, t.track.SSRC(), t.track.ID(), t.track.Label()) outTrack, err := peer.conn.NewTrack(codecs[0].PayloadType, t.track.SSRC(), packedId, t.track.Label())
if err != nil { if err != nil {
return err return err
} }
+21
View File
@@ -0,0 +1,21 @@
package rtc
import (
"strings"
)
const (
trackIdSeparator = "|"
)
func UnpackPeerTrack(packed string) (peerId string, trackId string) {
parts := strings.Split(packed, trackIdSeparator)
if len(parts) > 1 {
return parts[0], packed[len(parts[0]):]
}
return "", packed
}
func PackPeerTrack(peerId, trackId string) string {
return peerId + trackIdSeparator + trackId
}
+199 -15
View File
@@ -230,6 +230,148 @@ func (x *Room) GetToken() string {
return "" return ""
} }
type RoomInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RoomId string `protobuf:"bytes,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"`
NodeIp string `protobuf:"bytes,2,opt,name=node_ip,json=nodeIp,proto3" json:"node_ip,omitempty"`
NodeRtcPort uint32 `protobuf:"varint,3,opt,name=node_rtc_port,json=nodeRtcPort,proto3" json:"node_rtc_port,omitempty"`
CreationTime int64 `protobuf:"varint,4,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty"`
Token string `protobuf:"bytes,5,opt,name=token,proto3" json:"token,omitempty"`
}
func (x *RoomInfo) Reset() {
*x = RoomInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_model_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RoomInfo) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RoomInfo) ProtoMessage() {}
func (x *RoomInfo) ProtoReflect() protoreflect.Message {
mi := &file_model_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RoomInfo.ProtoReflect.Descriptor instead.
func (*RoomInfo) Descriptor() ([]byte, []int) {
return file_model_proto_rawDescGZIP(), []int{3}
}
func (x *RoomInfo) GetRoomId() string {
if x != nil {
return x.RoomId
}
return ""
}
func (x *RoomInfo) GetNodeIp() string {
if x != nil {
return x.NodeIp
}
return ""
}
func (x *RoomInfo) GetNodeRtcPort() uint32 {
if x != nil {
return x.NodeRtcPort
}
return 0
}
func (x *RoomInfo) GetCreationTime() int64 {
if x != nil {
return x.CreationTime
}
return 0
}
func (x *RoomInfo) GetToken() string {
if x != nil {
return x.Token
}
return ""
}
type PeerInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
HasAudio bool `protobuf:"varint,2,opt,name=has_audio,json=hasAudio,proto3" json:"has_audio,omitempty"`
HasVideo bool `protobuf:"varint,3,opt,name=has_video,json=hasVideo,proto3" json:"has_video,omitempty"`
}
func (x *PeerInfo) Reset() {
*x = PeerInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_model_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PeerInfo) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PeerInfo) ProtoMessage() {}
func (x *PeerInfo) ProtoReflect() protoreflect.Message {
mi := &file_model_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PeerInfo.ProtoReflect.Descriptor instead.
func (*PeerInfo) Descriptor() ([]byte, []int) {
return file_model_proto_rawDescGZIP(), []int{4}
}
func (x *PeerInfo) GetPeerId() string {
if x != nil {
return x.PeerId
}
return ""
}
func (x *PeerInfo) GetHasAudio() bool {
if x != nil {
return x.HasAudio
}
return false
}
func (x *PeerInfo) GetHasVideo() bool {
if x != nil {
return x.HasVideo
}
return false
}
type DataChannel struct { type DataChannel struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@@ -242,7 +384,7 @@ type DataChannel struct {
func (x *DataChannel) Reset() { func (x *DataChannel) Reset() {
*x = DataChannel{} *x = DataChannel{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_model_proto_msgTypes[3] mi := &file_model_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@@ -255,7 +397,7 @@ func (x *DataChannel) String() string {
func (*DataChannel) ProtoMessage() {} func (*DataChannel) ProtoMessage() {}
func (x *DataChannel) ProtoReflect() protoreflect.Message { func (x *DataChannel) ProtoReflect() protoreflect.Message {
mi := &file_model_proto_msgTypes[3] mi := &file_model_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -268,7 +410,7 @@ func (x *DataChannel) ProtoReflect() protoreflect.Message {
// Deprecated: Use DataChannel.ProtoReflect.Descriptor instead. // Deprecated: Use DataChannel.ProtoReflect.Descriptor instead.
func (*DataChannel) Descriptor() ([]byte, []int) { func (*DataChannel) Descriptor() ([]byte, []int) {
return file_model_proto_rawDescGZIP(), []int{3} return file_model_proto_rawDescGZIP(), []int{5}
} }
func (x *DataChannel) GetSessionId() string { func (x *DataChannel) GetSessionId() string {
@@ -311,15 +453,31 @@ var file_model_proto_rawDesc = []byte{
0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d,
0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x46, 0x0a, 0x0b, 0x44, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x9b, 0x01, 0x0a, 0x08,
0x61, 0x74, 0x61, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6f, 0x6d,
0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49,
0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01,
0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x70, 0x12, 0x22, 0x0a, 0x0d, 0x6e, 0x6f,
0x6f, 0x61, 0x64, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x72, 0x74, 0x63, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
0x6d, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x0d, 0x52, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x52, 0x74, 0x63, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x23,
0x74, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6c, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18,
0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54,
0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x5d, 0x0a, 0x08, 0x50, 0x65, 0x65,
0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b,
0x0a, 0x09, 0x68, 0x61, 0x73, 0x5f, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28,
0x08, 0x52, 0x08, 0x68, 0x61, 0x73, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x68,
0x61, 0x73, 0x5f, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08,
0x68, 0x61, 0x73, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x22, 0x46, 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x61,
0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69,
0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73,
0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61,
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64,
0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c,
0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2d, 0x73,
0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6c, 0x69, 0x76, 0x65,
0x6b, 0x69, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@@ -334,12 +492,14 @@ func file_model_proto_rawDescGZIP() []byte {
return file_model_proto_rawDescData return file_model_proto_rawDescData
} }
var file_model_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_model_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_model_proto_goTypes = []interface{}{ var file_model_proto_goTypes = []interface{}{
(*Node)(nil), // 0: livekit.Node (*Node)(nil), // 0: livekit.Node
(*NodeStats)(nil), // 1: livekit.NodeStats (*NodeStats)(nil), // 1: livekit.NodeStats
(*Room)(nil), // 2: livekit.Room (*Room)(nil), // 2: livekit.Room
(*DataChannel)(nil), // 3: livekit.DataChannel (*RoomInfo)(nil), // 3: livekit.RoomInfo
(*PeerInfo)(nil), // 4: livekit.PeerInfo
(*DataChannel)(nil), // 5: livekit.DataChannel
} }
var file_model_proto_depIdxs = []int32{ var file_model_proto_depIdxs = []int32{
1, // 0: livekit.Node.stats:type_name -> livekit.NodeStats 1, // 0: livekit.Node.stats:type_name -> livekit.NodeStats
@@ -393,6 +553,30 @@ func file_model_proto_init() {
} }
} }
file_model_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { file_model_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RoomInfo); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_model_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PeerInfo); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_model_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DataChannel); i { switch v := v.(*DataChannel); i {
case 0: case 0:
return &v.state return &v.state
@@ -411,7 +595,7 @@ func file_model_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_model_proto_rawDesc, RawDescriptor: file_model_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 4, NumMessages: 6,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },
+50 -149
View File
@@ -136,85 +136,6 @@ func (x *GetRoomRequest) GetRoomId() string {
return "" return ""
} }
type RoomInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RoomId string `protobuf:"bytes,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"`
NodeIp string `protobuf:"bytes,2,opt,name=node_ip,json=nodeIp,proto3" json:"node_ip,omitempty"`
NodeRtcPort uint32 `protobuf:"varint,3,opt,name=node_rtc_port,json=nodeRtcPort,proto3" json:"node_rtc_port,omitempty"`
CreationTime int64 `protobuf:"varint,4,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty"`
Token string `protobuf:"bytes,5,opt,name=token,proto3" json:"token,omitempty"`
}
func (x *RoomInfo) Reset() {
*x = RoomInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_room_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RoomInfo) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RoomInfo) ProtoMessage() {}
func (x *RoomInfo) ProtoReflect() protoreflect.Message {
mi := &file_room_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RoomInfo.ProtoReflect.Descriptor instead.
func (*RoomInfo) Descriptor() ([]byte, []int) {
return file_room_proto_rawDescGZIP(), []int{2}
}
func (x *RoomInfo) GetRoomId() string {
if x != nil {
return x.RoomId
}
return ""
}
func (x *RoomInfo) GetNodeIp() string {
if x != nil {
return x.NodeIp
}
return ""
}
func (x *RoomInfo) GetNodeRtcPort() uint32 {
if x != nil {
return x.NodeRtcPort
}
return 0
}
func (x *RoomInfo) GetCreationTime() int64 {
if x != nil {
return x.CreationTime
}
return 0
}
func (x *RoomInfo) GetToken() string {
if x != nil {
return x.Token
}
return ""
}
type DeleteRoomRequest struct { type DeleteRoomRequest struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@@ -226,7 +147,7 @@ type DeleteRoomRequest struct {
func (x *DeleteRoomRequest) Reset() { func (x *DeleteRoomRequest) Reset() {
*x = DeleteRoomRequest{} *x = DeleteRoomRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_room_proto_msgTypes[3] mi := &file_room_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@@ -239,7 +160,7 @@ func (x *DeleteRoomRequest) String() string {
func (*DeleteRoomRequest) ProtoMessage() {} func (*DeleteRoomRequest) ProtoMessage() {}
func (x *DeleteRoomRequest) ProtoReflect() protoreflect.Message { func (x *DeleteRoomRequest) ProtoReflect() protoreflect.Message {
mi := &file_room_proto_msgTypes[3] mi := &file_room_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -252,7 +173,7 @@ func (x *DeleteRoomRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteRoomRequest.ProtoReflect.Descriptor instead. // Deprecated: Use DeleteRoomRequest.ProtoReflect.Descriptor instead.
func (*DeleteRoomRequest) Descriptor() ([]byte, []int) { func (*DeleteRoomRequest) Descriptor() ([]byte, []int) {
return file_room_proto_rawDescGZIP(), []int{3} return file_room_proto_rawDescGZIP(), []int{2}
} }
func (x *DeleteRoomRequest) GetRoomId() string { func (x *DeleteRoomRequest) GetRoomId() string {
@@ -271,7 +192,7 @@ type DeleteRoomResponse struct {
func (x *DeleteRoomResponse) Reset() { func (x *DeleteRoomResponse) Reset() {
*x = DeleteRoomResponse{} *x = DeleteRoomResponse{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_room_proto_msgTypes[4] mi := &file_room_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@@ -284,7 +205,7 @@ func (x *DeleteRoomResponse) String() string {
func (*DeleteRoomResponse) ProtoMessage() {} func (*DeleteRoomResponse) ProtoMessage() {}
func (x *DeleteRoomResponse) ProtoReflect() protoreflect.Message { func (x *DeleteRoomResponse) ProtoReflect() protoreflect.Message {
mi := &file_room_proto_msgTypes[4] mi := &file_room_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -297,55 +218,46 @@ func (x *DeleteRoomResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteRoomResponse.ProtoReflect.Descriptor instead. // Deprecated: Use DeleteRoomResponse.ProtoReflect.Descriptor instead.
func (*DeleteRoomResponse) Descriptor() ([]byte, []int) { func (*DeleteRoomResponse) Descriptor() ([]byte, []int) {
return file_room_proto_rawDescGZIP(), []int{4} return file_room_proto_rawDescGZIP(), []int{3}
} }
var File_room_proto protoreflect.FileDescriptor var File_room_proto protoreflect.FileDescriptor
var file_room_proto_rawDesc = []byte{ var file_room_proto_rawDesc = []byte{
0x0a, 0x0a, 0x72, 0x6f, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x6c, 0x69, 0x0a, 0x0a, 0x72, 0x6f, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x6c, 0x69,
0x76, 0x65, 0x6b, 0x69, 0x74, 0x22, 0x7c, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x1a, 0x0b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f,
0x6f, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7c, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x6d,
0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6f, 0x6d, 0x5f,
0x6d, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x74, 0x69, 0x6d, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64,
0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x65, 0x6d, 0x70, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75,
0x79, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x54, 0x69,
0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x61, 0x72,
0x28, 0x0d, 0x52, 0x0f, 0x6d, 0x61, 0x78, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52,
0x6e, 0x74, 0x73, 0x22, 0x29, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x52, 0x65, 0x0f, 0x6d, 0x61, 0x78, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x22, 0x29, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x22, 0x9b, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x0a, 0x08, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x22, 0x2c, 0x0a, 0x11, 0x44,
0x6f, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x6f, 0x6d, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x70, 0x18, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x70, 0x12, 0x22, 0x0a, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c,
0x0d, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x72, 0x74, 0x63, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32,
0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x52, 0x74, 0x63, 0x50, 0x6f, 0x72, 0xc8, 0x01, 0x0a, 0x0b, 0x52, 0x6f, 0x6f, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12,
0x74, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x3b, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x12, 0x1a, 0x2e,
0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f,
0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x6c, 0x69, 0x76, 0x65,
0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x2c, 0x0a, 0x11, 0x6b, 0x69, 0x74, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x35, 0x0a, 0x07,
0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x12, 0x17, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69,
0x74, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x1a, 0x11, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x49,
0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x66, 0x6f, 0x12, 0x45, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6f,
0x32, 0xc8, 0x01, 0x0a, 0x0b, 0x52, 0x6f, 0x6f, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x6d, 0x12, 0x1a, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65,
0x12, 0x3b, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x12, 0x1a, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e,
0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f,
0x6f, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x6c, 0x69, 0x76, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69,
0x65, 0x6b, 0x69, 0x74, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x35, 0x0a, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74,
0x07, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x12, 0x17, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f,
0x69, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x62, 0x06, 0x70,
0x74, 0x1a, 0x11, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x49, 0x6e, 0x66, 0x6f, 0x12, 0x45, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f,
0x6f, 0x6d, 0x12, 0x1a, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x44, 0x65, 0x6c,
0x65, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b,
0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52,
0x6f, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69,
0x74, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@@ -360,21 +272,21 @@ func file_room_proto_rawDescGZIP() []byte {
return file_room_proto_rawDescData return file_room_proto_rawDescData
} }
var file_room_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_room_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_room_proto_goTypes = []interface{}{ var file_room_proto_goTypes = []interface{}{
(*CreateRoomRequest)(nil), // 0: livekit.CreateRoomRequest (*CreateRoomRequest)(nil), // 0: livekit.CreateRoomRequest
(*GetRoomRequest)(nil), // 1: livekit.GetRoomRequest (*GetRoomRequest)(nil), // 1: livekit.GetRoomRequest
(*RoomInfo)(nil), // 2: livekit.RoomInfo (*DeleteRoomRequest)(nil), // 2: livekit.DeleteRoomRequest
(*DeleteRoomRequest)(nil), // 3: livekit.DeleteRoomRequest (*DeleteRoomResponse)(nil), // 3: livekit.DeleteRoomResponse
(*DeleteRoomResponse)(nil), // 4: livekit.DeleteRoomResponse (*RoomInfo)(nil), // 4: livekit.RoomInfo
} }
var file_room_proto_depIdxs = []int32{ var file_room_proto_depIdxs = []int32{
0, // 0: livekit.RoomService.CreateRoom:input_type -> livekit.CreateRoomRequest 0, // 0: livekit.RoomService.CreateRoom:input_type -> livekit.CreateRoomRequest
1, // 1: livekit.RoomService.GetRoom:input_type -> livekit.GetRoomRequest 1, // 1: livekit.RoomService.GetRoom:input_type -> livekit.GetRoomRequest
3, // 2: livekit.RoomService.DeleteRoom:input_type -> livekit.DeleteRoomRequest 2, // 2: livekit.RoomService.DeleteRoom:input_type -> livekit.DeleteRoomRequest
2, // 3: livekit.RoomService.CreateRoom:output_type -> livekit.RoomInfo 4, // 3: livekit.RoomService.CreateRoom:output_type -> livekit.RoomInfo
2, // 4: livekit.RoomService.GetRoom:output_type -> livekit.RoomInfo 4, // 4: livekit.RoomService.GetRoom:output_type -> livekit.RoomInfo
4, // 5: livekit.RoomService.DeleteRoom:output_type -> livekit.DeleteRoomResponse 3, // 5: livekit.RoomService.DeleteRoom:output_type -> livekit.DeleteRoomResponse
3, // [3:6] is the sub-list for method output_type 3, // [3:6] is the sub-list for method output_type
0, // [0:3] is the sub-list for method input_type 0, // [0:3] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension type_name
@@ -387,6 +299,7 @@ func file_room_proto_init() {
if File_room_proto != nil { if File_room_proto != nil {
return return
} }
file_model_proto_init()
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_room_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_room_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateRoomRequest); i { switch v := v.(*CreateRoomRequest); i {
@@ -413,18 +326,6 @@ func file_room_proto_init() {
} }
} }
file_room_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { file_room_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RoomInfo); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_room_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteRoomRequest); i { switch v := v.(*DeleteRoomRequest); i {
case 0: case 0:
return &v.state return &v.state
@@ -436,7 +337,7 @@ func file_room_proto_init() {
return nil return nil
} }
} }
file_room_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { file_room_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteRoomResponse); i { switch v := v.(*DeleteRoomResponse); i {
case 0: case 0:
return &v.state return &v.state
@@ -455,7 +356,7 @@ func file_room_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_room_proto_rawDesc, RawDescriptor: file_room_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 5, NumMessages: 4,
NumExtensions: 0, NumExtensions: 0,
NumServices: 1, NumServices: 1,
}, },
+19 -24
View File
@@ -1595,28 +1595,23 @@ func callClientError(ctx context.Context, h *twirp.ClientHooks, err twirp.Error)
} }
var twirpFileDescriptor0 = []byte{ var twirpFileDescriptor0 = []byte{
// 360 bytes of a gzipped FileDescriptorProto // 288 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x4d, 0x6f, 0xda, 0x40, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0x4f, 0x4b, 0xc3, 0x40,
0x10, 0x95, 0x4b, 0xc1, 0x65, 0x80, 0xb6, 0xac, 0x90, 0xb0, 0xe8, 0x05, 0xb9, 0x17, 0x90, 0x5a, 0x10, 0xc5, 0x89, 0x42, 0x8b, 0x53, 0xab, 0x76, 0x11, 0x1a, 0xe2, 0xa5, 0xc4, 0x4b, 0x0b, 0x9a,
0xa3, 0x36, 0xca, 0x29, 0xb7, 0x7c, 0x28, 0xe2, 0x86, 0x9c, 0x9c, 0x72, 0xb1, 0x8c, 0x99, 0x24, 0xa0, 0xe2, 0xc9, 0x9b, 0x7f, 0x90, 0xde, 0x24, 0x7a, 0xf2, 0x12, 0xd2, 0x64, 0xd4, 0xc5, 0x6c,
0x2b, 0xb0, 0x67, 0xb3, 0x1e, 0x10, 0x91, 0xf2, 0x4f, 0xf2, 0x87, 0xf2, 0xb3, 0xa2, 0x5d, 0xcc, 0x26, 0x6e, 0x26, 0xa1, 0x82, 0x1f, 0xd0, 0x8f, 0x25, 0xf9, 0xd3, 0x36, 0xd2, 0x1e, 0x7a, 0x5a,
0x47, 0x04, 0x91, 0x38, 0x59, 0xf3, 0xde, 0xb3, 0xe7, 0xbd, 0x37, 0x06, 0xd0, 0x44, 0x69, 0xa0, 0xe6, 0x37, 0x6f, 0x98, 0xf7, 0x66, 0x01, 0x34, 0x91, 0x72, 0x52, 0x4d, 0x4c, 0xa2, 0x1b, 0xcb,
0x34, 0x31, 0x09, 0x77, 0x26, 0x17, 0x38, 0x95, 0xec, 0xbf, 0x40, 0xf3, 0x42, 0x63, 0xcc, 0x18, 0x02, 0x3f, 0x25, 0x5b, 0x3d, 0x45, 0x11, 0xc6, 0x35, 0xb5, 0x7f, 0x60, 0x70, 0xa7, 0x31, 0x60,
0x12, 0xa5, 0x21, 0x3e, 0xcd, 0x31, 0x67, 0xd1, 0x06, 0xd7, 0x68, 0x23, 0x39, 0xf1, 0x9c, 0xae, 0xf4, 0x88, 0x94, 0x87, 0x5f, 0x39, 0x66, 0x2c, 0x86, 0xd0, 0x2d, 0x07, 0x7d, 0x19, 0x99, 0xc6,
0xd3, 0xab, 0x86, 0x15, 0x33, 0x0e, 0x27, 0xe2, 0x37, 0x34, 0x30, 0x55, 0xfc, 0x1c, 0xb1, 0x4c, 0xc8, 0x18, 0xef, 0x79, 0x9d, 0xb2, 0x9c, 0x46, 0xe2, 0x14, 0xfa, 0xa8, 0x52, 0xfe, 0xf6, 0x59,
0x91, 0xe6, 0xec, 0x7d, 0xe9, 0x3a, 0xbd, 0x46, 0x58, 0xb7, 0xe0, 0xed, 0x0a, 0x13, 0x7d, 0xf8, 0x2a, 0xa4, 0x9c, 0xcd, 0x9d, 0x91, 0x31, 0xee, 0x7b, 0xfb, 0x15, 0x7c, 0xa9, 0x99, 0x98, 0xc0,
0x99, 0xc6, 0xcb, 0x48, 0xc5, 0x9a, 0x65, 0x22, 0x55, 0x9c, 0x71, 0xee, 0x95, 0xac, 0xee, 0x47, 0x91, 0x0a, 0xe6, 0x7e, 0x1a, 0x68, 0x96, 0xa1, 0x4c, 0x83, 0x84, 0x33, 0x73, 0xb7, 0xd2, 0x1d,
0x1a, 0x2f, 0x47, 0x3b, 0xb0, 0xdf, 0x87, 0xef, 0xd7, 0xc8, 0xc7, 0xac, 0xf6, 0x5f, 0x1d, 0xf8, 0xaa, 0x60, 0xfe, 0xd4, 0xc2, 0xf6, 0x04, 0x0e, 0x1e, 0x91, 0xb7, 0x59, 0x6d, 0x9f, 0xc1, 0xe0,
0x66, 0x84, 0xc3, 0xec, 0x9e, 0x3e, 0x37, 0xd8, 0x06, 0x37, 0xa3, 0x09, 0x46, 0x52, 0x59, 0x6b, 0x1e, 0x63, 0xdc, 0xce, 0xa8, 0x7d, 0x0c, 0xa2, 0xad, 0xce, 0x52, 0x4a, 0x32, 0xbc, 0xfc, 0x35,
0xd5, 0xb0, 0x62, 0xc6, 0xa1, 0x12, 0x3e, 0x34, 0x2c, 0xa1, 0x39, 0x89, 0x14, 0x69, 0x2e, 0x1c, 0xa0, 0x57, 0x82, 0x67, 0xd4, 0x85, 0x0c, 0x51, 0xdc, 0x00, 0xac, 0xc2, 0x0b, 0xcb, 0x69, 0x2e,
0xd5, 0x0c, 0x18, 0x72, 0x32, 0x22, 0xcd, 0x26, 0x5d, 0x62, 0xba, 0x90, 0x94, 0xd9, 0x80, 0xde, 0xe4, 0xac, 0x5d, 0xc4, 0x1a, 0x2c, 0x7b, 0x25, 0x9d, 0x26, 0x6f, 0x24, 0xae, 0xa1, 0xdb, 0x78,
0xd7, 0xae, 0xd3, 0x2b, 0x85, 0xf5, 0x35, 0x68, 0x02, 0x8a, 0x16, 0x94, 0x99, 0xa6, 0x98, 0x79, 0x17, 0xc3, 0x65, 0xf7, 0x7f, 0x9a, 0x4d, 0x63, 0x0f, 0x00, 0x2b, 0x67, 0xad, 0x9d, 0x6b, 0xe1,
0x65, 0xfb, 0xfd, 0xd5, 0xe0, 0xff, 0x81, 0xe6, 0x25, 0xce, 0xf0, 0xb8, 0x1a, 0xfd, 0x16, 0x88, 0xac, 0x93, 0x8d, 0xbd, 0x3a, 0xca, 0xed, 0xc5, 0xab, 0xfb, 0x2e, 0xf9, 0x23, 0x9f, 0x39, 0x21,
0x5d, 0x75, 0xae, 0x28, 0xcb, 0xf1, 0xff, 0x9b, 0x03, 0x35, 0x03, 0xdc, 0xa0, 0x5e, 0xc8, 0x04, 0x29, 0xb7, 0x11, 0x2e, 0xde, 0xf3, 0x0c, 0x75, 0x81, 0xda, 0xad, 0xbe, 0x78, 0x01, 0x67, 0x9d,
0xc5, 0x19, 0xc0, 0xf6, 0x34, 0xa2, 0x13, 0x14, 0x27, 0x0b, 0xf6, 0xee, 0xd5, 0x69, 0x6e, 0xb8, 0xaa, 0xbc, 0xfa, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x26, 0x82, 0x91, 0x90, 0x15, 0x02, 0x00, 0x00,
0x4d, 0x43, 0xa7, 0xe0, 0x16, 0xcd, 0x8a, 0xf6, 0x86, 0xfd, 0xd8, 0xf5, 0xa1, 0xd7, 0xae, 0x00,
0xb6, 0xce, 0x76, 0x76, 0xee, 0x85, 0xeb, 0xfc, 0x3a, 0xc8, 0xad, 0xa2, 0x9c, 0xff, 0xbb, 0x1b,
0x3c, 0x48, 0x7e, 0x9c, 0x8f, 0x83, 0x84, 0xd2, 0x41, 0x21, 0x5c, 0x3f, 0xff, 0xe6, 0xa8, 0x17,
0xa8, 0x07, 0xf6, 0x4f, 0x5c, 0x83, 0xe3, 0x8a, 0x1d, 0x4f, 0xde, 0x03, 0x00, 0x00, 0xff, 0xff,
0x88, 0x0b, 0xf0, 0x4d, 0xa6, 0x02, 0x00, 0x00,
} }
+14
View File
@@ -25,6 +25,20 @@ message Room {
string token = 5; string token = 5;
} }
message RoomInfo {
string room_id = 1;
string node_ip = 2;
uint32 node_rtc_port = 3;
int64 creation_time = 4;
string token = 5;
}
message PeerInfo {
string peer_id = 1;
bool has_audio = 2;
bool has_video = 3;
}
message DataChannel { message DataChannel {
string session_id = 1; string session_id = 1;
bytes payload = 2; bytes payload = 2;
+2 -8
View File
@@ -3,6 +3,8 @@ syntax = "proto3";
package livekit; package livekit;
option go_package = "github.com/livekit/livekit-server/proto/livekit"; option go_package = "github.com/livekit/livekit-server/proto/livekit";
import "model.proto";
// Room service that can be performed on any node // Room service that can be performed on any node
// they are simple HTTP req/responses // they are simple HTTP req/responses
service RoomService { service RoomService {
@@ -24,14 +26,6 @@ message GetRoomRequest {
string room_id = 1; string room_id = 1;
} }
message RoomInfo {
string room_id = 1;
string node_ip = 2;
uint32 node_rtc_port = 3;
int64 creation_time = 4;
string token = 5;
}
message DeleteRoomRequest { message DeleteRoomRequest {
string room_id = 1; string room_id = 1;
} }