github.com/whoyao/protocol@v0.0.0-20230519045905-2d8ace718ca5/livekit_internal.proto (about)

     1  syntax = "proto3";
     2  
     3  package livekit;
     4  option go_package = "github.com/livekit/protocol/livekit";
     5  option csharp_namespace = "LiveKit.Proto";
     6  option ruby_package = "LiveKit::Proto";
     7  
     8  // internal protos, not exposed to clients
     9  import "livekit_models.proto";
    10  import "livekit_rtc.proto";
    11  import "livekit_room.proto";
    12  import "livekit_egress.proto";
    13  
    14  enum NodeType {
    15    SERVER = 0;
    16    CONTROLLER = 1;
    17    MEDIA = 2;
    18    TURN = 4;
    19    SWEEPER = 5;
    20    DIRECTOR = 6;
    21  }
    22  
    23  enum NodeState {
    24    STARTING_UP = 0;
    25    SERVING = 1;
    26    SHUTTING_DOWN = 2;
    27  }
    28  
    29  message Node {
    30    string id = 1;
    31    string ip = 2;
    32    uint32 num_cpus = 3;
    33    NodeStats stats = 4;
    34    NodeType type = 5;
    35    NodeState state = 6;
    36    string region = 7;
    37  }
    38  
    39  message NodeStats {
    40    // when server was started
    41    int64 started_at = 1;
    42    // when server last reported its status
    43    int64 updated_at = 2;
    44  
    45    // room
    46    int32 num_rooms = 3;
    47    int32 num_clients = 4;
    48    int32 num_tracks_in = 5;
    49    int32 num_tracks_out = 6;
    50    int32 num_track_publish_attempts = 36;
    51    float track_publish_attempts_per_sec = 37;
    52    int32 num_track_publish_success = 38;
    53    float track_publish_success_per_sec = 39;
    54    int32 num_track_subscribe_attempts = 40;
    55    float track_subscribe_attempts_per_sec = 41;
    56    int32 num_track_subscribe_success = 42;
    57    float track_subscribe_success_per_sec = 43;
    58  
    59    // packet
    60    uint64 bytes_in = 7;
    61    uint64 bytes_out = 8;
    62    uint64 packets_in = 9;
    63    uint64 packets_out = 10;
    64    uint64 nack_total = 11;
    65    float bytes_in_per_sec = 12;
    66    float bytes_out_per_sec = 13;
    67    float packets_in_per_sec = 14;
    68    float packets_out_per_sec = 15;
    69    float nack_per_sec = 16;
    70  
    71    // system
    72    uint32 num_cpus = 17;
    73    float load_avg_last1min = 18;
    74    float load_avg_last5min = 19;
    75    float load_avg_last15min = 20;
    76    float cpu_load = 21;
    77    float memory_load = 33; // deprecated
    78    uint64 memory_total = 34;
    79    uint64 memory_used = 35;
    80    uint32 sys_packets_out = 28;
    81    uint32 sys_packets_dropped = 29;
    82    float sys_packets_out_per_sec = 30;
    83    float sys_packets_dropped_per_sec = 31;
    84    float sys_packets_dropped_pct_per_sec = 32;
    85  
    86    // retransmissions
    87    uint64 retransmit_bytes_out = 22;
    88    uint64 retransmit_packets_out = 23;
    89    float retransmit_bytes_out_per_sec = 24;
    90    float retransmit_packets_out_per_sec = 25;
    91  
    92    // participant joins
    93    uint64 participant_signal_connected = 26;
    94    float participant_signal_connected_per_sec = 27;
    95    uint64 participant_rtc_connected = 44;
    96    float participant_rtc_connected_per_sec = 45;
    97    uint64 participant_rtc_init = 46;
    98    float participant_rtc_init_per_sec = 47;
    99  
   100    // NEXT ID: 48
   101  }
   102  
   103  // message to RTC nodes
   104  message RTCNodeMessage {
   105    string participant_key = 1;
   106    int64 sender_time = 11;
   107    string connection_id = 13;
   108    string participant_key_b62 = 14;
   109    string room_name = 15;
   110    string identity = 16;
   111    oneof message {
   112      StartSession start_session = 2;
   113      SignalRequest request = 3;
   114      // internal messages
   115      RoomParticipantIdentity remove_participant = 4;
   116      MuteRoomTrackRequest mute_track = 5;
   117      UpdateParticipantRequest update_participant = 6;
   118      DeleteRoomRequest delete_room = 7;
   119      UpdateSubscriptionsRequest update_subscriptions = 8;
   120      SendDataRequest send_data = 9;
   121      UpdateRoomMetadataRequest update_room_metadata = 10;
   122      KeepAlive keep_alive = 12;
   123    }
   124  
   125    // NEXT ID: 17
   126  }
   127  
   128  // message to Signal nodes
   129  message SignalNodeMessage {
   130    string connection_id = 1;
   131    oneof message {
   132      SignalResponse response = 2;
   133      EndSession end_session = 3;
   134    }
   135  }
   136  
   137  message StartSession {
   138    string room_name = 1;
   139    string identity = 2;
   140    string connection_id = 3;
   141    // if a client is reconnecting (i.e. resume instead of restart)
   142    bool reconnect = 4;
   143    bool auto_subscribe = 9;
   144    bool hidden = 10;
   145    ClientInfo client = 11;
   146    bool recorder = 12;
   147    string name = 13;
   148    // A user's ClaimGrants serialized in JSON
   149    string grants_json = 14;
   150    bool adaptive_stream = 15;
   151    //if reconnect, client will set current sid
   152    string participant_id = 16;
   153    ReconnectReason reconnect_reason = 17;
   154    optional bool subscriber_allow_pause = 18;
   155  }
   156  
   157  message EndSession {
   158  }
   159  
   160  message RemoveParticipant {
   161    string participant_id = 1;
   162  }
   163  
   164  message KeepAlive {
   165  }
   166  
   167  // room info that should not be returned to clients
   168  message RoomInternal {
   169    AutoTrackEgress track_egress = 1;
   170  }
   171  
   172  enum ICECandidateType {
   173    ICT_NONE = 0;
   174    ICT_TCP = 1;
   175    ICT_TLS = 2;
   176  }
   177  
   178  message ICEConfig {
   179    ICECandidateType preference_subscriber = 1;
   180    ICECandidateType preference_publisher = 2;
   181  }