diff --git a/cmd/watcher/main.go b/cmd/watcher/main.go index 61d5c95..a6ec82c 100644 --- a/cmd/watcher/main.go +++ b/cmd/watcher/main.go @@ -27,14 +27,41 @@ const ( h264FrameDuration = time.Millisecond * 33 ) +func withAuth[T any](token string, v *T) *connect.Request[T] { + req := connect.NewRequest[T](v) + req.Header().Add("authorization", "Bearer "+token) + return req +} + func main() { //nolint ctx := context.Background() - client := servicepb.NewSignalerServiceClient(&http.Client{}, "http://localhost:8080/") + httpClient := &http.Client{} + client := servicepb.NewSignalerServiceClient(httpClient, "http://localhost:8080/") + authToken, err := client.CreateAuthToken(ctx, connect.NewRequest(&pb.CreateAuthTokenRequest{ + Type: &pb.CreateAuthTokenRequest_Camera_{ + Camera: &pb.CreateAuthTokenRequest_Camera{ + Id: "movie", + }, + }, + })) + if err != nil { + log.Fatalf("Failed to get auth token: %v", err) + } + token := authToken.Msg.GetToken() + // Assert that we have an audio or video file - _, err := os.Stat(videoFileName) + _, err = os.Stat(videoFileName) haveVideoFile := !os.IsNotExist(err) + iceConnectedCtx, iceConnectedCtxCancel := context.WithCancel(context.Background()) + // Create a new RTCPeerConnection + + // Wait for a session request + session, err := client.PopSession(ctx, withAuth(token, &pb.PopSessionRequest{})) + if err != nil { + log.Fatalf("error creating session: %v", err) + } peerConnection, err := webrtc.NewPeerConnection(webrtc.Configuration{ ICEServers: []webrtc.ICEServer{ { @@ -51,8 +78,6 @@ func main() { //nolint } }() - iceConnectedCtx, iceConnectedCtxCancel := context.WithCancel(context.Background()) - if haveVideoFile { // Create a video track videoTrack, videoTrackErr := webrtc.NewTrackLocalStaticSample(webrtc.RTPCodecCapability{MimeType: webrtc.MimeTypeH264}, "video", "pion") @@ -139,90 +164,86 @@ func main() { //nolint } }) - var iceCandidates []*pb.IceCandidate peerConnection.OnICECandidate(func(i *webrtc.ICECandidate) { if i == nil { return } c := i.ToJSON() - iceCandidates = append(iceCandidates, &pb.IceCandidate{ - Candidate: c.Candidate, - SdpMid: c.SDPMid, - SdpLineIndex: proto.Int32(int32(*c.SDPMLineIndex)), - UsernameFragment: proto.String(*c.UsernameFragment), - }) + client.CreateIceMessage(ctx, withAuth(token, &pb.CreateIceMessageRequest{ + SessionIdentifier: session.Msg.GetId(), + IceMessage: &pb.IceMessage{ + Type: &pb.IceMessage_Candidate{ + Candidate: &pb.IceCandidate{ + Candidate: c.Candidate, + SdpMid: c.SDPMid, + SdpLineIndex: proto.Int32(int32(*c.SDPMLineIndex)), + UsernameFragment: proto.String(*c.UsernameFragment), + }, + }, + }, + })) }) - // Wait for a session request - var session *pb.Session - for session == nil { - resp, err := client.ListSessions(ctx, connect.NewRequest(&pb.ListSessionsRequest{})) - if err != nil { - log.Fatalf("error creating session: %v", err) - } - if len(resp.Msg.Sessions) > 0 { - session = resp.Msg.Sessions[0] - } - time.Sleep(time.Millisecond * 500) - } - // Add ICE candidates from remote - for _, candidate := range session.GetClientIceCandidates() { - var sdpMLine *uint16 - if candidate.SdpLineIndex != nil { - t := uint16(candidate.GetSdpLineIndex()) - sdpMLine = &t + go func() { + for { + msg, err := client.PopIceMessage(ctx, withAuth(token, &pb.PopIceMessageRequest{ + SessionIdentifier: session.Msg.GetId(), + })) + if err != nil { + log.Fatalf("failed to pop ice message: %v", err) + } + switch msg.Msg.Type.(type) { + case *pb.IceMessage_Candidate: + candidate := msg.Msg.GetCandidate() + var sdpMLine *uint16 + if candidate.SdpLineIndex != nil { + t := uint16(candidate.GetSdpLineIndex()) + sdpMLine = &t + } + if err := peerConnection.AddICECandidate(webrtc.ICECandidateInit{ + Candidate: candidate.GetCandidate(), + SDPMid: candidate.SdpMid, + SDPMLineIndex: sdpMLine, + }); err != nil { + log.Fatalf("Failed to add ice candidate: %v", err) + } + case *pb.IceMessage_Session: + session := msg.Msg.GetSession() + + offer := webrtc.SessionDescription{ + Type: webrtc.SDPType(session.SdpType), + SDP: session.Sdp, + } + if err := peerConnection.SetLocalDescription(offer); err != nil { + log.Fatalf("Failed to set location description: %v", err) + } + + // Send back an answer + answer, err := peerConnection.CreateAnswer(nil) + if err != nil { + log.Fatalf("Failed to create an answer: %v", err) + } + if err := peerConnection.SetRemoteDescription(answer); err != nil { + log.Fatalf("Failed to set remote description: %v", err) + } + + _, err = client.CreateIceMessage(ctx, withAuth(token, &pb.CreateIceMessageRequest{ + IceMessage: &pb.IceMessage{ + Type: &pb.IceMessage_Session{ + Session: &pb.IceSessionDescription{ + SdpType: int64(answer.Type), + Sdp: answer.SDP, + }, + }, + }, + })) + if err != nil { + log.Fatalf("Failed to send answer: %v", err) + } + } } - peerConnection.AddICECandidate(webrtc.ICECandidateInit{ - Candidate: candidate.GetCandidate(), - SDPMid: candidate.SdpMid, - SDPMLineIndex: sdpMLine, - }) - } - - cameraOffer, err := peerConnection.CreateOffer(nil) - if err != nil { - log.Fatalf("error creating session: %v", err) - } - - // Set the remote SessionDescription - if err = peerConnection.SetRemoteDescription(cameraOffer); err != nil { - panic(err) - } - - // Create channel that is blocked until ICE Gathering is complete - gatherComplete := webrtc.GatheringCompletePromise(peerConnection) - // Block until ICE Gathering is complete, disabling trickle ICE - // we do this because we only can exchange one signaling message - // in a production application you should exchange ICE Candidates via OnICECandidate - log.Printf("Waiting to gather ICE") - <-gatherComplete - log.Printf("Done gathering ICE") - - session.CameraIceCandidates = iceCandidates - session.CameraOffer = &pb.IceSessionDescription{ - SdpType: int64(cameraOffer.Type), - Sdp: cameraOffer.SDP, - } - - // Send it back - resp, err := client.UpdateSession(ctx, connect.NewRequest(&pb.UpdateSessionRequest{ - Session: session, - WaitForUpdate: true, - })) - if err != nil { - log.Fatalf("error creating session: %v", err) - } - - answer := webrtc.SessionDescription{ - Type: webrtc.SDPType(resp.Msg.ClientAnswer.SdpType), - SDP: resp.Msg.ClientAnswer.Sdp, - } - - // Sets the LocalDescription, and starts our UDP listeners - if err = peerConnection.SetLocalDescription(answer); err != nil { - panic(err) - } + }() // Block forever select {} diff --git a/gen/genconnect/signaler_service.connect.go b/gen/genconnect/signaler_service.connect.go index 9344672..66f7485 100644 --- a/gen/genconnect/signaler_service.connect.go +++ b/gen/genconnect/signaler_service.connect.go @@ -42,24 +42,15 @@ const ( // SignalerServiceCreateSessionProcedure is the fully-qualified name of the SignalerService's // CreateSession RPC. SignalerServiceCreateSessionProcedure = "/signaler.SignalerService/CreateSession" - // SignalerServiceUpdateSessionProcedure is the fully-qualified name of the SignalerService's - // UpdateSession RPC. - SignalerServiceUpdateSessionProcedure = "/signaler.SignalerService/UpdateSession" - // SignalerServiceListSessionsProcedure is the fully-qualified name of the SignalerService's - // ListSessions RPC. - SignalerServiceListSessionsProcedure = "/signaler.SignalerService/ListSessions" - // SignalerServiceCreateIceCandidateProcedure is the fully-qualified name of the SignalerService's - // CreateIceCandidate RPC. - SignalerServiceCreateIceCandidateProcedure = "/signaler.SignalerService/CreateIceCandidate" - // SignalerServicePopIceCandidateProcedure is the fully-qualified name of the SignalerService's - // PopIceCandidate RPC. - SignalerServicePopIceCandidateProcedure = "/signaler.SignalerService/PopIceCandidate" - // SignalerServiceCreateIceSessionDescriptionProcedure is the fully-qualified name of the - // SignalerService's CreateIceSessionDescription RPC. - SignalerServiceCreateIceSessionDescriptionProcedure = "/signaler.SignalerService/CreateIceSessionDescription" - // SignalerServicePopIceSessionDescriptionProcedure is the fully-qualified name of the - // SignalerService's PopIceSessionDescription RPC. - SignalerServicePopIceSessionDescriptionProcedure = "/signaler.SignalerService/PopIceSessionDescription" + // SignalerServicePopSessionProcedure is the fully-qualified name of the SignalerService's + // PopSession RPC. + SignalerServicePopSessionProcedure = "/signaler.SignalerService/PopSession" + // SignalerServiceCreateIceMessageProcedure is the fully-qualified name of the SignalerService's + // CreateIceMessage RPC. + SignalerServiceCreateIceMessageProcedure = "/signaler.SignalerService/CreateIceMessage" + // SignalerServicePopIceMessageProcedure is the fully-qualified name of the SignalerService's + // PopIceMessage RPC. + SignalerServicePopIceMessageProcedure = "/signaler.SignalerService/PopIceMessage" ) // SignalerServiceClient is a client for the signaler.SignalerService service. @@ -71,21 +62,16 @@ type SignalerServiceClient interface { // Optionally, wait_for_update can be set to prevent returning until the Camera has seen the // session request, populated candidates, and returned a session offer. CreateSession(context.Context, *connect.Request[gen.CreateSessionRequest]) (*connect.Response[gen.Session], error) - // UpdateSession updates the session - UpdateSession(context.Context, *connect.Request[gen.UpdateSessionRequest]) (*connect.Response[gen.Session], error) - // ListSessions lists all sessions the client should consider. + // PopSession deletes a session from the list of sessions, and returns it. // - // TODO: it would be better if we could alert a camera to poll for sessions - // i.e., with websockets (or streaming RPCs). - ListSessions(context.Context, *connect.Request[gen.ListSessionsRequest]) (*connect.Response[gen.ListSessionsResponse], error) - // CreateIceCandidate adds the provided candidate to the list of candidates. - CreateIceCandidate(context.Context, *connect.Request[gen.CreateIceCandidateRequest]) (*connect.Response[gen.IceCandidate], error) - // PopIceCandidate delete a candidate from the list of candidates and returns it. + // If there are no sessions, this blocks until one becomes available. + PopSession(context.Context, *connect.Request[gen.PopSessionRequest]) (*connect.Response[gen.Session], error) + // CreateIceMessage adds the provided message to the list of candidates. + CreateIceMessage(context.Context, *connect.Request[gen.CreateIceMessageRequest]) (*connect.Response[gen.IceMessage], error) + // PopIceCandidate delete a message from the list of messages and returns it. // - // If there are no candidates, this blocks until one becomes available. - PopIceCandidate(context.Context, *connect.Request[gen.PopIceCandidateRequest]) (*connect.Response[gen.IceCandidate], error) - CreateIceSessionDescription(context.Context, *connect.Request[gen.CreateIceSessionDescriptionRequest]) (*connect.Response[gen.IceSessionDescription], error) - PopIceSessionDescription(context.Context, *connect.Request[gen.PopIceSessionDescriptionRequest]) (*connect.Response[gen.IceSessionDescription], error) + // If there are no messages, this blocks until one becomes available. + PopIceMessage(context.Context, *connect.Request[gen.PopIceMessageRequest]) (*connect.Response[gen.IceMessage], error) } // NewSignalerServiceClient constructs a client for the signaler.SignalerService service. By @@ -113,34 +99,19 @@ func NewSignalerServiceClient(httpClient connect.HTTPClient, baseURL string, opt baseURL+SignalerServiceCreateSessionProcedure, opts..., ), - updateSession: connect.NewClient[gen.UpdateSessionRequest, gen.Session]( + popSession: connect.NewClient[gen.PopSessionRequest, gen.Session]( httpClient, - baseURL+SignalerServiceUpdateSessionProcedure, + baseURL+SignalerServicePopSessionProcedure, opts..., ), - listSessions: connect.NewClient[gen.ListSessionsRequest, gen.ListSessionsResponse]( + createIceMessage: connect.NewClient[gen.CreateIceMessageRequest, gen.IceMessage]( httpClient, - baseURL+SignalerServiceListSessionsProcedure, + baseURL+SignalerServiceCreateIceMessageProcedure, opts..., ), - createIceCandidate: connect.NewClient[gen.CreateIceCandidateRequest, gen.IceCandidate]( + popIceMessage: connect.NewClient[gen.PopIceMessageRequest, gen.IceMessage]( httpClient, - baseURL+SignalerServiceCreateIceCandidateProcedure, - opts..., - ), - popIceCandidate: connect.NewClient[gen.PopIceCandidateRequest, gen.IceCandidate]( - httpClient, - baseURL+SignalerServicePopIceCandidateProcedure, - opts..., - ), - createIceSessionDescription: connect.NewClient[gen.CreateIceSessionDescriptionRequest, gen.IceSessionDescription]( - httpClient, - baseURL+SignalerServiceCreateIceSessionDescriptionProcedure, - opts..., - ), - popIceSessionDescription: connect.NewClient[gen.PopIceSessionDescriptionRequest, gen.IceSessionDescription]( - httpClient, - baseURL+SignalerServicePopIceSessionDescriptionProcedure, + baseURL+SignalerServicePopIceMessageProcedure, opts..., ), } @@ -148,15 +119,12 @@ func NewSignalerServiceClient(httpClient connect.HTTPClient, baseURL string, opt // signalerServiceClient implements SignalerServiceClient. type signalerServiceClient struct { - createAuthToken *connect.Client[gen.CreateAuthTokenRequest, gen.AuthToken] - listCameras *connect.Client[gen.ListCamerasRequest, gen.ListCamerasResponse] - createSession *connect.Client[gen.CreateSessionRequest, gen.Session] - updateSession *connect.Client[gen.UpdateSessionRequest, gen.Session] - listSessions *connect.Client[gen.ListSessionsRequest, gen.ListSessionsResponse] - createIceCandidate *connect.Client[gen.CreateIceCandidateRequest, gen.IceCandidate] - popIceCandidate *connect.Client[gen.PopIceCandidateRequest, gen.IceCandidate] - createIceSessionDescription *connect.Client[gen.CreateIceSessionDescriptionRequest, gen.IceSessionDescription] - popIceSessionDescription *connect.Client[gen.PopIceSessionDescriptionRequest, gen.IceSessionDescription] + createAuthToken *connect.Client[gen.CreateAuthTokenRequest, gen.AuthToken] + listCameras *connect.Client[gen.ListCamerasRequest, gen.ListCamerasResponse] + createSession *connect.Client[gen.CreateSessionRequest, gen.Session] + popSession *connect.Client[gen.PopSessionRequest, gen.Session] + createIceMessage *connect.Client[gen.CreateIceMessageRequest, gen.IceMessage] + popIceMessage *connect.Client[gen.PopIceMessageRequest, gen.IceMessage] } // CreateAuthToken calls signaler.SignalerService.CreateAuthToken. @@ -174,34 +142,19 @@ func (c *signalerServiceClient) CreateSession(ctx context.Context, req *connect. return c.createSession.CallUnary(ctx, req) } -// UpdateSession calls signaler.SignalerService.UpdateSession. -func (c *signalerServiceClient) UpdateSession(ctx context.Context, req *connect.Request[gen.UpdateSessionRequest]) (*connect.Response[gen.Session], error) { - return c.updateSession.CallUnary(ctx, req) +// PopSession calls signaler.SignalerService.PopSession. +func (c *signalerServiceClient) PopSession(ctx context.Context, req *connect.Request[gen.PopSessionRequest]) (*connect.Response[gen.Session], error) { + return c.popSession.CallUnary(ctx, req) } -// ListSessions calls signaler.SignalerService.ListSessions. -func (c *signalerServiceClient) ListSessions(ctx context.Context, req *connect.Request[gen.ListSessionsRequest]) (*connect.Response[gen.ListSessionsResponse], error) { - return c.listSessions.CallUnary(ctx, req) +// CreateIceMessage calls signaler.SignalerService.CreateIceMessage. +func (c *signalerServiceClient) CreateIceMessage(ctx context.Context, req *connect.Request[gen.CreateIceMessageRequest]) (*connect.Response[gen.IceMessage], error) { + return c.createIceMessage.CallUnary(ctx, req) } -// CreateIceCandidate calls signaler.SignalerService.CreateIceCandidate. -func (c *signalerServiceClient) CreateIceCandidate(ctx context.Context, req *connect.Request[gen.CreateIceCandidateRequest]) (*connect.Response[gen.IceCandidate], error) { - return c.createIceCandidate.CallUnary(ctx, req) -} - -// PopIceCandidate calls signaler.SignalerService.PopIceCandidate. -func (c *signalerServiceClient) PopIceCandidate(ctx context.Context, req *connect.Request[gen.PopIceCandidateRequest]) (*connect.Response[gen.IceCandidate], error) { - return c.popIceCandidate.CallUnary(ctx, req) -} - -// CreateIceSessionDescription calls signaler.SignalerService.CreateIceSessionDescription. -func (c *signalerServiceClient) CreateIceSessionDescription(ctx context.Context, req *connect.Request[gen.CreateIceSessionDescriptionRequest]) (*connect.Response[gen.IceSessionDescription], error) { - return c.createIceSessionDescription.CallUnary(ctx, req) -} - -// PopIceSessionDescription calls signaler.SignalerService.PopIceSessionDescription. -func (c *signalerServiceClient) PopIceSessionDescription(ctx context.Context, req *connect.Request[gen.PopIceSessionDescriptionRequest]) (*connect.Response[gen.IceSessionDescription], error) { - return c.popIceSessionDescription.CallUnary(ctx, req) +// PopIceMessage calls signaler.SignalerService.PopIceMessage. +func (c *signalerServiceClient) PopIceMessage(ctx context.Context, req *connect.Request[gen.PopIceMessageRequest]) (*connect.Response[gen.IceMessage], error) { + return c.popIceMessage.CallUnary(ctx, req) } // SignalerServiceHandler is an implementation of the signaler.SignalerService service. @@ -213,21 +166,16 @@ type SignalerServiceHandler interface { // Optionally, wait_for_update can be set to prevent returning until the Camera has seen the // session request, populated candidates, and returned a session offer. CreateSession(context.Context, *connect.Request[gen.CreateSessionRequest]) (*connect.Response[gen.Session], error) - // UpdateSession updates the session - UpdateSession(context.Context, *connect.Request[gen.UpdateSessionRequest]) (*connect.Response[gen.Session], error) - // ListSessions lists all sessions the client should consider. + // PopSession deletes a session from the list of sessions, and returns it. // - // TODO: it would be better if we could alert a camera to poll for sessions - // i.e., with websockets (or streaming RPCs). - ListSessions(context.Context, *connect.Request[gen.ListSessionsRequest]) (*connect.Response[gen.ListSessionsResponse], error) - // CreateIceCandidate adds the provided candidate to the list of candidates. - CreateIceCandidate(context.Context, *connect.Request[gen.CreateIceCandidateRequest]) (*connect.Response[gen.IceCandidate], error) - // PopIceCandidate delete a candidate from the list of candidates and returns it. + // If there are no sessions, this blocks until one becomes available. + PopSession(context.Context, *connect.Request[gen.PopSessionRequest]) (*connect.Response[gen.Session], error) + // CreateIceMessage adds the provided message to the list of candidates. + CreateIceMessage(context.Context, *connect.Request[gen.CreateIceMessageRequest]) (*connect.Response[gen.IceMessage], error) + // PopIceCandidate delete a message from the list of messages and returns it. // - // If there are no candidates, this blocks until one becomes available. - PopIceCandidate(context.Context, *connect.Request[gen.PopIceCandidateRequest]) (*connect.Response[gen.IceCandidate], error) - CreateIceSessionDescription(context.Context, *connect.Request[gen.CreateIceSessionDescriptionRequest]) (*connect.Response[gen.IceSessionDescription], error) - PopIceSessionDescription(context.Context, *connect.Request[gen.PopIceSessionDescriptionRequest]) (*connect.Response[gen.IceSessionDescription], error) + // If there are no messages, this blocks until one becomes available. + PopIceMessage(context.Context, *connect.Request[gen.PopIceMessageRequest]) (*connect.Response[gen.IceMessage], error) } // NewSignalerServiceHandler builds an HTTP handler from the service implementation. It returns the @@ -251,34 +199,19 @@ func NewSignalerServiceHandler(svc SignalerServiceHandler, opts ...connect.Handl svc.CreateSession, opts..., ) - signalerServiceUpdateSessionHandler := connect.NewUnaryHandler( - SignalerServiceUpdateSessionProcedure, - svc.UpdateSession, + signalerServicePopSessionHandler := connect.NewUnaryHandler( + SignalerServicePopSessionProcedure, + svc.PopSession, opts..., ) - signalerServiceListSessionsHandler := connect.NewUnaryHandler( - SignalerServiceListSessionsProcedure, - svc.ListSessions, + signalerServiceCreateIceMessageHandler := connect.NewUnaryHandler( + SignalerServiceCreateIceMessageProcedure, + svc.CreateIceMessage, opts..., ) - signalerServiceCreateIceCandidateHandler := connect.NewUnaryHandler( - SignalerServiceCreateIceCandidateProcedure, - svc.CreateIceCandidate, - opts..., - ) - signalerServicePopIceCandidateHandler := connect.NewUnaryHandler( - SignalerServicePopIceCandidateProcedure, - svc.PopIceCandidate, - opts..., - ) - signalerServiceCreateIceSessionDescriptionHandler := connect.NewUnaryHandler( - SignalerServiceCreateIceSessionDescriptionProcedure, - svc.CreateIceSessionDescription, - opts..., - ) - signalerServicePopIceSessionDescriptionHandler := connect.NewUnaryHandler( - SignalerServicePopIceSessionDescriptionProcedure, - svc.PopIceSessionDescription, + signalerServicePopIceMessageHandler := connect.NewUnaryHandler( + SignalerServicePopIceMessageProcedure, + svc.PopIceMessage, opts..., ) return "/signaler.SignalerService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -289,18 +222,12 @@ func NewSignalerServiceHandler(svc SignalerServiceHandler, opts ...connect.Handl signalerServiceListCamerasHandler.ServeHTTP(w, r) case SignalerServiceCreateSessionProcedure: signalerServiceCreateSessionHandler.ServeHTTP(w, r) - case SignalerServiceUpdateSessionProcedure: - signalerServiceUpdateSessionHandler.ServeHTTP(w, r) - case SignalerServiceListSessionsProcedure: - signalerServiceListSessionsHandler.ServeHTTP(w, r) - case SignalerServiceCreateIceCandidateProcedure: - signalerServiceCreateIceCandidateHandler.ServeHTTP(w, r) - case SignalerServicePopIceCandidateProcedure: - signalerServicePopIceCandidateHandler.ServeHTTP(w, r) - case SignalerServiceCreateIceSessionDescriptionProcedure: - signalerServiceCreateIceSessionDescriptionHandler.ServeHTTP(w, r) - case SignalerServicePopIceSessionDescriptionProcedure: - signalerServicePopIceSessionDescriptionHandler.ServeHTTP(w, r) + case SignalerServicePopSessionProcedure: + signalerServicePopSessionHandler.ServeHTTP(w, r) + case SignalerServiceCreateIceMessageProcedure: + signalerServiceCreateIceMessageHandler.ServeHTTP(w, r) + case SignalerServicePopIceMessageProcedure: + signalerServicePopIceMessageHandler.ServeHTTP(w, r) default: http.NotFound(w, r) } @@ -322,26 +249,14 @@ func (UnimplementedSignalerServiceHandler) CreateSession(context.Context, *conne return nil, connect.NewError(connect.CodeUnimplemented, errors.New("signaler.SignalerService.CreateSession is not implemented")) } -func (UnimplementedSignalerServiceHandler) UpdateSession(context.Context, *connect.Request[gen.UpdateSessionRequest]) (*connect.Response[gen.Session], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("signaler.SignalerService.UpdateSession is not implemented")) +func (UnimplementedSignalerServiceHandler) PopSession(context.Context, *connect.Request[gen.PopSessionRequest]) (*connect.Response[gen.Session], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("signaler.SignalerService.PopSession is not implemented")) } -func (UnimplementedSignalerServiceHandler) ListSessions(context.Context, *connect.Request[gen.ListSessionsRequest]) (*connect.Response[gen.ListSessionsResponse], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("signaler.SignalerService.ListSessions is not implemented")) +func (UnimplementedSignalerServiceHandler) CreateIceMessage(context.Context, *connect.Request[gen.CreateIceMessageRequest]) (*connect.Response[gen.IceMessage], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("signaler.SignalerService.CreateIceMessage is not implemented")) } -func (UnimplementedSignalerServiceHandler) CreateIceCandidate(context.Context, *connect.Request[gen.CreateIceCandidateRequest]) (*connect.Response[gen.IceCandidate], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("signaler.SignalerService.CreateIceCandidate is not implemented")) -} - -func (UnimplementedSignalerServiceHandler) PopIceCandidate(context.Context, *connect.Request[gen.PopIceCandidateRequest]) (*connect.Response[gen.IceCandidate], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("signaler.SignalerService.PopIceCandidate is not implemented")) -} - -func (UnimplementedSignalerServiceHandler) CreateIceSessionDescription(context.Context, *connect.Request[gen.CreateIceSessionDescriptionRequest]) (*connect.Response[gen.IceSessionDescription], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("signaler.SignalerService.CreateIceSessionDescription is not implemented")) -} - -func (UnimplementedSignalerServiceHandler) PopIceSessionDescription(context.Context, *connect.Request[gen.PopIceSessionDescriptionRequest]) (*connect.Response[gen.IceSessionDescription], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("signaler.SignalerService.PopIceSessionDescription is not implemented")) +func (UnimplementedSignalerServiceHandler) PopIceMessage(context.Context, *connect.Request[gen.PopIceMessageRequest]) (*connect.Response[gen.IceMessage], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("signaler.SignalerService.PopIceMessage is not implemented")) } diff --git a/gen/signaler_service.pb.dart b/gen/signaler_service.pb.dart index 287acca..0b5ab7f 100644 --- a/gen/signaler_service.pb.dart +++ b/gen/signaler_service.pb.dart @@ -342,6 +342,58 @@ class CreateSessionRequest extends $pb.GeneratedMessage { void clearWaitForUpdate() => clearField(2); } +class PopSessionRequest extends $pb.GeneratedMessage { + factory PopSessionRequest({ + Session? session, + }) { + final $result = create(); + if (session != null) { + $result.session = session; + } + return $result; + } + PopSessionRequest._() : super(); + factory PopSessionRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory PopSessionRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PopSessionRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'signaler'), createEmptyInstance: create) + ..aOM(1, _omitFieldNames ? '' : 'session', subBuilder: Session.create) + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + PopSessionRequest clone() => PopSessionRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + PopSessionRequest copyWith(void Function(PopSessionRequest) updates) => super.copyWith((message) => updates(message as PopSessionRequest)) as PopSessionRequest; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static PopSessionRequest create() => PopSessionRequest._(); + PopSessionRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static PopSessionRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static PopSessionRequest? _defaultInstance; + + @$pb.TagNumber(1) + Session get session => $_getN(0); + @$pb.TagNumber(1) + set session(Session v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasSession() => $_has(0); + @$pb.TagNumber(1) + void clearSession() => clearField(1); + @$pb.TagNumber(1) + Session ensureSession() => $_ensure(0); +} + class UpdateSessionRequest extends $pb.GeneratedMessage { factory UpdateSessionRequest({ Session? session, @@ -487,27 +539,27 @@ class ListSessionsResponse extends $pb.GeneratedMessage { $core.List get sessions => $_getList(0); } -class CreateIceCandidateRequest extends $pb.GeneratedMessage { - factory CreateIceCandidateRequest({ +class CreateIceMessageRequest extends $pb.GeneratedMessage { + factory CreateIceMessageRequest({ Session_Identifier? sessionIdentifier, - IceCandidate? candidate, + IceMessage? iceMessage, }) { final $result = create(); if (sessionIdentifier != null) { $result.sessionIdentifier = sessionIdentifier; } - if (candidate != null) { - $result.candidate = candidate; + if (iceMessage != null) { + $result.iceMessage = iceMessage; } return $result; } - CreateIceCandidateRequest._() : super(); - factory CreateIceCandidateRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory CreateIceCandidateRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + CreateIceMessageRequest._() : super(); + factory CreateIceMessageRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory CreateIceMessageRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'CreateIceCandidateRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'signaler'), createEmptyInstance: create) + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'CreateIceMessageRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'signaler'), createEmptyInstance: create) ..aOM(1, _omitFieldNames ? '' : 'sessionIdentifier', subBuilder: Session_Identifier.create) - ..aOM(2, _omitFieldNames ? '' : 'candidate', subBuilder: IceCandidate.create) + ..aOM(2, _omitFieldNames ? '' : 'iceMessage', subBuilder: IceMessage.create) ..hasRequiredFields = false ; @@ -515,22 +567,22 @@ class CreateIceCandidateRequest extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') - CreateIceCandidateRequest clone() => CreateIceCandidateRequest()..mergeFromMessage(this); + CreateIceMessageRequest clone() => CreateIceMessageRequest()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - CreateIceCandidateRequest copyWith(void Function(CreateIceCandidateRequest) updates) => super.copyWith((message) => updates(message as CreateIceCandidateRequest)) as CreateIceCandidateRequest; + CreateIceMessageRequest copyWith(void Function(CreateIceMessageRequest) updates) => super.copyWith((message) => updates(message as CreateIceMessageRequest)) as CreateIceMessageRequest; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') - static CreateIceCandidateRequest create() => CreateIceCandidateRequest._(); - CreateIceCandidateRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static CreateIceMessageRequest create() => CreateIceMessageRequest._(); + CreateIceMessageRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static CreateIceCandidateRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static CreateIceCandidateRequest? _defaultInstance; + static CreateIceMessageRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static CreateIceMessageRequest? _defaultInstance; @$pb.TagNumber(1) Session_Identifier get sessionIdentifier => $_getN(0); @@ -544,19 +596,19 @@ class CreateIceCandidateRequest extends $pb.GeneratedMessage { Session_Identifier ensureSessionIdentifier() => $_ensure(0); @$pb.TagNumber(2) - IceCandidate get candidate => $_getN(1); + IceMessage get iceMessage => $_getN(1); @$pb.TagNumber(2) - set candidate(IceCandidate v) { setField(2, v); } + set iceMessage(IceMessage v) { setField(2, v); } @$pb.TagNumber(2) - $core.bool hasCandidate() => $_has(1); + $core.bool hasIceMessage() => $_has(1); @$pb.TagNumber(2) - void clearCandidate() => clearField(2); + void clearIceMessage() => clearField(2); @$pb.TagNumber(2) - IceCandidate ensureCandidate() => $_ensure(1); + IceMessage ensureIceMessage() => $_ensure(1); } -class PopIceCandidateRequest extends $pb.GeneratedMessage { - factory PopIceCandidateRequest({ +class PopIceMessageRequest extends $pb.GeneratedMessage { + factory PopIceMessageRequest({ Session_Identifier? sessionIdentifier, }) { final $result = create(); @@ -565,11 +617,11 @@ class PopIceCandidateRequest extends $pb.GeneratedMessage { } return $result; } - PopIceCandidateRequest._() : super(); - factory PopIceCandidateRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory PopIceCandidateRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + PopIceMessageRequest._() : super(); + factory PopIceMessageRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory PopIceMessageRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PopIceCandidateRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'signaler'), createEmptyInstance: create) + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PopIceMessageRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'signaler'), createEmptyInstance: create) ..aOM(1, _omitFieldNames ? '' : 'sessionIdentifier', subBuilder: Session_Identifier.create) ..hasRequiredFields = false ; @@ -578,142 +630,22 @@ class PopIceCandidateRequest extends $pb.GeneratedMessage { 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') - PopIceCandidateRequest clone() => PopIceCandidateRequest()..mergeFromMessage(this); + PopIceMessageRequest clone() => PopIceMessageRequest()..mergeFromMessage(this); @$core.Deprecated( 'Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - PopIceCandidateRequest copyWith(void Function(PopIceCandidateRequest) updates) => super.copyWith((message) => updates(message as PopIceCandidateRequest)) as PopIceCandidateRequest; + PopIceMessageRequest copyWith(void Function(PopIceMessageRequest) updates) => super.copyWith((message) => updates(message as PopIceMessageRequest)) as PopIceMessageRequest; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') - static PopIceCandidateRequest create() => PopIceCandidateRequest._(); - PopIceCandidateRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static PopIceMessageRequest create() => PopIceMessageRequest._(); + PopIceMessageRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static PopIceCandidateRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static PopIceCandidateRequest? _defaultInstance; - - @$pb.TagNumber(1) - Session_Identifier get sessionIdentifier => $_getN(0); - @$pb.TagNumber(1) - set sessionIdentifier(Session_Identifier v) { setField(1, v); } - @$pb.TagNumber(1) - $core.bool hasSessionIdentifier() => $_has(0); - @$pb.TagNumber(1) - void clearSessionIdentifier() => clearField(1); - @$pb.TagNumber(1) - Session_Identifier ensureSessionIdentifier() => $_ensure(0); -} - -class CreateIceSessionDescriptionRequest extends $pb.GeneratedMessage { - factory CreateIceSessionDescriptionRequest({ - Session_Identifier? sessionIdentifier, - IceSessionDescription? description, - }) { - final $result = create(); - if (sessionIdentifier != null) { - $result.sessionIdentifier = sessionIdentifier; - } - if (description != null) { - $result.description = description; - } - return $result; - } - CreateIceSessionDescriptionRequest._() : super(); - factory CreateIceSessionDescriptionRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory CreateIceSessionDescriptionRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'CreateIceSessionDescriptionRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'signaler'), createEmptyInstance: create) - ..aOM(1, _omitFieldNames ? '' : 'sessionIdentifier', subBuilder: Session_Identifier.create) - ..aOM(2, _omitFieldNames ? '' : 'description', subBuilder: IceSessionDescription.create) - ..hasRequiredFields = false - ; - - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - CreateIceSessionDescriptionRequest clone() => CreateIceSessionDescriptionRequest()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - CreateIceSessionDescriptionRequest copyWith(void Function(CreateIceSessionDescriptionRequest) updates) => super.copyWith((message) => updates(message as CreateIceSessionDescriptionRequest)) as CreateIceSessionDescriptionRequest; - - $pb.BuilderInfo get info_ => _i; - - @$core.pragma('dart2js:noInline') - static CreateIceSessionDescriptionRequest create() => CreateIceSessionDescriptionRequest._(); - CreateIceSessionDescriptionRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static CreateIceSessionDescriptionRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static CreateIceSessionDescriptionRequest? _defaultInstance; - - @$pb.TagNumber(1) - Session_Identifier get sessionIdentifier => $_getN(0); - @$pb.TagNumber(1) - set sessionIdentifier(Session_Identifier v) { setField(1, v); } - @$pb.TagNumber(1) - $core.bool hasSessionIdentifier() => $_has(0); - @$pb.TagNumber(1) - void clearSessionIdentifier() => clearField(1); - @$pb.TagNumber(1) - Session_Identifier ensureSessionIdentifier() => $_ensure(0); - - @$pb.TagNumber(2) - IceSessionDescription get description => $_getN(1); - @$pb.TagNumber(2) - set description(IceSessionDescription v) { setField(2, v); } - @$pb.TagNumber(2) - $core.bool hasDescription() => $_has(1); - @$pb.TagNumber(2) - void clearDescription() => clearField(2); - @$pb.TagNumber(2) - IceSessionDescription ensureDescription() => $_ensure(1); -} - -class PopIceSessionDescriptionRequest extends $pb.GeneratedMessage { - factory PopIceSessionDescriptionRequest({ - Session_Identifier? sessionIdentifier, - }) { - final $result = create(); - if (sessionIdentifier != null) { - $result.sessionIdentifier = sessionIdentifier; - } - return $result; - } - PopIceSessionDescriptionRequest._() : super(); - factory PopIceSessionDescriptionRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory PopIceSessionDescriptionRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PopIceSessionDescriptionRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'signaler'), createEmptyInstance: create) - ..aOM(1, _omitFieldNames ? '' : 'sessionIdentifier', subBuilder: Session_Identifier.create) - ..hasRequiredFields = false - ; - - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - PopIceSessionDescriptionRequest clone() => PopIceSessionDescriptionRequest()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - PopIceSessionDescriptionRequest copyWith(void Function(PopIceSessionDescriptionRequest) updates) => super.copyWith((message) => updates(message as PopIceSessionDescriptionRequest)) as PopIceSessionDescriptionRequest; - - $pb.BuilderInfo get info_ => _i; - - @$core.pragma('dart2js:noInline') - static PopIceSessionDescriptionRequest create() => PopIceSessionDescriptionRequest._(); - PopIceSessionDescriptionRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static PopIceSessionDescriptionRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static PopIceSessionDescriptionRequest? _defaultInstance; + static PopIceMessageRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static PopIceMessageRequest? _defaultInstance; @$pb.TagNumber(1) Session_Identifier get sessionIdentifier => $_getN(0); @@ -829,6 +761,89 @@ class Camera extends $pb.GeneratedMessage { Camera_Identifier ensureIdentifier() => $_ensure(0); } +enum IceMessage_Type { + candidate, + session, + notSet +} + +class IceMessage extends $pb.GeneratedMessage { + factory IceMessage({ + IceCandidate? candidate, + IceSessionDescription? session, + }) { + final $result = create(); + if (candidate != null) { + $result.candidate = candidate; + } + if (session != null) { + $result.session = session; + } + return $result; + } + IceMessage._() : super(); + factory IceMessage.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory IceMessage.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static const $core.Map<$core.int, IceMessage_Type> _IceMessage_TypeByTag = { + 1 : IceMessage_Type.candidate, + 2 : IceMessage_Type.session, + 0 : IceMessage_Type.notSet + }; + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'IceMessage', package: const $pb.PackageName(_omitMessageNames ? '' : 'signaler'), createEmptyInstance: create) + ..oo(0, [1, 2]) + ..aOM(1, _omitFieldNames ? '' : 'candidate', subBuilder: IceCandidate.create) + ..aOM(2, _omitFieldNames ? '' : 'session', subBuilder: IceSessionDescription.create) + ..hasRequiredFields = false + ; + + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + IceMessage clone() => IceMessage()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + IceMessage copyWith(void Function(IceMessage) updates) => super.copyWith((message) => updates(message as IceMessage)) as IceMessage; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static IceMessage create() => IceMessage._(); + IceMessage createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static IceMessage getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static IceMessage? _defaultInstance; + + IceMessage_Type whichType() => _IceMessage_TypeByTag[$_whichOneof(0)]!; + void clearType() => clearField($_whichOneof(0)); + + @$pb.TagNumber(1) + IceCandidate get candidate => $_getN(0); + @$pb.TagNumber(1) + set candidate(IceCandidate v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasCandidate() => $_has(0); + @$pb.TagNumber(1) + void clearCandidate() => clearField(1); + @$pb.TagNumber(1) + IceCandidate ensureCandidate() => $_ensure(0); + + @$pb.TagNumber(2) + IceSessionDescription get session => $_getN(1); + @$pb.TagNumber(2) + set session(IceSessionDescription v) { setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasSession() => $_has(1); + @$pb.TagNumber(2) + void clearSession() => clearField(2); + @$pb.TagNumber(2) + IceSessionDescription ensureSession() => $_ensure(1); +} + class IceCandidate extends $pb.GeneratedMessage { factory IceCandidate({ $core.String? candidate, @@ -1041,10 +1056,6 @@ class Session extends $pb.GeneratedMessage { factory Session({ Session_Identifier? id, Camera_Identifier? camera, - $core.Iterable? clientIceCandidates, - $core.Iterable? cameraIceCandidates, - IceSessionDescription? cameraOffer, - IceSessionDescription? clientAnswer, }) { final $result = create(); if (id != null) { @@ -1053,18 +1064,6 @@ class Session extends $pb.GeneratedMessage { if (camera != null) { $result.camera = camera; } - if (clientIceCandidates != null) { - $result.clientIceCandidates.addAll(clientIceCandidates); - } - if (cameraIceCandidates != null) { - $result.cameraIceCandidates.addAll(cameraIceCandidates); - } - if (cameraOffer != null) { - $result.cameraOffer = cameraOffer; - } - if (clientAnswer != null) { - $result.clientAnswer = clientAnswer; - } return $result; } Session._() : super(); @@ -1074,10 +1073,6 @@ class Session extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Session', package: const $pb.PackageName(_omitMessageNames ? '' : 'signaler'), createEmptyInstance: create) ..aOM(1, _omitFieldNames ? '' : 'id', subBuilder: Session_Identifier.create) ..aOM(2, _omitFieldNames ? '' : 'camera', subBuilder: Camera_Identifier.create) - ..pc(3, _omitFieldNames ? '' : 'clientIceCandidates', $pb.PbFieldType.PM, subBuilder: IceCandidate.create) - ..pc(4, _omitFieldNames ? '' : 'cameraIceCandidates', $pb.PbFieldType.PM, subBuilder: IceCandidate.create) - ..aOM(5, _omitFieldNames ? '' : 'cameraOffer', subBuilder: IceSessionDescription.create) - ..aOM(6, _omitFieldNames ? '' : 'clientAnswer', subBuilder: IceSessionDescription.create) ..hasRequiredFields = false ; @@ -1123,34 +1118,6 @@ class Session extends $pb.GeneratedMessage { void clearCamera() => clearField(2); @$pb.TagNumber(2) Camera_Identifier ensureCamera() => $_ensure(1); - - @$pb.TagNumber(3) - $core.List get clientIceCandidates => $_getList(2); - - @$pb.TagNumber(4) - $core.List get cameraIceCandidates => $_getList(3); - - @$pb.TagNumber(5) - IceSessionDescription get cameraOffer => $_getN(4); - @$pb.TagNumber(5) - set cameraOffer(IceSessionDescription v) { setField(5, v); } - @$pb.TagNumber(5) - $core.bool hasCameraOffer() => $_has(4); - @$pb.TagNumber(5) - void clearCameraOffer() => clearField(5); - @$pb.TagNumber(5) - IceSessionDescription ensureCameraOffer() => $_ensure(4); - - @$pb.TagNumber(6) - IceSessionDescription get clientAnswer => $_getN(5); - @$pb.TagNumber(6) - set clientAnswer(IceSessionDescription v) { setField(6, v); } - @$pb.TagNumber(6) - $core.bool hasClientAnswer() => $_has(5); - @$pb.TagNumber(6) - void clearClientAnswer() => clearField(6); - @$pb.TagNumber(6) - IceSessionDescription ensureClientAnswer() => $_ensure(5); } class AuthToken extends $pb.GeneratedMessage { @@ -1216,23 +1183,14 @@ class SignalerServiceApi { $async.Future createSession($pb.ClientContext? ctx, CreateSessionRequest request) => _client.invoke(ctx, 'SignalerService', 'CreateSession', request, Session()) ; - $async.Future updateSession($pb.ClientContext? ctx, UpdateSessionRequest request) => - _client.invoke(ctx, 'SignalerService', 'UpdateSession', request, Session()) + $async.Future popSession($pb.ClientContext? ctx, PopSessionRequest request) => + _client.invoke(ctx, 'SignalerService', 'PopSession', request, Session()) ; - $async.Future listSessions($pb.ClientContext? ctx, ListSessionsRequest request) => - _client.invoke(ctx, 'SignalerService', 'ListSessions', request, ListSessionsResponse()) + $async.Future createIceMessage($pb.ClientContext? ctx, CreateIceMessageRequest request) => + _client.invoke(ctx, 'SignalerService', 'CreateIceMessage', request, IceMessage()) ; - $async.Future createIceCandidate($pb.ClientContext? ctx, CreateIceCandidateRequest request) => - _client.invoke(ctx, 'SignalerService', 'CreateIceCandidate', request, IceCandidate()) - ; - $async.Future popIceCandidate($pb.ClientContext? ctx, PopIceCandidateRequest request) => - _client.invoke(ctx, 'SignalerService', 'PopIceCandidate', request, IceCandidate()) - ; - $async.Future createIceSessionDescription($pb.ClientContext? ctx, CreateIceSessionDescriptionRequest request) => - _client.invoke(ctx, 'SignalerService', 'CreateIceSessionDescription', request, IceSessionDescription()) - ; - $async.Future popIceSessionDescription($pb.ClientContext? ctx, PopIceSessionDescriptionRequest request) => - _client.invoke(ctx, 'SignalerService', 'PopIceSessionDescription', request, IceSessionDescription()) + $async.Future popIceMessage($pb.ClientContext? ctx, PopIceMessageRequest request) => + _client.invoke(ctx, 'SignalerService', 'PopIceMessage', request, IceMessage()) ; } diff --git a/gen/signaler_service.pb.go b/gen/signaler_service.pb.go index 0b90513..ee78ba0 100644 --- a/gen/signaler_service.pb.go +++ b/gen/signaler_service.pb.go @@ -253,6 +253,53 @@ func (x *CreateSessionRequest) GetWaitForUpdate() bool { return false } +type PopSessionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Session *Session `protobuf:"bytes,1,opt,name=session,proto3" json:"session,omitempty"` +} + +func (x *PopSessionRequest) Reset() { + *x = PopSessionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_signaler_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PopSessionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PopSessionRequest) ProtoMessage() {} + +func (x *PopSessionRequest) ProtoReflect() protoreflect.Message { + mi := &file_signaler_service_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 PopSessionRequest.ProtoReflect.Descriptor instead. +func (*PopSessionRequest) Descriptor() ([]byte, []int) { + return file_signaler_service_proto_rawDescGZIP(), []int{4} +} + +func (x *PopSessionRequest) GetSession() *Session { + if x != nil { + return x.Session + } + return nil +} + type UpdateSessionRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -268,7 +315,7 @@ type UpdateSessionRequest struct { func (x *UpdateSessionRequest) Reset() { *x = UpdateSessionRequest{} if protoimpl.UnsafeEnabled { - mi := &file_signaler_service_proto_msgTypes[4] + mi := &file_signaler_service_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -281,7 +328,7 @@ func (x *UpdateSessionRequest) String() string { func (*UpdateSessionRequest) ProtoMessage() {} func (x *UpdateSessionRequest) ProtoReflect() protoreflect.Message { - mi := &file_signaler_service_proto_msgTypes[4] + mi := &file_signaler_service_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -294,7 +341,7 @@ func (x *UpdateSessionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateSessionRequest.ProtoReflect.Descriptor instead. func (*UpdateSessionRequest) Descriptor() ([]byte, []int) { - return file_signaler_service_proto_rawDescGZIP(), []int{4} + return file_signaler_service_proto_rawDescGZIP(), []int{5} } func (x *UpdateSessionRequest) GetSession() *Session { @@ -320,7 +367,7 @@ type ListSessionsRequest struct { func (x *ListSessionsRequest) Reset() { *x = ListSessionsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_signaler_service_proto_msgTypes[5] + mi := &file_signaler_service_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -333,7 +380,7 @@ func (x *ListSessionsRequest) String() string { func (*ListSessionsRequest) ProtoMessage() {} func (x *ListSessionsRequest) ProtoReflect() protoreflect.Message { - mi := &file_signaler_service_proto_msgTypes[5] + mi := &file_signaler_service_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -346,7 +393,7 @@ func (x *ListSessionsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListSessionsRequest.ProtoReflect.Descriptor instead. func (*ListSessionsRequest) Descriptor() ([]byte, []int) { - return file_signaler_service_proto_rawDescGZIP(), []int{5} + return file_signaler_service_proto_rawDescGZIP(), []int{6} } type ListSessionsResponse struct { @@ -360,7 +407,7 @@ type ListSessionsResponse struct { func (x *ListSessionsResponse) Reset() { *x = ListSessionsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_signaler_service_proto_msgTypes[6] + mi := &file_signaler_service_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -373,7 +420,7 @@ func (x *ListSessionsResponse) String() string { func (*ListSessionsResponse) ProtoMessage() {} func (x *ListSessionsResponse) ProtoReflect() protoreflect.Message { - mi := &file_signaler_service_proto_msgTypes[6] + mi := &file_signaler_service_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -386,7 +433,7 @@ func (x *ListSessionsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListSessionsResponse.ProtoReflect.Descriptor instead. func (*ListSessionsResponse) Descriptor() ([]byte, []int) { - return file_signaler_service_proto_rawDescGZIP(), []int{6} + return file_signaler_service_proto_rawDescGZIP(), []int{7} } func (x *ListSessionsResponse) GetSessions() []*Session { @@ -396,71 +443,17 @@ func (x *ListSessionsResponse) GetSessions() []*Session { return nil } -type CreateIceCandidateRequest struct { +type CreateIceMessageRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields SessionIdentifier *Session_Identifier `protobuf:"bytes,1,opt,name=session_identifier,json=sessionIdentifier,proto3" json:"session_identifier,omitempty"` - Candidate *IceCandidate `protobuf:"bytes,2,opt,name=candidate,proto3" json:"candidate,omitempty"` + IceMessage *IceMessage `protobuf:"bytes,2,opt,name=ice_message,json=iceMessage,proto3" json:"ice_message,omitempty"` } -func (x *CreateIceCandidateRequest) Reset() { - *x = CreateIceCandidateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_signaler_service_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateIceCandidateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateIceCandidateRequest) ProtoMessage() {} - -func (x *CreateIceCandidateRequest) ProtoReflect() protoreflect.Message { - mi := &file_signaler_service_proto_msgTypes[7] - 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 CreateIceCandidateRequest.ProtoReflect.Descriptor instead. -func (*CreateIceCandidateRequest) Descriptor() ([]byte, []int) { - return file_signaler_service_proto_rawDescGZIP(), []int{7} -} - -func (x *CreateIceCandidateRequest) GetSessionIdentifier() *Session_Identifier { - if x != nil { - return x.SessionIdentifier - } - return nil -} - -func (x *CreateIceCandidateRequest) GetCandidate() *IceCandidate { - if x != nil { - return x.Candidate - } - return nil -} - -type PopIceCandidateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SessionIdentifier *Session_Identifier `protobuf:"bytes,1,opt,name=session_identifier,json=sessionIdentifier,proto3" json:"session_identifier,omitempty"` -} - -func (x *PopIceCandidateRequest) Reset() { - *x = PopIceCandidateRequest{} +func (x *CreateIceMessageRequest) Reset() { + *x = CreateIceMessageRequest{} if protoimpl.UnsafeEnabled { mi := &file_signaler_service_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -468,13 +461,13 @@ func (x *PopIceCandidateRequest) Reset() { } } -func (x *PopIceCandidateRequest) String() string { +func (x *CreateIceMessageRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PopIceCandidateRequest) ProtoMessage() {} +func (*CreateIceMessageRequest) ProtoMessage() {} -func (x *PopIceCandidateRequest) ProtoReflect() protoreflect.Message { +func (x *CreateIceMessageRequest) ProtoReflect() protoreflect.Message { mi := &file_signaler_service_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -486,29 +479,35 @@ func (x *PopIceCandidateRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PopIceCandidateRequest.ProtoReflect.Descriptor instead. -func (*PopIceCandidateRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use CreateIceMessageRequest.ProtoReflect.Descriptor instead. +func (*CreateIceMessageRequest) Descriptor() ([]byte, []int) { return file_signaler_service_proto_rawDescGZIP(), []int{8} } -func (x *PopIceCandidateRequest) GetSessionIdentifier() *Session_Identifier { +func (x *CreateIceMessageRequest) GetSessionIdentifier() *Session_Identifier { if x != nil { return x.SessionIdentifier } return nil } -type CreateIceSessionDescriptionRequest struct { +func (x *CreateIceMessageRequest) GetIceMessage() *IceMessage { + if x != nil { + return x.IceMessage + } + return nil +} + +type PopIceMessageRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - SessionIdentifier *Session_Identifier `protobuf:"bytes,1,opt,name=session_identifier,json=sessionIdentifier,proto3" json:"session_identifier,omitempty"` - Description *IceSessionDescription `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + SessionIdentifier *Session_Identifier `protobuf:"bytes,1,opt,name=session_identifier,json=sessionIdentifier,proto3" json:"session_identifier,omitempty"` } -func (x *CreateIceSessionDescriptionRequest) Reset() { - *x = CreateIceSessionDescriptionRequest{} +func (x *PopIceMessageRequest) Reset() { + *x = PopIceMessageRequest{} if protoimpl.UnsafeEnabled { mi := &file_signaler_service_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -516,13 +515,13 @@ func (x *CreateIceSessionDescriptionRequest) Reset() { } } -func (x *CreateIceSessionDescriptionRequest) String() string { +func (x *PopIceMessageRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateIceSessionDescriptionRequest) ProtoMessage() {} +func (*PopIceMessageRequest) ProtoMessage() {} -func (x *CreateIceSessionDescriptionRequest) ProtoReflect() protoreflect.Message { +func (x *PopIceMessageRequest) ProtoReflect() protoreflect.Message { mi := &file_signaler_service_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -534,66 +533,12 @@ func (x *CreateIceSessionDescriptionRequest) ProtoReflect() protoreflect.Message return mi.MessageOf(x) } -// Deprecated: Use CreateIceSessionDescriptionRequest.ProtoReflect.Descriptor instead. -func (*CreateIceSessionDescriptionRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use PopIceMessageRequest.ProtoReflect.Descriptor instead. +func (*PopIceMessageRequest) Descriptor() ([]byte, []int) { return file_signaler_service_proto_rawDescGZIP(), []int{9} } -func (x *CreateIceSessionDescriptionRequest) GetSessionIdentifier() *Session_Identifier { - if x != nil { - return x.SessionIdentifier - } - return nil -} - -func (x *CreateIceSessionDescriptionRequest) GetDescription() *IceSessionDescription { - if x != nil { - return x.Description - } - return nil -} - -type PopIceSessionDescriptionRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SessionIdentifier *Session_Identifier `protobuf:"bytes,1,opt,name=session_identifier,json=sessionIdentifier,proto3" json:"session_identifier,omitempty"` -} - -func (x *PopIceSessionDescriptionRequest) Reset() { - *x = PopIceSessionDescriptionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_signaler_service_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PopIceSessionDescriptionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PopIceSessionDescriptionRequest) ProtoMessage() {} - -func (x *PopIceSessionDescriptionRequest) ProtoReflect() protoreflect.Message { - mi := &file_signaler_service_proto_msgTypes[10] - 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 PopIceSessionDescriptionRequest.ProtoReflect.Descriptor instead. -func (*PopIceSessionDescriptionRequest) Descriptor() ([]byte, []int) { - return file_signaler_service_proto_rawDescGZIP(), []int{10} -} - -func (x *PopIceSessionDescriptionRequest) GetSessionIdentifier() *Session_Identifier { +func (x *PopIceMessageRequest) GetSessionIdentifier() *Session_Identifier { if x != nil { return x.SessionIdentifier } @@ -611,7 +556,7 @@ type Camera struct { func (x *Camera) Reset() { *x = Camera{} if protoimpl.UnsafeEnabled { - mi := &file_signaler_service_proto_msgTypes[11] + mi := &file_signaler_service_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -624,7 +569,7 @@ func (x *Camera) String() string { func (*Camera) ProtoMessage() {} func (x *Camera) ProtoReflect() protoreflect.Message { - mi := &file_signaler_service_proto_msgTypes[11] + mi := &file_signaler_service_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -637,7 +582,7 @@ func (x *Camera) ProtoReflect() protoreflect.Message { // Deprecated: Use Camera.ProtoReflect.Descriptor instead. func (*Camera) Descriptor() ([]byte, []int) { - return file_signaler_service_proto_rawDescGZIP(), []int{11} + return file_signaler_service_proto_rawDescGZIP(), []int{10} } func (x *Camera) GetIdentifier() *Camera_Identifier { @@ -647,6 +592,87 @@ func (x *Camera) GetIdentifier() *Camera_Identifier { return nil } +type IceMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Type: + // + // *IceMessage_Candidate + // *IceMessage_Session + Type isIceMessage_Type `protobuf_oneof:"type"` +} + +func (x *IceMessage) Reset() { + *x = IceMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_signaler_service_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IceMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IceMessage) ProtoMessage() {} + +func (x *IceMessage) ProtoReflect() protoreflect.Message { + mi := &file_signaler_service_proto_msgTypes[11] + 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 IceMessage.ProtoReflect.Descriptor instead. +func (*IceMessage) Descriptor() ([]byte, []int) { + return file_signaler_service_proto_rawDescGZIP(), []int{11} +} + +func (m *IceMessage) GetType() isIceMessage_Type { + if m != nil { + return m.Type + } + return nil +} + +func (x *IceMessage) GetCandidate() *IceCandidate { + if x, ok := x.GetType().(*IceMessage_Candidate); ok { + return x.Candidate + } + return nil +} + +func (x *IceMessage) GetSession() *IceSessionDescription { + if x, ok := x.GetType().(*IceMessage_Session); ok { + return x.Session + } + return nil +} + +type isIceMessage_Type interface { + isIceMessage_Type() +} + +type IceMessage_Candidate struct { + Candidate *IceCandidate `protobuf:"bytes,1,opt,name=candidate,proto3,oneof"` +} + +type IceMessage_Session struct { + Session *IceSessionDescription `protobuf:"bytes,2,opt,name=session,proto3,oneof"` +} + +func (*IceMessage_Candidate) isIceMessage_Type() {} + +func (*IceMessage_Session) isIceMessage_Type() {} + type IceCandidate struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -780,12 +806,8 @@ type Session struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id *Session_Identifier `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Camera *Camera_Identifier `protobuf:"bytes,2,opt,name=camera,proto3" json:"camera,omitempty"` - ClientIceCandidates []*IceCandidate `protobuf:"bytes,3,rep,name=client_ice_candidates,json=clientIceCandidates,proto3" json:"client_ice_candidates,omitempty"` - CameraIceCandidates []*IceCandidate `protobuf:"bytes,4,rep,name=camera_ice_candidates,json=cameraIceCandidates,proto3" json:"camera_ice_candidates,omitempty"` - CameraOffer *IceSessionDescription `protobuf:"bytes,5,opt,name=camera_offer,json=cameraOffer,proto3" json:"camera_offer,omitempty"` - ClientAnswer *IceSessionDescription `protobuf:"bytes,6,opt,name=client_answer,json=clientAnswer,proto3" json:"client_answer,omitempty"` + Id *Session_Identifier `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Camera *Camera_Identifier `protobuf:"bytes,2,opt,name=camera,proto3" json:"camera,omitempty"` } func (x *Session) Reset() { @@ -834,34 +856,6 @@ func (x *Session) GetCamera() *Camera_Identifier { return nil } -func (x *Session) GetClientIceCandidates() []*IceCandidate { - if x != nil { - return x.ClientIceCandidates - } - return nil -} - -func (x *Session) GetCameraIceCandidates() []*IceCandidate { - if x != nil { - return x.CameraIceCandidates - } - return nil -} - -func (x *Session) GetCameraOffer() *IceSessionDescription { - if x != nil { - return x.CameraOffer - } - return nil -} - -func (x *Session) GetClientAnswer() *IceSessionDescription { - if x != nil { - return x.ClientAnswer - } - return nil -} - type AuthToken struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1033,7 +1027,7 @@ func (x *Camera_Identifier) ProtoReflect() protoreflect.Message { // Deprecated: Use Camera_Identifier.ProtoReflect.Descriptor instead. func (*Camera_Identifier) Descriptor() ([]byte, []int) { - return file_signaler_service_proto_rawDescGZIP(), []int{11, 0} + return file_signaler_service_proto_rawDescGZIP(), []int{10, 0} } func (x *Camera_Identifier) GetId() string { @@ -1121,166 +1115,122 @@ var file_signaler_service_proto_rawDesc = []byte{ 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x0f, 0x77, 0x61, 0x69, 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x77, 0x61, 0x69, 0x74, - 0x46, 0x6f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x6b, 0x0a, 0x14, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x2b, 0x0a, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x26, - 0x0a, 0x0f, 0x77, 0x61, 0x69, 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x77, 0x61, 0x69, 0x74, 0x46, 0x6f, 0x72, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x15, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x45, 0x0a, - 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x08, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, - 0x65, 0x72, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x73, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x9e, 0x01, 0x0a, 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, - 0x63, 0x65, 0x43, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x46, 0x6f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x40, 0x0a, 0x11, 0x50, 0x6f, 0x70, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, + 0x0a, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x11, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x6b, 0x0a, 0x14, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x26, 0x0a, 0x0f, 0x77, 0x61, 0x69, 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x5f, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x77, 0x61, 0x69, 0x74, 0x46, + 0x6f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x15, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0x45, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x08, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x9d, 0x01, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x49, 0x63, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4b, 0x0a, 0x12, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x11, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, - 0x34, 0x0a, 0x09, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x35, 0x0a, 0x0b, 0x69, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, + 0x49, 0x63, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0a, 0x69, 0x63, 0x65, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x63, 0x0a, 0x14, 0x50, 0x6f, 0x70, 0x49, 0x63, 0x65, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4b, + 0x0a, 0x12, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x11, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x22, 0x63, 0x0a, 0x06, 0x43, + 0x61, 0x6d, 0x65, 0x72, 0x61, 0x12, 0x3b, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x61, 0x6d, 0x65, 0x72, 0x61, 0x2e, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, + 0x65, 0x72, 0x1a, 0x1c, 0x0a, 0x0a, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x22, 0x89, 0x01, 0x0a, 0x0a, 0x49, 0x63, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, + 0x36, 0x0a, 0x09, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x49, 0x63, - 0x65, 0x43, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x52, 0x09, 0x63, 0x61, 0x6e, 0x64, - 0x69, 0x64, 0x61, 0x74, 0x65, 0x22, 0x65, 0x0a, 0x16, 0x50, 0x6f, 0x70, 0x49, 0x63, 0x65, 0x43, - 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x4b, 0x0a, 0x12, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x49, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x11, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x22, 0xb4, 0x01, 0x0a, - 0x22, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x63, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x4b, 0x0a, 0x12, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1c, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x11, 0x73, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, - 0x12, 0x41, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, - 0x2e, 0x49, 0x63, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x22, 0x6e, 0x0a, 0x1f, 0x50, 0x6f, 0x70, 0x49, 0x63, 0x65, 0x53, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4b, 0x0a, 0x12, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, - 0x52, 0x11, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, - 0x69, 0x65, 0x72, 0x22, 0x63, 0x0a, 0x06, 0x43, 0x61, 0x6d, 0x65, 0x72, 0x61, 0x12, 0x3b, 0x0a, - 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x61, 0x6d, - 0x65, 0x72, 0x61, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x0a, - 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x1a, 0x1c, 0x0a, 0x0a, 0x49, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0xdc, 0x01, 0x0a, 0x0c, 0x49, 0x63, 0x65, - 0x43, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 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, 0x12, 0x1c, 0x0a, 0x07, 0x73, 0x64, 0x70, 0x5f, 0x6d, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x73, 0x64, 0x70, 0x4d, - 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x0e, 0x73, 0x64, 0x70, 0x5f, 0x6c, 0x69, 0x6e, - 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x48, 0x01, 0x52, - 0x0c, 0x73, 0x64, 0x70, 0x4c, 0x69, 0x6e, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x88, 0x01, 0x01, - 0x12, 0x30, 0x0a, 0x11, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x66, 0x72, 0x61, - 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x10, 0x75, - 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x88, - 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x73, 0x64, 0x70, 0x5f, 0x6d, 0x69, 0x64, 0x42, 0x11, - 0x0a, 0x0f, 0x5f, 0x73, 0x64, 0x70, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x66, - 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x44, 0x0a, 0x15, 0x49, 0x63, 0x65, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x19, 0x0a, 0x08, 0x73, 0x64, 0x70, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x07, 0x73, 0x64, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, - 0x64, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x64, 0x70, 0x22, 0xac, 0x03, - 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, - 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, - 0x69, 0x65, 0x72, 0x52, 0x02, 0x69, 0x64, 0x12, 0x33, 0x0a, 0x06, 0x63, 0x61, 0x6d, 0x65, 0x72, - 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, - 0x65, 0x72, 0x2e, 0x43, 0x61, 0x6d, 0x65, 0x72, 0x61, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x66, 0x69, 0x65, 0x72, 0x52, 0x06, 0x63, 0x61, 0x6d, 0x65, 0x72, 0x61, 0x12, 0x4a, 0x0a, 0x15, - 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x63, 0x65, 0x5f, 0x63, 0x61, 0x6e, 0x64, 0x69, - 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x49, 0x63, 0x65, 0x43, 0x61, 0x6e, 0x64, 0x69, 0x64, - 0x61, 0x74, 0x65, 0x52, 0x13, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x63, 0x65, 0x43, 0x61, - 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x4a, 0x0a, 0x15, 0x63, 0x61, 0x6d, 0x65, - 0x72, 0x61, 0x5f, 0x69, 0x63, 0x65, 0x5f, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, - 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, - 0x65, 0x72, 0x2e, 0x49, 0x63, 0x65, 0x43, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x52, - 0x13, 0x63, 0x61, 0x6d, 0x65, 0x72, 0x61, 0x49, 0x63, 0x65, 0x43, 0x61, 0x6e, 0x64, 0x69, 0x64, - 0x61, 0x74, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x0c, 0x63, 0x61, 0x6d, 0x65, 0x72, 0x61, 0x5f, 0x6f, - 0x66, 0x66, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x49, 0x63, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x63, 0x61, 0x6d, - 0x65, 0x72, 0x61, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x12, 0x44, 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x5f, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1f, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x49, 0x63, 0x65, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x1a, 0x1c, - 0x0a, 0x0a, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x21, 0x0a, 0x09, - 0x41, 0x75, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x32, - 0xf4, 0x05, 0x0a, 0x0f, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x48, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, - 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x20, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, - 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x6c, 0x65, 0x72, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x4a, 0x0a, - 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x61, 0x6d, 0x65, 0x72, 0x61, 0x73, 0x12, 0x1c, 0x2e, 0x73, + 0x65, 0x43, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x09, 0x63, 0x61, + 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x12, 0x3b, 0x0a, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x6c, 0x65, 0x72, 0x2e, 0x49, 0x63, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x07, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xdc, 0x01, 0x0a, + 0x0c, 0x49, 0x63, 0x65, 0x43, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 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, 0x12, 0x1c, 0x0a, 0x07, 0x73, + 0x64, 0x70, 0x5f, 0x6d, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, + 0x73, 0x64, 0x70, 0x4d, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x0e, 0x73, 0x64, 0x70, + 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x48, 0x01, 0x52, 0x0c, 0x73, 0x64, 0x70, 0x4c, 0x69, 0x6e, 0x65, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x88, 0x01, 0x01, 0x12, 0x30, 0x0a, 0x11, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x5f, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x02, 0x52, 0x10, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x46, 0x72, 0x61, 0x67, 0x6d, + 0x65, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x73, 0x64, 0x70, 0x5f, 0x6d, + 0x69, 0x64, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x73, 0x64, 0x70, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x5f, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, + 0x6d, 0x65, 0x5f, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x44, 0x0a, 0x15, 0x49, + 0x63, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x64, 0x70, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x73, 0x64, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x10, 0x0a, 0x03, 0x73, 0x64, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x64, + 0x70, 0x22, 0x8a, 0x01, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x02, 0x69, 0x64, 0x12, 0x33, 0x0a, 0x06, 0x63, + 0x61, 0x6d, 0x65, 0x72, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x61, 0x6d, 0x65, 0x72, 0x61, 0x2e, 0x49, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x06, 0x63, 0x61, 0x6d, 0x65, 0x72, 0x61, + 0x1a, 0x1c, 0x0a, 0x0a, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x21, + 0x0a, 0x09, 0x41, 0x75, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x32, 0xbd, 0x03, 0x0a, 0x0f, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x48, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, + 0x75, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x20, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, + 0x4a, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x61, 0x6d, 0x65, 0x72, 0x61, 0x73, 0x12, 0x1c, + 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x61, + 0x6d, 0x65, 0x72, 0x61, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x61, 0x6d, 0x65, - 0x72, 0x61, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x61, 0x6d, 0x65, 0x72, 0x61, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0d, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, + 0x72, 0x61, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0d, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x3c, 0x0a, 0x0a, 0x50, 0x6f, 0x70, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x2e, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x6f, 0x70, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x42, 0x0a, - 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, - 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, - 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x4d, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x1d, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1e, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x51, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x63, 0x65, 0x43, 0x61, 0x6e, - 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x12, 0x23, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, - 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x63, 0x65, 0x43, 0x61, 0x6e, 0x64, 0x69, - 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x49, 0x63, 0x65, 0x43, 0x61, 0x6e, 0x64, 0x69, 0x64, - 0x61, 0x74, 0x65, 0x12, 0x4b, 0x0a, 0x0f, 0x50, 0x6f, 0x70, 0x49, 0x63, 0x65, 0x43, 0x61, 0x6e, - 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x12, 0x20, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, - 0x72, 0x2e, 0x50, 0x6f, 0x70, 0x49, 0x63, 0x65, 0x43, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x6c, 0x65, 0x72, 0x2e, 0x49, 0x63, 0x65, 0x43, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, - 0x12, 0x6c, 0x0a, 0x1b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x63, 0x65, 0x53, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x2c, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x49, 0x63, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x49, 0x63, 0x65, 0x53, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x66, - 0x0a, 0x18, 0x50, 0x6f, 0x70, 0x49, 0x63, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x2e, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x6f, 0x70, 0x49, 0x63, 0x65, 0x53, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, - 0x2e, 0x49, 0x63, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x94, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x42, 0x14, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, - 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x61, 0x74, - 0x68, 0x61, 0x77, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x68, 0x6f, 0x6d, 0x65, - 0x2d, 0x73, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x2f, 0x76, 0x32, 0x2f, 0x67, 0x65, 0x6e, 0xa2, - 0x02, 0x03, 0x53, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, - 0xca, 0x02, 0x08, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0xe2, 0x02, 0x14, 0x53, 0x69, - 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x08, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x4b, 0x0a, + 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x63, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x12, 0x21, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x49, 0x63, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, + 0x49, 0x63, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x45, 0x0a, 0x0d, 0x50, 0x6f, + 0x70, 0x49, 0x63, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1e, 0x2e, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x6f, 0x70, 0x49, 0x63, 0x65, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x49, 0x63, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x42, 0x94, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, + 0x65, 0x72, 0x42, 0x14, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x61, 0x74, 0x68, 0x61, 0x77, 0x61, 0x79, + 0x2d, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x68, 0x6f, 0x6d, 0x65, 0x2d, 0x73, 0x65, 0x6e, 0x73, + 0x6f, 0x72, 0x73, 0x2f, 0x76, 0x32, 0x2f, 0x67, 0x65, 0x6e, 0xa2, 0x02, 0x03, 0x53, 0x58, 0x58, + 0xaa, 0x02, 0x08, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0xca, 0x02, 0x08, 0x53, 0x69, + 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0xe2, 0x02, 0x14, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, + 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x08, + 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1297,70 +1247,60 @@ func file_signaler_service_proto_rawDescGZIP() []byte { var file_signaler_service_proto_msgTypes = make([]protoimpl.MessageInfo, 20) var file_signaler_service_proto_goTypes = []interface{}{ - (*CreateAuthTokenRequest)(nil), // 0: signaler.CreateAuthTokenRequest - (*ListCamerasRequest)(nil), // 1: signaler.ListCamerasRequest - (*ListCamerasResponse)(nil), // 2: signaler.ListCamerasResponse - (*CreateSessionRequest)(nil), // 3: signaler.CreateSessionRequest - (*UpdateSessionRequest)(nil), // 4: signaler.UpdateSessionRequest - (*ListSessionsRequest)(nil), // 5: signaler.ListSessionsRequest - (*ListSessionsResponse)(nil), // 6: signaler.ListSessionsResponse - (*CreateIceCandidateRequest)(nil), // 7: signaler.CreateIceCandidateRequest - (*PopIceCandidateRequest)(nil), // 8: signaler.PopIceCandidateRequest - (*CreateIceSessionDescriptionRequest)(nil), // 9: signaler.CreateIceSessionDescriptionRequest - (*PopIceSessionDescriptionRequest)(nil), // 10: signaler.PopIceSessionDescriptionRequest - (*Camera)(nil), // 11: signaler.Camera - (*IceCandidate)(nil), // 12: signaler.IceCandidate - (*IceSessionDescription)(nil), // 13: signaler.IceSessionDescription - (*Session)(nil), // 14: signaler.Session - (*AuthToken)(nil), // 15: signaler.AuthToken - (*CreateAuthTokenRequest_Camera)(nil), // 16: signaler.CreateAuthTokenRequest.Camera - (*CreateAuthTokenRequest_Client)(nil), // 17: signaler.CreateAuthTokenRequest.Client - (*Camera_Identifier)(nil), // 18: signaler.Camera.Identifier - (*Session_Identifier)(nil), // 19: signaler.Session.Identifier + (*CreateAuthTokenRequest)(nil), // 0: signaler.CreateAuthTokenRequest + (*ListCamerasRequest)(nil), // 1: signaler.ListCamerasRequest + (*ListCamerasResponse)(nil), // 2: signaler.ListCamerasResponse + (*CreateSessionRequest)(nil), // 3: signaler.CreateSessionRequest + (*PopSessionRequest)(nil), // 4: signaler.PopSessionRequest + (*UpdateSessionRequest)(nil), // 5: signaler.UpdateSessionRequest + (*ListSessionsRequest)(nil), // 6: signaler.ListSessionsRequest + (*ListSessionsResponse)(nil), // 7: signaler.ListSessionsResponse + (*CreateIceMessageRequest)(nil), // 8: signaler.CreateIceMessageRequest + (*PopIceMessageRequest)(nil), // 9: signaler.PopIceMessageRequest + (*Camera)(nil), // 10: signaler.Camera + (*IceMessage)(nil), // 11: signaler.IceMessage + (*IceCandidate)(nil), // 12: signaler.IceCandidate + (*IceSessionDescription)(nil), // 13: signaler.IceSessionDescription + (*Session)(nil), // 14: signaler.Session + (*AuthToken)(nil), // 15: signaler.AuthToken + (*CreateAuthTokenRequest_Camera)(nil), // 16: signaler.CreateAuthTokenRequest.Camera + (*CreateAuthTokenRequest_Client)(nil), // 17: signaler.CreateAuthTokenRequest.Client + (*Camera_Identifier)(nil), // 18: signaler.Camera.Identifier + (*Session_Identifier)(nil), // 19: signaler.Session.Identifier } var file_signaler_service_proto_depIdxs = []int32{ 16, // 0: signaler.CreateAuthTokenRequest.camera:type_name -> signaler.CreateAuthTokenRequest.Camera 17, // 1: signaler.CreateAuthTokenRequest.client:type_name -> signaler.CreateAuthTokenRequest.Client - 11, // 2: signaler.ListCamerasResponse.cameras:type_name -> signaler.Camera + 10, // 2: signaler.ListCamerasResponse.cameras:type_name -> signaler.Camera 14, // 3: signaler.CreateSessionRequest.session:type_name -> signaler.Session - 14, // 4: signaler.UpdateSessionRequest.session:type_name -> signaler.Session - 14, // 5: signaler.ListSessionsResponse.sessions:type_name -> signaler.Session - 19, // 6: signaler.CreateIceCandidateRequest.session_identifier:type_name -> signaler.Session.Identifier - 12, // 7: signaler.CreateIceCandidateRequest.candidate:type_name -> signaler.IceCandidate - 19, // 8: signaler.PopIceCandidateRequest.session_identifier:type_name -> signaler.Session.Identifier - 19, // 9: signaler.CreateIceSessionDescriptionRequest.session_identifier:type_name -> signaler.Session.Identifier - 13, // 10: signaler.CreateIceSessionDescriptionRequest.description:type_name -> signaler.IceSessionDescription - 19, // 11: signaler.PopIceSessionDescriptionRequest.session_identifier:type_name -> signaler.Session.Identifier - 18, // 12: signaler.Camera.identifier:type_name -> signaler.Camera.Identifier + 14, // 4: signaler.PopSessionRequest.session:type_name -> signaler.Session + 14, // 5: signaler.UpdateSessionRequest.session:type_name -> signaler.Session + 14, // 6: signaler.ListSessionsResponse.sessions:type_name -> signaler.Session + 19, // 7: signaler.CreateIceMessageRequest.session_identifier:type_name -> signaler.Session.Identifier + 11, // 8: signaler.CreateIceMessageRequest.ice_message:type_name -> signaler.IceMessage + 19, // 9: signaler.PopIceMessageRequest.session_identifier:type_name -> signaler.Session.Identifier + 18, // 10: signaler.Camera.identifier:type_name -> signaler.Camera.Identifier + 12, // 11: signaler.IceMessage.candidate:type_name -> signaler.IceCandidate + 13, // 12: signaler.IceMessage.session:type_name -> signaler.IceSessionDescription 19, // 13: signaler.Session.id:type_name -> signaler.Session.Identifier 18, // 14: signaler.Session.camera:type_name -> signaler.Camera.Identifier - 12, // 15: signaler.Session.client_ice_candidates:type_name -> signaler.IceCandidate - 12, // 16: signaler.Session.camera_ice_candidates:type_name -> signaler.IceCandidate - 13, // 17: signaler.Session.camera_offer:type_name -> signaler.IceSessionDescription - 13, // 18: signaler.Session.client_answer:type_name -> signaler.IceSessionDescription - 0, // 19: signaler.SignalerService.CreateAuthToken:input_type -> signaler.CreateAuthTokenRequest - 1, // 20: signaler.SignalerService.ListCameras:input_type -> signaler.ListCamerasRequest - 3, // 21: signaler.SignalerService.CreateSession:input_type -> signaler.CreateSessionRequest - 4, // 22: signaler.SignalerService.UpdateSession:input_type -> signaler.UpdateSessionRequest - 5, // 23: signaler.SignalerService.ListSessions:input_type -> signaler.ListSessionsRequest - 7, // 24: signaler.SignalerService.CreateIceCandidate:input_type -> signaler.CreateIceCandidateRequest - 8, // 25: signaler.SignalerService.PopIceCandidate:input_type -> signaler.PopIceCandidateRequest - 9, // 26: signaler.SignalerService.CreateIceSessionDescription:input_type -> signaler.CreateIceSessionDescriptionRequest - 10, // 27: signaler.SignalerService.PopIceSessionDescription:input_type -> signaler.PopIceSessionDescriptionRequest - 15, // 28: signaler.SignalerService.CreateAuthToken:output_type -> signaler.AuthToken - 2, // 29: signaler.SignalerService.ListCameras:output_type -> signaler.ListCamerasResponse - 14, // 30: signaler.SignalerService.CreateSession:output_type -> signaler.Session - 14, // 31: signaler.SignalerService.UpdateSession:output_type -> signaler.Session - 6, // 32: signaler.SignalerService.ListSessions:output_type -> signaler.ListSessionsResponse - 12, // 33: signaler.SignalerService.CreateIceCandidate:output_type -> signaler.IceCandidate - 12, // 34: signaler.SignalerService.PopIceCandidate:output_type -> signaler.IceCandidate - 13, // 35: signaler.SignalerService.CreateIceSessionDescription:output_type -> signaler.IceSessionDescription - 13, // 36: signaler.SignalerService.PopIceSessionDescription:output_type -> signaler.IceSessionDescription - 28, // [28:37] is the sub-list for method output_type - 19, // [19:28] is the sub-list for method input_type - 19, // [19:19] is the sub-list for extension type_name - 19, // [19:19] is the sub-list for extension extendee - 0, // [0:19] is the sub-list for field type_name + 0, // 15: signaler.SignalerService.CreateAuthToken:input_type -> signaler.CreateAuthTokenRequest + 1, // 16: signaler.SignalerService.ListCameras:input_type -> signaler.ListCamerasRequest + 3, // 17: signaler.SignalerService.CreateSession:input_type -> signaler.CreateSessionRequest + 4, // 18: signaler.SignalerService.PopSession:input_type -> signaler.PopSessionRequest + 8, // 19: signaler.SignalerService.CreateIceMessage:input_type -> signaler.CreateIceMessageRequest + 9, // 20: signaler.SignalerService.PopIceMessage:input_type -> signaler.PopIceMessageRequest + 15, // 21: signaler.SignalerService.CreateAuthToken:output_type -> signaler.AuthToken + 2, // 22: signaler.SignalerService.ListCameras:output_type -> signaler.ListCamerasResponse + 14, // 23: signaler.SignalerService.CreateSession:output_type -> signaler.Session + 14, // 24: signaler.SignalerService.PopSession:output_type -> signaler.Session + 11, // 25: signaler.SignalerService.CreateIceMessage:output_type -> signaler.IceMessage + 11, // 26: signaler.SignalerService.PopIceMessage:output_type -> signaler.IceMessage + 21, // [21:27] is the sub-list for method output_type + 15, // [15:21] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name } func init() { file_signaler_service_proto_init() } @@ -1418,7 +1358,7 @@ func file_signaler_service_proto_init() { } } file_signaler_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateSessionRequest); i { + switch v := v.(*PopSessionRequest); i { case 0: return &v.state case 1: @@ -1430,7 +1370,7 @@ func file_signaler_service_proto_init() { } } file_signaler_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSessionsRequest); i { + switch v := v.(*UpdateSessionRequest); i { case 0: return &v.state case 1: @@ -1442,7 +1382,7 @@ func file_signaler_service_proto_init() { } } file_signaler_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSessionsResponse); i { + switch v := v.(*ListSessionsRequest); i { case 0: return &v.state case 1: @@ -1454,7 +1394,7 @@ func file_signaler_service_proto_init() { } } file_signaler_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateIceCandidateRequest); i { + switch v := v.(*ListSessionsResponse); i { case 0: return &v.state case 1: @@ -1466,7 +1406,7 @@ func file_signaler_service_proto_init() { } } file_signaler_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PopIceCandidateRequest); i { + switch v := v.(*CreateIceMessageRequest); i { case 0: return &v.state case 1: @@ -1478,7 +1418,7 @@ func file_signaler_service_proto_init() { } } file_signaler_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateIceSessionDescriptionRequest); i { + switch v := v.(*PopIceMessageRequest); i { case 0: return &v.state case 1: @@ -1490,7 +1430,7 @@ func file_signaler_service_proto_init() { } } file_signaler_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PopIceSessionDescriptionRequest); i { + switch v := v.(*Camera); i { case 0: return &v.state case 1: @@ -1502,7 +1442,7 @@ func file_signaler_service_proto_init() { } } file_signaler_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Camera); i { + switch v := v.(*IceMessage); i { case 0: return &v.state case 1: @@ -1614,6 +1554,10 @@ func file_signaler_service_proto_init() { (*CreateAuthTokenRequest_Camera_)(nil), (*CreateAuthTokenRequest_Client_)(nil), } + file_signaler_service_proto_msgTypes[11].OneofWrappers = []interface{}{ + (*IceMessage_Candidate)(nil), + (*IceMessage_Session)(nil), + } file_signaler_service_proto_msgTypes[12].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ diff --git a/gen/signaler_service.pbjson.dart b/gen/signaler_service.pbjson.dart index f927274..b67a503 100644 --- a/gen/signaler_service.pbjson.dart +++ b/gen/signaler_service.pbjson.dart @@ -83,6 +83,19 @@ final $typed_data.Uint8List createSessionRequestDescriptor = $convert.base64Deco 'ChRDcmVhdGVTZXNzaW9uUmVxdWVzdBIrCgdzZXNzaW9uGAEgASgLMhEuc2lnbmFsZXIuU2Vzc2' 'lvblIHc2Vzc2lvbhImCg93YWl0X2Zvcl91cGRhdGUYAiABKAhSDXdhaXRGb3JVcGRhdGU='); +@$core.Deprecated('Use popSessionRequestDescriptor instead') +const PopSessionRequest$json = { + '1': 'PopSessionRequest', + '2': [ + {'1': 'session', '3': 1, '4': 1, '5': 11, '6': '.signaler.Session', '10': 'session'}, + ], +}; + +/// Descriptor for `PopSessionRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List popSessionRequestDescriptor = $convert.base64Decode( + 'ChFQb3BTZXNzaW9uUmVxdWVzdBIrCgdzZXNzaW9uGAEgASgLMhEuc2lnbmFsZXIuU2Vzc2lvbl' + 'IHc2Vzc2lvbg=='); + @$core.Deprecated('Use updateSessionRequestDescriptor instead') const UpdateSessionRequest$json = { '1': 'UpdateSessionRequest', @@ -119,62 +132,33 @@ final $typed_data.Uint8List listSessionsResponseDescriptor = $convert.base64Deco 'ChRMaXN0U2Vzc2lvbnNSZXNwb25zZRItCghzZXNzaW9ucxgBIAMoCzIRLnNpZ25hbGVyLlNlc3' 'Npb25SCHNlc3Npb25z'); -@$core.Deprecated('Use createIceCandidateRequestDescriptor instead') -const CreateIceCandidateRequest$json = { - '1': 'CreateIceCandidateRequest', +@$core.Deprecated('Use createIceMessageRequestDescriptor instead') +const CreateIceMessageRequest$json = { + '1': 'CreateIceMessageRequest', '2': [ {'1': 'session_identifier', '3': 1, '4': 1, '5': 11, '6': '.signaler.Session.Identifier', '10': 'sessionIdentifier'}, - {'1': 'candidate', '3': 2, '4': 1, '5': 11, '6': '.signaler.IceCandidate', '10': 'candidate'}, + {'1': 'ice_message', '3': 2, '4': 1, '5': 11, '6': '.signaler.IceMessage', '10': 'iceMessage'}, ], }; -/// Descriptor for `CreateIceCandidateRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List createIceCandidateRequestDescriptor = $convert.base64Decode( - 'ChlDcmVhdGVJY2VDYW5kaWRhdGVSZXF1ZXN0EksKEnNlc3Npb25faWRlbnRpZmllchgBIAEoCz' - 'IcLnNpZ25hbGVyLlNlc3Npb24uSWRlbnRpZmllclIRc2Vzc2lvbklkZW50aWZpZXISNAoJY2Fu' - 'ZGlkYXRlGAIgASgLMhYuc2lnbmFsZXIuSWNlQ2FuZGlkYXRlUgljYW5kaWRhdGU='); +/// Descriptor for `CreateIceMessageRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List createIceMessageRequestDescriptor = $convert.base64Decode( + 'ChdDcmVhdGVJY2VNZXNzYWdlUmVxdWVzdBJLChJzZXNzaW9uX2lkZW50aWZpZXIYASABKAsyHC' + '5zaWduYWxlci5TZXNzaW9uLklkZW50aWZpZXJSEXNlc3Npb25JZGVudGlmaWVyEjUKC2ljZV9t' + 'ZXNzYWdlGAIgASgLMhQuc2lnbmFsZXIuSWNlTWVzc2FnZVIKaWNlTWVzc2FnZQ=='); -@$core.Deprecated('Use popIceCandidateRequestDescriptor instead') -const PopIceCandidateRequest$json = { - '1': 'PopIceCandidateRequest', +@$core.Deprecated('Use popIceMessageRequestDescriptor instead') +const PopIceMessageRequest$json = { + '1': 'PopIceMessageRequest', '2': [ {'1': 'session_identifier', '3': 1, '4': 1, '5': 11, '6': '.signaler.Session.Identifier', '10': 'sessionIdentifier'}, ], }; -/// Descriptor for `PopIceCandidateRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List popIceCandidateRequestDescriptor = $convert.base64Decode( - 'ChZQb3BJY2VDYW5kaWRhdGVSZXF1ZXN0EksKEnNlc3Npb25faWRlbnRpZmllchgBIAEoCzIcLn' - 'NpZ25hbGVyLlNlc3Npb24uSWRlbnRpZmllclIRc2Vzc2lvbklkZW50aWZpZXI='); - -@$core.Deprecated('Use createIceSessionDescriptionRequestDescriptor instead') -const CreateIceSessionDescriptionRequest$json = { - '1': 'CreateIceSessionDescriptionRequest', - '2': [ - {'1': 'session_identifier', '3': 1, '4': 1, '5': 11, '6': '.signaler.Session.Identifier', '10': 'sessionIdentifier'}, - {'1': 'description', '3': 2, '4': 1, '5': 11, '6': '.signaler.IceSessionDescription', '10': 'description'}, - ], -}; - -/// Descriptor for `CreateIceSessionDescriptionRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List createIceSessionDescriptionRequestDescriptor = $convert.base64Decode( - 'CiJDcmVhdGVJY2VTZXNzaW9uRGVzY3JpcHRpb25SZXF1ZXN0EksKEnNlc3Npb25faWRlbnRpZm' - 'llchgBIAEoCzIcLnNpZ25hbGVyLlNlc3Npb24uSWRlbnRpZmllclIRc2Vzc2lvbklkZW50aWZp' - 'ZXISQQoLZGVzY3JpcHRpb24YAiABKAsyHy5zaWduYWxlci5JY2VTZXNzaW9uRGVzY3JpcHRpb2' - '5SC2Rlc2NyaXB0aW9u'); - -@$core.Deprecated('Use popIceSessionDescriptionRequestDescriptor instead') -const PopIceSessionDescriptionRequest$json = { - '1': 'PopIceSessionDescriptionRequest', - '2': [ - {'1': 'session_identifier', '3': 1, '4': 1, '5': 11, '6': '.signaler.Session.Identifier', '10': 'sessionIdentifier'}, - ], -}; - -/// Descriptor for `PopIceSessionDescriptionRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List popIceSessionDescriptionRequestDescriptor = $convert.base64Decode( - 'Ch9Qb3BJY2VTZXNzaW9uRGVzY3JpcHRpb25SZXF1ZXN0EksKEnNlc3Npb25faWRlbnRpZmllch' - 'gBIAEoCzIcLnNpZ25hbGVyLlNlc3Npb24uSWRlbnRpZmllclIRc2Vzc2lvbklkZW50aWZpZXI='); +/// Descriptor for `PopIceMessageRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List popIceMessageRequestDescriptor = $convert.base64Decode( + 'ChRQb3BJY2VNZXNzYWdlUmVxdWVzdBJLChJzZXNzaW9uX2lkZW50aWZpZXIYASABKAsyHC5zaW' + 'duYWxlci5TZXNzaW9uLklkZW50aWZpZXJSEXNlc3Npb25JZGVudGlmaWVy'); @$core.Deprecated('Use cameraDescriptor instead') const Camera$json = { @@ -198,6 +182,24 @@ final $typed_data.Uint8List cameraDescriptor = $convert.base64Decode( 'CgZDYW1lcmESOwoKaWRlbnRpZmllchgBIAEoCzIbLnNpZ25hbGVyLkNhbWVyYS5JZGVudGlmaW' 'VyUgppZGVudGlmaWVyGhwKCklkZW50aWZpZXISDgoCaWQYASABKAlSAmlk'); +@$core.Deprecated('Use iceMessageDescriptor instead') +const IceMessage$json = { + '1': 'IceMessage', + '2': [ + {'1': 'candidate', '3': 1, '4': 1, '5': 11, '6': '.signaler.IceCandidate', '9': 0, '10': 'candidate'}, + {'1': 'session', '3': 2, '4': 1, '5': 11, '6': '.signaler.IceSessionDescription', '9': 0, '10': 'session'}, + ], + '8': [ + {'1': 'type'}, + ], +}; + +/// Descriptor for `IceMessage`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List iceMessageDescriptor = $convert.base64Decode( + 'CgpJY2VNZXNzYWdlEjYKCWNhbmRpZGF0ZRgBIAEoCzIWLnNpZ25hbGVyLkljZUNhbmRpZGF0ZU' + 'gAUgljYW5kaWRhdGUSOwoHc2Vzc2lvbhgCIAEoCzIfLnNpZ25hbGVyLkljZVNlc3Npb25EZXNj' + 'cmlwdGlvbkgAUgdzZXNzaW9uQgYKBHR5cGU='); + @$core.Deprecated('Use iceCandidateDescriptor instead') const IceCandidate$json = { '1': 'IceCandidate', @@ -241,10 +243,6 @@ const Session$json = { '2': [ {'1': 'id', '3': 1, '4': 1, '5': 11, '6': '.signaler.Session.Identifier', '10': 'id'}, {'1': 'camera', '3': 2, '4': 1, '5': 11, '6': '.signaler.Camera.Identifier', '10': 'camera'}, - {'1': 'client_ice_candidates', '3': 3, '4': 3, '5': 11, '6': '.signaler.IceCandidate', '10': 'clientIceCandidates'}, - {'1': 'camera_ice_candidates', '3': 4, '4': 3, '5': 11, '6': '.signaler.IceCandidate', '10': 'cameraIceCandidates'}, - {'1': 'camera_offer', '3': 5, '4': 1, '5': 11, '6': '.signaler.IceSessionDescription', '10': 'cameraOffer'}, - {'1': 'client_answer', '3': 6, '4': 1, '5': 11, '6': '.signaler.IceSessionDescription', '10': 'clientAnswer'}, ], '3': [Session_Identifier$json], }; @@ -260,13 +258,8 @@ const Session_Identifier$json = { /// Descriptor for `Session`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List sessionDescriptor = $convert.base64Decode( 'CgdTZXNzaW9uEiwKAmlkGAEgASgLMhwuc2lnbmFsZXIuU2Vzc2lvbi5JZGVudGlmaWVyUgJpZB' - 'IzCgZjYW1lcmEYAiABKAsyGy5zaWduYWxlci5DYW1lcmEuSWRlbnRpZmllclIGY2FtZXJhEkoK' - 'FWNsaWVudF9pY2VfY2FuZGlkYXRlcxgDIAMoCzIWLnNpZ25hbGVyLkljZUNhbmRpZGF0ZVITY2' - 'xpZW50SWNlQ2FuZGlkYXRlcxJKChVjYW1lcmFfaWNlX2NhbmRpZGF0ZXMYBCADKAsyFi5zaWdu' - 'YWxlci5JY2VDYW5kaWRhdGVSE2NhbWVyYUljZUNhbmRpZGF0ZXMSQgoMY2FtZXJhX29mZmVyGA' - 'UgASgLMh8uc2lnbmFsZXIuSWNlU2Vzc2lvbkRlc2NyaXB0aW9uUgtjYW1lcmFPZmZlchJECg1j' - 'bGllbnRfYW5zd2VyGAYgASgLMh8uc2lnbmFsZXIuSWNlU2Vzc2lvbkRlc2NyaXB0aW9uUgxjbG' - 'llbnRBbnN3ZXIaHAoKSWRlbnRpZmllchIOCgJpZBgBIAEoCVICaWQ='); + 'IzCgZjYW1lcmEYAiABKAsyGy5zaWduYWxlci5DYW1lcmEuSWRlbnRpZmllclIGY2FtZXJhGhwK' + 'CklkZW50aWZpZXISDgoCaWQYASABKAlSAmlk'); @$core.Deprecated('Use authTokenDescriptor instead') const AuthToken$json = { @@ -286,12 +279,9 @@ const $core.Map<$core.String, $core.dynamic> SignalerServiceBase$json = { {'1': 'CreateAuthToken', '2': '.signaler.CreateAuthTokenRequest', '3': '.signaler.AuthToken'}, {'1': 'ListCameras', '2': '.signaler.ListCamerasRequest', '3': '.signaler.ListCamerasResponse'}, {'1': 'CreateSession', '2': '.signaler.CreateSessionRequest', '3': '.signaler.Session'}, - {'1': 'UpdateSession', '2': '.signaler.UpdateSessionRequest', '3': '.signaler.Session'}, - {'1': 'ListSessions', '2': '.signaler.ListSessionsRequest', '3': '.signaler.ListSessionsResponse'}, - {'1': 'CreateIceCandidate', '2': '.signaler.CreateIceCandidateRequest', '3': '.signaler.IceCandidate'}, - {'1': 'PopIceCandidate', '2': '.signaler.PopIceCandidateRequest', '3': '.signaler.IceCandidate'}, - {'1': 'CreateIceSessionDescription', '2': '.signaler.CreateIceSessionDescriptionRequest', '3': '.signaler.IceSessionDescription'}, - {'1': 'PopIceSessionDescription', '2': '.signaler.PopIceSessionDescriptionRequest', '3': '.signaler.IceSessionDescription'}, + {'1': 'PopSession', '2': '.signaler.PopSessionRequest', '3': '.signaler.Session'}, + {'1': 'CreateIceMessage', '2': '.signaler.CreateIceMessageRequest', '3': '.signaler.IceMessage'}, + {'1': 'PopIceMessage', '2': '.signaler.PopIceMessageRequest', '3': '.signaler.IceMessage'}, ], }; @@ -308,15 +298,12 @@ const $core.Map<$core.String, $core.Map<$core.String, $core.dynamic>> SignalerSe '.signaler.CreateSessionRequest': CreateSessionRequest$json, '.signaler.Session': Session$json, '.signaler.Session.Identifier': Session_Identifier$json, + '.signaler.PopSessionRequest': PopSessionRequest$json, + '.signaler.CreateIceMessageRequest': CreateIceMessageRequest$json, + '.signaler.IceMessage': IceMessage$json, '.signaler.IceCandidate': IceCandidate$json, '.signaler.IceSessionDescription': IceSessionDescription$json, - '.signaler.UpdateSessionRequest': UpdateSessionRequest$json, - '.signaler.ListSessionsRequest': ListSessionsRequest$json, - '.signaler.ListSessionsResponse': ListSessionsResponse$json, - '.signaler.CreateIceCandidateRequest': CreateIceCandidateRequest$json, - '.signaler.PopIceCandidateRequest': PopIceCandidateRequest$json, - '.signaler.CreateIceSessionDescriptionRequest': CreateIceSessionDescriptionRequest$json, - '.signaler.PopIceSessionDescriptionRequest': PopIceSessionDescriptionRequest$json, + '.signaler.PopIceMessageRequest': PopIceMessageRequest$json, }; /// Descriptor for `SignalerService`. Decode as a `google.protobuf.ServiceDescriptorProto`. @@ -325,14 +312,9 @@ final $typed_data.Uint8List signalerServiceDescriptor = $convert.base64Decode( 'V0aFRva2VuUmVxdWVzdBoTLnNpZ25hbGVyLkF1dGhUb2tlbhJKCgtMaXN0Q2FtZXJhcxIcLnNp' 'Z25hbGVyLkxpc3RDYW1lcmFzUmVxdWVzdBodLnNpZ25hbGVyLkxpc3RDYW1lcmFzUmVzcG9uc2' 'USQgoNQ3JlYXRlU2Vzc2lvbhIeLnNpZ25hbGVyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0GhEuc2ln' - 'bmFsZXIuU2Vzc2lvbhJCCg1VcGRhdGVTZXNzaW9uEh4uc2lnbmFsZXIuVXBkYXRlU2Vzc2lvbl' - 'JlcXVlc3QaES5zaWduYWxlci5TZXNzaW9uEk0KDExpc3RTZXNzaW9ucxIdLnNpZ25hbGVyLkxp' - 'c3RTZXNzaW9uc1JlcXVlc3QaHi5zaWduYWxlci5MaXN0U2Vzc2lvbnNSZXNwb25zZRJRChJDcm' - 'VhdGVJY2VDYW5kaWRhdGUSIy5zaWduYWxlci5DcmVhdGVJY2VDYW5kaWRhdGVSZXF1ZXN0GhYu' - 'c2lnbmFsZXIuSWNlQ2FuZGlkYXRlEksKD1BvcEljZUNhbmRpZGF0ZRIgLnNpZ25hbGVyLlBvcE' - 'ljZUNhbmRpZGF0ZVJlcXVlc3QaFi5zaWduYWxlci5JY2VDYW5kaWRhdGUSbAobQ3JlYXRlSWNl' - 'U2Vzc2lvbkRlc2NyaXB0aW9uEiwuc2lnbmFsZXIuQ3JlYXRlSWNlU2Vzc2lvbkRlc2NyaXB0aW' - '9uUmVxdWVzdBofLnNpZ25hbGVyLkljZVNlc3Npb25EZXNjcmlwdGlvbhJmChhQb3BJY2VTZXNz' - 'aW9uRGVzY3JpcHRpb24SKS5zaWduYWxlci5Qb3BJY2VTZXNzaW9uRGVzY3JpcHRpb25SZXF1ZX' - 'N0Gh8uc2lnbmFsZXIuSWNlU2Vzc2lvbkRlc2NyaXB0aW9u'); + 'bmFsZXIuU2Vzc2lvbhI8CgpQb3BTZXNzaW9uEhsuc2lnbmFsZXIuUG9wU2Vzc2lvblJlcXVlc3' + 'QaES5zaWduYWxlci5TZXNzaW9uEksKEENyZWF0ZUljZU1lc3NhZ2USIS5zaWduYWxlci5DcmVh' + 'dGVJY2VNZXNzYWdlUmVxdWVzdBoULnNpZ25hbGVyLkljZU1lc3NhZ2USRQoNUG9wSWNlTWVzc2' + 'FnZRIeLnNpZ25hbGVyLlBvcEljZU1lc3NhZ2VSZXF1ZXN0GhQuc2lnbmFsZXIuSWNlTWVzc2Fn' + 'ZQ=='); diff --git a/gen/signaler_service.pbserver.dart b/gen/signaler_service.pbserver.dart index 312d119..7fe73fe 100644 --- a/gen/signaler_service.pbserver.dart +++ b/gen/signaler_service.pbserver.dart @@ -24,24 +24,18 @@ abstract class SignalerServiceBase extends $pb.GeneratedService { $async.Future<$0.AuthToken> createAuthToken($pb.ServerContext ctx, $0.CreateAuthTokenRequest request); $async.Future<$0.ListCamerasResponse> listCameras($pb.ServerContext ctx, $0.ListCamerasRequest request); $async.Future<$0.Session> createSession($pb.ServerContext ctx, $0.CreateSessionRequest request); - $async.Future<$0.Session> updateSession($pb.ServerContext ctx, $0.UpdateSessionRequest request); - $async.Future<$0.ListSessionsResponse> listSessions($pb.ServerContext ctx, $0.ListSessionsRequest request); - $async.Future<$0.IceCandidate> createIceCandidate($pb.ServerContext ctx, $0.CreateIceCandidateRequest request); - $async.Future<$0.IceCandidate> popIceCandidate($pb.ServerContext ctx, $0.PopIceCandidateRequest request); - $async.Future<$0.IceSessionDescription> createIceSessionDescription($pb.ServerContext ctx, $0.CreateIceSessionDescriptionRequest request); - $async.Future<$0.IceSessionDescription> popIceSessionDescription($pb.ServerContext ctx, $0.PopIceSessionDescriptionRequest request); + $async.Future<$0.Session> popSession($pb.ServerContext ctx, $0.PopSessionRequest request); + $async.Future<$0.IceMessage> createIceMessage($pb.ServerContext ctx, $0.CreateIceMessageRequest request); + $async.Future<$0.IceMessage> popIceMessage($pb.ServerContext ctx, $0.PopIceMessageRequest request); $pb.GeneratedMessage createRequest($core.String methodName) { switch (methodName) { case 'CreateAuthToken': return $0.CreateAuthTokenRequest(); case 'ListCameras': return $0.ListCamerasRequest(); case 'CreateSession': return $0.CreateSessionRequest(); - case 'UpdateSession': return $0.UpdateSessionRequest(); - case 'ListSessions': return $0.ListSessionsRequest(); - case 'CreateIceCandidate': return $0.CreateIceCandidateRequest(); - case 'PopIceCandidate': return $0.PopIceCandidateRequest(); - case 'CreateIceSessionDescription': return $0.CreateIceSessionDescriptionRequest(); - case 'PopIceSessionDescription': return $0.PopIceSessionDescriptionRequest(); + case 'PopSession': return $0.PopSessionRequest(); + case 'CreateIceMessage': return $0.CreateIceMessageRequest(); + case 'PopIceMessage': return $0.PopIceMessageRequest(); default: throw $core.ArgumentError('Unknown method: $methodName'); } } @@ -51,12 +45,9 @@ abstract class SignalerServiceBase extends $pb.GeneratedService { case 'CreateAuthToken': return this.createAuthToken(ctx, request as $0.CreateAuthTokenRequest); case 'ListCameras': return this.listCameras(ctx, request as $0.ListCamerasRequest); case 'CreateSession': return this.createSession(ctx, request as $0.CreateSessionRequest); - case 'UpdateSession': return this.updateSession(ctx, request as $0.UpdateSessionRequest); - case 'ListSessions': return this.listSessions(ctx, request as $0.ListSessionsRequest); - case 'CreateIceCandidate': return this.createIceCandidate(ctx, request as $0.CreateIceCandidateRequest); - case 'PopIceCandidate': return this.popIceCandidate(ctx, request as $0.PopIceCandidateRequest); - case 'CreateIceSessionDescription': return this.createIceSessionDescription(ctx, request as $0.CreateIceSessionDescriptionRequest); - case 'PopIceSessionDescription': return this.popIceSessionDescription(ctx, request as $0.PopIceSessionDescriptionRequest); + case 'PopSession': return this.popSession(ctx, request as $0.PopSessionRequest); + case 'CreateIceMessage': return this.createIceMessage(ctx, request as $0.CreateIceMessageRequest); + case 'PopIceMessage': return this.popIceMessage(ctx, request as $0.PopIceMessageRequest); default: throw $core.ArgumentError('Unknown method: $methodName'); } } diff --git a/pkg/signaler/signaler.go b/pkg/signaler/signaler.go index 23e4d51..db785f5 100644 --- a/pkg/signaler/signaler.go +++ b/pkg/signaler/signaler.go @@ -5,7 +5,7 @@ import ( "context" "encoding/base64" "fmt" - "net/http" + "strings" "sync" "time" @@ -22,29 +22,39 @@ type camera struct { id string } +type session struct { + id string + cameraID string + createTime time.Time + toCamera chan *pb.IceMessage + toClient chan *pb.IceMessage +} + type Server struct { - mu sync.Mutex - camerasByHome map[string]map[string]*camera - sessionsByCamera map[string]map[string]*pb.Session - sessionsById map[string]*pb.Session - waitersBySessionId map[string][]chan<- bool + mu sync.Mutex + camerasByHome map[string]map[string]*camera + + sessionsByCamera map[string]chan *session + sessionsById map[string]*session } func New() *Server { - return &Server{ - camerasByHome: make(map[string]map[string]*camera), - sessionsByCamera: make(map[string]map[string]*pb.Session), - sessionsById: make(map[string]*pb.Session), - waitersBySessionId: make(map[string][]chan<- bool), + s := &Server{ + camerasByHome: make(map[string]map[string]*camera), + sessionsByCamera: make(map[string]chan *session), + sessionsById: make(map[string]*session), } + go s.cleanup() + return s } func (s *Server) CreateAuthToken(ctx context.Context, request *connect.Request[pb.CreateAuthTokenRequest]) (*connect.Response[pb.AuthToken], error) { req := request.Msg + var id string switch req.Type.(type) { case *pb.CreateAuthTokenRequest_Camera_: - id := req.GetCamera().GetId() + id = req.GetCamera().GetId() s.mu.Lock() thisCamera := &camera{ id: id, @@ -54,15 +64,18 @@ func (s *Server) CreateAuthToken(ctx context.Context, request *connect.Request[p s.camerasByHome[home] = make(map[string]*camera) } s.camerasByHome[home][id] = thisCamera + if _, ok := s.sessionsByCamera[id]; !ok { + s.sessionsByCamera[id] = make(chan *session, 100) + } s.mu.Unlock() + case *pb.CreateAuthTokenRequest_Client_: + myUUID, err := uuid.NewV4() + if err != nil { + return nil, fmt.Errorf("error creating UUID: %v", err) + } + id = myUUID.String() } - myUUID, err := uuid.NewV4() - if err != nil { - return nil, fmt.Errorf("error creating UUID: %v", err) - } - id := myUUID.String() - token := &internalpb.AuthToken{ Uid: id, Home: req.GetHome(), @@ -100,129 +113,158 @@ func (s *Server) ListCameras(ctx context.Context, request *connect.Request[pb.Li // Optionally, wait_for_update can be set to prevent returning until the Camera has seen the // session request, populated candidates, and returned a session offer. func (s *Server) CreateSession(ctx context.Context, request *connect.Request[pb.CreateSessionRequest]) (*connect.Response[pb.Session], error) { - req := request.Msg - if req.GetSession() == nil { + thisSession := request.Msg.Session + if thisSession == nil { return nil, status.Errorf(codes.InvalidArgument, "nil session") } + myUUID, err := uuid.NewV4() if err != nil { return nil, fmt.Errorf("error creating UUID: %v", err) } id := myUUID.String() - req.GetSession().Id = &pb.Session_Identifier{Id: id} - - s.upsertSession(req.GetSession(), req.GetWaitForUpdate()) - + thisSession.Id = &pb.Session_Identifier{Id: id} + cameraID := thisSession.GetCamera().GetId() s.mu.Lock() defer s.mu.Unlock() - // Spin off goroutine to eventually cleanup the session - go s.scheduleCleanup(id, time.Minute) + sess := &session{ + id: id, + cameraID: cameraID, + createTime: time.Now(), + toCamera: make(chan *pb.IceMessage, 100), + toClient: make(chan *pb.IceMessage, 100), + } + s.sessionsByCamera[cameraID] <- sess + s.sessionsById[id] = sess - returnSession := s.sessionsById[id] - - return connect.NewResponse(returnSession), nil + return connect.NewResponse(thisSession), nil } -// UpdateSession updates the session -func (s *Server) UpdateSession(ctx context.Context, request *connect.Request[pb.UpdateSessionRequest]) (*connect.Response[pb.Session], error) { - req := request.Msg - id := req.GetSession().GetId().GetId() - s.mu.Lock() - if _, ok := s.sessionsById[id]; !ok { - s.mu.Unlock() - return nil, status.Errorf(codes.NotFound, "no such session %q", id) +func (s *Server) PopSession(ctx context.Context, request *connect.Request[pb.PopSessionRequest]) (*connect.Response[pb.Session], error) { + authToken, err := getAuthToken(request) + if err != nil { + return nil, err } + + s.mu.Lock() + + if _, ok := s.camerasByHome[authToken.Home]; !ok { + return nil, status.Errorf(codes.NotFound, "home %q not found", authToken.Home) + } + if _, ok := s.camerasByHome[authToken.Home][authToken.Uid]; !ok { + return nil, status.Errorf(codes.Unauthenticated, "you are not a camera") + } + + ch := s.sessionsByCamera[authToken.Uid] s.mu.Unlock() - s.upsertSession(req.GetSession(), req.WaitForUpdate) + sess := <-ch + + return connect.NewResponse(&pb.Session{ + Id: &pb.Session_Identifier{ + Id: sess.id, + }, + }), nil +} + +func (s *Server) CreateIceMessage(ctx context.Context, request *connect.Request[pb.CreateIceMessageRequest]) (*connect.Response[pb.IceMessage], error) { + authToken, err := getAuthToken(request) + if err != nil { + return nil, err + } + req := request.Msg s.mu.Lock() defer s.mu.Unlock() - returnSession := s.sessionsById[id] - - return connect.NewResponse(returnSession), nil -} - -// ListSessions lists all sessions the client should consider. -// -// TODO: it would be better if we could alert a camera to poll for sessions -// i.e., with websockets (or streaming RPCs). -func (s *Server) ListSessions(context.Context, *connect.Request[pb.ListSessionsRequest]) (*connect.Response[pb.ListSessionsResponse], error) { - var sessions []*pb.Session - for _, session := range s.sessionsById { - sessions = append(sessions, session) + session, ok := s.sessionsById[req.GetSessionIdentifier().GetId()] + if !ok { + return nil, status.Errorf(codes.NotFound, "unknown session") } - return connect.NewResponse(&pb.ListSessionsResponse{Sessions: sessions}), nil + + if _, ok := s.camerasByHome[authToken.Home]; !ok { + return nil, status.Errorf(codes.NotFound, "home %q not found", authToken.Home) + } + _, isCamera := s.camerasByHome[authToken.Home][authToken.Uid] + + session.createTime = time.Now() + msg := req.GetIceMessage() + if isCamera { + session.toClient <- msg + } else { + session.toCamera <- msg + } + return connect.NewResponse(msg), nil } -func (s *Server) CreateIceCandidate(context.Context, *connect.Request[pb.CreateIceCandidateRequest]) (*connect.Response[pb.IceCandidate], error) { - return nil, fmt.Errorf("") -} +func (s *Server) PopIceMessage(ctx context.Context, request *connect.Request[pb.PopIceMessageRequest]) (*connect.Response[pb.IceMessage], error) { + authToken, err := getAuthToken(request) + if err != nil { + return nil, err + } + req := request.Msg -func (s *Server) PopIceCandidate(context.Context, *connect.Request[pb.PopIceCandidateRequest]) (*connect.Response[pb.IceCandidate], error) { - return nil, fmt.Errorf("") -} - -func (s *Server) CreateIceSessionDescription(context.Context, *connect.Request[pb.CreateIceSessionDescriptionRequest]) (*connect.Response[pb.IceSessionDescription], error) { - return nil, fmt.Errorf("") -} - -func (s *Server) PopIceSessionDescription(context.Context, *connect.Request[pb.PopIceSessionDescriptionRequest]) (*connect.Response[pb.IceSessionDescription], error) { - return nil, fmt.Errorf("") -} - -// upsertSession updates or creates a session, optionally blocking until the session is updated -// again in the future. -// -// WARN: this function locks and unlocks s.mu; make sure no locks are held or it will block forever. -func (s *Server) upsertSession(session *pb.Session, waitForUpdate bool) { s.mu.Lock() - defer s.mu.Unlock() - id := session.Id.Id - s.sessionsById[id] = session - cameraID := session.GetCamera().GetId() - if _, ok := s.sessionsByCamera[cameraID]; !ok { - s.sessionsByCamera[cameraID] = make(map[string]*pb.Session) + if _, ok := s.camerasByHome[authToken.Home]; !ok { + return nil, status.Errorf(codes.NotFound, "home %q not found", authToken.Home) } - s.sessionsByCamera[cameraID][id] = session + _, isCamera := s.camerasByHome[authToken.Home][authToken.Uid] + session := s.sessionsById[req.GetSessionIdentifier().GetId()] + session.createTime = time.Now() + s.mu.Unlock() - // Alert anything that needs to go - for _, waiter := range s.waitersBySessionId[id] { - waiter <- true - close(waiter) + var msg *pb.IceMessage + if isCamera { + msg = <-session.toCamera + } else { + msg = <-session.toClient } - s.waitersBySessionId[id] = nil + return connect.NewResponse(msg), nil +} - if waitForUpdate { - waitChan := make(chan bool) - s.waitersBySessionId[id] = append(s.waitersBySessionId[id], waitChan) - defer func() { - <-waitChan +func (s *Server) cleanup() { + ticker := time.NewTicker(time.Minute * 5) + for t := range ticker.C { + func() { + s.mu.Lock() + defer s.mu.Unlock() + + // Look for any stale sessions + staleSessionsByCamera := make(map[string]*session) + for _, session := range s.sessionsById { + if t.Sub(session.createTime) > time.Minute { + if prev, ok := staleSessionsByCamera[session.cameraID]; ok { + // Only use this session if it was created after the previous one + if prev.createTime.Before(session.createTime) { + staleSessionsByCamera[session.cameraID] = session + } + } else { + staleSessionsByCamera[session.cameraID] = session + } + } + } + + for camera, lastSession := range staleSessionsByCamera { + // Consume from the chanel until we remove all stale sessions + for sess := range s.sessionsByCamera[camera] { + if sess == lastSession { + // We consumed all stale channels; break + break + } + } + } }() } } -func (s *Server) scheduleCleanup(sessionID string, waitPeriod time.Duration) { - time.Sleep(waitPeriod) - - s.mu.Lock() - defer s.mu.Unlock() - - session := s.sessionsById[sessionID] - for _, water := range s.waitersBySessionId[sessionID] { - water <- true - close(water) - } - delete(s.sessionsByCamera[session.GetCamera().GetId()], sessionID) - delete(s.sessionsById, sessionID) - delete(s.waitersBySessionId, sessionID) -} - func getAuthToken[T any](req *connect.Request[T]) (*internalpb.AuthToken, error) { - authHeader := req.Header().Get(http.CanonicalHeaderKey("Authorization")) + authHeader := req.Header().Get("Authorization") + if !strings.HasPrefix(authHeader, "Bearer ") { + return nil, fmt.Errorf("invalid authorization token") + } + authHeader = authHeader[len("Bearer "):] bytes, err := base64.URLEncoding.DecodeString(authHeader) if err != nil { return nil, status.Errorf(codes.InvalidArgument, "malformed authorization header (extract)") diff --git a/proto/signaler_service.proto b/proto/signaler_service.proto index 11f38f5..b43af0f 100644 --- a/proto/signaler_service.proto +++ b/proto/signaler_service.proto @@ -11,23 +11,17 @@ service SignalerService { // Optionally, wait_for_update can be set to prevent returning until the Camera has seen the // session request, populated candidates, and returned a session offer. rpc CreateSession(CreateSessionRequest) returns (Session); - // UpdateSession updates the session - rpc UpdateSession(UpdateSessionRequest) returns (Session); - // ListSessions lists all sessions the client should consider. + // PopSession deletes a session from the list of sessions, and returns it. // - // TODO: it would be better if we could alert a camera to poll for sessions - // i.e., with websockets (or streaming RPCs). - rpc ListSessions(ListSessionsRequest) returns (ListSessionsResponse); + // If there are no sessions, this blocks until one becomes available. + rpc PopSession(PopSessionRequest) returns (Session); - // CreateIceCandidate adds the provided candidate to the list of candidates. - rpc CreateIceCandidate(CreateIceCandidateRequest) returns (IceCandidate); - // PopIceCandidate delete a candidate from the list of candidates and returns it. + // CreateIceMessage adds the provided message to the list of candidates. + rpc CreateIceMessage(CreateIceMessageRequest) returns (IceMessage); + // PopIceCandidate delete a message from the list of messages and returns it. // - // If there are no candidates, this blocks until one becomes available. - rpc PopIceCandidate(PopIceCandidateRequest) returns (IceCandidate); - - rpc CreateIceSessionDescription(CreateIceSessionDescriptionRequest) returns (IceSessionDescription); - rpc PopIceSessionDescription(PopIceSessionDescriptionRequest) returns (IceSessionDescription); + // If there are no messages, this blocks until one becomes available. + rpc PopIceMessage(PopIceMessageRequest) returns (IceMessage); } @@ -63,6 +57,10 @@ message CreateSessionRequest { bool wait_for_update = 2; } +message PopSessionRequest { + Session session = 1; +} + message UpdateSessionRequest { Session session = 1; @@ -78,21 +76,12 @@ message ListSessionsResponse { repeated Session sessions = 1; } -message CreateIceCandidateRequest { +message CreateIceMessageRequest { Session.Identifier session_identifier = 1; - IceCandidate candidate = 2; + IceMessage ice_message = 2; } -message PopIceCandidateRequest { - Session.Identifier session_identifier = 1; -} - -message CreateIceSessionDescriptionRequest { - Session.Identifier session_identifier = 1; - IceSessionDescription description = 2; -} - -message PopIceSessionDescriptionRequest { +message PopIceMessageRequest { Session.Identifier session_identifier = 1; } @@ -103,6 +92,13 @@ message Camera { Identifier identifier = 1; } +message IceMessage { + oneof type { + IceCandidate candidate = 1; + IceSessionDescription session = 2; + } +} + message IceCandidate { // Copied from https://pkg.go.dev/github.com/pion/webrtc/v4#ICECandidateInit string candidate = 1; @@ -123,11 +119,6 @@ message Session { } Identifier id = 1; Camera.Identifier camera = 2; - repeated IceCandidate client_ice_candidates = 3; - repeated IceCandidate camera_ice_candidates = 4; - - IceSessionDescription camera_offer = 5; - IceSessionDescription client_answer = 6; } message AuthToken {