diff --git a/cmd/main.go b/cmd/main.go index c9d48362..479627e0 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -13,14 +13,8 @@ import ( "github.com/erikdubbelboer/gspt" "github.com/jetkvm/kvm" -) - -const ( - envChildID = "JETKVM_CHILD_ID" - envSubcomponent = "JETKVM_SUBCOMPONENT" - errorDumpDir = "/userdata/jetkvm/crashdump" - errorDumpLastFile = "last-crash.log" - errorDumpTemplate = "jetkvm-%s.log" + "github.com/jetkvm/kvm/internal/native" + "github.com/jetkvm/kvm/internal/supervisor" ) var ( @@ -28,14 +22,14 @@ var ( ) func program() { - subcomponentOverride := os.Getenv(envSubcomponent) + subcomponentOverride := os.Getenv(supervisor.EnvSubcomponent) if subcomponentOverride != "" { subcomponent = subcomponentOverride } switch subcomponent { case "native": gspt.SetProcTitle(os.Args[0] + " [native]") - kvm.RunNativeProcess() + native.RunNativeProcess(os.Args[0]) default: gspt.SetProcTitle(os.Args[0] + " [app]") kvm.Main() @@ -58,7 +52,7 @@ func main() { return } - childID := os.Getenv(envChildID) + childID := os.Getenv(supervisor.EnvChildID) switch childID { case "": doSupervise() @@ -90,11 +84,11 @@ func supervise() error { // run the child binary cmd := exec.Command(binPath) - lastFilePath := filepath.Join(errorDumpDir, errorDumpLastFile) + lastFilePath := filepath.Join(supervisor.ErrorDumpDir, supervisor.ErrorDumpLastFile) cmd.Env = append(os.Environ(), []string{ - fmt.Sprintf("%s=%s", envChildID, kvm.GetBuiltAppVersion()), - fmt.Sprintf("JETKVM_LAST_ERROR_PATH=%s", lastFilePath), + fmt.Sprintf("%s=%s", supervisor.EnvChildID, kvm.GetBuiltAppVersion()), + fmt.Sprintf("%s=%s", supervisor.ErrorDumpLastFile, lastFilePath), }...) cmd.Args = os.Args @@ -202,11 +196,11 @@ func renameFile(f *os.File, newName string) error { func ensureErrorDumpDir() error { // TODO: check if the directory is writable - f, err := os.Stat(errorDumpDir) + f, err := os.Stat(supervisor.ErrorDumpDir) if err == nil && f.IsDir() { return nil } - if err := os.MkdirAll(errorDumpDir, 0755); err != nil { + if err := os.MkdirAll(supervisor.ErrorDumpDir, 0755); err != nil { return fmt.Errorf("failed to create error dump directory: %w", err) } return nil @@ -216,7 +210,7 @@ func createErrorDump(logFile *os.File) { fmt.Println() fileName := fmt.Sprintf( - errorDumpTemplate, + supervisor.ErrorDumpTemplate, time.Now().Format("20060102-150405"), ) @@ -226,7 +220,7 @@ func createErrorDump(logFile *os.File) { return } - filePath := filepath.Join(errorDumpDir, fileName) + filePath := filepath.Join(supervisor.ErrorDumpDir, fileName) if err := renameFile(logFile, filePath); err != nil { fmt.Printf("failed to rename file: %v\n", err) return @@ -234,7 +228,7 @@ func createErrorDump(logFile *os.File) { fmt.Printf("error dump copied: %s\n", filePath) - lastFilePath := filepath.Join(errorDumpDir, errorDumpLastFile) + lastFilePath := filepath.Join(supervisor.ErrorDumpDir, supervisor.ErrorDumpLastFile) if err := ensureSymlink(filePath, lastFilePath); err != nil { fmt.Printf("failed to create symlink: %v\n", err) diff --git a/go.mod b/go.mod index bcfbf2cc..aac58799 100644 --- a/go.mod +++ b/go.mod @@ -44,6 +44,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/bytedance/sonic v1.14.0 // indirect github.com/bytedance/sonic/loader v0.3.0 // indirect + github.com/caarlos0/env/v11 v11.3.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudwego/base64x v0.1.6 // indirect github.com/creack/goselect v0.1.2 // indirect @@ -87,6 +88,7 @@ require ( github.com/prometheus/client_model v0.6.2 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect github.com/rogpeppe/go-internal v1.14.1 // indirect + github.com/spf13/pflag v1.0.10 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/u-root/uio v0.0.0-20230220225925-ffce2a382923 // indirect github.com/ugorji/go/codec v1.3.0 // indirect diff --git a/go.sum b/go.sum index 45ce4685..8d33b159 100644 --- a/go.sum +++ b/go.sum @@ -12,6 +12,8 @@ github.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQ github.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA= github.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA= github.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI= +github.com/caarlos0/env/v11 v11.3.1 h1:cArPWC15hWmEt+gWk7YBi7lEXTXCvpaSdCiZE2X5mCA= +github.com/caarlos0/env/v11 v11.3.1/go.mod h1:qupehSf/Y0TUTsxKywqRt/vJjN5nz6vauiYEUUr8P4U= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chemhack/go-nbd v0.0.0-20241006125820-59e45f5b1e7b h1:dSbDgy72Y1sjLPWLv7vs0fMFuhMBMViiT9PJZiZWZNs= @@ -173,6 +175,8 @@ github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY= github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ= github.com/sourcegraph/tf-dag v0.2.2-0.20250131204052-3e8ff1477b4f h1:VgoRCP1efSCEZIcF2THLQ46+pIBzzgNiaUBe9wEDwYU= github.com/sourcegraph/tf-dag v0.2.2-0.20250131204052-3e8ff1477b4f/go.mod h1:pzro7BGorij2WgrjEammtrkbo3+xldxo+KaGLGUiD+Q= +github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= +github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= diff --git a/internal/native/grpc_client.go b/internal/native/grpc_client.go new file mode 100644 index 00000000..ffb6e5b7 --- /dev/null +++ b/internal/native/grpc_client.go @@ -0,0 +1,418 @@ +package native + +import ( + "context" + "errors" + "fmt" + "sync" + "time" + + "github.com/rs/zerolog" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/status" + + pb "github.com/jetkvm/kvm/internal/native/proto" +) + +// GRPCClient wraps the gRPC client for the native service +type GRPCClient struct { + conn *grpc.ClientConn + client pb.NativeServiceClient + logger *zerolog.Logger + + eventStream pb.NativeService_StreamEventsClient + eventM sync.RWMutex + eventCh chan *pb.Event + eventDone chan struct{} + + closed bool + closeM sync.Mutex +} + +// NewGRPCClient creates a new gRPC client connected to the native service +func NewGRPCClient(socketPath string, logger *zerolog.Logger) (*GRPCClient, error) { + // Connect to the Unix domain socket + conn, err := grpc.NewClient( + fmt.Sprintf("unix-abstract:%v", socketPath), + grpc.WithTransportCredentials(insecure.NewCredentials()), + ) + if err != nil { + return nil, fmt.Errorf("failed to connect to gRPC server: %w", err) + } + + client := pb.NewNativeServiceClient(conn) + + grpcClient := &GRPCClient{ + conn: conn, + client: client, + logger: logger, + eventCh: make(chan *pb.Event, 100), + eventDone: make(chan struct{}), + } + + // Start event stream + go grpcClient.startEventStream() + + return grpcClient, nil +} + +func (c *GRPCClient) startEventStream() { + // for { + // return + // c.closeM.Lock() + // if c.closed { + // c.closeM.Unlock() + // return + // } + // c.closeM.Unlock() + + // ctx := context.Background() + // stream, err := c.client.StreamEvents(ctx, &pb.Empty{}) + // if err != nil { + // c.logger.Warn().Err(err).Msg("failed to start event stream, retrying...") + // time.Sleep(1 * time.Second) + // continue + // } + + // c.eventM.Lock() + // c.eventStream = stream + // c.eventM.Unlock() + + // for { + // event, err := stream.Recv() + // if err == io.EOF { + // c.logger.Debug().Msg("event stream closed") + // break + // } + // if err != nil { + // c.logger.Warn().Err(err).Msg("event stream error") + // break + // } + + // select { + // case c.eventCh <- event: + // default: + // c.logger.Warn().Msg("event channel full, dropping event") + // } + // } + + // c.eventM.Lock() + // c.eventStream = nil + // c.eventM.Unlock() + + // // Wait before retrying + // time.Sleep(1 * time.Second) + // } +} + +func (c *GRPCClient) checkIsReady(ctx context.Context) error { + c.logger.Info().Msg("connection is idle, connecting...") + resp, err := c.client.IsReady(ctx, &pb.IsReadyRequest{}) + if err != nil { + if errors.Is(err, status.Error(codes.Unavailable, "")) { + return fmt.Errorf("timeout waiting for ready: %w", err) + } + return fmt.Errorf("failed to check if ready: %w", err) + } + if resp.Ready { + return nil + } + return nil +} + +// WaitReady waits for the gRPC connection to be ready +func (c *GRPCClient) WaitReady() error { + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() + + for { + state := c.conn.GetState() + if state == connectivity.Idle || state == connectivity.Ready { + if err := c.checkIsReady(ctx); err != nil { + time.Sleep(1 * time.Second) + continue + } + } + + c.logger.Info().Str("state", state.String()).Msg("waiting for connection to be ready") + if state == connectivity.Ready { + return nil + } + if state == connectivity.Shutdown { + return fmt.Errorf("connection failed: %v", state) + } + + if !c.conn.WaitForStateChange(ctx, state) { + return ctx.Err() + } + } +} + +// OnEvent registers an event handler +func (c *GRPCClient) OnEvent(eventType string, handler func(data interface{})) { + return + // go func() { + // for { + // select { + // case event := <-c.eventCh: + // if event.Type == eventType { + // var data interface{} + // switch eventType { + // case "video_state_change": + // if event.VideoState != nil { + // data = VideoState{ + // Ready: event.VideoState.Ready, + // Error: event.VideoState.Error, + // Width: int(event.VideoState.Width), + // Height: int(event.VideoState.Height), + // FramePerSecond: event.VideoState.FramePerSecond, + // } + // } + // case "indev_event": + // data = event.IndevEvent + // case "rpc_event": + // data = event.RpcEvent + // case "video_frame": + // if event.VideoFrame != nil { + // data = map[string]interface{}{ + // "frame": event.VideoFrame.Frame, + // "duration": time.Duration(event.VideoFrame.DurationNs), + // } + // } + // } + // if data != nil { + // handler(data) + // } + // } + // case <-c.eventDone: + // return + // } + // } + // }() +} + +// Close closes the gRPC client +func (c *GRPCClient) Close() error { + c.closeM.Lock() + defer c.closeM.Unlock() + if c.closed { + return nil + } + c.closed = true + + close(c.eventDone) + + c.eventM.Lock() + if c.eventStream != nil { + c.eventStream.CloseSend() + } + c.eventM.Unlock() + + return c.conn.Close() +} + +// Video methods +func (c *GRPCClient) VideoSetSleepMode(enabled bool) error { + _, err := c.client.VideoSetSleepMode(context.Background(), &pb.VideoSetSleepModeRequest{Enabled: enabled}) + return err +} + +func (c *GRPCClient) VideoGetSleepMode() (bool, error) { + resp, err := c.client.VideoGetSleepMode(context.Background(), &pb.Empty{}) + if err != nil { + return false, err + } + return resp.Enabled, nil +} + +func (c *GRPCClient) VideoSleepModeSupported() bool { + resp, err := c.client.VideoSleepModeSupported(context.Background(), &pb.Empty{}) + if err != nil { + return false + } + return resp.Supported +} + +func (c *GRPCClient) VideoSetQualityFactor(factor float64) error { + _, err := c.client.VideoSetQualityFactor(context.Background(), &pb.VideoSetQualityFactorRequest{Factor: factor}) + return err +} + +func (c *GRPCClient) VideoGetQualityFactor() (float64, error) { + resp, err := c.client.VideoGetQualityFactor(context.Background(), &pb.Empty{}) + if err != nil { + return 0, err + } + return resp.Factor, nil +} + +func (c *GRPCClient) VideoSetEDID(edid string) error { + _, err := c.client.VideoSetEDID(context.Background(), &pb.VideoSetEDIDRequest{Edid: edid}) + return err +} + +func (c *GRPCClient) VideoGetEDID() (string, error) { + resp, err := c.client.VideoGetEDID(context.Background(), &pb.Empty{}) + if err != nil { + return "", err + } + return resp.Edid, nil +} + +func (c *GRPCClient) VideoLogStatus() (string, error) { + resp, err := c.client.VideoLogStatus(context.Background(), &pb.Empty{}) + if err != nil { + return "", err + } + return resp.Status, nil +} + +func (c *GRPCClient) VideoStop() error { + _, err := c.client.VideoStop(context.Background(), &pb.Empty{}) + return err +} + +func (c *GRPCClient) VideoStart() error { + _, err := c.client.VideoStart(context.Background(), &pb.Empty{}) + return err +} + +// UI methods +func (c *GRPCClient) GetLVGLVersion() (string, error) { + resp, err := c.client.GetLVGLVersion(context.Background(), &pb.Empty{}) + if err != nil { + return "", err + } + return resp.Version, nil +} + +func (c *GRPCClient) UIObjHide(objName string) (bool, error) { + resp, err := c.client.UIObjHide(context.Background(), &pb.UIObjHideRequest{ObjName: objName}) + if err != nil { + return false, err + } + return resp.Success, nil +} + +func (c *GRPCClient) UIObjShow(objName string) (bool, error) { + resp, err := c.client.UIObjShow(context.Background(), &pb.UIObjShowRequest{ObjName: objName}) + if err != nil { + return false, err + } + return resp.Success, nil +} + +func (c *GRPCClient) UISetVar(name string, value string) { + _, _ = c.client.UISetVar(context.Background(), &pb.UISetVarRequest{Name: name, Value: value}) +} + +func (c *GRPCClient) UIGetVar(name string) string { + resp, err := c.client.UIGetVar(context.Background(), &pb.UIGetVarRequest{Name: name}) + if err != nil { + return "" + } + return resp.Value +} + +func (c *GRPCClient) UIObjAddState(objName string, state string) (bool, error) { + resp, err := c.client.UIObjAddState(context.Background(), &pb.UIObjAddStateRequest{ObjName: objName, State: state}) + if err != nil { + return false, err + } + return resp.Success, nil +} + +func (c *GRPCClient) UIObjClearState(objName string, state string) (bool, error) { + resp, err := c.client.UIObjClearState(context.Background(), &pb.UIObjClearStateRequest{ObjName: objName, State: state}) + if err != nil { + return false, err + } + return resp.Success, nil +} + +func (c *GRPCClient) UIObjAddFlag(objName string, flag string) (bool, error) { + resp, err := c.client.UIObjAddFlag(context.Background(), &pb.UIObjAddFlagRequest{ObjName: objName, Flag: flag}) + if err != nil { + return false, err + } + return resp.Success, nil +} + +func (c *GRPCClient) UIObjClearFlag(objName string, flag string) (bool, error) { + resp, err := c.client.UIObjClearFlag(context.Background(), &pb.UIObjClearFlagRequest{ObjName: objName, Flag: flag}) + if err != nil { + return false, err + } + return resp.Success, nil +} + +func (c *GRPCClient) UIObjSetOpacity(objName string, opacity int) (bool, error) { + resp, err := c.client.UIObjSetOpacity(context.Background(), &pb.UIObjSetOpacityRequest{ObjName: objName, Opacity: int32(opacity)}) + if err != nil { + return false, err + } + return resp.Success, nil +} + +func (c *GRPCClient) UIObjFadeIn(objName string, duration uint32) (bool, error) { + resp, err := c.client.UIObjFadeIn(context.Background(), &pb.UIObjFadeInRequest{ObjName: objName, Duration: duration}) + if err != nil { + return false, err + } + return resp.Success, nil +} + +func (c *GRPCClient) UIObjFadeOut(objName string, duration uint32) (bool, error) { + resp, err := c.client.UIObjFadeOut(context.Background(), &pb.UIObjFadeOutRequest{ObjName: objName, Duration: duration}) + if err != nil { + return false, err + } + return resp.Success, nil +} + +func (c *GRPCClient) UIObjSetLabelText(objName string, text string) (bool, error) { + resp, err := c.client.UIObjSetLabelText(context.Background(), &pb.UIObjSetLabelTextRequest{ObjName: objName, Text: text}) + if err != nil { + return false, err + } + return resp.Success, nil +} + +func (c *GRPCClient) UIObjSetImageSrc(objName string, image string) (bool, error) { + resp, err := c.client.UIObjSetImageSrc(context.Background(), &pb.UIObjSetImageSrcRequest{ObjName: objName, Image: image}) + if err != nil { + return false, err + } + return resp.Success, nil +} + +func (c *GRPCClient) DisplaySetRotation(rotation uint16) (bool, error) { + resp, err := c.client.DisplaySetRotation(context.Background(), &pb.DisplaySetRotationRequest{Rotation: uint32(rotation)}) + if err != nil { + return false, err + } + return resp.Success, nil +} + +func (c *GRPCClient) UpdateLabelIfChanged(objName string, newText string) { + _, _ = c.client.UpdateLabelIfChanged(context.Background(), &pb.UpdateLabelIfChangedRequest{ObjName: objName, NewText: newText}) +} + +func (c *GRPCClient) UpdateLabelAndChangeVisibility(objName string, newText string) { + _, _ = c.client.UpdateLabelAndChangeVisibility(context.Background(), &pb.UpdateLabelAndChangeVisibilityRequest{ObjName: objName, NewText: newText}) +} + +func (c *GRPCClient) SwitchToScreenIf(screenName string, shouldSwitch []string) { + _, _ = c.client.SwitchToScreenIf(context.Background(), &pb.SwitchToScreenIfRequest{ScreenName: screenName, ShouldSwitch: shouldSwitch}) +} + +func (c *GRPCClient) SwitchToScreenIfDifferent(screenName string) { + _, _ = c.client.SwitchToScreenIfDifferent(context.Background(), &pb.SwitchToScreenIfDifferentRequest{ScreenName: screenName}) +} + +func (c *GRPCClient) DoNotUseThisIsForCrashTestingOnly() { + _, _ = c.client.DoNotUseThisIsForCrashTestingOnly(context.Background(), &pb.Empty{}) +} diff --git a/internal/native/grpc_server.go b/internal/native/grpc_server.go index b5fcce4a..e00a3908 100644 --- a/internal/native/grpc_server.go +++ b/internal/native/grpc_server.go @@ -4,8 +4,6 @@ import ( "context" "fmt" "net" - "os" - "path/filepath" "sync" "time" @@ -47,12 +45,14 @@ func NewGRPCServer(n *Native, logger *zerolog.Logger) *grpcServer { } event := &pb.Event{ Type: "video_state_change", - VideoState: &pb.VideoState{ - Ready: state.Ready, - Error: state.Error, - Width: int32(state.Width), - Height: int32(state.Height), - FramePerSecond: state.FramePerSecond, + Data: &pb.Event_VideoState{ + VideoState: &pb.VideoState{ + Ready: state.Ready, + Error: state.Error, + Width: int32(state.Width), + Height: int32(state.Height), + FramePerSecond: state.FramePerSecond, + }, }, } s.broadcastEvent(event) @@ -63,8 +63,10 @@ func NewGRPCServer(n *Native, logger *zerolog.Logger) *grpcServer { originalIndevEvent(event) } s.broadcastEvent(&pb.Event{ - Type: "indev_event", - IndevEvent: event, + Type: "indev_event", + Data: &pb.Event_IndevEvent{ + IndevEvent: event, + }, }) } @@ -73,8 +75,10 @@ func NewGRPCServer(n *Native, logger *zerolog.Logger) *grpcServer { originalRpcEvent(event) } s.broadcastEvent(&pb.Event{ - Type: "rpc_event", - RpcEvent: event, + Type: "rpc_event", + Data: &pb.Event_RpcEvent{ + RpcEvent: event, + }, }) } @@ -84,9 +88,11 @@ func NewGRPCServer(n *Native, logger *zerolog.Logger) *grpcServer { } s.broadcastEvent(&pb.Event{ Type: "video_frame", - VideoFrame: &pb.VideoFrame{ - Frame: frame, - DurationNs: duration.Nanoseconds(), + Data: &pb.Event_VideoFrame{ + VideoFrame: &pb.VideoFrame{ + Frame: frame, + DurationNs: duration.Nanoseconds(), + }, }, }) } @@ -107,6 +113,10 @@ func (s *grpcServer) broadcastEvent(event *pb.Event) { } } +func (s *grpcServer) IsReady(ctx context.Context, req *pb.IsReadyRequest) (*pb.IsReadyResponse, error) { + return &pb.IsReadyResponse{Ready: true, VideoReady: true}, nil +} + // Video methods func (s *grpcServer) VideoSetSleepMode(ctx context.Context, req *pb.VideoSetSleepModeRequest) (*pb.Empty, error) { if err := s.native.VideoSetSleepMode(req.Enabled); err != nil { @@ -356,17 +366,6 @@ func (s *grpcServer) StreamEvents(req *pb.Empty, stream pb.NativeService_StreamE // StartGRPCServer starts the gRPC server on a Unix domain socket func StartGRPCServer(server *grpcServer, socketPath string, logger *zerolog.Logger) (*grpc.Server, net.Listener, error) { - // Remove socket if it exists - if _, err := os.Stat(socketPath); err == nil { - if err := os.Remove(socketPath); err != nil { - return nil, nil, fmt.Errorf("failed to remove existing socket: %w", err) - } - } - - // Ensure directory exists - if err := os.MkdirAll(filepath.Dir(socketPath), 0755); err != nil { - return nil, nil, fmt.Errorf("failed to create socket directory: %w", err) - } lis, err := net.Listen("unix", socketPath) if err != nil { diff --git a/internal/native/ipc.go b/internal/native/ipc.go deleted file mode 100644 index 4157c96b..00000000 --- a/internal/native/ipc.go +++ /dev/null @@ -1,293 +0,0 @@ -package native - -import ( - "bufio" - "encoding/json" - "fmt" - "io" - "sync" - "time" - - "github.com/rs/zerolog" -) - -// Request represents a JSON-RPC request -type Request struct { - JSONRPC string `json:"jsonrpc"` - ID interface{} `json:"id,omitempty"` - Method string `json:"method"` - Params json.RawMessage `json:"params,omitempty"` -} - -// Response represents a JSON-RPC response -type Response struct { - JSONRPC string `json:"jsonrpc"` - ID interface{} `json:"id,omitempty"` - Result interface{} `json:"result,omitempty"` - Error *RPCError `json:"error,omitempty"` -} - -// RPCError represents a JSON-RPC error -type RPCError struct { - Code int `json:"code"` - Message string `json:"message"` - Data interface{} `json:"data,omitempty"` -} - -// Event represents a JSON-RPC notification/event -type Event struct { - JSONRPC string `json:"jsonrpc"` - Method string `json:"method"` - Params map[string]interface{} `json:"params,omitempty"` -} - -// ProcessConfig is the configuration for the native process -type ProcessConfig struct { - Disable bool `json:"disable"` - SystemVersion string `json:"system_version"` // Serialized as string - AppVersion string `json:"app_version"` // Serialized as string - DisplayRotation uint16 `json:"display_rotation"` - DefaultQualityFactor float64 `json:"default_quality_factor"` -} - -// IPCClient handles communication with the native process -type IPCClient struct { - stdin io.WriteCloser - stdout *bufio.Scanner - logger *zerolog.Logger - - requestID int64 - requestIDM sync.Mutex - - pendingRequests map[interface{}]chan *Response - pendingM sync.Mutex - - eventHandlers map[string][]func(data interface{}) - eventM sync.RWMutex - - readyCh chan struct{} - ready bool - - closed bool - closeM sync.Mutex -} - -type processCmd interface { - Start() error - Wait() error - GetProcess() interface { - Kill() error - Signal(sig interface{}) error - } - StdinPipe() (io.WriteCloser, error) - StdoutPipe() (io.ReadCloser, error) - StderrPipe() (io.ReadCloser, error) -} - -func NewIPCClient(cmd processCmd, logger *zerolog.Logger) (*IPCClient, error) { - stdin, err := cmd.StdinPipe() - if err != nil { - return nil, fmt.Errorf("failed to get stdin pipe: %w", err) - } - - stdout, err := cmd.StdoutPipe() - if err != nil { - stdin.Close() - return nil, fmt.Errorf("failed to get stdout pipe: %w", err) - } - - client := &IPCClient{ - stdin: stdin, - stdout: bufio.NewScanner(stdout), - logger: logger, - pendingRequests: make(map[interface{}]chan *Response), - eventHandlers: make(map[string][]func(data interface{})), - readyCh: make(chan struct{}), - } - - // Start reading responses - go client.readLoop() - - return client, nil -} - -func (c *IPCClient) readLoop() { - for c.stdout.Scan() { - line := c.stdout.Bytes() - if len(line) == 0 { - continue - } - - // Try to parse as response - var resp Response - if err := json.Unmarshal(line, &resp); err == nil { - // Check if it's a ready signal (result is "ready" and no ID) - if resp.Result == "ready" && resp.ID == nil && !c.ready { - c.ready = true - close(c.readyCh) - continue - } - if resp.Result != nil || resp.Error != nil { - c.handleResponse(&resp) - continue - } - } - - // Try to parse as event - var event Event - if err := json.Unmarshal(line, &event); err == nil && event.Method == "event" { - c.handleEvent(&event) - continue - } - - c.logger.Warn().Bytes("line", line).Msg("unexpected message from native process") - } - - c.closeM.Lock() - if !c.closed { - c.closed = true - c.closeM.Unlock() - c.logger.Warn().Msg("native process stdout closed") - // Cancel all pending requests - c.pendingM.Lock() - for id, ch := range c.pendingRequests { - close(ch) - delete(c.pendingRequests, id) - } - c.pendingM.Unlock() - } else { - c.closeM.Unlock() - } -} - -func (c *IPCClient) handleResponse(resp *Response) { - c.pendingM.Lock() - ch, ok := c.pendingRequests[resp.ID] - if ok { - delete(c.pendingRequests, resp.ID) - } - c.pendingM.Unlock() - - if ok { - select { - case ch <- resp: - default: - } - } -} - -func (c *IPCClient) handleEvent(event *Event) { - if event.Method != "event" || event.Params == nil { - return - } - - eventType, ok := event.Params["type"].(string) - if !ok { - return - } - - data := event.Params["data"] - - c.eventM.RLock() - handlers := c.eventHandlers[eventType] - c.eventM.RUnlock() - - for _, handler := range handlers { - handler(data) - } -} - -func (c *IPCClient) Call(method string, params interface{}) (*Response, error) { - c.closeM.Lock() - if c.closed { - c.closeM.Unlock() - return nil, fmt.Errorf("client is closed") - } - c.closeM.Unlock() - - c.requestIDM.Lock() - c.requestID++ - id := c.requestID - c.requestIDM.Unlock() - - req := Request{ - JSONRPC: "2.0", - ID: id, - Method: method, - } - - if params != nil { - paramsBytes, err := json.Marshal(params) - if err != nil { - return nil, fmt.Errorf("failed to marshal params: %w", err) - } - req.Params = paramsBytes - } - - ch := make(chan *Response, 1) - c.pendingM.Lock() - c.pendingRequests[id] = ch - c.pendingM.Unlock() - - reqBytes, err := json.Marshal(req) - if err != nil { - c.pendingM.Lock() - delete(c.pendingRequests, id) - c.pendingM.Unlock() - return nil, fmt.Errorf("failed to marshal request: %w", err) - } - - if _, err := c.stdin.Write(append(reqBytes, '\n')); err != nil { - c.pendingM.Lock() - delete(c.pendingRequests, id) - c.pendingM.Unlock() - return nil, fmt.Errorf("failed to write request: %w", err) - } - - select { - case resp := <-ch: - if resp.Error != nil { - return nil, fmt.Errorf("RPC error: %s (code: %d)", resp.Error.Message, resp.Error.Code) - } - return resp, nil - case <-time.After(30 * time.Second): - c.pendingM.Lock() - delete(c.pendingRequests, id) - c.pendingM.Unlock() - return nil, fmt.Errorf("request timeout") - } -} - -func (c *IPCClient) OnEvent(eventType string, handler func(data interface{})) { - c.eventM.Lock() - defer c.eventM.Unlock() - c.eventHandlers[eventType] = append(c.eventHandlers[eventType], handler) -} - -func (c *IPCClient) WaitReady() error { - select { - case <-c.readyCh: - return nil - case <-time.After(10 * time.Second): - return fmt.Errorf("timeout waiting for ready signal") - } -} - -func (c *IPCClient) Close() error { - c.closeM.Lock() - defer c.closeM.Unlock() - if c.closed { - return nil - } - c.closed = true - - c.pendingM.Lock() - for id, ch := range c.pendingRequests { - close(ch) - delete(c.pendingRequests, id) - } - c.pendingM.Unlock() - - return c.stdin.Close() -} - diff --git a/internal/native/log.go b/internal/native/log.go index 41ae4df9..d74b81a2 100644 --- a/internal/native/log.go +++ b/internal/native/log.go @@ -1,11 +1,14 @@ package native import ( + "os" + "github.com/jetkvm/kvm/internal/logging" "github.com/rs/zerolog" ) -var nativeLogger = logging.GetSubsystemLogger("native") +var nativeL = logging.GetSubsystemLogger("native").With().Int("pid", os.Getpid()).Logger() +var nativeLogger = &nativeL var displayLogger = logging.GetSubsystemLogger("display") type nativeLogMessage struct { diff --git a/internal/native/native.go b/internal/native/native.go index e772db52..edf5217a 100644 --- a/internal/native/native.go +++ b/internal/native/native.go @@ -28,11 +28,11 @@ type Native struct { } type NativeOptions struct { - Disable bool - SystemVersion *semver.Version - AppVersion *semver.Version - DisplayRotation uint16 - DefaultQualityFactor float64 + Disable bool `env:"JETKVM_NATIVE_DISABLE"` + SystemVersion *semver.Version `env:"JETKVM_NATIVE_SYSTEM_VERSION"` + AppVersion *semver.Version `env:"JETKVM_NATIVE_APP_VERSION"` + DisplayRotation uint16 `env:"JETKVM_NATIVE_DISPLAY_ROTATION"` + DefaultQualityFactor float64 `env:"JETKVM_NATIVE_DEFAULT_QUALITY_FACTOR"` OnVideoStateChange func(state VideoState) OnVideoFrameReceived func(frame []byte, duration time.Duration) OnIndevEvent func(event string) @@ -50,7 +50,7 @@ func NewNative(opts NativeOptions) *Native { onVideoFrameReceived := opts.OnVideoFrameReceived if onVideoFrameReceived == nil { onVideoFrameReceived = func(frame []byte, duration time.Duration) { - nativeLogger.Info().Interface("frame", frame).Dur("duration", duration).Msg("video frame received") + nativeLogger.Trace().Interface("frame", frame).Dur("duration", duration).Msg("video frame received") } } diff --git a/internal/native/proto/native.pb.go b/internal/native/proto/native.pb.go index 0cb58fff..7eb5fdcc 100644 --- a/internal/native/proto/native.pb.go +++ b/internal/native/proto/native.pb.go @@ -1,596 +1,2775 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// This file should be regenerated from native.proto using: -// protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative internal/native/proto/native.proto -// -// For now, this is a minimal implementation to allow compilation. -// TODO: Regenerate from proto file when protoc is available. +// versions: +// protoc-gen-go v1.36.5 +// protoc v3.21.12 +// source: internal/native/proto/native.proto package proto import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( + // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// Messages type Empty struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Empty) Reset() { *x = Empty{} + mi := &file_internal_native_proto_native_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Empty) String() string { - return "" + return protoimpl.X.MessageStringOf(x) } func (*Empty) ProtoMessage() {} func (x *Empty) ProtoReflect() protoreflect.Message { - return nil // Stub + mi := &file_internal_native_proto_native_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Empty.ProtoReflect.Descriptor instead. +func (*Empty) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{0} +} + +type IsReadyRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IsReadyRequest) Reset() { + *x = IsReadyRequest{} + mi := &file_internal_native_proto_native_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IsReadyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IsReadyRequest) ProtoMessage() {} + +func (x *IsReadyRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IsReadyRequest.ProtoReflect.Descriptor instead. +func (*IsReadyRequest) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{1} +} + +type IsReadyResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Ready bool `protobuf:"varint,1,opt,name=ready,proto3" json:"ready,omitempty"` + Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` + VideoReady bool `protobuf:"varint,3,opt,name=video_ready,json=videoReady,proto3" json:"video_ready,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IsReadyResponse) Reset() { + *x = IsReadyResponse{} + mi := &file_internal_native_proto_native_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IsReadyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IsReadyResponse) ProtoMessage() {} + +func (x *IsReadyResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IsReadyResponse.ProtoReflect.Descriptor instead. +func (*IsReadyResponse) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{2} +} + +func (x *IsReadyResponse) GetReady() bool { + if x != nil { + return x.Ready + } + return false +} + +func (x *IsReadyResponse) GetError() string { + if x != nil { + return x.Error + } + return "" +} + +func (x *IsReadyResponse) GetVideoReady() bool { + if x != nil { + return x.VideoReady + } + return false } type VideoState struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Ready bool `protobuf:"varint,1,opt,name=ready,proto3" json:"ready,omitempty"` - Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` - Width int32 `protobuf:"varint,3,opt,name=width,proto3" json:"width,omitempty"` - Height int32 `protobuf:"varint,4,opt,name=height,proto3" json:"height,omitempty"` - FramePerSecond float64 `protobuf:"fixed64,5,opt,name=frame_per_second,json=framePerSecond,proto3" json:"frame_per_second,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Ready bool `protobuf:"varint,1,opt,name=ready,proto3" json:"ready,omitempty"` + Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` + Width int32 `protobuf:"varint,3,opt,name=width,proto3" json:"width,omitempty"` + Height int32 `protobuf:"varint,4,opt,name=height,proto3" json:"height,omitempty"` + FramePerSecond float64 `protobuf:"fixed64,5,opt,name=frame_per_second,json=framePerSecond,proto3" json:"frame_per_second,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *VideoState) Reset() { *x = VideoState{} + mi := &file_internal_native_proto_native_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *VideoState) String() string { - return "" + return protoimpl.X.MessageStringOf(x) } func (*VideoState) ProtoMessage() {} func (x *VideoState) ProtoReflect() protoreflect.Message { - return nil // Stub + mi := &file_internal_native_proto_native_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VideoState.ProtoReflect.Descriptor instead. +func (*VideoState) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{3} +} + +func (x *VideoState) GetReady() bool { + if x != nil { + return x.Ready + } + return false +} + +func (x *VideoState) GetError() string { + if x != nil { + return x.Error + } + return "" +} + +func (x *VideoState) GetWidth() int32 { + if x != nil { + return x.Width + } + return 0 +} + +func (x *VideoState) GetHeight() int32 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *VideoState) GetFramePerSecond() float64 { + if x != nil { + return x.FramePerSecond + } + return 0 } -// Request/Response types - minimal implementations type VideoSetSleepModeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` unknownFields protoimpl.UnknownFields - Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *VideoSetSleepModeRequest) Reset() { *x = VideoSetSleepModeRequest{} } -func (x *VideoSetSleepModeRequest) String() string { return "" } -func (*VideoSetSleepModeRequest) ProtoMessage() {} -func (x *VideoSetSleepModeRequest) ProtoReflect() protoreflect.Message { return nil } +func (x *VideoSetSleepModeRequest) Reset() { + *x = VideoSetSleepModeRequest{} + mi := &file_internal_native_proto_native_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VideoSetSleepModeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VideoSetSleepModeRequest) ProtoMessage() {} + +func (x *VideoSetSleepModeRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VideoSetSleepModeRequest.ProtoReflect.Descriptor instead. +func (*VideoSetSleepModeRequest) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{4} +} + +func (x *VideoSetSleepModeRequest) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} type VideoGetSleepModeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` unknownFields protoimpl.UnknownFields - Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *VideoGetSleepModeResponse) Reset() { *x = VideoGetSleepModeResponse{} } -func (x *VideoGetSleepModeResponse) String() string { return "" } -func (*VideoGetSleepModeResponse) ProtoMessage() {} -func (x *VideoGetSleepModeResponse) ProtoReflect() protoreflect.Message { return nil } +func (x *VideoGetSleepModeResponse) Reset() { + *x = VideoGetSleepModeResponse{} + mi := &file_internal_native_proto_native_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VideoGetSleepModeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VideoGetSleepModeResponse) ProtoMessage() {} + +func (x *VideoGetSleepModeResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VideoGetSleepModeResponse.ProtoReflect.Descriptor instead. +func (*VideoGetSleepModeResponse) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{5} +} + +func (x *VideoGetSleepModeResponse) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} type VideoSleepModeSupportedResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Supported bool `protobuf:"varint,1,opt,name=supported,proto3" json:"supported,omitempty"` unknownFields protoimpl.UnknownFields - Supported bool `protobuf:"varint,1,opt,name=supported,proto3" json:"supported,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *VideoSleepModeSupportedResponse) Reset() { *x = VideoSleepModeSupportedResponse{} } -func (x *VideoSleepModeSupportedResponse) String() string { return "" } -func (*VideoSleepModeSupportedResponse) ProtoMessage() {} -func (x *VideoSleepModeSupportedResponse) ProtoReflect() protoreflect.Message { return nil } +func (x *VideoSleepModeSupportedResponse) Reset() { + *x = VideoSleepModeSupportedResponse{} + mi := &file_internal_native_proto_native_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VideoSleepModeSupportedResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VideoSleepModeSupportedResponse) ProtoMessage() {} + +func (x *VideoSleepModeSupportedResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VideoSleepModeSupportedResponse.ProtoReflect.Descriptor instead. +func (*VideoSleepModeSupportedResponse) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{6} +} + +func (x *VideoSleepModeSupportedResponse) GetSupported() bool { + if x != nil { + return x.Supported + } + return false +} type VideoSetQualityFactorRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Factor float64 `protobuf:"fixed64,1,opt,name=factor,proto3" json:"factor,omitempty"` unknownFields protoimpl.UnknownFields - Factor float64 `protobuf:"fixed64,1,opt,name=factor,proto3" json:"factor,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *VideoSetQualityFactorRequest) Reset() { *x = VideoSetQualityFactorRequest{} } -func (x *VideoSetQualityFactorRequest) String() string { return "" } -func (*VideoSetQualityFactorRequest) ProtoMessage() {} -func (x *VideoSetQualityFactorRequest) ProtoReflect() protoreflect.Message { return nil } +func (x *VideoSetQualityFactorRequest) Reset() { + *x = VideoSetQualityFactorRequest{} + mi := &file_internal_native_proto_native_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VideoSetQualityFactorRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VideoSetQualityFactorRequest) ProtoMessage() {} + +func (x *VideoSetQualityFactorRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VideoSetQualityFactorRequest.ProtoReflect.Descriptor instead. +func (*VideoSetQualityFactorRequest) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{7} +} + +func (x *VideoSetQualityFactorRequest) GetFactor() float64 { + if x != nil { + return x.Factor + } + return 0 +} type VideoGetQualityFactorResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Factor float64 `protobuf:"fixed64,1,opt,name=factor,proto3" json:"factor,omitempty"` unknownFields protoimpl.UnknownFields - Factor float64 `protobuf:"fixed64,1,opt,name=factor,proto3" json:"factor,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *VideoGetQualityFactorResponse) Reset() { *x = VideoGetQualityFactorResponse{} } -func (x *VideoGetQualityFactorResponse) String() string { return "" } -func (*VideoGetQualityFactorResponse) ProtoMessage() {} -func (x *VideoGetQualityFactorResponse) ProtoReflect() protoreflect.Message { return nil } +func (x *VideoGetQualityFactorResponse) Reset() { + *x = VideoGetQualityFactorResponse{} + mi := &file_internal_native_proto_native_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VideoGetQualityFactorResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VideoGetQualityFactorResponse) ProtoMessage() {} + +func (x *VideoGetQualityFactorResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VideoGetQualityFactorResponse.ProtoReflect.Descriptor instead. +func (*VideoGetQualityFactorResponse) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{8} +} + +func (x *VideoGetQualityFactorResponse) GetFactor() float64 { + if x != nil { + return x.Factor + } + return 0 +} type VideoSetEDIDRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Edid string `protobuf:"bytes,1,opt,name=edid,proto3" json:"edid,omitempty"` unknownFields protoimpl.UnknownFields - Edid string `protobuf:"bytes,1,opt,name=edid,proto3" json:"edid,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *VideoSetEDIDRequest) Reset() { *x = VideoSetEDIDRequest{} } -func (x *VideoSetEDIDRequest) String() string { return "" } -func (*VideoSetEDIDRequest) ProtoMessage() {} -func (x *VideoSetEDIDRequest) ProtoReflect() protoreflect.Message { return nil } +func (x *VideoSetEDIDRequest) Reset() { + *x = VideoSetEDIDRequest{} + mi := &file_internal_native_proto_native_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VideoSetEDIDRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VideoSetEDIDRequest) ProtoMessage() {} + +func (x *VideoSetEDIDRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VideoSetEDIDRequest.ProtoReflect.Descriptor instead. +func (*VideoSetEDIDRequest) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{9} +} + +func (x *VideoSetEDIDRequest) GetEdid() string { + if x != nil { + return x.Edid + } + return "" +} type VideoGetEDIDResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Edid string `protobuf:"bytes,1,opt,name=edid,proto3" json:"edid,omitempty"` unknownFields protoimpl.UnknownFields - Edid string `protobuf:"bytes,1,opt,name=edid,proto3" json:"edid,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *VideoGetEDIDResponse) Reset() { *x = VideoGetEDIDResponse{} } -func (x *VideoGetEDIDResponse) String() string { return "" } -func (*VideoGetEDIDResponse) ProtoMessage() {} -func (x *VideoGetEDIDResponse) ProtoReflect() protoreflect.Message { return nil } +func (x *VideoGetEDIDResponse) Reset() { + *x = VideoGetEDIDResponse{} + mi := &file_internal_native_proto_native_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VideoGetEDIDResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VideoGetEDIDResponse) ProtoMessage() {} + +func (x *VideoGetEDIDResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VideoGetEDIDResponse.ProtoReflect.Descriptor instead. +func (*VideoGetEDIDResponse) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{10} +} + +func (x *VideoGetEDIDResponse) GetEdid() string { + if x != nil { + return x.Edid + } + return "" +} type VideoLogStatusResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` unknownFields protoimpl.UnknownFields - Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *VideoLogStatusResponse) Reset() { *x = VideoLogStatusResponse{} } -func (x *VideoLogStatusResponse) String() string { return "" } -func (*VideoLogStatusResponse) ProtoMessage() {} -func (x *VideoLogStatusResponse) ProtoReflect() protoreflect.Message { return nil } +func (x *VideoLogStatusResponse) Reset() { + *x = VideoLogStatusResponse{} + mi := &file_internal_native_proto_native_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VideoLogStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VideoLogStatusResponse) ProtoMessage() {} + +func (x *VideoLogStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VideoLogStatusResponse.ProtoReflect.Descriptor instead. +func (*VideoLogStatusResponse) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{11} +} + +func (x *VideoLogStatusResponse) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} type GetLVGLVersionResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` unknownFields protoimpl.UnknownFields - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *GetLVGLVersionResponse) Reset() { *x = GetLVGLVersionResponse{} } -func (x *GetLVGLVersionResponse) String() string { return "" } -func (*GetLVGLVersionResponse) ProtoMessage() {} -func (x *GetLVGLVersionResponse) ProtoReflect() protoreflect.Message { return nil } +func (x *GetLVGLVersionResponse) Reset() { + *x = GetLVGLVersionResponse{} + mi := &file_internal_native_proto_native_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetLVGLVersionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetLVGLVersionResponse) ProtoMessage() {} + +func (x *GetLVGLVersionResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetLVGLVersionResponse.ProtoReflect.Descriptor instead. +func (*GetLVGLVersionResponse) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{12} +} + +func (x *GetLVGLVersionResponse) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} -// UI message types type UIObjHideRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` unknownFields protoimpl.UnknownFields - ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIObjHideRequest) Reset() { *x = UIObjHideRequest{} } -func (x *UIObjHideRequest) String() string { return "" } -func (*UIObjHideRequest) ProtoMessage() {} -func (x *UIObjHideRequest) ProtoReflect() protoreflect.Message { return nil } +func (x *UIObjHideRequest) Reset() { + *x = UIObjHideRequest{} + mi := &file_internal_native_proto_native_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UIObjHideRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIObjHideRequest) ProtoMessage() {} + +func (x *UIObjHideRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIObjHideRequest.ProtoReflect.Descriptor instead. +func (*UIObjHideRequest) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{13} +} + +func (x *UIObjHideRequest) GetObjName() string { + if x != nil { + return x.ObjName + } + return "" +} type UIObjHideResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` unknownFields protoimpl.UnknownFields - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIObjHideResponse) Reset() { *x = UIObjHideResponse{} } -func (x *UIObjHideResponse) String() string { return "" } -func (*UIObjHideResponse) ProtoMessage() {} -func (x *UIObjHideResponse) ProtoReflect() protoreflect.Message { return nil } +func (x *UIObjHideResponse) Reset() { + *x = UIObjHideResponse{} + mi := &file_internal_native_proto_native_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UIObjHideResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIObjHideResponse) ProtoMessage() {} + +func (x *UIObjHideResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIObjHideResponse.ProtoReflect.Descriptor instead. +func (*UIObjHideResponse) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{14} +} + +func (x *UIObjHideResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} type UIObjShowRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` unknownFields protoimpl.UnknownFields - ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIObjShowRequest) Reset() { *x = UIObjShowRequest{} } -func (x *UIObjShowRequest) String() string { return "" } -func (*UIObjShowRequest) ProtoMessage() {} -func (x *UIObjShowRequest) ProtoReflect() protoreflect.Message { return nil } +func (x *UIObjShowRequest) Reset() { + *x = UIObjShowRequest{} + mi := &file_internal_native_proto_native_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UIObjShowRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIObjShowRequest) ProtoMessage() {} + +func (x *UIObjShowRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIObjShowRequest.ProtoReflect.Descriptor instead. +func (*UIObjShowRequest) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{15} +} + +func (x *UIObjShowRequest) GetObjName() string { + if x != nil { + return x.ObjName + } + return "" +} type UIObjShowResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` unknownFields protoimpl.UnknownFields - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIObjShowResponse) Reset() { *x = UIObjShowResponse{} } -func (x *UIObjShowResponse) String() string { return "" } -func (*UIObjShowResponse) ProtoMessage() {} -func (x *UIObjShowResponse) ProtoReflect() protoreflect.Message { return nil } +func (x *UIObjShowResponse) Reset() { + *x = UIObjShowResponse{} + mi := &file_internal_native_proto_native_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UIObjShowResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIObjShowResponse) ProtoMessage() {} + +func (x *UIObjShowResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIObjShowResponse.ProtoReflect.Descriptor instead. +func (*UIObjShowResponse) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{16} +} + +func (x *UIObjShowResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} type UISetVarRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` unknownFields protoimpl.UnknownFields - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UISetVarRequest) Reset() { *x = UISetVarRequest{} } -func (x *UISetVarRequest) String() string { return "" } -func (*UISetVarRequest) ProtoMessage() {} -func (x *UISetVarRequest) ProtoReflect() protoreflect.Message { return nil } +func (x *UISetVarRequest) Reset() { + *x = UISetVarRequest{} + mi := &file_internal_native_proto_native_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UISetVarRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UISetVarRequest) ProtoMessage() {} + +func (x *UISetVarRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UISetVarRequest.ProtoReflect.Descriptor instead. +func (*UISetVarRequest) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{17} +} + +func (x *UISetVarRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UISetVarRequest) GetValue() string { + if x != nil { + return x.Value + } + return "" +} type UIGetVarRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` unknownFields protoimpl.UnknownFields - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIGetVarRequest) Reset() { *x = UIGetVarRequest{} } -func (x *UIGetVarRequest) String() string { return "" } -func (*UIGetVarRequest) ProtoMessage() {} -func (x *UIGetVarRequest) ProtoReflect() protoreflect.Message { return nil } +func (x *UIGetVarRequest) Reset() { + *x = UIGetVarRequest{} + mi := &file_internal_native_proto_native_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UIGetVarRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIGetVarRequest) ProtoMessage() {} + +func (x *UIGetVarRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIGetVarRequest.ProtoReflect.Descriptor instead. +func (*UIGetVarRequest) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{18} +} + +func (x *UIGetVarRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} type UIGetVarResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` unknownFields protoimpl.UnknownFields - Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIGetVarResponse) Reset() { *x = UIGetVarResponse{} } -func (x *UIGetVarResponse) String() string { return "" } -func (*UIGetVarResponse) ProtoMessage() {} -func (x *UIGetVarResponse) ProtoReflect() protoreflect.Message { return nil } +func (x *UIGetVarResponse) Reset() { + *x = UIGetVarResponse{} + mi := &file_internal_native_proto_native_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UIGetVarResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIGetVarResponse) ProtoMessage() {} + +func (x *UIGetVarResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIGetVarResponse.ProtoReflect.Descriptor instead. +func (*UIGetVarResponse) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{19} +} + +func (x *UIGetVarResponse) GetValue() string { + if x != nil { + return x.Value + } + return "" +} -// Additional UI types - abbreviated for brevity, follow same pattern type UIObjAddStateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` + State string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` unknownFields protoimpl.UnknownFields - ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` - State string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIObjAddStateRequest) Reset() { *x = UIObjAddStateRequest{} } -func (x *UIObjAddStateRequest) String() string { return "" } -func (*UIObjAddStateRequest) ProtoMessage() {} -func (x *UIObjAddStateRequest) ProtoReflect() protoreflect.Message { return nil } +func (x *UIObjAddStateRequest) Reset() { + *x = UIObjAddStateRequest{} + mi := &file_internal_native_proto_native_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UIObjAddStateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIObjAddStateRequest) ProtoMessage() {} + +func (x *UIObjAddStateRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIObjAddStateRequest.ProtoReflect.Descriptor instead. +func (*UIObjAddStateRequest) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{20} +} + +func (x *UIObjAddStateRequest) GetObjName() string { + if x != nil { + return x.ObjName + } + return "" +} + +func (x *UIObjAddStateRequest) GetState() string { + if x != nil { + return x.State + } + return "" +} type UIObjAddStateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` unknownFields protoimpl.UnknownFields - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIObjAddStateResponse) Reset() { *x = UIObjAddStateResponse{} } -func (x *UIObjAddStateResponse) String() string { return "" } -func (*UIObjAddStateResponse) ProtoMessage() {} -func (x *UIObjAddStateResponse) ProtoReflect() protoreflect.Message { return nil } - -// Event types -type Event struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - // oneof data - using separate fields for now - VideoState *VideoState `protobuf:"bytes,2,opt,name=video_state,json=videoState,proto3" json:"video_state,omitempty"` - IndevEvent string `protobuf:"bytes,3,opt,name=indev_event,json=indevEvent,proto3" json:"indev_event,omitempty"` - RpcEvent string `protobuf:"bytes,4,opt,name=rpc_event,json=rpcEvent,proto3" json:"rpc_event,omitempty"` - VideoFrame *VideoFrame `protobuf:"bytes,5,opt,name=video_frame,json=videoFrame,proto3" json:"video_frame,omitempty"` +func (x *UIObjAddStateResponse) Reset() { + *x = UIObjAddStateResponse{} + mi := &file_internal_native_proto_native_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (x *Event) Reset() { *x = Event{} } -func (x *Event) String() string { return "" } -func (*Event) ProtoMessage() {} -func (x *Event) ProtoReflect() protoreflect.Message { return nil } - -type VideoFrame struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - Frame []byte `protobuf:"bytes,1,opt,name=frame,proto3" json:"frame,omitempty"` - DurationNs int64 `protobuf:"varint,2,opt,name=duration_ns,json=durationNs,proto3" json:"duration_ns,omitempty"` +func (x *UIObjAddStateResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (x *VideoFrame) Reset() { *x = VideoFrame{} } -func (x *VideoFrame) String() string { return "" } -func (*VideoFrame) ProtoMessage() {} -func (x *VideoFrame) ProtoReflect() protoreflect.Message { return nil } +func (*UIObjAddStateResponse) ProtoMessage() {} + +func (x *UIObjAddStateResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIObjAddStateResponse.ProtoReflect.Descriptor instead. +func (*UIObjAddStateResponse) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{21} +} + +func (x *UIObjAddStateResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} -// Additional request/response types - following same pattern -// (Abbreviated - all follow the same structure) type UIObjClearStateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` + State string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` unknownFields protoimpl.UnknownFields - ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` - State string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIObjClearStateRequest) Reset() { *x = UIObjClearStateRequest{} } -func (x *UIObjClearStateRequest) String() string { return "" } -func (*UIObjClearStateRequest) ProtoMessage() {} -func (x *UIObjClearStateRequest) ProtoReflect() protoreflect.Message { return nil } +func (x *UIObjClearStateRequest) Reset() { + *x = UIObjClearStateRequest{} + mi := &file_internal_native_proto_native_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UIObjClearStateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIObjClearStateRequest) ProtoMessage() {} + +func (x *UIObjClearStateRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIObjClearStateRequest.ProtoReflect.Descriptor instead. +func (*UIObjClearStateRequest) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{22} +} + +func (x *UIObjClearStateRequest) GetObjName() string { + if x != nil { + return x.ObjName + } + return "" +} + +func (x *UIObjClearStateRequest) GetState() string { + if x != nil { + return x.State + } + return "" +} type UIObjClearStateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` unknownFields protoimpl.UnknownFields - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIObjClearStateResponse) Reset() { *x = UIObjClearStateResponse{} } -func (x *UIObjClearStateResponse) String() string { return "" } -func (*UIObjClearStateResponse) ProtoMessage() {} -func (x *UIObjClearStateResponse) ProtoReflect() protoreflect.Message { return nil } +func (x *UIObjClearStateResponse) Reset() { + *x = UIObjClearStateResponse{} + mi := &file_internal_native_proto_native_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -// Remaining types follow same pattern - creating minimal stubs -// TODO: Regenerate from proto for complete implementation +func (x *UIObjClearStateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIObjClearStateResponse) ProtoMessage() {} + +func (x *UIObjClearStateResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIObjClearStateResponse.ProtoReflect.Descriptor instead. +func (*UIObjClearStateResponse) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{23} +} + +func (x *UIObjClearStateResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} type UIObjAddFlagRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` + Flag string `protobuf:"bytes,2,opt,name=flag,proto3" json:"flag,omitempty"` unknownFields protoimpl.UnknownFields - ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` - Flag string `protobuf:"bytes,2,opt,name=flag,proto3" json:"flag,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIObjAddFlagRequest) Reset() { *x = UIObjAddFlagRequest{} } -func (x *UIObjAddFlagRequest) String() string { return "" } -func (*UIObjAddFlagRequest) ProtoMessage() {} -func (x *UIObjAddFlagRequest) ProtoReflect() protoreflect.Message { return nil } +func (x *UIObjAddFlagRequest) Reset() { + *x = UIObjAddFlagRequest{} + mi := &file_internal_native_proto_native_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UIObjAddFlagRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIObjAddFlagRequest) ProtoMessage() {} + +func (x *UIObjAddFlagRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIObjAddFlagRequest.ProtoReflect.Descriptor instead. +func (*UIObjAddFlagRequest) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{24} +} + +func (x *UIObjAddFlagRequest) GetObjName() string { + if x != nil { + return x.ObjName + } + return "" +} + +func (x *UIObjAddFlagRequest) GetFlag() string { + if x != nil { + return x.Flag + } + return "" +} type UIObjAddFlagResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` unknownFields protoimpl.UnknownFields - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIObjAddFlagResponse) Reset() { *x = UIObjAddFlagResponse{} } -func (x *UIObjAddFlagResponse) String() string { return "" } -func (*UIObjAddFlagResponse) ProtoMessage() {} -func (x *UIObjAddFlagResponse) ProtoReflect() protoreflect.Message { return nil } +func (x *UIObjAddFlagResponse) Reset() { + *x = UIObjAddFlagResponse{} + mi := &file_internal_native_proto_native_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UIObjAddFlagResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIObjAddFlagResponse) ProtoMessage() {} + +func (x *UIObjAddFlagResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIObjAddFlagResponse.ProtoReflect.Descriptor instead. +func (*UIObjAddFlagResponse) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{25} +} + +func (x *UIObjAddFlagResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} type UIObjClearFlagRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` + Flag string `protobuf:"bytes,2,opt,name=flag,proto3" json:"flag,omitempty"` unknownFields protoimpl.UnknownFields - ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` - Flag string `protobuf:"bytes,2,opt,name=flag,proto3" json:"flag,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIObjClearFlagRequest) Reset() { *x = UIObjClearFlagRequest{} } -func (x *UIObjClearFlagRequest) String() string { return "" } -func (*UIObjClearFlagRequest) ProtoMessage() {} -func (x *UIObjClearFlagRequest) ProtoReflect() protoreflect.Message { return nil } +func (x *UIObjClearFlagRequest) Reset() { + *x = UIObjClearFlagRequest{} + mi := &file_internal_native_proto_native_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UIObjClearFlagRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIObjClearFlagRequest) ProtoMessage() {} + +func (x *UIObjClearFlagRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIObjClearFlagRequest.ProtoReflect.Descriptor instead. +func (*UIObjClearFlagRequest) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{26} +} + +func (x *UIObjClearFlagRequest) GetObjName() string { + if x != nil { + return x.ObjName + } + return "" +} + +func (x *UIObjClearFlagRequest) GetFlag() string { + if x != nil { + return x.Flag + } + return "" +} type UIObjClearFlagResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` unknownFields protoimpl.UnknownFields - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIObjClearFlagResponse) Reset() { *x = UIObjClearFlagResponse{} } -func (x *UIObjClearFlagResponse) String() string { return "" } -func (*UIObjClearFlagResponse) ProtoMessage() {} -func (x *UIObjClearFlagResponse) ProtoReflect() protoreflect.Message { return nil } +func (x *UIObjClearFlagResponse) Reset() { + *x = UIObjClearFlagResponse{} + mi := &file_internal_native_proto_native_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UIObjClearFlagResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIObjClearFlagResponse) ProtoMessage() {} + +func (x *UIObjClearFlagResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIObjClearFlagResponse.ProtoReflect.Descriptor instead. +func (*UIObjClearFlagResponse) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{27} +} + +func (x *UIObjClearFlagResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} type UIObjSetOpacityRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` + Opacity int32 `protobuf:"varint,2,opt,name=opacity,proto3" json:"opacity,omitempty"` unknownFields protoimpl.UnknownFields - ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` - Opacity int32 `protobuf:"varint,2,opt,name=opacity,proto3" json:"opacity,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIObjSetOpacityRequest) Reset() { *x = UIObjSetOpacityRequest{} } -func (x *UIObjSetOpacityRequest) String() string { return "" } -func (*UIObjSetOpacityRequest) ProtoMessage() {} -func (x *UIObjSetOpacityRequest) ProtoReflect() protoreflect.Message { return nil } +func (x *UIObjSetOpacityRequest) Reset() { + *x = UIObjSetOpacityRequest{} + mi := &file_internal_native_proto_native_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UIObjSetOpacityRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIObjSetOpacityRequest) ProtoMessage() {} + +func (x *UIObjSetOpacityRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIObjSetOpacityRequest.ProtoReflect.Descriptor instead. +func (*UIObjSetOpacityRequest) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{28} +} + +func (x *UIObjSetOpacityRequest) GetObjName() string { + if x != nil { + return x.ObjName + } + return "" +} + +func (x *UIObjSetOpacityRequest) GetOpacity() int32 { + if x != nil { + return x.Opacity + } + return 0 +} type UIObjSetOpacityResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` unknownFields protoimpl.UnknownFields - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIObjSetOpacityResponse) Reset() { *x = UIObjSetOpacityResponse{} } -func (x *UIObjSetOpacityResponse) String() string { return "" } -func (*UIObjSetOpacityResponse) ProtoMessage() {} -func (x *UIObjSetOpacityResponse) ProtoReflect() protoreflect.Message { return nil } +func (x *UIObjSetOpacityResponse) Reset() { + *x = UIObjSetOpacityResponse{} + mi := &file_internal_native_proto_native_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UIObjSetOpacityResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIObjSetOpacityResponse) ProtoMessage() {} + +func (x *UIObjSetOpacityResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIObjSetOpacityResponse.ProtoReflect.Descriptor instead. +func (*UIObjSetOpacityResponse) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{29} +} + +func (x *UIObjSetOpacityResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} type UIObjFadeInRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` + Duration uint32 `protobuf:"varint,2,opt,name=duration,proto3" json:"duration,omitempty"` unknownFields protoimpl.UnknownFields - ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` - Duration uint32 `protobuf:"varint,2,opt,name=duration,proto3" json:"duration,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIObjFadeInRequest) Reset() { *x = UIObjFadeInRequest{} } -func (x *UIObjFadeInRequest) String() string { return "" } -func (*UIObjFadeInRequest) ProtoMessage() {} -func (x *UIObjFadeInRequest) ProtoReflect() protoreflect.Message { return nil } +func (x *UIObjFadeInRequest) Reset() { + *x = UIObjFadeInRequest{} + mi := &file_internal_native_proto_native_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UIObjFadeInRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIObjFadeInRequest) ProtoMessage() {} + +func (x *UIObjFadeInRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIObjFadeInRequest.ProtoReflect.Descriptor instead. +func (*UIObjFadeInRequest) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{30} +} + +func (x *UIObjFadeInRequest) GetObjName() string { + if x != nil { + return x.ObjName + } + return "" +} + +func (x *UIObjFadeInRequest) GetDuration() uint32 { + if x != nil { + return x.Duration + } + return 0 +} type UIObjFadeInResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` unknownFields protoimpl.UnknownFields - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIObjFadeInResponse) Reset() { *x = UIObjFadeInResponse{} } -func (x *UIObjFadeInResponse) String() string { return "" } -func (*UIObjFadeInResponse) ProtoMessage() {} -func (x *UIObjFadeInResponse) ProtoReflect() protoreflect.Message { return nil } +func (x *UIObjFadeInResponse) Reset() { + *x = UIObjFadeInResponse{} + mi := &file_internal_native_proto_native_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UIObjFadeInResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIObjFadeInResponse) ProtoMessage() {} + +func (x *UIObjFadeInResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIObjFadeInResponse.ProtoReflect.Descriptor instead. +func (*UIObjFadeInResponse) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{31} +} + +func (x *UIObjFadeInResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} type UIObjFadeOutRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` + Duration uint32 `protobuf:"varint,2,opt,name=duration,proto3" json:"duration,omitempty"` unknownFields protoimpl.UnknownFields - ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` - Duration uint32 `protobuf:"varint,2,opt,name=duration,proto3" json:"duration,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIObjFadeOutRequest) Reset() { *x = UIObjFadeOutRequest{} } -func (x *UIObjFadeOutRequest) String() string { return "" } -func (*UIObjFadeOutRequest) ProtoMessage() {} -func (x *UIObjFadeOutRequest) ProtoReflect() protoreflect.Message { return nil } +func (x *UIObjFadeOutRequest) Reset() { + *x = UIObjFadeOutRequest{} + mi := &file_internal_native_proto_native_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UIObjFadeOutRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIObjFadeOutRequest) ProtoMessage() {} + +func (x *UIObjFadeOutRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[32] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIObjFadeOutRequest.ProtoReflect.Descriptor instead. +func (*UIObjFadeOutRequest) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{32} +} + +func (x *UIObjFadeOutRequest) GetObjName() string { + if x != nil { + return x.ObjName + } + return "" +} + +func (x *UIObjFadeOutRequest) GetDuration() uint32 { + if x != nil { + return x.Duration + } + return 0 +} type UIObjFadeOutResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` unknownFields protoimpl.UnknownFields - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIObjFadeOutResponse) Reset() { *x = UIObjFadeOutResponse{} } -func (x *UIObjFadeOutResponse) String() string { return "" } -func (*UIObjFadeOutResponse) ProtoMessage() {} -func (x *UIObjFadeOutResponse) ProtoReflect() protoreflect.Message { return nil } +func (x *UIObjFadeOutResponse) Reset() { + *x = UIObjFadeOutResponse{} + mi := &file_internal_native_proto_native_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UIObjFadeOutResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIObjFadeOutResponse) ProtoMessage() {} + +func (x *UIObjFadeOutResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[33] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIObjFadeOutResponse.ProtoReflect.Descriptor instead. +func (*UIObjFadeOutResponse) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{33} +} + +func (x *UIObjFadeOutResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} type UIObjSetLabelTextRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` + Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` unknownFields protoimpl.UnknownFields - ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` - Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIObjSetLabelTextRequest) Reset() { *x = UIObjSetLabelTextRequest{} } -func (x *UIObjSetLabelTextRequest) String() string { return "" } -func (*UIObjSetLabelTextRequest) ProtoMessage() {} -func (x *UIObjSetLabelTextRequest) ProtoReflect() protoreflect.Message { return nil } +func (x *UIObjSetLabelTextRequest) Reset() { + *x = UIObjSetLabelTextRequest{} + mi := &file_internal_native_proto_native_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UIObjSetLabelTextRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIObjSetLabelTextRequest) ProtoMessage() {} + +func (x *UIObjSetLabelTextRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[34] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIObjSetLabelTextRequest.ProtoReflect.Descriptor instead. +func (*UIObjSetLabelTextRequest) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{34} +} + +func (x *UIObjSetLabelTextRequest) GetObjName() string { + if x != nil { + return x.ObjName + } + return "" +} + +func (x *UIObjSetLabelTextRequest) GetText() string { + if x != nil { + return x.Text + } + return "" +} type UIObjSetLabelTextResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` unknownFields protoimpl.UnknownFields - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIObjSetLabelTextResponse) Reset() { *x = UIObjSetLabelTextResponse{} } -func (x *UIObjSetLabelTextResponse) String() string { return "" } -func (*UIObjSetLabelTextResponse) ProtoMessage() {} -func (x *UIObjSetLabelTextResponse) ProtoReflect() protoreflect.Message { return nil } +func (x *UIObjSetLabelTextResponse) Reset() { + *x = UIObjSetLabelTextResponse{} + mi := &file_internal_native_proto_native_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UIObjSetLabelTextResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIObjSetLabelTextResponse) ProtoMessage() {} + +func (x *UIObjSetLabelTextResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[35] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIObjSetLabelTextResponse.ProtoReflect.Descriptor instead. +func (*UIObjSetLabelTextResponse) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{35} +} + +func (x *UIObjSetLabelTextResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} type UIObjSetImageSrcRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` + Image string `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` unknownFields protoimpl.UnknownFields - ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` - Image string `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIObjSetImageSrcRequest) Reset() { *x = UIObjSetImageSrcRequest{} } -func (x *UIObjSetImageSrcRequest) String() string { return "" } -func (*UIObjSetImageSrcRequest) ProtoMessage() {} -func (x *UIObjSetImageSrcRequest) ProtoReflect() protoreflect.Message { return nil } +func (x *UIObjSetImageSrcRequest) Reset() { + *x = UIObjSetImageSrcRequest{} + mi := &file_internal_native_proto_native_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UIObjSetImageSrcRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIObjSetImageSrcRequest) ProtoMessage() {} + +func (x *UIObjSetImageSrcRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[36] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIObjSetImageSrcRequest.ProtoReflect.Descriptor instead. +func (*UIObjSetImageSrcRequest) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{36} +} + +func (x *UIObjSetImageSrcRequest) GetObjName() string { + if x != nil { + return x.ObjName + } + return "" +} + +func (x *UIObjSetImageSrcRequest) GetImage() string { + if x != nil { + return x.Image + } + return "" +} type UIObjSetImageSrcResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` unknownFields protoimpl.UnknownFields - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UIObjSetImageSrcResponse) Reset() { *x = UIObjSetImageSrcResponse{} } -func (x *UIObjSetImageSrcResponse) String() string { return "" } -func (*UIObjSetImageSrcResponse) ProtoMessage() {} -func (x *UIObjSetImageSrcResponse) ProtoReflect() protoreflect.Message { return nil } +func (x *UIObjSetImageSrcResponse) Reset() { + *x = UIObjSetImageSrcResponse{} + mi := &file_internal_native_proto_native_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UIObjSetImageSrcResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UIObjSetImageSrcResponse) ProtoMessage() {} + +func (x *UIObjSetImageSrcResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[37] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UIObjSetImageSrcResponse.ProtoReflect.Descriptor instead. +func (*UIObjSetImageSrcResponse) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{37} +} + +func (x *UIObjSetImageSrcResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} type DisplaySetRotationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Rotation uint32 `protobuf:"varint,1,opt,name=rotation,proto3" json:"rotation,omitempty"` unknownFields protoimpl.UnknownFields - Rotation uint32 `protobuf:"varint,1,opt,name=rotation,proto3" json:"rotation,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *DisplaySetRotationRequest) Reset() { *x = DisplaySetRotationRequest{} } -func (x *DisplaySetRotationRequest) String() string { return "" } -func (*DisplaySetRotationRequest) ProtoMessage() {} -func (x *DisplaySetRotationRequest) ProtoReflect() protoreflect.Message { return nil } +func (x *DisplaySetRotationRequest) Reset() { + *x = DisplaySetRotationRequest{} + mi := &file_internal_native_proto_native_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DisplaySetRotationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DisplaySetRotationRequest) ProtoMessage() {} + +func (x *DisplaySetRotationRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[38] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DisplaySetRotationRequest.ProtoReflect.Descriptor instead. +func (*DisplaySetRotationRequest) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{38} +} + +func (x *DisplaySetRotationRequest) GetRotation() uint32 { + if x != nil { + return x.Rotation + } + return 0 +} type DisplaySetRotationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` unknownFields protoimpl.UnknownFields - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *DisplaySetRotationResponse) Reset() { *x = DisplaySetRotationResponse{} } -func (x *DisplaySetRotationResponse) String() string { return "" } -func (*DisplaySetRotationResponse) ProtoMessage() {} -func (x *DisplaySetRotationResponse) ProtoReflect() protoreflect.Message { return nil } +func (x *DisplaySetRotationResponse) Reset() { + *x = DisplaySetRotationResponse{} + mi := &file_internal_native_proto_native_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DisplaySetRotationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DisplaySetRotationResponse) ProtoMessage() {} + +func (x *DisplaySetRotationResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[39] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DisplaySetRotationResponse.ProtoReflect.Descriptor instead. +func (*DisplaySetRotationResponse) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{39} +} + +func (x *DisplaySetRotationResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} type UpdateLabelIfChangedRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` + NewText string `protobuf:"bytes,2,opt,name=new_text,json=newText,proto3" json:"new_text,omitempty"` unknownFields protoimpl.UnknownFields - ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` - NewText string `protobuf:"bytes,2,opt,name=new_text,json=newText,proto3" json:"new_text,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UpdateLabelIfChangedRequest) Reset() { *x = UpdateLabelIfChangedRequest{} } -func (x *UpdateLabelIfChangedRequest) String() string { return "" } -func (*UpdateLabelIfChangedRequest) ProtoMessage() {} -func (x *UpdateLabelIfChangedRequest) ProtoReflect() protoreflect.Message { return nil } +func (x *UpdateLabelIfChangedRequest) Reset() { + *x = UpdateLabelIfChangedRequest{} + mi := &file_internal_native_proto_native_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateLabelIfChangedRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateLabelIfChangedRequest) ProtoMessage() {} + +func (x *UpdateLabelIfChangedRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[40] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateLabelIfChangedRequest.ProtoReflect.Descriptor instead. +func (*UpdateLabelIfChangedRequest) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{40} +} + +func (x *UpdateLabelIfChangedRequest) GetObjName() string { + if x != nil { + return x.ObjName + } + return "" +} + +func (x *UpdateLabelIfChangedRequest) GetNewText() string { + if x != nil { + return x.NewText + } + return "" +} type UpdateLabelAndChangeVisibilityRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` + NewText string `protobuf:"bytes,2,opt,name=new_text,json=newText,proto3" json:"new_text,omitempty"` unknownFields protoimpl.UnknownFields - ObjName string `protobuf:"bytes,1,opt,name=obj_name,json=objName,proto3" json:"obj_name,omitempty"` - NewText string `protobuf:"bytes,2,opt,name=new_text,json=newText,proto3" json:"new_text,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *UpdateLabelAndChangeVisibilityRequest) Reset() { *x = UpdateLabelAndChangeVisibilityRequest{} } -func (x *UpdateLabelAndChangeVisibilityRequest) String() string { return "" } -func (*UpdateLabelAndChangeVisibilityRequest) ProtoMessage() {} -func (x *UpdateLabelAndChangeVisibilityRequest) ProtoReflect() protoreflect.Message { return nil } +func (x *UpdateLabelAndChangeVisibilityRequest) Reset() { + *x = UpdateLabelAndChangeVisibilityRequest{} + mi := &file_internal_native_proto_native_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateLabelAndChangeVisibilityRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateLabelAndChangeVisibilityRequest) ProtoMessage() {} + +func (x *UpdateLabelAndChangeVisibilityRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[41] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateLabelAndChangeVisibilityRequest.ProtoReflect.Descriptor instead. +func (*UpdateLabelAndChangeVisibilityRequest) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{41} +} + +func (x *UpdateLabelAndChangeVisibilityRequest) GetObjName() string { + if x != nil { + return x.ObjName + } + return "" +} + +func (x *UpdateLabelAndChangeVisibilityRequest) GetNewText() string { + if x != nil { + return x.NewText + } + return "" +} type SwitchToScreenIfRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ScreenName string `protobuf:"bytes,1,opt,name=screen_name,json=screenName,proto3" json:"screen_name,omitempty"` + ShouldSwitch []string `protobuf:"bytes,2,rep,name=should_switch,json=shouldSwitch,proto3" json:"should_switch,omitempty"` unknownFields protoimpl.UnknownFields - ScreenName string `protobuf:"bytes,1,opt,name=screen_name,json=screenName,proto3" json:"screen_name,omitempty"` - ShouldSwitch []string `protobuf:"bytes,2,rep,name=should_switch,json=shouldSwitch,proto3" json:"should_switch,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *SwitchToScreenIfRequest) Reset() { *x = SwitchToScreenIfRequest{} } -func (x *SwitchToScreenIfRequest) String() string { return "" } -func (*SwitchToScreenIfRequest) ProtoMessage() {} -func (x *SwitchToScreenIfRequest) ProtoReflect() protoreflect.Message { return nil } +func (x *SwitchToScreenIfRequest) Reset() { + *x = SwitchToScreenIfRequest{} + mi := &file_internal_native_proto_native_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SwitchToScreenIfRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SwitchToScreenIfRequest) ProtoMessage() {} + +func (x *SwitchToScreenIfRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[42] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SwitchToScreenIfRequest.ProtoReflect.Descriptor instead. +func (*SwitchToScreenIfRequest) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{42} +} + +func (x *SwitchToScreenIfRequest) GetScreenName() string { + if x != nil { + return x.ScreenName + } + return "" +} + +func (x *SwitchToScreenIfRequest) GetShouldSwitch() []string { + if x != nil { + return x.ShouldSwitch + } + return nil +} type SwitchToScreenIfDifferentRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ScreenName string `protobuf:"bytes,1,opt,name=screen_name,json=screenName,proto3" json:"screen_name,omitempty"` unknownFields protoimpl.UnknownFields - ScreenName string `protobuf:"bytes,1,opt,name=screen_name,json=screenName,proto3" json:"screen_name,omitempty"` + sizeCache protoimpl.SizeCache } -func (x *SwitchToScreenIfDifferentRequest) Reset() { *x = SwitchToScreenIfDifferentRequest{} } -func (x *SwitchToScreenIfDifferentRequest) String() string { return "" } -func (*SwitchToScreenIfDifferentRequest) ProtoMessage() {} -func (x *SwitchToScreenIfDifferentRequest) ProtoReflect() protoreflect.Message { return nil } +func (x *SwitchToScreenIfDifferentRequest) Reset() { + *x = SwitchToScreenIfDifferentRequest{} + mi := &file_internal_native_proto_native_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SwitchToScreenIfDifferentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SwitchToScreenIfDifferentRequest) ProtoMessage() {} + +func (x *SwitchToScreenIfDifferentRequest) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[43] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SwitchToScreenIfDifferentRequest.ProtoReflect.Descriptor instead. +func (*SwitchToScreenIfDifferentRequest) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{43} +} + +func (x *SwitchToScreenIfDifferentRequest) GetScreenName() string { + if x != nil { + return x.ScreenName + } + return "" +} + +type Event struct { + state protoimpl.MessageState `protogen:"open.v1"` + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + // Types that are valid to be assigned to Data: + // + // *Event_VideoState + // *Event_IndevEvent + // *Event_RpcEvent + // *Event_VideoFrame + Data isEvent_Data `protobuf_oneof:"data"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Event) Reset() { + *x = Event{} + mi := &file_internal_native_proto_native_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Event) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Event) ProtoMessage() {} + +func (x *Event) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[44] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Event.ProtoReflect.Descriptor instead. +func (*Event) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{44} +} + +func (x *Event) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Event) GetData() isEvent_Data { + if x != nil { + return x.Data + } + return nil +} + +func (x *Event) GetVideoState() *VideoState { + if x != nil { + if x, ok := x.Data.(*Event_VideoState); ok { + return x.VideoState + } + } + return nil +} + +func (x *Event) GetIndevEvent() string { + if x != nil { + if x, ok := x.Data.(*Event_IndevEvent); ok { + return x.IndevEvent + } + } + return "" +} + +func (x *Event) GetRpcEvent() string { + if x != nil { + if x, ok := x.Data.(*Event_RpcEvent); ok { + return x.RpcEvent + } + } + return "" +} + +func (x *Event) GetVideoFrame() *VideoFrame { + if x != nil { + if x, ok := x.Data.(*Event_VideoFrame); ok { + return x.VideoFrame + } + } + return nil +} + +type isEvent_Data interface { + isEvent_Data() +} + +type Event_VideoState struct { + VideoState *VideoState `protobuf:"bytes,2,opt,name=video_state,json=videoState,proto3,oneof"` +} + +type Event_IndevEvent struct { + IndevEvent string `protobuf:"bytes,3,opt,name=indev_event,json=indevEvent,proto3,oneof"` +} + +type Event_RpcEvent struct { + RpcEvent string `protobuf:"bytes,4,opt,name=rpc_event,json=rpcEvent,proto3,oneof"` +} + +type Event_VideoFrame struct { + VideoFrame *VideoFrame `protobuf:"bytes,5,opt,name=video_frame,json=videoFrame,proto3,oneof"` +} + +func (*Event_VideoState) isEvent_Data() {} + +func (*Event_IndevEvent) isEvent_Data() {} + +func (*Event_RpcEvent) isEvent_Data() {} + +func (*Event_VideoFrame) isEvent_Data() {} + +type VideoFrame struct { + state protoimpl.MessageState `protogen:"open.v1"` + Frame []byte `protobuf:"bytes,1,opt,name=frame,proto3" json:"frame,omitempty"` + DurationNs int64 `protobuf:"varint,2,opt,name=duration_ns,json=durationNs,proto3" json:"duration_ns,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *VideoFrame) Reset() { + *x = VideoFrame{} + mi := &file_internal_native_proto_native_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VideoFrame) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VideoFrame) ProtoMessage() {} + +func (x *VideoFrame) ProtoReflect() protoreflect.Message { + mi := &file_internal_native_proto_native_proto_msgTypes[45] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VideoFrame.ProtoReflect.Descriptor instead. +func (*VideoFrame) Descriptor() ([]byte, []int) { + return file_internal_native_proto_native_proto_rawDescGZIP(), []int{45} +} + +func (x *VideoFrame) GetFrame() []byte { + if x != nil { + return x.Frame + } + return nil +} + +func (x *VideoFrame) GetDurationNs() int64 { + if x != nil { + return x.DurationNs + } + return 0 +} + +var File_internal_native_proto_native_proto protoreflect.FileDescriptor + +var file_internal_native_proto_native_proto_rawDesc = string([]byte{ + 0x0a, 0x22, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x6e, 0x61, 0x74, 0x69, 0x76, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x22, 0x07, 0x0a, 0x05, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, 0x0a, 0x0e, 0x49, 0x73, 0x52, 0x65, 0x61, 0x64, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x5e, 0x0a, 0x0f, 0x49, 0x73, 0x52, 0x65, 0x61, + 0x64, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, + 0x61, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x5f, + 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x76, 0x69, 0x64, + 0x65, 0x6f, 0x52, 0x65, 0x61, 0x64, 0x79, 0x22, 0x90, 0x01, 0x0a, 0x0a, 0x56, 0x69, 0x64, 0x65, + 0x6f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, + 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x12, 0x28, 0x0a, 0x10, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x73, 0x65, + 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0e, 0x66, 0x72, 0x61, 0x6d, + 0x65, 0x50, 0x65, 0x72, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x34, 0x0a, 0x18, 0x56, 0x69, + 0x64, 0x65, 0x6f, 0x53, 0x65, 0x74, 0x53, 0x6c, 0x65, 0x65, 0x70, 0x4d, 0x6f, 0x64, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x22, 0x35, 0x0a, 0x19, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x47, 0x65, 0x74, 0x53, 0x6c, 0x65, 0x65, + 0x70, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x3f, 0x0a, 0x1f, 0x56, 0x69, 0x64, 0x65, 0x6f, + 0x53, 0x6c, 0x65, 0x65, 0x70, 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x75, + 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x73, + 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x22, 0x36, 0x0a, 0x1c, 0x56, 0x69, 0x64, 0x65, + 0x6f, 0x53, 0x65, 0x74, 0x51, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x46, 0x61, 0x63, 0x74, 0x6f, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x61, 0x63, 0x74, + 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, + 0x22, 0x37, 0x0a, 0x1d, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x47, 0x65, 0x74, 0x51, 0x75, 0x61, 0x6c, + 0x69, 0x74, 0x79, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x06, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x29, 0x0a, 0x13, 0x56, 0x69, 0x64, + 0x65, 0x6f, 0x53, 0x65, 0x74, 0x45, 0x44, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x65, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x65, 0x64, 0x69, 0x64, 0x22, 0x2a, 0x0a, 0x14, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x47, 0x65, 0x74, + 0x45, 0x44, 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x65, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x65, 0x64, 0x69, 0x64, + 0x22, 0x30, 0x0a, 0x16, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x4c, 0x6f, 0x67, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x22, 0x32, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4c, 0x56, 0x47, 0x4c, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x2d, 0x0a, 0x10, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x48, + 0x69, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x62, + 0x6a, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x62, + 0x6a, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x2d, 0x0a, 0x11, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x48, 0x69, + 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x22, 0x2d, 0x0a, 0x10, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x53, 0x68, 0x6f, + 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x62, 0x6a, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x62, 0x6a, 0x4e, + 0x61, 0x6d, 0x65, 0x22, 0x2d, 0x0a, 0x11, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x53, 0x68, 0x6f, 0x77, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x22, 0x3b, 0x0a, 0x0f, 0x55, 0x49, 0x53, 0x65, 0x74, 0x56, 0x61, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0x25, 0x0a, 0x0f, 0x55, 0x49, 0x47, 0x65, 0x74, 0x56, 0x61, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x28, 0x0a, 0x10, 0x55, 0x49, 0x47, 0x65, 0x74, 0x56, + 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x22, 0x47, 0x0a, 0x14, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x41, 0x64, 0x64, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x62, 0x6a, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x62, 0x6a, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x31, 0x0a, 0x15, 0x55, 0x49, 0x4f, + 0x62, 0x6a, 0x41, 0x64, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x49, 0x0a, 0x16, + 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x62, 0x6a, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x62, 0x6a, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x33, 0x0a, 0x17, 0x55, 0x49, 0x4f, 0x62, 0x6a, + 0x43, 0x6c, 0x65, 0x61, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x44, 0x0a, 0x13, + 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x41, 0x64, 0x64, 0x46, 0x6c, 0x61, 0x67, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x62, 0x6a, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x62, 0x6a, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x6c, + 0x61, 0x67, 0x22, 0x30, 0x0a, 0x14, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x41, 0x64, 0x64, 0x46, 0x6c, + 0x61, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x22, 0x46, 0x0a, 0x15, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x43, 0x6c, 0x65, + 0x61, 0x72, 0x46, 0x6c, 0x61, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, + 0x08, 0x6f, 0x62, 0x6a, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6f, 0x62, 0x6a, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x61, 0x67, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x22, 0x32, 0x0a, 0x16, + 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x46, 0x6c, 0x61, 0x67, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x22, 0x4d, 0x0a, 0x16, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x53, 0x65, 0x74, 0x4f, 0x70, 0x61, 0x63, + 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x62, + 0x6a, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x62, + 0x6a, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x22, + 0x33, 0x0a, 0x17, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x53, 0x65, 0x74, 0x4f, 0x70, 0x61, 0x63, 0x69, + 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x22, 0x4b, 0x0a, 0x12, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x46, 0x61, 0x64, + 0x65, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x62, + 0x6a, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x62, + 0x6a, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x22, 0x2f, 0x0a, 0x13, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x46, 0x61, 0x64, 0x65, 0x49, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x22, 0x4c, 0x0a, 0x13, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x46, 0x61, 0x64, 0x65, 0x4f, + 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x62, 0x6a, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x62, 0x6a, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x22, 0x30, 0x0a, 0x14, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x46, 0x61, 0x64, 0x65, 0x4f, 0x75, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x22, 0x49, 0x0a, 0x18, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x53, 0x65, 0x74, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x54, 0x65, 0x78, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, + 0x0a, 0x08, 0x6f, 0x62, 0x6a, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6f, 0x62, 0x6a, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x22, 0x35, 0x0a, + 0x19, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x53, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x54, 0x65, + 0x78, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x22, 0x4a, 0x0a, 0x17, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x53, 0x65, 0x74, + 0x49, 0x6d, 0x61, 0x67, 0x65, 0x53, 0x72, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x19, 0x0a, 0x08, 0x6f, 0x62, 0x6a, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x6f, 0x62, 0x6a, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, + 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, + 0x22, 0x34, 0x0a, 0x18, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x53, 0x65, 0x74, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x53, 0x72, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, + 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x37, 0x0a, 0x19, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, + 0x79, 0x53, 0x65, 0x74, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0x36, 0x0a, 0x1a, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x53, 0x65, 0x74, 0x52, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x53, 0x0a, 0x1b, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x49, 0x66, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x62, 0x6a, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x62, 0x6a, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x65, 0x77, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x77, 0x54, 0x65, 0x78, 0x74, 0x22, 0x5d, 0x0a, 0x25, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x41, 0x6e, 0x64, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x62, 0x6a, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x62, 0x6a, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x65, 0x77, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x77, 0x54, 0x65, 0x78, 0x74, 0x22, 0x5f, 0x0a, 0x17, 0x53, + 0x77, 0x69, 0x74, 0x63, 0x68, 0x54, 0x6f, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x49, 0x66, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x63, 0x72, + 0x65, 0x65, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x68, 0x6f, 0x75, 0x6c, + 0x64, 0x5f, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, + 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x22, 0x43, 0x0a, 0x20, + 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x54, 0x6f, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x49, 0x66, + 0x44, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x4e, 0x61, 0x6d, + 0x65, 0x22, 0xd3, 0x01, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x35, 0x0a, 0x0b, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x56, 0x69, + 0x64, 0x65, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x76, 0x69, 0x64, 0x65, + 0x6f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x69, 0x6e, 0x64, 0x65, 0x76, 0x5f, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0a, 0x69, + 0x6e, 0x64, 0x65, 0x76, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x09, 0x72, 0x70, 0x63, + 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, + 0x72, 0x70, 0x63, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x0b, 0x76, 0x69, 0x64, 0x65, + 0x6f, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x46, 0x72, 0x61, 0x6d, + 0x65, 0x48, 0x00, 0x52, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x42, + 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x43, 0x0a, 0x0a, 0x56, 0x69, 0x64, 0x65, 0x6f, + 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x64, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0a, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x73, 0x32, 0xfd, 0x11, 0x0a, + 0x0d, 0x4e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3a, + 0x0a, 0x07, 0x49, 0x73, 0x52, 0x65, 0x61, 0x64, 0x79, 0x12, 0x16, 0x2e, 0x6e, 0x61, 0x74, 0x69, + 0x76, 0x65, 0x2e, 0x49, 0x73, 0x52, 0x65, 0x61, 0x64, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x17, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x49, 0x73, 0x52, 0x65, 0x61, + 0x64, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x11, 0x56, 0x69, + 0x64, 0x65, 0x6f, 0x53, 0x65, 0x74, 0x53, 0x6c, 0x65, 0x65, 0x70, 0x4d, 0x6f, 0x64, 0x65, 0x12, + 0x20, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x53, 0x65, + 0x74, 0x53, 0x6c, 0x65, 0x65, 0x70, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x0d, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x12, 0x45, 0x0a, 0x11, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x47, 0x65, 0x74, 0x53, 0x6c, 0x65, 0x65, + 0x70, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x0d, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x21, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x56, 0x69, + 0x64, 0x65, 0x6f, 0x47, 0x65, 0x74, 0x53, 0x6c, 0x65, 0x65, 0x70, 0x4d, 0x6f, 0x64, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x17, 0x56, 0x69, 0x64, 0x65, 0x6f, + 0x53, 0x6c, 0x65, 0x65, 0x70, 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x64, 0x12, 0x0d, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x1a, 0x27, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x56, 0x69, 0x64, 0x65, 0x6f, + 0x53, 0x6c, 0x65, 0x65, 0x70, 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x15, 0x56, 0x69, + 0x64, 0x65, 0x6f, 0x53, 0x65, 0x74, 0x51, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x46, 0x61, 0x63, + 0x74, 0x6f, 0x72, 0x12, 0x24, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x56, 0x69, 0x64, + 0x65, 0x6f, 0x53, 0x65, 0x74, 0x51, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x46, 0x61, 0x63, 0x74, + 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x6e, 0x61, 0x74, 0x69, + 0x76, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4d, 0x0a, 0x15, 0x56, 0x69, 0x64, 0x65, + 0x6f, 0x47, 0x65, 0x74, 0x51, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x46, 0x61, 0x63, 0x74, 0x6f, + 0x72, 0x12, 0x0d, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x1a, 0x25, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x47, + 0x65, 0x74, 0x51, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x0c, 0x56, 0x69, 0x64, 0x65, 0x6f, + 0x53, 0x65, 0x74, 0x45, 0x44, 0x49, 0x44, 0x12, 0x1b, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, + 0x2e, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x53, 0x65, 0x74, 0x45, 0x44, 0x49, 0x44, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x0c, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x47, 0x65, 0x74, 0x45, + 0x44, 0x49, 0x44, 0x12, 0x0d, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x1a, 0x1c, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x56, 0x69, 0x64, 0x65, + 0x6f, 0x47, 0x65, 0x74, 0x45, 0x44, 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x3f, 0x0a, 0x0e, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x4c, 0x6f, 0x67, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x0d, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x1a, 0x1e, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x56, 0x69, 0x64, 0x65, 0x6f, + 0x4c, 0x6f, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x29, 0x0a, 0x09, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x0d, + 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0d, 0x2e, + 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x2a, 0x0a, 0x0a, + 0x56, 0x69, 0x64, 0x65, 0x6f, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x0d, 0x2e, 0x6e, 0x61, 0x74, + 0x69, 0x76, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0d, 0x2e, 0x6e, 0x61, 0x74, 0x69, + 0x76, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3f, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4c, + 0x56, 0x47, 0x4c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0d, 0x2e, 0x6e, 0x61, 0x74, + 0x69, 0x76, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1e, 0x2e, 0x6e, 0x61, 0x74, 0x69, + 0x76, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x56, 0x47, 0x4c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x09, 0x55, 0x49, 0x4f, + 0x62, 0x6a, 0x48, 0x69, 0x64, 0x65, 0x12, 0x18, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, + 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x48, 0x69, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x19, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x48, + 0x69, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x09, 0x55, + 0x49, 0x4f, 0x62, 0x6a, 0x53, 0x68, 0x6f, 0x77, 0x12, 0x18, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, + 0x65, 0x2e, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x55, 0x49, 0x4f, 0x62, + 0x6a, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, + 0x08, 0x55, 0x49, 0x53, 0x65, 0x74, 0x56, 0x61, 0x72, 0x12, 0x17, 0x2e, 0x6e, 0x61, 0x74, 0x69, + 0x76, 0x65, 0x2e, 0x55, 0x49, 0x53, 0x65, 0x74, 0x56, 0x61, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x12, 0x3d, 0x0a, 0x08, 0x55, 0x49, 0x47, 0x65, 0x74, 0x56, 0x61, 0x72, 0x12, 0x17, 0x2e, + 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x55, 0x49, 0x47, 0x65, 0x74, 0x56, 0x61, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, + 0x55, 0x49, 0x47, 0x65, 0x74, 0x56, 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x4c, 0x0a, 0x0d, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x41, 0x64, 0x64, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x1c, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x55, 0x49, 0x4f, 0x62, 0x6a, + 0x41, 0x64, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1d, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x41, 0x64, + 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, + 0x0a, 0x0f, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x1e, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x55, 0x49, 0x4f, 0x62, 0x6a, + 0x43, 0x6c, 0x65, 0x61, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1f, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x55, 0x49, 0x4f, 0x62, 0x6a, + 0x43, 0x6c, 0x65, 0x61, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0c, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x41, 0x64, 0x64, 0x46, 0x6c, + 0x61, 0x67, 0x12, 0x1b, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x55, 0x49, 0x4f, 0x62, + 0x6a, 0x41, 0x64, 0x64, 0x46, 0x6c, 0x61, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1c, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x41, 0x64, + 0x64, 0x46, 0x6c, 0x61, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, + 0x0e, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x46, 0x6c, 0x61, 0x67, 0x12, + 0x1d, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x43, 0x6c, + 0x65, 0x61, 0x72, 0x46, 0x6c, 0x61, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, + 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x43, 0x6c, 0x65, + 0x61, 0x72, 0x46, 0x6c, 0x61, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, + 0x0a, 0x0f, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x53, 0x65, 0x74, 0x4f, 0x70, 0x61, 0x63, 0x69, 0x74, + 0x79, 0x12, 0x1e, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x55, 0x49, 0x4f, 0x62, 0x6a, + 0x53, 0x65, 0x74, 0x4f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1f, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x55, 0x49, 0x4f, 0x62, 0x6a, + 0x53, 0x65, 0x74, 0x4f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x46, 0x61, 0x64, 0x65, 0x49, + 0x6e, 0x12, 0x1a, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x55, 0x49, 0x4f, 0x62, 0x6a, + 0x46, 0x61, 0x64, 0x65, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, + 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x46, 0x61, 0x64, 0x65, + 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0c, 0x55, 0x49, + 0x4f, 0x62, 0x6a, 0x46, 0x61, 0x64, 0x65, 0x4f, 0x75, 0x74, 0x12, 0x1b, 0x2e, 0x6e, 0x61, 0x74, + 0x69, 0x76, 0x65, 0x2e, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x46, 0x61, 0x64, 0x65, 0x4f, 0x75, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, + 0x2e, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x46, 0x61, 0x64, 0x65, 0x4f, 0x75, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x11, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x53, 0x65, + 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x54, 0x65, 0x78, 0x74, 0x12, 0x20, 0x2e, 0x6e, 0x61, 0x74, + 0x69, 0x76, 0x65, 0x2e, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x53, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x54, 0x65, 0x78, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6e, + 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x53, 0x65, 0x74, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x54, 0x65, 0x78, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x55, 0x0a, 0x10, 0x55, 0x49, 0x4f, 0x62, 0x6a, 0x53, 0x65, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, + 0x53, 0x72, 0x63, 0x12, 0x1f, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x55, 0x49, 0x4f, + 0x62, 0x6a, 0x53, 0x65, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x53, 0x72, 0x63, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x55, 0x49, + 0x4f, 0x62, 0x6a, 0x53, 0x65, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x53, 0x72, 0x63, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x12, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, + 0x79, 0x53, 0x65, 0x74, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x2e, 0x6e, + 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x53, 0x65, 0x74, + 0x52, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x22, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, + 0x53, 0x65, 0x74, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x49, 0x66, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x12, 0x23, 0x2e, 0x6e, 0x61, + 0x74, 0x69, 0x76, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x49, 0x66, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x0d, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, + 0x5e, 0x0a, 0x1e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x41, 0x6e, + 0x64, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x79, 0x12, 0x2d, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x41, 0x6e, 0x64, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x56, + 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x0d, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, + 0x42, 0x0a, 0x10, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x54, 0x6f, 0x53, 0x63, 0x72, 0x65, 0x65, + 0x6e, 0x49, 0x66, 0x12, 0x1f, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x53, 0x77, 0x69, + 0x74, 0x63, 0x68, 0x54, 0x6f, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x49, 0x66, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x12, 0x54, 0x0a, 0x19, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x54, 0x6f, 0x53, + 0x63, 0x72, 0x65, 0x65, 0x6e, 0x49, 0x66, 0x44, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, + 0x12, 0x28, 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, + 0x54, 0x6f, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x49, 0x66, 0x44, 0x69, 0x66, 0x66, 0x65, 0x72, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x6e, 0x61, 0x74, + 0x69, 0x76, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x41, 0x0a, 0x21, 0x44, 0x6f, 0x4e, + 0x6f, 0x74, 0x55, 0x73, 0x65, 0x54, 0x68, 0x69, 0x73, 0x49, 0x73, 0x46, 0x6f, 0x72, 0x43, 0x72, + 0x61, 0x73, 0x68, 0x54, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x0d, + 0x2e, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0d, 0x2e, + 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x2e, 0x0a, 0x0c, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x0d, 0x2e, 0x6e, + 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0d, 0x2e, 0x6e, 0x61, + 0x74, 0x69, 0x76, 0x65, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x30, 0x01, 0x42, 0x2d, 0x5a, 0x2b, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6a, 0x65, 0x74, 0x6b, 0x76, + 0x6d, 0x2f, 0x6b, 0x76, 0x6d, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x6e, + 0x61, 0x74, 0x69, 0x76, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +}) + +var ( + file_internal_native_proto_native_proto_rawDescOnce sync.Once + file_internal_native_proto_native_proto_rawDescData []byte +) + +func file_internal_native_proto_native_proto_rawDescGZIP() []byte { + file_internal_native_proto_native_proto_rawDescOnce.Do(func() { + file_internal_native_proto_native_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_internal_native_proto_native_proto_rawDesc), len(file_internal_native_proto_native_proto_rawDesc))) + }) + return file_internal_native_proto_native_proto_rawDescData +} + +var file_internal_native_proto_native_proto_msgTypes = make([]protoimpl.MessageInfo, 46) +var file_internal_native_proto_native_proto_goTypes = []any{ + (*Empty)(nil), // 0: native.Empty + (*IsReadyRequest)(nil), // 1: native.IsReadyRequest + (*IsReadyResponse)(nil), // 2: native.IsReadyResponse + (*VideoState)(nil), // 3: native.VideoState + (*VideoSetSleepModeRequest)(nil), // 4: native.VideoSetSleepModeRequest + (*VideoGetSleepModeResponse)(nil), // 5: native.VideoGetSleepModeResponse + (*VideoSleepModeSupportedResponse)(nil), // 6: native.VideoSleepModeSupportedResponse + (*VideoSetQualityFactorRequest)(nil), // 7: native.VideoSetQualityFactorRequest + (*VideoGetQualityFactorResponse)(nil), // 8: native.VideoGetQualityFactorResponse + (*VideoSetEDIDRequest)(nil), // 9: native.VideoSetEDIDRequest + (*VideoGetEDIDResponse)(nil), // 10: native.VideoGetEDIDResponse + (*VideoLogStatusResponse)(nil), // 11: native.VideoLogStatusResponse + (*GetLVGLVersionResponse)(nil), // 12: native.GetLVGLVersionResponse + (*UIObjHideRequest)(nil), // 13: native.UIObjHideRequest + (*UIObjHideResponse)(nil), // 14: native.UIObjHideResponse + (*UIObjShowRequest)(nil), // 15: native.UIObjShowRequest + (*UIObjShowResponse)(nil), // 16: native.UIObjShowResponse + (*UISetVarRequest)(nil), // 17: native.UISetVarRequest + (*UIGetVarRequest)(nil), // 18: native.UIGetVarRequest + (*UIGetVarResponse)(nil), // 19: native.UIGetVarResponse + (*UIObjAddStateRequest)(nil), // 20: native.UIObjAddStateRequest + (*UIObjAddStateResponse)(nil), // 21: native.UIObjAddStateResponse + (*UIObjClearStateRequest)(nil), // 22: native.UIObjClearStateRequest + (*UIObjClearStateResponse)(nil), // 23: native.UIObjClearStateResponse + (*UIObjAddFlagRequest)(nil), // 24: native.UIObjAddFlagRequest + (*UIObjAddFlagResponse)(nil), // 25: native.UIObjAddFlagResponse + (*UIObjClearFlagRequest)(nil), // 26: native.UIObjClearFlagRequest + (*UIObjClearFlagResponse)(nil), // 27: native.UIObjClearFlagResponse + (*UIObjSetOpacityRequest)(nil), // 28: native.UIObjSetOpacityRequest + (*UIObjSetOpacityResponse)(nil), // 29: native.UIObjSetOpacityResponse + (*UIObjFadeInRequest)(nil), // 30: native.UIObjFadeInRequest + (*UIObjFadeInResponse)(nil), // 31: native.UIObjFadeInResponse + (*UIObjFadeOutRequest)(nil), // 32: native.UIObjFadeOutRequest + (*UIObjFadeOutResponse)(nil), // 33: native.UIObjFadeOutResponse + (*UIObjSetLabelTextRequest)(nil), // 34: native.UIObjSetLabelTextRequest + (*UIObjSetLabelTextResponse)(nil), // 35: native.UIObjSetLabelTextResponse + (*UIObjSetImageSrcRequest)(nil), // 36: native.UIObjSetImageSrcRequest + (*UIObjSetImageSrcResponse)(nil), // 37: native.UIObjSetImageSrcResponse + (*DisplaySetRotationRequest)(nil), // 38: native.DisplaySetRotationRequest + (*DisplaySetRotationResponse)(nil), // 39: native.DisplaySetRotationResponse + (*UpdateLabelIfChangedRequest)(nil), // 40: native.UpdateLabelIfChangedRequest + (*UpdateLabelAndChangeVisibilityRequest)(nil), // 41: native.UpdateLabelAndChangeVisibilityRequest + (*SwitchToScreenIfRequest)(nil), // 42: native.SwitchToScreenIfRequest + (*SwitchToScreenIfDifferentRequest)(nil), // 43: native.SwitchToScreenIfDifferentRequest + (*Event)(nil), // 44: native.Event + (*VideoFrame)(nil), // 45: native.VideoFrame +} +var file_internal_native_proto_native_proto_depIdxs = []int32{ + 3, // 0: native.Event.video_state:type_name -> native.VideoState + 45, // 1: native.Event.video_frame:type_name -> native.VideoFrame + 1, // 2: native.NativeService.IsReady:input_type -> native.IsReadyRequest + 4, // 3: native.NativeService.VideoSetSleepMode:input_type -> native.VideoSetSleepModeRequest + 0, // 4: native.NativeService.VideoGetSleepMode:input_type -> native.Empty + 0, // 5: native.NativeService.VideoSleepModeSupported:input_type -> native.Empty + 7, // 6: native.NativeService.VideoSetQualityFactor:input_type -> native.VideoSetQualityFactorRequest + 0, // 7: native.NativeService.VideoGetQualityFactor:input_type -> native.Empty + 9, // 8: native.NativeService.VideoSetEDID:input_type -> native.VideoSetEDIDRequest + 0, // 9: native.NativeService.VideoGetEDID:input_type -> native.Empty + 0, // 10: native.NativeService.VideoLogStatus:input_type -> native.Empty + 0, // 11: native.NativeService.VideoStop:input_type -> native.Empty + 0, // 12: native.NativeService.VideoStart:input_type -> native.Empty + 0, // 13: native.NativeService.GetLVGLVersion:input_type -> native.Empty + 13, // 14: native.NativeService.UIObjHide:input_type -> native.UIObjHideRequest + 15, // 15: native.NativeService.UIObjShow:input_type -> native.UIObjShowRequest + 17, // 16: native.NativeService.UISetVar:input_type -> native.UISetVarRequest + 18, // 17: native.NativeService.UIGetVar:input_type -> native.UIGetVarRequest + 20, // 18: native.NativeService.UIObjAddState:input_type -> native.UIObjAddStateRequest + 22, // 19: native.NativeService.UIObjClearState:input_type -> native.UIObjClearStateRequest + 24, // 20: native.NativeService.UIObjAddFlag:input_type -> native.UIObjAddFlagRequest + 26, // 21: native.NativeService.UIObjClearFlag:input_type -> native.UIObjClearFlagRequest + 28, // 22: native.NativeService.UIObjSetOpacity:input_type -> native.UIObjSetOpacityRequest + 30, // 23: native.NativeService.UIObjFadeIn:input_type -> native.UIObjFadeInRequest + 32, // 24: native.NativeService.UIObjFadeOut:input_type -> native.UIObjFadeOutRequest + 34, // 25: native.NativeService.UIObjSetLabelText:input_type -> native.UIObjSetLabelTextRequest + 36, // 26: native.NativeService.UIObjSetImageSrc:input_type -> native.UIObjSetImageSrcRequest + 38, // 27: native.NativeService.DisplaySetRotation:input_type -> native.DisplaySetRotationRequest + 40, // 28: native.NativeService.UpdateLabelIfChanged:input_type -> native.UpdateLabelIfChangedRequest + 41, // 29: native.NativeService.UpdateLabelAndChangeVisibility:input_type -> native.UpdateLabelAndChangeVisibilityRequest + 42, // 30: native.NativeService.SwitchToScreenIf:input_type -> native.SwitchToScreenIfRequest + 43, // 31: native.NativeService.SwitchToScreenIfDifferent:input_type -> native.SwitchToScreenIfDifferentRequest + 0, // 32: native.NativeService.DoNotUseThisIsForCrashTestingOnly:input_type -> native.Empty + 0, // 33: native.NativeService.StreamEvents:input_type -> native.Empty + 2, // 34: native.NativeService.IsReady:output_type -> native.IsReadyResponse + 0, // 35: native.NativeService.VideoSetSleepMode:output_type -> native.Empty + 5, // 36: native.NativeService.VideoGetSleepMode:output_type -> native.VideoGetSleepModeResponse + 6, // 37: native.NativeService.VideoSleepModeSupported:output_type -> native.VideoSleepModeSupportedResponse + 0, // 38: native.NativeService.VideoSetQualityFactor:output_type -> native.Empty + 8, // 39: native.NativeService.VideoGetQualityFactor:output_type -> native.VideoGetQualityFactorResponse + 0, // 40: native.NativeService.VideoSetEDID:output_type -> native.Empty + 10, // 41: native.NativeService.VideoGetEDID:output_type -> native.VideoGetEDIDResponse + 11, // 42: native.NativeService.VideoLogStatus:output_type -> native.VideoLogStatusResponse + 0, // 43: native.NativeService.VideoStop:output_type -> native.Empty + 0, // 44: native.NativeService.VideoStart:output_type -> native.Empty + 12, // 45: native.NativeService.GetLVGLVersion:output_type -> native.GetLVGLVersionResponse + 14, // 46: native.NativeService.UIObjHide:output_type -> native.UIObjHideResponse + 16, // 47: native.NativeService.UIObjShow:output_type -> native.UIObjShowResponse + 0, // 48: native.NativeService.UISetVar:output_type -> native.Empty + 19, // 49: native.NativeService.UIGetVar:output_type -> native.UIGetVarResponse + 21, // 50: native.NativeService.UIObjAddState:output_type -> native.UIObjAddStateResponse + 23, // 51: native.NativeService.UIObjClearState:output_type -> native.UIObjClearStateResponse + 25, // 52: native.NativeService.UIObjAddFlag:output_type -> native.UIObjAddFlagResponse + 27, // 53: native.NativeService.UIObjClearFlag:output_type -> native.UIObjClearFlagResponse + 29, // 54: native.NativeService.UIObjSetOpacity:output_type -> native.UIObjSetOpacityResponse + 31, // 55: native.NativeService.UIObjFadeIn:output_type -> native.UIObjFadeInResponse + 33, // 56: native.NativeService.UIObjFadeOut:output_type -> native.UIObjFadeOutResponse + 35, // 57: native.NativeService.UIObjSetLabelText:output_type -> native.UIObjSetLabelTextResponse + 37, // 58: native.NativeService.UIObjSetImageSrc:output_type -> native.UIObjSetImageSrcResponse + 39, // 59: native.NativeService.DisplaySetRotation:output_type -> native.DisplaySetRotationResponse + 0, // 60: native.NativeService.UpdateLabelIfChanged:output_type -> native.Empty + 0, // 61: native.NativeService.UpdateLabelAndChangeVisibility:output_type -> native.Empty + 0, // 62: native.NativeService.SwitchToScreenIf:output_type -> native.Empty + 0, // 63: native.NativeService.SwitchToScreenIfDifferent:output_type -> native.Empty + 0, // 64: native.NativeService.DoNotUseThisIsForCrashTestingOnly:output_type -> native.Empty + 44, // 65: native.NativeService.StreamEvents:output_type -> native.Event + 34, // [34:66] is the sub-list for method output_type + 2, // [2:34] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_internal_native_proto_native_proto_init() } +func file_internal_native_proto_native_proto_init() { + if File_internal_native_proto_native_proto != nil { + return + } + file_internal_native_proto_native_proto_msgTypes[44].OneofWrappers = []any{ + (*Event_VideoState)(nil), + (*Event_IndevEvent)(nil), + (*Event_RpcEvent)(nil), + (*Event_VideoFrame)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_internal_native_proto_native_proto_rawDesc), len(file_internal_native_proto_native_proto_rawDesc)), + NumEnums: 0, + NumMessages: 46, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_internal_native_proto_native_proto_goTypes, + DependencyIndexes: file_internal_native_proto_native_proto_depIdxs, + MessageInfos: file_internal_native_proto_native_proto_msgTypes, + }.Build() + File_internal_native_proto_native_proto = out.File + file_internal_native_proto_native_proto_goTypes = nil + file_internal_native_proto_native_proto_depIdxs = nil +} diff --git a/internal/native/proto/native.proto b/internal/native/proto/native.proto index c320d81d..538d3303 100644 --- a/internal/native/proto/native.proto +++ b/internal/native/proto/native.proto @@ -6,8 +6,8 @@ option go_package = "github.com/jetkvm/kvm/internal/native/proto"; // NativeService provides methods to interact with the native layer service NativeService { - // Init - rpc Init(InitRequest) returns (InitResponse); + // Ready check + rpc IsReady(IsReadyRequest) returns (IsReadyResponse); // Video methods rpc VideoSetSleepMode(VideoSetSleepModeRequest) returns (Empty); @@ -52,16 +52,12 @@ service NativeService { // Messages message Empty {} -message InitRequest { - string system_version = 1; - string app_version = 2; - uint32 display_rotation = 3; - double default_quality_factor = 4; -} +message IsReadyRequest {} -message InitResponse { - bool success = 1; +message IsReadyResponse { + bool ready = 1; string error = 2; + bool video_ready = 3; } message VideoState { diff --git a/internal/native/proto/native_grpc.pb.go b/internal/native/proto/native_grpc.pb.go index 59d2a239..abdd38bb 100644 --- a/internal/native/proto/native_grpc.pb.go +++ b/internal/native/proto/native_grpc.pb.go @@ -1,11 +1,13 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// This is a placeholder file. Run: protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative internal/native/proto/native.proto +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v3.21.12 +// source: internal/native/proto/native.proto package proto import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -13,10 +15,50 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + NativeService_IsReady_FullMethodName = "/native.NativeService/IsReady" + NativeService_VideoSetSleepMode_FullMethodName = "/native.NativeService/VideoSetSleepMode" + NativeService_VideoGetSleepMode_FullMethodName = "/native.NativeService/VideoGetSleepMode" + NativeService_VideoSleepModeSupported_FullMethodName = "/native.NativeService/VideoSleepModeSupported" + NativeService_VideoSetQualityFactor_FullMethodName = "/native.NativeService/VideoSetQualityFactor" + NativeService_VideoGetQualityFactor_FullMethodName = "/native.NativeService/VideoGetQualityFactor" + NativeService_VideoSetEDID_FullMethodName = "/native.NativeService/VideoSetEDID" + NativeService_VideoGetEDID_FullMethodName = "/native.NativeService/VideoGetEDID" + NativeService_VideoLogStatus_FullMethodName = "/native.NativeService/VideoLogStatus" + NativeService_VideoStop_FullMethodName = "/native.NativeService/VideoStop" + NativeService_VideoStart_FullMethodName = "/native.NativeService/VideoStart" + NativeService_GetLVGLVersion_FullMethodName = "/native.NativeService/GetLVGLVersion" + NativeService_UIObjHide_FullMethodName = "/native.NativeService/UIObjHide" + NativeService_UIObjShow_FullMethodName = "/native.NativeService/UIObjShow" + NativeService_UISetVar_FullMethodName = "/native.NativeService/UISetVar" + NativeService_UIGetVar_FullMethodName = "/native.NativeService/UIGetVar" + NativeService_UIObjAddState_FullMethodName = "/native.NativeService/UIObjAddState" + NativeService_UIObjClearState_FullMethodName = "/native.NativeService/UIObjClearState" + NativeService_UIObjAddFlag_FullMethodName = "/native.NativeService/UIObjAddFlag" + NativeService_UIObjClearFlag_FullMethodName = "/native.NativeService/UIObjClearFlag" + NativeService_UIObjSetOpacity_FullMethodName = "/native.NativeService/UIObjSetOpacity" + NativeService_UIObjFadeIn_FullMethodName = "/native.NativeService/UIObjFadeIn" + NativeService_UIObjFadeOut_FullMethodName = "/native.NativeService/UIObjFadeOut" + NativeService_UIObjSetLabelText_FullMethodName = "/native.NativeService/UIObjSetLabelText" + NativeService_UIObjSetImageSrc_FullMethodName = "/native.NativeService/UIObjSetImageSrc" + NativeService_DisplaySetRotation_FullMethodName = "/native.NativeService/DisplaySetRotation" + NativeService_UpdateLabelIfChanged_FullMethodName = "/native.NativeService/UpdateLabelIfChanged" + NativeService_UpdateLabelAndChangeVisibility_FullMethodName = "/native.NativeService/UpdateLabelAndChangeVisibility" + NativeService_SwitchToScreenIf_FullMethodName = "/native.NativeService/SwitchToScreenIf" + NativeService_SwitchToScreenIfDifferent_FullMethodName = "/native.NativeService/SwitchToScreenIfDifferent" + NativeService_DoNotUseThisIsForCrashTestingOnly_FullMethodName = "/native.NativeService/DoNotUseThisIsForCrashTestingOnly" + NativeService_StreamEvents_FullMethodName = "/native.NativeService/StreamEvents" +) // NativeServiceClient is the client API for NativeService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type NativeServiceClient interface { + // Ready check + IsReady(ctx context.Context, in *IsReadyRequest, opts ...grpc.CallOption) (*IsReadyResponse, error) // Video methods VideoSetSleepMode(ctx context.Context, in *VideoSetSleepModeRequest, opts ...grpc.CallOption) (*Empty, error) VideoGetSleepMode(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*VideoGetSleepModeResponse, error) @@ -62,192 +104,323 @@ func NewNativeServiceClient(cc grpc.ClientConnInterface) NativeServiceClient { return &nativeServiceClient{cc} } -func (c *nativeServiceClient) VideoSetSleepMode(ctx context.Context, in *VideoSetSleepModeRequest, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/native.NativeService/VideoSetSleepMode", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) VideoGetSleepMode(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*VideoGetSleepModeResponse, error) { - out := new(VideoGetSleepModeResponse) - err := c.cc.Invoke(ctx, "/native.NativeService/VideoGetSleepMode", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) VideoSleepModeSupported(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*VideoSleepModeSupportedResponse, error) { - out := new(VideoSleepModeSupportedResponse) - err := c.cc.Invoke(ctx, "/native.NativeService/VideoSleepModeSupported", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) VideoSetQualityFactor(ctx context.Context, in *VideoSetQualityFactorRequest, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/native.NativeService/VideoSetQualityFactor", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) VideoGetQualityFactor(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*VideoGetQualityFactorResponse, error) { - out := new(VideoGetQualityFactorResponse) - err := c.cc.Invoke(ctx, "/native.NativeService/VideoGetQualityFactor", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) VideoSetEDID(ctx context.Context, in *VideoSetEDIDRequest, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/native.NativeService/VideoSetEDID", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) VideoGetEDID(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*VideoGetEDIDResponse, error) { - out := new(VideoGetEDIDResponse) - err := c.cc.Invoke(ctx, "/native.NativeService/VideoGetEDID", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) VideoLogStatus(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*VideoLogStatusResponse, error) { - out := new(VideoLogStatusResponse) - err := c.cc.Invoke(ctx, "/native.NativeService/VideoLogStatus", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) VideoStop(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/native.NativeService/VideoStop", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) VideoStart(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/native.NativeService/VideoStart", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) GetLVGLVersion(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetLVGLVersionResponse, error) { - out := new(GetLVGLVersionResponse) - err := c.cc.Invoke(ctx, "/native.NativeService/GetLVGLVersion", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) UIObjHide(ctx context.Context, in *UIObjHideRequest, opts ...grpc.CallOption) (*UIObjHideResponse, error) { - out := new(UIObjHideResponse) - err := c.cc.Invoke(ctx, "/native.NativeService/UIObjHide", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) UIObjShow(ctx context.Context, in *UIObjShowRequest, opts ...grpc.CallOption) (*UIObjShowResponse, error) { - out := new(UIObjShowResponse) - err := c.cc.Invoke(ctx, "/native.NativeService/UIObjShow", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) UISetVar(ctx context.Context, in *UISetVarRequest, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/native.NativeService/UISetVar", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) UIGetVar(ctx context.Context, in *UIGetVarRequest, opts ...grpc.CallOption) (*UIGetVarResponse, error) { - out := new(UIGetVarResponse) - err := c.cc.Invoke(ctx, "/native.NativeService/UIGetVar", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) UIObjAddState(ctx context.Context, in *UIObjAddStateRequest, opts ...grpc.CallOption) (*UIObjAddStateResponse, error) { - out := new(UIObjAddStateResponse) - err := c.cc.Invoke(ctx, "/native.NativeService/UIObjAddState", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) UIObjClearState(ctx context.Context, in *UIObjClearStateRequest, opts ...grpc.CallOption) (*UIObjClearStateResponse, error) { - out := new(UIObjClearStateResponse) - err := c.cc.Invoke(ctx, "/native.NativeService/UIObjClearState", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) UIObjAddFlag(ctx context.Context, in *UIObjAddFlagRequest, opts ...grpc.CallOption) (*UIObjAddFlagResponse, error) { - out := new(UIObjAddFlagResponse) - err := c.cc.Invoke(ctx, "/native.NativeService/UIObjAddFlag", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) UIObjClearFlag(ctx context.Context, in *UIObjClearFlagRequest, opts ...grpc.CallOption) (*UIObjClearFlagResponse, error) { - out := new(UIObjClearFlagResponse) - err := c.cc.Invoke(ctx, "/native.NativeService/UIObjClearFlag", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) UIObjSetOpacity(ctx context.Context, in *UIObjSetOpacityRequest, opts ...grpc.CallOption) (*UIObjSetOpacityResponse, error) { - out := new(UIObjSetOpacityResponse) - err := c.cc.Invoke(ctx, "/native.NativeService/UIObjSetOpacity", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) UIObjFadeIn(ctx context.Context, in *UIObjFadeInRequest, opts ...grpc.CallOption) (*UIObjFadeInResponse, error) { - out := new(UIObjFadeInResponse) - err := c.cc.Invoke(ctx, "/native.NativeService/UIObjFadeIn", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) UIObjFadeOut(ctx context.Context, in *UIObjFadeOutRequest, opts ...grpc.CallOption) (*UIObjFadeOutResponse, error) { - out := new(UIObjFadeOutResponse) - err := c.cc.Invoke(ctx, "/native.NativeService/UIObjFadeOut", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) UIObjSetLabelText(ctx context.Context, in *UIObjSetLabelTextRequest, opts ...grpc.CallOption) (*UIObjSetLabelTextResponse, error) { - out := new(UIObjSetLabelTextResponse) - err := c.cc.Invoke(ctx, "/native.NativeService/UIObjSetLabelText", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) UIObjSetImageSrc(ctx context.Context, in *UIObjSetImageSrcRequest, opts ...grpc.CallOption) (*UIObjSetImageSrcResponse, error) { - out := new(UIObjSetImageSrcResponse) - err := c.cc.Invoke(ctx, "/native.NativeService/UIObjSetImageSrc", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) DisplaySetRotation(ctx context.Context, in *DisplaySetRotationRequest, opts ...grpc.CallOption) (*DisplaySetRotationResponse, error) { - out := new(DisplaySetRotationResponse) - err := c.cc.Invoke(ctx, "/native.NativeService/DisplaySetRotation", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) UpdateLabelIfChanged(ctx context.Context, in *UpdateLabelIfChangedRequest, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/native.NativeService/UpdateLabelIfChanged", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) UpdateLabelAndChangeVisibility(ctx context.Context, in *UpdateLabelAndChangeVisibilityRequest, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/native.NativeService/UpdateLabelAndChangeVisibility", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) SwitchToScreenIf(ctx context.Context, in *SwitchToScreenIfRequest, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/native.NativeService/SwitchToScreenIf", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) SwitchToScreenIfDifferent(ctx context.Context, in *SwitchToScreenIfDifferentRequest, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/native.NativeService/SwitchToScreenIfDifferent", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) DoNotUseThisIsForCrashTestingOnly(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/native.NativeService/DoNotUseThisIsForCrashTestingOnly", in, out, opts...) - return out, err -} - -func (c *nativeServiceClient) StreamEvents(ctx context.Context, in *Empty, opts ...grpc.CallOption) (NativeService_StreamEventsClient, error) { - stream, err := c.cc.NewStream(ctx, &NativeService_ServiceDesc.Streams[0], "/native.NativeService/StreamEvents", opts...) +func (c *nativeServiceClient) IsReady(ctx context.Context, in *IsReadyRequest, opts ...grpc.CallOption) (*IsReadyResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(IsReadyResponse) + err := c.cc.Invoke(ctx, NativeService_IsReady_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } - x := &nativeServiceStreamEventsClient{stream} + return out, nil +} + +func (c *nativeServiceClient) VideoSetSleepMode(ctx context.Context, in *VideoSetSleepModeRequest, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Empty) + err := c.cc.Invoke(ctx, NativeService_VideoSetSleepMode_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) VideoGetSleepMode(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*VideoGetSleepModeResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(VideoGetSleepModeResponse) + err := c.cc.Invoke(ctx, NativeService_VideoGetSleepMode_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) VideoSleepModeSupported(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*VideoSleepModeSupportedResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(VideoSleepModeSupportedResponse) + err := c.cc.Invoke(ctx, NativeService_VideoSleepModeSupported_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) VideoSetQualityFactor(ctx context.Context, in *VideoSetQualityFactorRequest, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Empty) + err := c.cc.Invoke(ctx, NativeService_VideoSetQualityFactor_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) VideoGetQualityFactor(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*VideoGetQualityFactorResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(VideoGetQualityFactorResponse) + err := c.cc.Invoke(ctx, NativeService_VideoGetQualityFactor_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) VideoSetEDID(ctx context.Context, in *VideoSetEDIDRequest, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Empty) + err := c.cc.Invoke(ctx, NativeService_VideoSetEDID_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) VideoGetEDID(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*VideoGetEDIDResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(VideoGetEDIDResponse) + err := c.cc.Invoke(ctx, NativeService_VideoGetEDID_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) VideoLogStatus(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*VideoLogStatusResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(VideoLogStatusResponse) + err := c.cc.Invoke(ctx, NativeService_VideoLogStatus_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) VideoStop(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Empty) + err := c.cc.Invoke(ctx, NativeService_VideoStop_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) VideoStart(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Empty) + err := c.cc.Invoke(ctx, NativeService_VideoStart_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) GetLVGLVersion(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetLVGLVersionResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetLVGLVersionResponse) + err := c.cc.Invoke(ctx, NativeService_GetLVGLVersion_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) UIObjHide(ctx context.Context, in *UIObjHideRequest, opts ...grpc.CallOption) (*UIObjHideResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UIObjHideResponse) + err := c.cc.Invoke(ctx, NativeService_UIObjHide_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) UIObjShow(ctx context.Context, in *UIObjShowRequest, opts ...grpc.CallOption) (*UIObjShowResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UIObjShowResponse) + err := c.cc.Invoke(ctx, NativeService_UIObjShow_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) UISetVar(ctx context.Context, in *UISetVarRequest, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Empty) + err := c.cc.Invoke(ctx, NativeService_UISetVar_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) UIGetVar(ctx context.Context, in *UIGetVarRequest, opts ...grpc.CallOption) (*UIGetVarResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UIGetVarResponse) + err := c.cc.Invoke(ctx, NativeService_UIGetVar_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) UIObjAddState(ctx context.Context, in *UIObjAddStateRequest, opts ...grpc.CallOption) (*UIObjAddStateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UIObjAddStateResponse) + err := c.cc.Invoke(ctx, NativeService_UIObjAddState_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) UIObjClearState(ctx context.Context, in *UIObjClearStateRequest, opts ...grpc.CallOption) (*UIObjClearStateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UIObjClearStateResponse) + err := c.cc.Invoke(ctx, NativeService_UIObjClearState_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) UIObjAddFlag(ctx context.Context, in *UIObjAddFlagRequest, opts ...grpc.CallOption) (*UIObjAddFlagResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UIObjAddFlagResponse) + err := c.cc.Invoke(ctx, NativeService_UIObjAddFlag_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) UIObjClearFlag(ctx context.Context, in *UIObjClearFlagRequest, opts ...grpc.CallOption) (*UIObjClearFlagResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UIObjClearFlagResponse) + err := c.cc.Invoke(ctx, NativeService_UIObjClearFlag_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) UIObjSetOpacity(ctx context.Context, in *UIObjSetOpacityRequest, opts ...grpc.CallOption) (*UIObjSetOpacityResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UIObjSetOpacityResponse) + err := c.cc.Invoke(ctx, NativeService_UIObjSetOpacity_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) UIObjFadeIn(ctx context.Context, in *UIObjFadeInRequest, opts ...grpc.CallOption) (*UIObjFadeInResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UIObjFadeInResponse) + err := c.cc.Invoke(ctx, NativeService_UIObjFadeIn_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) UIObjFadeOut(ctx context.Context, in *UIObjFadeOutRequest, opts ...grpc.CallOption) (*UIObjFadeOutResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UIObjFadeOutResponse) + err := c.cc.Invoke(ctx, NativeService_UIObjFadeOut_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) UIObjSetLabelText(ctx context.Context, in *UIObjSetLabelTextRequest, opts ...grpc.CallOption) (*UIObjSetLabelTextResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UIObjSetLabelTextResponse) + err := c.cc.Invoke(ctx, NativeService_UIObjSetLabelText_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) UIObjSetImageSrc(ctx context.Context, in *UIObjSetImageSrcRequest, opts ...grpc.CallOption) (*UIObjSetImageSrcResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UIObjSetImageSrcResponse) + err := c.cc.Invoke(ctx, NativeService_UIObjSetImageSrc_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) DisplaySetRotation(ctx context.Context, in *DisplaySetRotationRequest, opts ...grpc.CallOption) (*DisplaySetRotationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DisplaySetRotationResponse) + err := c.cc.Invoke(ctx, NativeService_DisplaySetRotation_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) UpdateLabelIfChanged(ctx context.Context, in *UpdateLabelIfChangedRequest, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Empty) + err := c.cc.Invoke(ctx, NativeService_UpdateLabelIfChanged_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) UpdateLabelAndChangeVisibility(ctx context.Context, in *UpdateLabelAndChangeVisibilityRequest, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Empty) + err := c.cc.Invoke(ctx, NativeService_UpdateLabelAndChangeVisibility_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) SwitchToScreenIf(ctx context.Context, in *SwitchToScreenIfRequest, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Empty) + err := c.cc.Invoke(ctx, NativeService_SwitchToScreenIf_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) SwitchToScreenIfDifferent(ctx context.Context, in *SwitchToScreenIfDifferentRequest, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Empty) + err := c.cc.Invoke(ctx, NativeService_SwitchToScreenIfDifferent_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) DoNotUseThisIsForCrashTestingOnly(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Empty) + err := c.cc.Invoke(ctx, NativeService_DoNotUseThisIsForCrashTestingOnly_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nativeServiceClient) StreamEvents(ctx context.Context, in *Empty, opts ...grpc.CallOption) (NativeService_StreamEventsClient, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &NativeService_ServiceDesc.Streams[0], NativeService_StreamEvents_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &nativeServiceStreamEventsClient{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -275,7 +448,11 @@ func (x *nativeServiceStreamEventsClient) Recv() (*Event, error) { } // NativeServiceServer is the server API for NativeService service. +// All implementations must embed UnimplementedNativeServiceServer +// for forward compatibility type NativeServiceServer interface { + // Ready check + IsReady(context.Context, *IsReadyRequest) (*IsReadyResponse, error) // Video methods VideoSetSleepMode(context.Context, *VideoSetSleepModeRequest) (*Empty, error) VideoGetSleepMode(context.Context, *Empty) (*VideoGetSleepModeResponse, error) @@ -318,130 +495,102 @@ type NativeServiceServer interface { type UnimplementedNativeServiceServer struct { } +func (UnimplementedNativeServiceServer) IsReady(context.Context, *IsReadyRequest) (*IsReadyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IsReady not implemented") +} func (UnimplementedNativeServiceServer) VideoSetSleepMode(context.Context, *VideoSetSleepModeRequest) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method VideoSetSleepMode not implemented") } - func (UnimplementedNativeServiceServer) VideoGetSleepMode(context.Context, *Empty) (*VideoGetSleepModeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method VideoGetSleepMode not implemented") } - func (UnimplementedNativeServiceServer) VideoSleepModeSupported(context.Context, *Empty) (*VideoSleepModeSupportedResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method VideoSleepModeSupported not implemented") } - func (UnimplementedNativeServiceServer) VideoSetQualityFactor(context.Context, *VideoSetQualityFactorRequest) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method VideoSetQualityFactor not implemented") } - func (UnimplementedNativeServiceServer) VideoGetQualityFactor(context.Context, *Empty) (*VideoGetQualityFactorResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method VideoGetQualityFactor not implemented") } - func (UnimplementedNativeServiceServer) VideoSetEDID(context.Context, *VideoSetEDIDRequest) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method VideoSetEDID not implemented") } - func (UnimplementedNativeServiceServer) VideoGetEDID(context.Context, *Empty) (*VideoGetEDIDResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method VideoGetEDID not implemented") } - func (UnimplementedNativeServiceServer) VideoLogStatus(context.Context, *Empty) (*VideoLogStatusResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method VideoLogStatus not implemented") } - func (UnimplementedNativeServiceServer) VideoStop(context.Context, *Empty) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method VideoStop not implemented") } - func (UnimplementedNativeServiceServer) VideoStart(context.Context, *Empty) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method VideoStart not implemented") } - func (UnimplementedNativeServiceServer) GetLVGLVersion(context.Context, *Empty) (*GetLVGLVersionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetLVGLVersion not implemented") } - func (UnimplementedNativeServiceServer) UIObjHide(context.Context, *UIObjHideRequest) (*UIObjHideResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UIObjHide not implemented") } - func (UnimplementedNativeServiceServer) UIObjShow(context.Context, *UIObjShowRequest) (*UIObjShowResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UIObjShow not implemented") } - func (UnimplementedNativeServiceServer) UISetVar(context.Context, *UISetVarRequest) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method UISetVar not implemented") } - func (UnimplementedNativeServiceServer) UIGetVar(context.Context, *UIGetVarRequest) (*UIGetVarResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UIGetVar not implemented") } - func (UnimplementedNativeServiceServer) UIObjAddState(context.Context, *UIObjAddStateRequest) (*UIObjAddStateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UIObjAddState not implemented") } - func (UnimplementedNativeServiceServer) UIObjClearState(context.Context, *UIObjClearStateRequest) (*UIObjClearStateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UIObjClearState not implemented") } - func (UnimplementedNativeServiceServer) UIObjAddFlag(context.Context, *UIObjAddFlagRequest) (*UIObjAddFlagResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UIObjAddFlag not implemented") } - func (UnimplementedNativeServiceServer) UIObjClearFlag(context.Context, *UIObjClearFlagRequest) (*UIObjClearFlagResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UIObjClearFlag not implemented") } - func (UnimplementedNativeServiceServer) UIObjSetOpacity(context.Context, *UIObjSetOpacityRequest) (*UIObjSetOpacityResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UIObjSetOpacity not implemented") } - func (UnimplementedNativeServiceServer) UIObjFadeIn(context.Context, *UIObjFadeInRequest) (*UIObjFadeInResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UIObjFadeIn not implemented") } - func (UnimplementedNativeServiceServer) UIObjFadeOut(context.Context, *UIObjFadeOutRequest) (*UIObjFadeOutResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UIObjFadeOut not implemented") } - func (UnimplementedNativeServiceServer) UIObjSetLabelText(context.Context, *UIObjSetLabelTextRequest) (*UIObjSetLabelTextResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UIObjSetLabelText not implemented") } - func (UnimplementedNativeServiceServer) UIObjSetImageSrc(context.Context, *UIObjSetImageSrcRequest) (*UIObjSetImageSrcResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UIObjSetImageSrc not implemented") } - func (UnimplementedNativeServiceServer) DisplaySetRotation(context.Context, *DisplaySetRotationRequest) (*DisplaySetRotationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DisplaySetRotation not implemented") } - func (UnimplementedNativeServiceServer) UpdateLabelIfChanged(context.Context, *UpdateLabelIfChangedRequest) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateLabelIfChanged not implemented") } - func (UnimplementedNativeServiceServer) UpdateLabelAndChangeVisibility(context.Context, *UpdateLabelAndChangeVisibilityRequest) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateLabelAndChangeVisibility not implemented") } - func (UnimplementedNativeServiceServer) SwitchToScreenIf(context.Context, *SwitchToScreenIfRequest) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method SwitchToScreenIf not implemented") } - func (UnimplementedNativeServiceServer) SwitchToScreenIfDifferent(context.Context, *SwitchToScreenIfDifferentRequest) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method SwitchToScreenIfDifferent not implemented") } - func (UnimplementedNativeServiceServer) DoNotUseThisIsForCrashTestingOnly(context.Context, *Empty) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method DoNotUseThisIsForCrashTestingOnly not implemented") } - func (UnimplementedNativeServiceServer) StreamEvents(*Empty, NativeService_StreamEventsServer) error { return status.Errorf(codes.Unimplemented, "method StreamEvents not implemented") } - func (UnimplementedNativeServiceServer) mustEmbedUnimplementedNativeServiceServer() {} // UnsafeNativeServiceServer may be embedded to opt out of forward compatibility for this service. @@ -455,6 +604,572 @@ func RegisterNativeServiceServer(s grpc.ServiceRegistrar, srv NativeServiceServe s.RegisterService(&NativeService_ServiceDesc, srv) } +func _NativeService_IsReady_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IsReadyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).IsReady(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_IsReady_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).IsReady(ctx, req.(*IsReadyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_VideoSetSleepMode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(VideoSetSleepModeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).VideoSetSleepMode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_VideoSetSleepMode_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).VideoSetSleepMode(ctx, req.(*VideoSetSleepModeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_VideoGetSleepMode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).VideoGetSleepMode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_VideoGetSleepMode_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).VideoGetSleepMode(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_VideoSleepModeSupported_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).VideoSleepModeSupported(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_VideoSleepModeSupported_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).VideoSleepModeSupported(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_VideoSetQualityFactor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(VideoSetQualityFactorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).VideoSetQualityFactor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_VideoSetQualityFactor_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).VideoSetQualityFactor(ctx, req.(*VideoSetQualityFactorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_VideoGetQualityFactor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).VideoGetQualityFactor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_VideoGetQualityFactor_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).VideoGetQualityFactor(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_VideoSetEDID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(VideoSetEDIDRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).VideoSetEDID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_VideoSetEDID_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).VideoSetEDID(ctx, req.(*VideoSetEDIDRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_VideoGetEDID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).VideoGetEDID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_VideoGetEDID_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).VideoGetEDID(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_VideoLogStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).VideoLogStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_VideoLogStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).VideoLogStatus(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_VideoStop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).VideoStop(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_VideoStop_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).VideoStop(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_VideoStart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).VideoStart(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_VideoStart_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).VideoStart(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_GetLVGLVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).GetLVGLVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_GetLVGLVersion_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).GetLVGLVersion(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_UIObjHide_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UIObjHideRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).UIObjHide(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_UIObjHide_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).UIObjHide(ctx, req.(*UIObjHideRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_UIObjShow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UIObjShowRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).UIObjShow(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_UIObjShow_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).UIObjShow(ctx, req.(*UIObjShowRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_UISetVar_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UISetVarRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).UISetVar(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_UISetVar_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).UISetVar(ctx, req.(*UISetVarRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_UIGetVar_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UIGetVarRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).UIGetVar(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_UIGetVar_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).UIGetVar(ctx, req.(*UIGetVarRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_UIObjAddState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UIObjAddStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).UIObjAddState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_UIObjAddState_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).UIObjAddState(ctx, req.(*UIObjAddStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_UIObjClearState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UIObjClearStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).UIObjClearState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_UIObjClearState_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).UIObjClearState(ctx, req.(*UIObjClearStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_UIObjAddFlag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UIObjAddFlagRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).UIObjAddFlag(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_UIObjAddFlag_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).UIObjAddFlag(ctx, req.(*UIObjAddFlagRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_UIObjClearFlag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UIObjClearFlagRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).UIObjClearFlag(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_UIObjClearFlag_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).UIObjClearFlag(ctx, req.(*UIObjClearFlagRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_UIObjSetOpacity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UIObjSetOpacityRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).UIObjSetOpacity(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_UIObjSetOpacity_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).UIObjSetOpacity(ctx, req.(*UIObjSetOpacityRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_UIObjFadeIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UIObjFadeInRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).UIObjFadeIn(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_UIObjFadeIn_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).UIObjFadeIn(ctx, req.(*UIObjFadeInRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_UIObjFadeOut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UIObjFadeOutRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).UIObjFadeOut(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_UIObjFadeOut_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).UIObjFadeOut(ctx, req.(*UIObjFadeOutRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_UIObjSetLabelText_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UIObjSetLabelTextRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).UIObjSetLabelText(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_UIObjSetLabelText_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).UIObjSetLabelText(ctx, req.(*UIObjSetLabelTextRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_UIObjSetImageSrc_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UIObjSetImageSrcRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).UIObjSetImageSrc(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_UIObjSetImageSrc_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).UIObjSetImageSrc(ctx, req.(*UIObjSetImageSrcRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_DisplaySetRotation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DisplaySetRotationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).DisplaySetRotation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_DisplaySetRotation_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).DisplaySetRotation(ctx, req.(*DisplaySetRotationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_UpdateLabelIfChanged_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateLabelIfChangedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).UpdateLabelIfChanged(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_UpdateLabelIfChanged_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).UpdateLabelIfChanged(ctx, req.(*UpdateLabelIfChangedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_UpdateLabelAndChangeVisibility_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateLabelAndChangeVisibilityRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).UpdateLabelAndChangeVisibility(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_UpdateLabelAndChangeVisibility_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).UpdateLabelAndChangeVisibility(ctx, req.(*UpdateLabelAndChangeVisibilityRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_SwitchToScreenIf_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SwitchToScreenIfRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).SwitchToScreenIf(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_SwitchToScreenIf_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).SwitchToScreenIf(ctx, req.(*SwitchToScreenIfRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_SwitchToScreenIfDifferent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SwitchToScreenIfDifferentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).SwitchToScreenIfDifferent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_SwitchToScreenIfDifferent_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).SwitchToScreenIfDifferent(ctx, req.(*SwitchToScreenIfDifferentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_DoNotUseThisIsForCrashTestingOnly_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NativeServiceServer).DoNotUseThisIsForCrashTestingOnly(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NativeService_DoNotUseThisIsForCrashTestingOnly_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NativeServiceServer).DoNotUseThisIsForCrashTestingOnly(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _NativeService_StreamEvents_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(Empty) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(NativeServiceServer).StreamEvents(m, &nativeServiceStreamEventsServer{ServerStream: stream}) +} + type NativeService_StreamEventsServer interface { Send(*Event) error grpc.ServerStream @@ -476,17 +1191,136 @@ var NativeService_ServiceDesc = grpc.ServiceDesc{ HandlerType: (*NativeServiceServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "VideoSetSleepMode", - Handler: nil, // Will be set by RegisterNativeServiceServer + MethodName: "IsReady", + Handler: _NativeService_IsReady_Handler, + }, + { + MethodName: "VideoSetSleepMode", + Handler: _NativeService_VideoSetSleepMode_Handler, + }, + { + MethodName: "VideoGetSleepMode", + Handler: _NativeService_VideoGetSleepMode_Handler, + }, + { + MethodName: "VideoSleepModeSupported", + Handler: _NativeService_VideoSleepModeSupported_Handler, + }, + { + MethodName: "VideoSetQualityFactor", + Handler: _NativeService_VideoSetQualityFactor_Handler, + }, + { + MethodName: "VideoGetQualityFactor", + Handler: _NativeService_VideoGetQualityFactor_Handler, + }, + { + MethodName: "VideoSetEDID", + Handler: _NativeService_VideoSetEDID_Handler, + }, + { + MethodName: "VideoGetEDID", + Handler: _NativeService_VideoGetEDID_Handler, + }, + { + MethodName: "VideoLogStatus", + Handler: _NativeService_VideoLogStatus_Handler, + }, + { + MethodName: "VideoStop", + Handler: _NativeService_VideoStop_Handler, + }, + { + MethodName: "VideoStart", + Handler: _NativeService_VideoStart_Handler, + }, + { + MethodName: "GetLVGLVersion", + Handler: _NativeService_GetLVGLVersion_Handler, + }, + { + MethodName: "UIObjHide", + Handler: _NativeService_UIObjHide_Handler, + }, + { + MethodName: "UIObjShow", + Handler: _NativeService_UIObjShow_Handler, + }, + { + MethodName: "UISetVar", + Handler: _NativeService_UISetVar_Handler, + }, + { + MethodName: "UIGetVar", + Handler: _NativeService_UIGetVar_Handler, + }, + { + MethodName: "UIObjAddState", + Handler: _NativeService_UIObjAddState_Handler, + }, + { + MethodName: "UIObjClearState", + Handler: _NativeService_UIObjClearState_Handler, + }, + { + MethodName: "UIObjAddFlag", + Handler: _NativeService_UIObjAddFlag_Handler, + }, + { + MethodName: "UIObjClearFlag", + Handler: _NativeService_UIObjClearFlag_Handler, + }, + { + MethodName: "UIObjSetOpacity", + Handler: _NativeService_UIObjSetOpacity_Handler, + }, + { + MethodName: "UIObjFadeIn", + Handler: _NativeService_UIObjFadeIn_Handler, + }, + { + MethodName: "UIObjFadeOut", + Handler: _NativeService_UIObjFadeOut_Handler, + }, + { + MethodName: "UIObjSetLabelText", + Handler: _NativeService_UIObjSetLabelText_Handler, + }, + { + MethodName: "UIObjSetImageSrc", + Handler: _NativeService_UIObjSetImageSrc_Handler, + }, + { + MethodName: "DisplaySetRotation", + Handler: _NativeService_DisplaySetRotation_Handler, + }, + { + MethodName: "UpdateLabelIfChanged", + Handler: _NativeService_UpdateLabelIfChanged_Handler, + }, + { + MethodName: "UpdateLabelAndChangeVisibility", + Handler: _NativeService_UpdateLabelAndChangeVisibility_Handler, + }, + { + MethodName: "SwitchToScreenIf", + Handler: _NativeService_SwitchToScreenIf_Handler, + }, + { + MethodName: "SwitchToScreenIfDifferent", + Handler: _NativeService_SwitchToScreenIfDifferent_Handler, + }, + { + MethodName: "DoNotUseThisIsForCrashTestingOnly", + Handler: _NativeService_DoNotUseThisIsForCrashTestingOnly_Handler, }, - // Additional methods will be registered here }, Streams: []grpc.StreamDesc{ { StreamName: "StreamEvents", - Handler: nil, // Will be set by RegisterNativeServiceServer + Handler: _NativeService_StreamEvents_Handler, ServerStreams: true, }, }, - Metadata: "native.proto", + Metadata: "internal/native/proto/native.proto", } diff --git a/internal/native/proxy.go b/internal/native/proxy.go index 0523e905..b36c82e7 100644 --- a/internal/native/proxy.go +++ b/internal/native/proxy.go @@ -1,19 +1,22 @@ package native import ( - "encoding/json" "fmt" + "net" "os" "os/exec" "sync" "syscall" "time" - "github.com/Masterminds/semver/v3" "github.com/jetkvm/kvm/internal/supervisor" "github.com/rs/zerolog" ) +const ( + maxFrameSize = 1920 * 1080 / 2 +) + // cmdWrapper wraps exec.Cmd to implement processCmd interface type cmdWrapper struct { *exec.Cmd @@ -43,94 +46,116 @@ func (p *processWrapper) Signal(sig interface{}) error { // NativeProxy is a proxy that communicates with a separate native process type NativeProxy struct { - client *IPCClient - cmd *exec.Cmd - wrapped *cmdWrapper + nativeUnixSocket string + videoStreamUnixSocket string + videoStreamListener net.Listener + binaryPath string + + client *GRPCClient + cmd *cmdWrapper logger *zerolog.Logger ready chan struct{} + options *NativeOptions restartM sync.Mutex stopped bool - opts NativeProxyOptions - binaryPath string - configJSON []byte processWait chan error } -// NativeProxyOptions are options for creating a NativeProxy -type NativeProxyOptions struct { - Disable bool - SystemVersion *semver.Version - AppVersion *semver.Version - DisplayRotation uint16 - DefaultQualityFactor float64 - OnVideoStateChange func(state VideoState) - OnVideoFrameReceived func(frame []byte, duration time.Duration) - OnIndevEvent func(event string) - OnRpcEvent func(event string) - Logger *zerolog.Logger +func ensureDirectoryExists(path string) error { + if _, err := os.Stat(path); os.IsNotExist(err) { + return os.MkdirAll(path, 0600) + } + return nil } // NewNativeProxy creates a new NativeProxy that spawns a separate process -func NewNativeProxy(opts NativeProxyOptions) (*NativeProxy, error) { - if opts.Logger == nil { - opts.Logger = nativeLogger - } +func NewNativeProxy(opts NativeOptions) (*NativeProxy, error) { + nativeUnixSocket := "jetkvm-native-grpc" + videoStreamUnixSocket := "@jetkvm-native-video-stream" // Get the current executable path to spawn itself exePath, err := os.Executable() if err != nil { return nil, fmt.Errorf("failed to get executable path: %w", err) } - binaryPath := exePath - config := ProcessConfig{ - Disable: opts.Disable, - SystemVersion: "", - AppVersion: "", - DisplayRotation: opts.DisplayRotation, - DefaultQualityFactor: opts.DefaultQualityFactor, + proxy := &NativeProxy{ + nativeUnixSocket: nativeUnixSocket, + videoStreamUnixSocket: videoStreamUnixSocket, + binaryPath: exePath, + logger: nativeLogger, + ready: make(chan struct{}), + options: &opts, + processWait: make(chan error, 1), } - if opts.SystemVersion != nil { - config.SystemVersion = opts.SystemVersion.String() - } - if opts.AppVersion != nil { - config.AppVersion = opts.AppVersion.String() - } - - configJSON, err := json.Marshal(config) + proxy.cmd, err = proxy.spawnProcess() + nativeLogger.Info().Msg("spawned process") if err != nil { - return nil, fmt.Errorf("failed to marshal config: %w", err) + return nil, fmt.Errorf("failed to spawn process: %w", err) } - cmd := exec.Command(binaryPath, string(configJSON)) + // create unix packet + listener, err := net.Listen("unixpacket", videoStreamUnixSocket) + if err != nil { + nativeLogger.Warn().Err(err).Msg("failed to start server") + return nil, fmt.Errorf("failed to start server: %w", err) + } + go func() { + for { + conn, err := listener.Accept() + if err != nil { + nativeLogger.Warn().Err(err).Msg("failed to accept socket") + continue + } + nativeLogger.Info().Str("socket", conn.RemoteAddr().String()).Msg("accepted socket") + go proxy.handleVideoFrame(conn) + } + }() + + return proxy, nil +} + +func (p *NativeProxy) spawnProcess() (*cmdWrapper, error) { + cmd := exec.Command( + p.binaryPath, + "-subcomponent=native", + ) + cmd.Stdout = os.Stdout // Forward stdout to parent cmd.Stderr = os.Stderr // Forward stderr to parent // Set environment variable to indicate native process mode - cmd.Env = append(os.Environ(), fmt.Sprintf("%s=native", supervisor.EnvSubcomponent)) - + cmd.Env = append( + os.Environ(), + fmt.Sprintf("%s=native", supervisor.EnvSubcomponent), + fmt.Sprintf("%s=%s", "JETKVM_NATIVE_SOCKET", p.nativeUnixSocket), + fmt.Sprintf("%s=%s", "JETKVM_VIDEO_STREAM_SOCKET", p.videoStreamUnixSocket), + fmt.Sprintf("%s=%s", "JETKVM_NATIVE_SYSTEM_VERSION", p.options.SystemVersion), + fmt.Sprintf("%s=%s", "JETKVM_NATIVE_APP_VERSION", p.options.AppVersion), + fmt.Sprintf("%s=%d", "JETKVM_NATIVE_DISPLAY_ROTATION", p.options.DisplayRotation), + fmt.Sprintf("%s=%f", "JETKVM_NATIVE_DEFAULT_QUALITY_FACTOR", p.options.DefaultQualityFactor), + ) // Wrap cmd to implement processCmd interface wrappedCmd := &cmdWrapper{Cmd: cmd} - client, err := NewIPCClient(wrappedCmd, opts.Logger) - if err != nil { - return nil, fmt.Errorf("failed to create IPC client: %w", err) + return wrappedCmd, nil +} + +func (p *NativeProxy) handleVideoFrame(conn net.Conn) { + defer conn.Close() + + inboundPacket := make([]byte, maxFrameSize) + lastFrame := time.Now() + + for { + n, err := conn.Read(inboundPacket) + if err != nil { + nativeLogger.Warn().Err(err).Msg("failed to accept socket") + break + } + now := time.Now() + sinceLastFrame := now.Sub(lastFrame) + lastFrame = now + p.options.OnVideoFrameReceived(inboundPacket[:n], sinceLastFrame) } - - proxy := &NativeProxy{ - client: client, - cmd: cmd, - wrapped: wrappedCmd, - logger: opts.Logger, - ready: make(chan struct{}), - opts: opts, - binaryPath: binaryPath, - configJSON: configJSON, - processWait: make(chan error, 1), - } - - // Set up event handlers - proxy.setupEventHandlers(client) - - return proxy, nil } // Start starts the native process @@ -146,6 +171,15 @@ func (p *NativeProxy) Start() error { return fmt.Errorf("failed to start native process: %w", err) } + nativeLogger.Info().Msg("process ready") + + client, err := NewGRPCClient(p.nativeUnixSocket, nativeLogger) + nativeLogger.Info().Str("socket_path", p.nativeUnixSocket).Msg("created client") + if err != nil { + return fmt.Errorf("failed to create IPC client: %w", err) + } + p.client = client + // Wait for ready signal from the native process if err := p.client.WaitReady(); err != nil { // Clean up if ready failed @@ -153,9 +187,12 @@ func (p *NativeProxy) Start() error { _ = p.cmd.Process.Kill() _ = p.cmd.Wait() } - return err + return fmt.Errorf("failed to wait for ready: %w", err) } + // Set up event handlers + p.setupEventHandlers(client) + // Start monitoring process for crashes go p.monitorProcess() @@ -216,14 +253,10 @@ func (p *NativeProxy) restartProcess() error { return fmt.Errorf("proxy is stopped") } - // Create new command - cmd := exec.Command(p.binaryPath, string(p.configJSON)) - cmd.Stderr = os.Stderr - // Set environment variable to indicate native process mode - cmd.Env = append(os.Environ(), "JETKVM_NATIVE_PROCESS=1") - - // Wrap cmd to implement processCmd interface - wrappedCmd := &cmdWrapper{Cmd: cmd} + wrappedCmd, err := p.spawnProcess() + if err != nil { + return fmt.Errorf("failed to spawn process: %w", err) + } // Close old client if p.client != nil { @@ -231,7 +264,7 @@ func (p *NativeProxy) restartProcess() error { } // Create new client - client, err := NewIPCClient(wrappedCmd, p.logger) + client, err := NewGRPCClient(p.nativeUnixSocket, p.logger) if err != nil { return fmt.Errorf("failed to create IPC client: %w", err) } @@ -240,90 +273,89 @@ func (p *NativeProxy) restartProcess() error { p.setupEventHandlers(client) // Start the process - if err := cmd.Start(); err != nil { + if err := wrappedCmd.Start(); err != nil { return fmt.Errorf("failed to start native process: %w", err) } // Wait for ready if err := client.WaitReady(); err != nil { - if cmd.Process != nil { - _ = cmd.Process.Kill() - _ = cmd.Wait() + if wrappedCmd.Process != nil { + _ = wrappedCmd.Process.Kill() + _ = wrappedCmd.Wait() } return fmt.Errorf("timeout waiting for ready: %w", err) } - p.cmd = cmd - p.wrapped = wrappedCmd + p.cmd = wrappedCmd p.client = client p.logger.Info().Msg("native process restarted successfully") return nil } -func (p *NativeProxy) setupEventHandlers(client *IPCClient) { - if p.opts.OnVideoStateChange != nil { - client.OnEvent("video_state_change", func(data interface{}) { - dataBytes, err := json.Marshal(data) - if err != nil { - p.logger.Warn().Err(err).Msg("failed to marshal video state event") - return - } - var state VideoState - if err := json.Unmarshal(dataBytes, &state); err != nil { - p.logger.Warn().Err(err).Msg("failed to unmarshal video state event") - return - } - p.opts.OnVideoStateChange(state) - }) - } +func (p *NativeProxy) setupEventHandlers(client *GRPCClient) { + // if p.opts.OnVideoStateChange != nil { + // client.OnEvent("video_state_change", func(data interface{}) { + // dataBytes, err := json.Marshal(data) + // if err != nil { + // p.logger.Warn().Err(err).Msg("failed to marshal video state event") + // return + // } + // var state VideoState + // if err := json.Unmarshal(dataBytes, &state); err != nil { + // p.logger.Warn().Err(err).Msg("failed to unmarshal video state event") + // return + // } + // p.opts.OnVideoStateChange(state) + // }) + // } - if p.opts.OnIndevEvent != nil { - client.OnEvent("indev_event", func(data interface{}) { - if event, ok := data.(string); ok { - p.opts.OnIndevEvent(event) - } - }) - } + // if p.opts.OnIndevEvent != nil { + // client.OnEvent("indev_event", func(data interface{}) { + // if event, ok := data.(string); ok { + // p.opts.OnIndevEvent(event) + // } + // }) + // } - if p.opts.OnRpcEvent != nil { - client.OnEvent("rpc_event", func(data interface{}) { - if event, ok := data.(string); ok { - p.opts.OnRpcEvent(event) - } - }) - } + // if p.opts.OnRpcEvent != nil { + // client.OnEvent("rpc_event", func(data interface{}) { + // if event, ok := data.(string); ok { + // p.opts.OnRpcEvent(event) + // } + // }) + // } - if p.opts.OnVideoFrameReceived != nil { - client.OnEvent("video_frame", func(data interface{}) { - dataMap, ok := data.(map[string]interface{}) - if !ok { - p.logger.Warn().Msg("invalid video frame event data") - return - } + // if p.opts.OnVideoFrameReceived != nil { + // client.OnEvent("video_frame", func(data interface{}) { + // dataMap, ok := data.(map[string]interface{}) + // if !ok { + // p.logger.Warn().Msg("invalid video frame event data") + // return + // } - frameData, ok := dataMap["frame"].([]interface{}) - if !ok { - p.logger.Warn().Msg("invalid frame data in event") - return - } + // frameData, ok := dataMap["frame"].([]interface{}) + // if !ok { + // p.logger.Warn().Msg("invalid frame data in event") + // return + // } - frame := make([]byte, len(frameData)) - for i, v := range frameData { - if b, ok := v.(float64); ok { - frame[i] = byte(b) - } - } + // frame := make([]byte, len(frameData)) + // for i, v := range frameData { + // if b, ok := v.(float64); ok { + // frame[i] = byte(b) + // } + // } - durationNs, ok := dataMap["duration"].(float64) - if !ok { - p.logger.Warn().Msg("invalid duration in event") - return - } + // durationNs, ok := dataMap["duration"].(float64) + // if !ok { + // p.logger.Warn().Msg("invalid duration in event") + // return + // } - p.opts.OnVideoFrameReceived(frame, time.Duration(durationNs)) - }) - } + // p.opts.OnVideoFrameReceived(frame, time.Duration(durationNs)) + // }) + // } } // Stop stops the native process @@ -347,336 +379,123 @@ func (p *NativeProxy) Stop() error { return nil } -// Implement all Native methods by forwarding to IPC - +// Implement all Native methods by forwarding to gRPC client func (p *NativeProxy) VideoSetSleepMode(enabled bool) error { - _, err := p.client.Call("VideoSetSleepMode", map[string]interface{}{ - "enabled": enabled, - }) - return err + return p.client.VideoSetSleepMode(enabled) } func (p *NativeProxy) VideoGetSleepMode() (bool, error) { - resp, err := p.client.Call("VideoGetSleepMode", nil) - if err != nil { - return false, err - } - result, ok := resp.Result.(bool) - if !ok { - return false, fmt.Errorf("invalid response type") - } - return result, nil + return p.client.VideoGetSleepMode() } func (p *NativeProxy) VideoSleepModeSupported() bool { - resp, err := p.client.Call("VideoSleepModeSupported", nil) - if err != nil { - return false - } - result, ok := resp.Result.(bool) - if !ok { - return false - } - return result + return p.client.VideoSleepModeSupported() } func (p *NativeProxy) VideoSetQualityFactor(factor float64) error { - _, err := p.client.Call("VideoSetQualityFactor", map[string]interface{}{ - "factor": factor, - }) - return err + return p.client.VideoSetQualityFactor(factor) } func (p *NativeProxy) VideoGetQualityFactor() (float64, error) { - resp, err := p.client.Call("VideoGetQualityFactor", nil) - if err != nil { - return 0, err - } - result, ok := resp.Result.(float64) - if !ok { - return 0, fmt.Errorf("invalid response type") - } - return result, nil + return p.client.VideoGetQualityFactor() } func (p *NativeProxy) VideoSetEDID(edid string) error { - _, err := p.client.Call("VideoSetEDID", map[string]interface{}{ - "edid": edid, - }) - return err + return p.client.VideoSetEDID(edid) } func (p *NativeProxy) VideoGetEDID() (string, error) { - resp, err := p.client.Call("VideoGetEDID", nil) - if err != nil { - return "", err - } - result, ok := resp.Result.(string) - if !ok { - return "", fmt.Errorf("invalid response type") - } - return result, nil + return p.client.VideoGetEDID() } func (p *NativeProxy) VideoLogStatus() (string, error) { - resp, err := p.client.Call("VideoLogStatus", nil) - if err != nil { - return "", err - } - result, ok := resp.Result.(string) - if !ok { - return "", fmt.Errorf("invalid response type") - } - return result, nil + return p.client.VideoLogStatus() } func (p *NativeProxy) VideoStop() error { - _, err := p.client.Call("VideoStop", nil) - return err + return p.client.VideoStop() } func (p *NativeProxy) VideoStart() error { - _, err := p.client.Call("VideoStart", nil) - return err + return p.client.VideoStart() } func (p *NativeProxy) GetLVGLVersion() (string, error) { - resp, err := p.client.Call("GetLVGLVersion", nil) - if err != nil { - return "", err - } - result, ok := resp.Result.(string) - if !ok { - return "", fmt.Errorf("invalid response type") - } - return result, nil + return p.client.GetLVGLVersion() } func (p *NativeProxy) UIObjHide(objName string) (bool, error) { - resp, err := p.client.Call("UIObjHide", map[string]interface{}{ - "obj_name": objName, - }) - if err != nil { - return false, err - } - result, ok := resp.Result.(bool) - if !ok { - return false, fmt.Errorf("invalid response type") - } - return result, nil + return p.client.UIObjHide(objName) } func (p *NativeProxy) UIObjShow(objName string) (bool, error) { - resp, err := p.client.Call("UIObjShow", map[string]interface{}{ - "obj_name": objName, - }) - if err != nil { - return false, err - } - result, ok := resp.Result.(bool) - if !ok { - return false, fmt.Errorf("invalid response type") - } - return result, nil + return p.client.UIObjShow(objName) } func (p *NativeProxy) UISetVar(name string, value string) { - _, _ = p.client.Call("UISetVar", map[string]interface{}{ - "name": name, - "value": value, - }) + p.client.UISetVar(name, value) } func (p *NativeProxy) UIGetVar(name string) string { - resp, err := p.client.Call("UIGetVar", map[string]interface{}{ - "name": name, - }) - if err != nil { - return "" - } - result, ok := resp.Result.(string) - if !ok { - return "" - } - return result + return p.client.UIGetVar(name) } func (p *NativeProxy) UIObjAddState(objName string, state string) (bool, error) { - resp, err := p.client.Call("UIObjAddState", map[string]interface{}{ - "obj_name": objName, - "state": state, - }) - if err != nil { - return false, err - } - result, ok := resp.Result.(bool) - if !ok { - return false, fmt.Errorf("invalid response type") - } - return result, nil + return p.client.UIObjAddState(objName, state) } func (p *NativeProxy) UIObjClearState(objName string, state string) (bool, error) { - resp, err := p.client.Call("UIObjClearState", map[string]interface{}{ - "obj_name": objName, - "state": state, - }) - if err != nil { - return false, err - } - result, ok := resp.Result.(bool) - if !ok { - return false, fmt.Errorf("invalid response type") - } - return result, nil + return p.client.UIObjClearState(objName, state) } func (p *NativeProxy) UIObjAddFlag(objName string, flag string) (bool, error) { - resp, err := p.client.Call("UIObjAddFlag", map[string]interface{}{ - "obj_name": objName, - "flag": flag, - }) - if err != nil { - return false, err - } - result, ok := resp.Result.(bool) - if !ok { - return false, fmt.Errorf("invalid response type") - } - return result, nil + return p.client.UIObjAddFlag(objName, flag) } func (p *NativeProxy) UIObjClearFlag(objName string, flag string) (bool, error) { - resp, err := p.client.Call("UIObjClearFlag", map[string]interface{}{ - "obj_name": objName, - "flag": flag, - }) - if err != nil { - return false, err - } - result, ok := resp.Result.(bool) - if !ok { - return false, fmt.Errorf("invalid response type") - } - return result, nil + return p.client.UIObjClearFlag(objName, flag) } func (p *NativeProxy) UIObjSetOpacity(objName string, opacity int) (bool, error) { - resp, err := p.client.Call("UIObjSetOpacity", map[string]interface{}{ - "obj_name": objName, - "opacity": opacity, - }) - if err != nil { - return false, err - } - result, ok := resp.Result.(bool) - if !ok { - return false, fmt.Errorf("invalid response type") - } - return result, nil + return p.client.UIObjSetOpacity(objName, opacity) } func (p *NativeProxy) UIObjFadeIn(objName string, duration uint32) (bool, error) { - resp, err := p.client.Call("UIObjFadeIn", map[string]interface{}{ - "obj_name": objName, - "duration": duration, - }) - if err != nil { - return false, err - } - result, ok := resp.Result.(bool) - if !ok { - return false, fmt.Errorf("invalid response type") - } - return result, nil + return p.client.UIObjFadeIn(objName, duration) } func (p *NativeProxy) UIObjFadeOut(objName string, duration uint32) (bool, error) { - resp, err := p.client.Call("UIObjFadeOut", map[string]interface{}{ - "obj_name": objName, - "duration": duration, - }) - if err != nil { - return false, err - } - result, ok := resp.Result.(bool) - if !ok { - return false, fmt.Errorf("invalid response type") - } - return result, nil + return p.client.UIObjFadeOut(objName, duration) } func (p *NativeProxy) UIObjSetLabelText(objName string, text string) (bool, error) { - resp, err := p.client.Call("UIObjSetLabelText", map[string]interface{}{ - "obj_name": objName, - "text": text, - }) - if err != nil { - return false, err - } - result, ok := resp.Result.(bool) - if !ok { - return false, fmt.Errorf("invalid response type") - } - return result, nil + return p.client.UIObjSetLabelText(objName, text) } func (p *NativeProxy) UIObjSetImageSrc(objName string, image string) (bool, error) { - resp, err := p.client.Call("UIObjSetImageSrc", map[string]interface{}{ - "obj_name": objName, - "image": image, - }) - if err != nil { - return false, err - } - result, ok := resp.Result.(bool) - if !ok { - return false, fmt.Errorf("invalid response type") - } - return result, nil + return p.client.UIObjSetImageSrc(objName, image) } func (p *NativeProxy) DisplaySetRotation(rotation uint16) (bool, error) { - resp, err := p.client.Call("DisplaySetRotation", map[string]interface{}{ - "rotation": rotation, - }) - if err != nil { - return false, err - } - result, ok := resp.Result.(bool) - if !ok { - return false, fmt.Errorf("invalid response type") - } - return result, nil + return p.client.DisplaySetRotation(rotation) } func (p *NativeProxy) UpdateLabelIfChanged(objName string, newText string) { - _, _ = p.client.Call("UpdateLabelIfChanged", map[string]interface{}{ - "obj_name": objName, - "new_text": newText, - }) + p.client.UpdateLabelIfChanged(objName, newText) } func (p *NativeProxy) UpdateLabelAndChangeVisibility(objName string, newText string) { - _, _ = p.client.Call("UpdateLabelAndChangeVisibility", map[string]interface{}{ - "obj_name": objName, - "new_text": newText, - }) + p.client.UpdateLabelAndChangeVisibility(objName, newText) } func (p *NativeProxy) SwitchToScreenIf(screenName string, shouldSwitch []string) { - _, _ = p.client.Call("SwitchToScreenIf", map[string]interface{}{ - "screen_name": screenName, - "should_switch": shouldSwitch, - }) + p.client.SwitchToScreenIf(screenName, shouldSwitch) } func (p *NativeProxy) SwitchToScreenIfDifferent(screenName string) { - _, _ = p.client.Call("SwitchToScreenIfDifferent", map[string]interface{}{ - "screen_name": screenName, - }) + p.client.SwitchToScreenIfDifferent(screenName) } func (p *NativeProxy) DoNotUseThisIsForCrashTestingOnly() { - _, _ = p.client.Call("DoNotUseThisIsForCrashTestingOnly", nil) + p.client.DoNotUseThisIsForCrashTestingOnly() } diff --git a/internal/native/server.go b/internal/native/server.go new file mode 100644 index 00000000..cc642381 --- /dev/null +++ b/internal/native/server.go @@ -0,0 +1,90 @@ +package native + +import ( + "fmt" + "net" + "os" + "os/signal" + "syscall" + "time" + + "github.com/caarlos0/env/v11" + "github.com/erikdubbelboer/gspt" + "github.com/rs/zerolog" +) + +// Native Process +// stdout - exchange messages with the parent process +// stderr - logging and error messages + +// RunNativeProcess runs the native process mode +func RunNativeProcess(binaryName string) { + // Initialize logger + logger := zerolog.New(os.Stderr).With().Timestamp().Logger() + + gspt.SetProcTitle(binaryName + " [native]") + + // Determine socket path + socketPath := os.Getenv("JETKVM_NATIVE_SOCKET") + videoStreamSocketPath := os.Getenv("JETKVM_VIDEO_STREAM_SOCKET") + + if socketPath == "" || videoStreamSocketPath == "" { + logger.Fatal().Str("socket_path", socketPath).Str("video_stream_socket_path", videoStreamSocketPath).Msg("socket path or video stream socket path is not set") + } + + // connect to video stream socket + conn, err := net.Dial("unixpacket", videoStreamSocketPath) + if err != nil { + logger.Fatal().Err(err).Msg("failed to connect to video stream socket") + } + logger.Info().Str("video_stream_socket_path", videoStreamSocketPath).Msg("connected to video stream socket") + + var nativeOptions NativeOptions + if err := env.Parse(&nativeOptions); err != nil { + logger.Fatal().Err(err).Msg("failed to parse native options") + } + + nativeOptions.OnVideoFrameReceived = func(frame []byte, duration time.Duration) { + _, err := conn.Write(frame) + if err != nil { + logger.Fatal().Err(err).Msg("failed to write frame to video stream socket") + } + } + + // Create native instance + nativeInstance := NewNative(nativeOptions) + + // Start native instance + if err := nativeInstance.Start(); err != nil { + logger.Fatal().Err(err).Msg("failed to start native instance") + } + + // Create gRPC server + grpcServer := NewGRPCServer(nativeInstance, &logger) + + logger.Info().Msg("starting gRPC server") + // Start gRPC server + server, lis, err := StartGRPCServer(grpcServer, fmt.Sprintf("@%v", socketPath), &logger) + if err != nil { + logger.Fatal().Err(err).Msg("failed to start gRPC server") + } + gspt.SetProcTitle(binaryName + " [native] ready") + + // Signal that we're ready by writing socket path to stdout (for parent to read) + fmt.Fprintf(os.Stdout, "%s\n", socketPath) + defer os.Stdout.Close() + + // Set up signal handling + sigChan := make(chan os.Signal, 1) + signal.Notify(sigChan, syscall.SIGTERM, syscall.SIGINT) + + // Wait for signal + <-sigChan + logger.Info().Msg("received termination signal") + + // Graceful shutdown + server.GracefulStop() + lis.Close() + + logger.Info().Msg("native process exiting") +} diff --git a/main.go b/main.go index d7ecc3e1..08df3f4a 100644 --- a/main.go +++ b/main.go @@ -40,8 +40,8 @@ func Main() { go runWatchdog() go confirmCurrentSystem() - initDisplay() initNative(systemVersionLocal, appVersionLocal) + initDisplay() http.DefaultClient.Timeout = 1 * time.Minute diff --git a/native.go b/native.go index 518c3fa9..ad7f4bde 100644 --- a/native.go +++ b/native.go @@ -16,14 +16,14 @@ var ( ) func initNative(systemVersion *semver.Version, appVersion *semver.Version) { + nativeLogger.Info().Msg("initializing native") var err error - nativeInstance, err = native.NewNativeProxy(native.NativeProxyOptions{ + nativeInstance, err = native.NewNativeProxy(native.NativeOptions{ Disable: failsafeModeActive, SystemVersion: systemVersion, AppVersion: appVersion, DisplayRotation: config.GetDisplayRotation(), DefaultQualityFactor: config.VideoQualityFactor, - Logger: nativeLogger, OnVideoStateChange: func(state native.VideoState) { lastVideoState = state triggerVideoStateUpdate() diff --git a/native_process.go b/native_process.go deleted file mode 100644 index c239afdf..00000000 --- a/native_process.go +++ /dev/null @@ -1,528 +0,0 @@ -package kvm - -import ( - "encoding/json" - "fmt" - "os" - "os/signal" - "path/filepath" - "syscall" - "time" - - "github.com/Masterminds/semver/v3" - "github.com/jetkvm/kvm/internal/native" - "github.com/rs/zerolog" -) - -// RunNativeProcess runs the native process mode -func RunNativeProcess() { - // Initialize logger - logger := zerolog.New(os.Stderr).With().Timestamp().Logger() - - // Parse command line arguments (config is passed as first arg) - if len(os.Args) < 2 { - logger.Fatal().Msg("usage: native process requires config_json argument") - } - - var config native.ProcessConfig - if err := json.Unmarshal([]byte(os.Args[1]), &config); err != nil { - logger.Fatal().Err(err).Msg("failed to parse config") - } - - // Parse version strings - var systemVersion *semver.Version - if config.SystemVersion != "" { - v, err := semver.NewVersion(config.SystemVersion) - if err != nil { - logger.Warn().Err(err).Str("version", config.SystemVersion).Msg("failed to parse system version") - } else { - systemVersion = v - } - } - - var appVersion *semver.Version - if config.AppVersion != "" { - v, err := semver.NewVersion(config.AppVersion) - if err != nil { - logger.Warn().Err(err).Str("version", config.AppVersion).Msg("failed to parse app version") - } else { - appVersion = v - } - } - - // Create native instance - nativeInstance := native.NewNative(native.NativeOptions{ - Disable: config.Disable, - SystemVersion: systemVersion, - AppVersion: appVersion, - DisplayRotation: config.DisplayRotation, - DefaultQualityFactor: config.DefaultQualityFactor, - OnVideoStateChange: func(state native.VideoState) { - sendEvent("video_state_change", state) - }, - OnIndevEvent: func(event string) { - sendEvent("indev_event", event) - }, - OnRpcEvent: func(event string) { - sendEvent("rpc_event", event) - }, - OnVideoFrameReceived: func(frame []byte, duration time.Duration) { - sendEvent("video_frame", map[string]interface{}{ - "frame": frame, - "duration": duration.Nanoseconds(), - }) - }, - }) - - // Start native instance - if err := nativeInstance.Start(); err != nil { - logger.Fatal().Err(err).Msg("failed to start native instance") - } - - // Create gRPC server - grpcServer := native.NewGRPCServer(nativeInstance, &logger) - - // Determine socket path - socketPath := os.Getenv("JETKVM_NATIVE_SOCKET") - if socketPath == "" { - // Default to a socket in /tmp - socketPath = filepath.Join("/tmp", fmt.Sprintf("jetkvm-native-%d.sock", os.Getpid())) - } - - // Start gRPC server - server, lis, err := native.StartGRPCServer(grpcServer, socketPath, &logger) - if err != nil { - logger.Fatal().Err(err).Msg("failed to start gRPC server") - } - - // Signal that we're ready by writing socket path to stdout (for parent to read) - fmt.Fprintf(os.Stdout, "%s\n", socketPath) - os.Stdout.Close() - - // Set up signal handling - sigChan := make(chan os.Signal, 1) - signal.Notify(sigChan, syscall.SIGTERM, syscall.SIGINT) - - // Wait for signal - <-sigChan - logger.Info().Msg("received termination signal") - - // Graceful shutdown - server.GracefulStop() - lis.Close() - - logger.Info().Msg("native process exiting") -} - -// All JSON-RPC handlers have been removed - now using gRPC - case "VideoSetSleepMode": - var params struct { - Enabled bool `json:"enabled"` - } - if err := json.Unmarshal(req.Params, ¶ms); err != nil { - sendError(encoder, req.ID, -32602, "Invalid params", nil) - return - } - err = n.VideoSetSleepMode(params.Enabled) - - case "VideoGetSleepMode": - var result bool - result, err = n.VideoGetSleepMode() - if err == nil { - sendResponse(encoder, req.ID, "result", result) - return - } - - case "VideoSleepModeSupported": - result = n.VideoSleepModeSupported() - sendResponse(encoder, req.ID, "result", result) - return - - case "VideoSetQualityFactor": - var params struct { - Factor float64 `json:"factor"` - } - if err := json.Unmarshal(req.Params, ¶ms); err != nil { - sendError(encoder, req.ID, -32602, "Invalid params", nil) - return - } - err = n.VideoSetQualityFactor(params.Factor) - - case "VideoGetQualityFactor": - var result float64 - result, err = n.VideoGetQualityFactor() - if err == nil { - sendResponse(encoder, req.ID, "result", result) - return - } - - case "VideoSetEDID": - var params struct { - EDID string `json:"edid"` - } - if err := json.Unmarshal(req.Params, ¶ms); err != nil { - sendError(encoder, req.ID, -32602, "Invalid params", nil) - return - } - err = n.VideoSetEDID(params.EDID) - - case "VideoGetEDID": - var result string - result, err = n.VideoGetEDID() - if err == nil { - sendResponse(encoder, req.ID, "result", result) - return - } - - case "VideoLogStatus": - var result string - result, err = n.VideoLogStatus() - if err == nil { - sendResponse(encoder, req.ID, "result", result) - return - } - - case "VideoStop": - err = n.VideoStop() - - case "VideoStart": - err = n.VideoStart() - - case "GetLVGLVersion": - var result string - result, err = n.GetLVGLVersion() - if err == nil { - sendResponse(encoder, req.ID, "result", result) - return - } - - case "UIObjHide": - var params struct { - ObjName string `json:"obj_name"` - } - if err := json.Unmarshal(req.Params, ¶ms); err != nil { - sendError(encoder, req.ID, -32602, "Invalid params", nil) - return - } - var result bool - result, err = n.UIObjHide(params.ObjName) - if err == nil { - sendResponse(encoder, req.ID, "result", result) - return - } - - case "UIObjShow": - var params struct { - ObjName string `json:"obj_name"` - } - if err := json.Unmarshal(req.Params, ¶ms); err != nil { - sendError(encoder, req.ID, -32602, "Invalid params", nil) - return - } - var result bool - result, err = n.UIObjShow(params.ObjName) - if err == nil { - sendResponse(encoder, req.ID, "result", result) - return - } - - case "UISetVar": - var params struct { - Name string `json:"name"` - Value string `json:"value"` - } - if err := json.Unmarshal(req.Params, ¶ms); err != nil { - sendError(encoder, req.ID, -32602, "Invalid params", nil) - return - } - n.UISetVar(params.Name, params.Value) - sendResponse(encoder, req.ID, "result", nil) - return - - case "UIGetVar": - var params struct { - Name string `json:"name"` - } - if err := json.Unmarshal(req.Params, ¶ms); err != nil { - sendError(encoder, req.ID, -32602, "Invalid params", nil) - return - } - result = n.UIGetVar(params.Name) - sendResponse(encoder, req.ID, "result", result) - return - - case "UIObjAddState": - var params struct { - ObjName string `json:"obj_name"` - State string `json:"state"` - } - if err := json.Unmarshal(req.Params, ¶ms); err != nil { - sendError(encoder, req.ID, -32602, "Invalid params", nil) - return - } - var result bool - result, err = n.UIObjAddState(params.ObjName, params.State) - if err == nil { - sendResponse(encoder, req.ID, "result", result) - return - } - - case "UIObjClearState": - var params struct { - ObjName string `json:"obj_name"` - State string `json:"state"` - } - if err := json.Unmarshal(req.Params, ¶ms); err != nil { - sendError(encoder, req.ID, -32602, "Invalid params", nil) - return - } - var result bool - result, err = n.UIObjClearState(params.ObjName, params.State) - if err == nil { - sendResponse(encoder, req.ID, "result", result) - return - } - - case "UIObjAddFlag": - var params struct { - ObjName string `json:"obj_name"` - Flag string `json:"flag"` - } - if err := json.Unmarshal(req.Params, ¶ms); err != nil { - sendError(encoder, req.ID, -32602, "Invalid params", nil) - return - } - var result bool - result, err = n.UIObjAddFlag(params.ObjName, params.Flag) - if err == nil { - sendResponse(encoder, req.ID, "result", result) - return - } - - case "UIObjClearFlag": - var params struct { - ObjName string `json:"obj_name"` - Flag string `json:"flag"` - } - if err := json.Unmarshal(req.Params, ¶ms); err != nil { - sendError(encoder, req.ID, -32602, "Invalid params", nil) - return - } - var result bool - result, err = n.UIObjClearFlag(params.ObjName, params.Flag) - if err == nil { - sendResponse(encoder, req.ID, "result", result) - return - } - - case "UIObjSetOpacity": - var params struct { - ObjName string `json:"obj_name"` - Opacity int `json:"opacity"` - } - if err := json.Unmarshal(req.Params, ¶ms); err != nil { - sendError(encoder, req.ID, -32602, "Invalid params", nil) - return - } - var result bool - result, err = n.UIObjSetOpacity(params.ObjName, params.Opacity) - if err == nil { - sendResponse(encoder, req.ID, "result", result) - return - } - - case "UIObjFadeIn": - var params struct { - ObjName string `json:"obj_name"` - Duration uint32 `json:"duration"` - } - if err := json.Unmarshal(req.Params, ¶ms); err != nil { - sendError(encoder, req.ID, -32602, "Invalid params", nil) - return - } - var result bool - result, err = n.UIObjFadeIn(params.ObjName, params.Duration) - if err == nil { - sendResponse(encoder, req.ID, "result", result) - return - } - - case "UIObjFadeOut": - var params struct { - ObjName string `json:"obj_name"` - Duration uint32 `json:"duration"` - } - if err := json.Unmarshal(req.Params, ¶ms); err != nil { - sendError(encoder, req.ID, -32602, "Invalid params", nil) - return - } - var result bool - result, err = n.UIObjFadeOut(params.ObjName, params.Duration) - if err == nil { - sendResponse(encoder, req.ID, "result", result) - return - } - - case "UIObjSetLabelText": - var params struct { - ObjName string `json:"obj_name"` - Text string `json:"text"` - } - if err := json.Unmarshal(req.Params, ¶ms); err != nil { - sendError(encoder, req.ID, -32602, "Invalid params", nil) - return - } - var result bool - result, err = n.UIObjSetLabelText(params.ObjName, params.Text) - if err == nil { - sendResponse(encoder, req.ID, "result", result) - return - } - - case "UIObjSetImageSrc": - var params struct { - ObjName string `json:"obj_name"` - Image string `json:"image"` - } - if err := json.Unmarshal(req.Params, ¶ms); err != nil { - sendError(encoder, req.ID, -32602, "Invalid params", nil) - return - } - var result bool - result, err = n.UIObjSetImageSrc(params.ObjName, params.Image) - if err == nil { - sendResponse(encoder, req.ID, "result", result) - return - } - - case "DisplaySetRotation": - var params struct { - Rotation uint16 `json:"rotation"` - } - if err := json.Unmarshal(req.Params, ¶ms); err != nil { - sendError(encoder, req.ID, -32602, "Invalid params", nil) - return - } - var result bool - result, err = n.DisplaySetRotation(params.Rotation) - if err == nil { - sendResponse(encoder, req.ID, "result", result) - return - } - - case "UpdateLabelIfChanged": - var params struct { - ObjName string `json:"obj_name"` - NewText string `json:"new_text"` - } - if err := json.Unmarshal(req.Params, ¶ms); err != nil { - sendError(encoder, req.ID, -32602, "Invalid params", nil) - return - } - n.UpdateLabelIfChanged(params.ObjName, params.NewText) - sendResponse(encoder, req.ID, "result", nil) - return - - case "UpdateLabelAndChangeVisibility": - var params struct { - ObjName string `json:"obj_name"` - NewText string `json:"new_text"` - } - if err := json.Unmarshal(req.Params, ¶ms); err != nil { - sendError(encoder, req.ID, -32602, "Invalid params", nil) - return - } - n.UpdateLabelAndChangeVisibility(params.ObjName, params.NewText) - sendResponse(encoder, req.ID, "result", nil) - return - - case "SwitchToScreenIf": - var params struct { - ScreenName string `json:"screen_name"` - ShouldSwitch []string `json:"should_switch"` - } - if err := json.Unmarshal(req.Params, ¶ms); err != nil { - sendError(encoder, req.ID, -32602, "Invalid params", nil) - return - } - n.SwitchToScreenIf(params.ScreenName, params.ShouldSwitch) - sendResponse(encoder, req.ID, "result", nil) - return - - case "SwitchToScreenIfDifferent": - var params struct { - ScreenName string `json:"screen_name"` - } - if err := json.Unmarshal(req.Params, ¶ms); err != nil { - sendError(encoder, req.ID, -32602, "Invalid params", nil) - return - } - n.SwitchToScreenIfDifferent(params.ScreenName) - sendResponse(encoder, req.ID, "result", nil) - return - - case "DoNotUseThisIsForCrashTestingOnly": - n.DoNotUseThisIsForCrashTestingOnly() - sendResponse(encoder, req.ID, "result", nil) - return - - default: - sendError(encoder, req.ID, -32601, fmt.Sprintf("Method not found: %s", req.Method), nil) - return - } - - if err != nil { - sendError(encoder, req.ID, -32000, err.Error(), nil) - return - } - - sendResponse(encoder, req.ID, "result", result) -} - -func sendResponse(encoder *json.Encoder, id interface{}, key string, result interface{}) { - response := map[string]interface{}{ - "jsonrpc": "2.0", - key: result, - } - if id != nil { - response["id"] = id - } - if err := encoder.Encode(response); err != nil { - fmt.Fprintf(os.Stderr, "failed to send response: %v\n", err) - } -} - -func sendError(encoder *json.Encoder, id interface{}, code int, message string, data interface{}) { - response := map[string]interface{}{ - "jsonrpc": "2.0", - "error": map[string]interface{}{ - "code": code, - "message": message, - }, - } - if id != nil { - response["id"] = id - } - if data != nil { - response["error"].(map[string]interface{})["data"] = data - } - if err := encoder.Encode(response); err != nil { - fmt.Fprintf(os.Stderr, "failed to send error: %v\n", err) - } -} - -func sendEvent(eventType string, data interface{}) { - event := map[string]interface{}{ - "jsonrpc": "2.0", - "method": "event", - "params": map[string]interface{}{ - "type": eventType, - "data": data, - }, - } - encoder := json.NewEncoder(os.Stdout) - if err := encoder.Encode(event); err != nil { - fmt.Fprintf(os.Stderr, "failed to send event: %v\n", err) - } -} -