refactoring, enabling sending out room updates
This commit is contained in:
+81
-33
@@ -143,6 +143,7 @@ type SignalResponse struct {
|
||||
// *SignalResponse_Answer
|
||||
// *SignalResponse_Negotiate
|
||||
// *SignalResponse_Trickle
|
||||
// *SignalResponse_Update
|
||||
Message isSignalResponse_Message `protobuf_oneof:"message"`
|
||||
}
|
||||
|
||||
@@ -213,6 +214,13 @@ func (x *SignalResponse) GetTrickle() *Trickle {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SignalResponse) GetUpdate() *ParticipantUpdate {
|
||||
if x, ok := x.GetMessage().(*SignalResponse_Update); ok {
|
||||
return x.Update
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type isSignalResponse_Message interface {
|
||||
isSignalResponse_Message()
|
||||
}
|
||||
@@ -237,6 +245,11 @@ type SignalResponse_Trickle struct {
|
||||
Trickle *Trickle `protobuf:"bytes,4,opt,name=trickle,proto3,oneof"`
|
||||
}
|
||||
|
||||
type SignalResponse_Update struct {
|
||||
// sent when participants in the room has changed
|
||||
Update *ParticipantUpdate `protobuf:"bytes,5,opt,name=update,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*SignalResponse_Join) isSignalResponse_Message() {}
|
||||
|
||||
func (*SignalResponse_Answer) isSignalResponse_Message() {}
|
||||
@@ -245,6 +258,8 @@ func (*SignalResponse_Negotiate) isSignalResponse_Message() {}
|
||||
|
||||
func (*SignalResponse_Trickle) isSignalResponse_Message() {}
|
||||
|
||||
func (*SignalResponse_Update) isSignalResponse_Message() {}
|
||||
|
||||
type Trickle struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
@@ -352,7 +367,8 @@ type JoinResponse struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Participant *ParticipantInfo `protobuf:"bytes,1,opt,name=participant,proto3" json:"participant,omitempty"`
|
||||
Participant *ParticipantInfo `protobuf:"bytes,1,opt,name=participant,proto3" json:"participant,omitempty"`
|
||||
OtherParticipants []*ParticipantInfo `protobuf:"bytes,2,rep,name=other_participants,json=otherParticipants,proto3" json:"other_participants,omitempty"`
|
||||
}
|
||||
|
||||
func (x *JoinResponse) Reset() {
|
||||
@@ -394,6 +410,13 @@ func (x *JoinResponse) GetParticipant() *ParticipantInfo {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *JoinResponse) GetOtherParticipants() []*ParticipantInfo {
|
||||
if x != nil {
|
||||
return x.OtherParticipants
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type MediaControl struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
@@ -436,6 +459,8 @@ type ParticipantUpdate struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Participants []*ParticipantInfo `protobuf:"bytes,1,rep,name=participants,proto3" json:"participants,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ParticipantUpdate) Reset() {
|
||||
@@ -470,6 +495,13 @@ func (*ParticipantUpdate) Descriptor() ([]byte, []int) {
|
||||
return file_rtc_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *ParticipantUpdate) GetParticipants() []*ParticipantInfo {
|
||||
if x != nil {
|
||||
return x.Participants
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_rtc_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_rtc_proto_rawDesc = []byte{
|
||||
@@ -490,7 +522,7 @@ var file_rtc_proto_rawDesc = []byte{
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4d,
|
||||
0x65, 0x64, 0x69, 0x61, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x48, 0x00, 0x52, 0x07, 0x63,
|
||||
0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
||||
0x65, 0x22, 0xea, 0x01, 0x0a, 0x0e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70,
|
||||
0x65, 0x22, 0xa0, 0x02, 0x0a, 0x0e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x04, 0x6a, 0x6f, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4a, 0x6f, 0x69,
|
||||
0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x04, 0x6a, 0x6f, 0x69,
|
||||
@@ -504,24 +536,36 @@ var file_rtc_proto_rawDesc = []byte{
|
||||
0x74, 0x69, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, 0x07, 0x74, 0x72, 0x69, 0x63, 0x6b, 0x6c, 0x65,
|
||||
0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74,
|
||||
0x2e, 0x54, 0x72, 0x69, 0x63, 0x6b, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x07, 0x74, 0x72, 0x69, 0x63,
|
||||
0x6b, 0x6c, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x27,
|
||||
0x0a, 0x07, 0x54, 0x72, 0x69, 0x63, 0x6b, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x6e,
|
||||
0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x61,
|
||||
0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x22, 0x3a, 0x0a, 0x12, 0x53, 0x65, 0x73, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a,
|
||||
0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70,
|
||||
0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x64, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
|
||||
0x73, 0x64, 0x70, 0x22, 0x4a, 0x0a, 0x0c, 0x4a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61,
|
||||
0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b,
|
||||
0x69, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x6e,
|
||||
0x66, 0x6f, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x22,
|
||||
0x6b, 0x6c, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x50, 0x61,
|
||||
0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48,
|
||||
0x00, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73,
|
||||
0x73, 0x61, 0x67, 0x65, 0x22, 0x27, 0x0a, 0x07, 0x54, 0x72, 0x69, 0x63, 0x6b, 0x6c, 0x65, 0x12,
|
||||
0x1c, 0x0a, 0x09, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x09, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x22, 0x3a, 0x0a,
|
||||
0x12, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x64, 0x70, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x64, 0x70, 0x22, 0x93, 0x01, 0x0a, 0x0c, 0x4a, 0x6f,
|
||||
0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x0b, 0x70, 0x61,
|
||||
0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x18, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63,
|
||||
0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69,
|
||||
0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x47, 0x0a, 0x12, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f,
|
||||
0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03,
|
||||
0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x50, 0x61, 0x72,
|
||||
0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x11, 0x6f, 0x74,
|
||||
0x68, 0x65, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x22,
|
||||
0x0e, 0x0a, 0x0c, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x22,
|
||||
0x13, 0x0a, 0x11, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x55, 0x70,
|
||||
0x64, 0x61, 0x74, 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,
|
||||
0x51, 0x0a, 0x11, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x55, 0x70,
|
||||
0x64, 0x61, 0x74, 0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70,
|
||||
0x61, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6c, 0x69, 0x76,
|
||||
0x65, 0x6b, 0x69, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74,
|
||||
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e,
|
||||
0x74, 0x73, 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 (
|
||||
@@ -548,20 +592,23 @@ var file_rtc_proto_goTypes = []interface{}{
|
||||
(*ParticipantInfo)(nil), // 7: livekit.ParticipantInfo
|
||||
}
|
||||
var file_rtc_proto_depIdxs = []int32{
|
||||
3, // 0: livekit.SignalRequest.offer:type_name -> livekit.SessionDescription
|
||||
3, // 1: livekit.SignalRequest.negotiate:type_name -> livekit.SessionDescription
|
||||
2, // 2: livekit.SignalRequest.trickle:type_name -> livekit.Trickle
|
||||
5, // 3: livekit.SignalRequest.control:type_name -> livekit.MediaControl
|
||||
4, // 4: livekit.SignalResponse.join:type_name -> livekit.JoinResponse
|
||||
3, // 5: livekit.SignalResponse.answer:type_name -> livekit.SessionDescription
|
||||
3, // 6: livekit.SignalResponse.negotiate:type_name -> livekit.SessionDescription
|
||||
2, // 7: livekit.SignalResponse.trickle:type_name -> livekit.Trickle
|
||||
7, // 8: livekit.JoinResponse.participant:type_name -> livekit.ParticipantInfo
|
||||
9, // [9:9] is the sub-list for method output_type
|
||||
9, // [9:9] is the sub-list for method input_type
|
||||
9, // [9:9] is the sub-list for extension type_name
|
||||
9, // [9:9] is the sub-list for extension extendee
|
||||
0, // [0:9] is the sub-list for field type_name
|
||||
3, // 0: livekit.SignalRequest.offer:type_name -> livekit.SessionDescription
|
||||
3, // 1: livekit.SignalRequest.negotiate:type_name -> livekit.SessionDescription
|
||||
2, // 2: livekit.SignalRequest.trickle:type_name -> livekit.Trickle
|
||||
5, // 3: livekit.SignalRequest.control:type_name -> livekit.MediaControl
|
||||
4, // 4: livekit.SignalResponse.join:type_name -> livekit.JoinResponse
|
||||
3, // 5: livekit.SignalResponse.answer:type_name -> livekit.SessionDescription
|
||||
3, // 6: livekit.SignalResponse.negotiate:type_name -> livekit.SessionDescription
|
||||
2, // 7: livekit.SignalResponse.trickle:type_name -> livekit.Trickle
|
||||
6, // 8: livekit.SignalResponse.update:type_name -> livekit.ParticipantUpdate
|
||||
7, // 9: livekit.JoinResponse.participant:type_name -> livekit.ParticipantInfo
|
||||
7, // 10: livekit.JoinResponse.other_participants:type_name -> livekit.ParticipantInfo
|
||||
7, // 11: livekit.ParticipantUpdate.participants:type_name -> livekit.ParticipantInfo
|
||||
12, // [12:12] is the sub-list for method output_type
|
||||
12, // [12:12] is the sub-list for method input_type
|
||||
12, // [12:12] is the sub-list for extension type_name
|
||||
12, // [12:12] is the sub-list for extension extendee
|
||||
0, // [0:12] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_rtc_proto_init() }
|
||||
@@ -667,6 +714,7 @@ func file_rtc_proto_init() {
|
||||
(*SignalResponse_Answer)(nil),
|
||||
(*SignalResponse_Negotiate)(nil),
|
||||
(*SignalResponse_Trickle)(nil),
|
||||
(*SignalResponse_Update)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
|
||||
Reference in New Issue
Block a user