github.com/livekit/protocol@v1.39.3/protobufs/livekit_room.proto (about) 1 // Copyright 2023 LiveKit, Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 syntax = "proto3"; 16 17 package livekit; 18 option go_package = "github.com/livekit/protocol/livekit"; 19 option csharp_namespace = "LiveKit.Proto"; 20 option ruby_package = "LiveKit::Proto"; 21 22 import "livekit_models.proto"; 23 import "livekit_egress.proto"; 24 import "livekit_agent_dispatch.proto"; 25 26 // Room service that can be performed on any node 27 // they are Twirp-based HTTP req/responses 28 service RoomService { 29 // Creates a room with settings. Requires `roomCreate` permission. 30 // This method is optional; rooms are automatically created when clients connect to them for the first time. 31 rpc CreateRoom(CreateRoomRequest) returns (Room); 32 33 // List rooms that are active on the server. Requires `roomList` permission. 34 rpc ListRooms(ListRoomsRequest) returns (ListRoomsResponse); 35 36 // Deletes an existing room by name or id. Requires `roomCreate` permission. 37 // DeleteRoom will disconnect all participants that are currently in the room. 38 rpc DeleteRoom(DeleteRoomRequest) returns (DeleteRoomResponse); 39 40 // Lists participants in a room, Requires `roomAdmin` 41 rpc ListParticipants(ListParticipantsRequest) returns (ListParticipantsResponse); 42 43 // Get information on a specific participant, Requires `roomAdmin` 44 rpc GetParticipant(RoomParticipantIdentity) returns (ParticipantInfo); 45 46 // Removes a participant from room. Requires `roomAdmin` 47 rpc RemoveParticipant(RoomParticipantIdentity) returns (RemoveParticipantResponse); 48 49 // Mute/unmute a participant's track, Requires `roomAdmin` 50 rpc MutePublishedTrack(MuteRoomTrackRequest) returns (MuteRoomTrackResponse); 51 52 // Update participant metadata, will cause updates to be broadcasted to everyone in the room. Requires `roomAdmin` 53 rpc UpdateParticipant(UpdateParticipantRequest) returns (ParticipantInfo); 54 55 // Subscribes or unsubscribe a participant from tracks. Requires `roomAdmin` 56 rpc UpdateSubscriptions(UpdateSubscriptionsRequest) returns (UpdateSubscriptionsResponse); 57 58 // Send data over data channel to participants in a room, Requires `roomAdmin` 59 rpc SendData(SendDataRequest) returns (SendDataResponse); 60 61 // Update room metadata, will cause updates to be broadcasted to everyone in the room, Requires `roomAdmin` 62 rpc UpdateRoomMetadata (UpdateRoomMetadataRequest) returns (Room); 63 64 // Cloud-only 65 // a connected participant's track(s) to another room. Requires `roomAdmin` and `destinationRoom`. The forwarding will 66 // stop when the participant leaves the room or `RemoveParticipant` has been called in the destination room. 67 // A participant can be forwarded to multiple rooms. The destination room will be created if it does not exist. 68 rpc ForwardParticipant(ForwardParticipantRequest) returns (ForwardParticipantResponse); 69 70 // Cloud-only 71 // Move a connected participant to a different room. Requires `roomAdmin` and `destinationRoom`. 72 // The participant will be removed from the current room and added to the destination room. 73 // From the other observers' perspective, the participant would've disconnected from the previous room and joined the new one. 74 rpc MoveParticipant(MoveParticipantRequest) returns (MoveParticipantResponse); 75 } 76 77 message CreateRoomRequest { 78 // name of the room 79 string name = 1; 80 // configuration to use for this room parameters. Setting parameters below override the config defaults. 81 string room_preset = 12; 82 // number of seconds to keep the room open if no one joins 83 uint32 empty_timeout = 2; 84 // number of seconds to keep the room open after everyone leaves 85 uint32 departure_timeout = 10; 86 // limit number of participants that can be in a room 87 uint32 max_participants = 3; 88 // override the node room is allocated to, for debugging 89 string node_id = 4; 90 // metadata of room 91 string metadata = 5; 92 // auto-egress configurations 93 RoomEgress egress = 6; 94 // playout delay of subscriber 95 uint32 min_playout_delay = 7; 96 uint32 max_playout_delay = 8; 97 // improves A/V sync when playout_delay set to a value larger than 200ms. It will disables transceiver re-use 98 // so not recommended for rooms with frequent subscription changes 99 bool sync_streams = 9; 100 // replay 101 bool replay_enabled = 13; 102 103 // Define agents that should be dispatched to this room 104 repeated RoomAgentDispatch agents = 14; 105 // NEXT-ID: 15 106 } 107 108 message RoomEgress { 109 RoomCompositeEgressRequest room = 1; 110 AutoParticipantEgress participant = 3; 111 AutoTrackEgress tracks = 2; 112 } 113 114 message RoomAgent { 115 repeated RoomAgentDispatch dispatches = 1; 116 } 117 118 119 message ListRoomsRequest { 120 // when set, will only return rooms with name match 121 repeated string names = 1; 122 } 123 124 message ListRoomsResponse { 125 repeated Room rooms = 1; 126 } 127 128 message DeleteRoomRequest { 129 // name of the room 130 string room = 1; 131 } 132 133 message DeleteRoomResponse { 134 } 135 136 message ListParticipantsRequest { 137 // name of the room 138 string room = 1; 139 } 140 141 message ListParticipantsResponse { 142 repeated ParticipantInfo participants = 1; 143 } 144 145 message RoomParticipantIdentity { 146 // name of the room 147 string room = 1; 148 // identity of the participant 149 string identity = 2; 150 } 151 152 message RemoveParticipantResponse { 153 } 154 155 message MuteRoomTrackRequest { 156 // name of the room 157 string room = 1; 158 string identity = 2; 159 // sid of the track to mute 160 string track_sid = 3; 161 // set to true to mute, false to unmute 162 bool muted = 4; 163 } 164 165 message MuteRoomTrackResponse { 166 TrackInfo track = 1; 167 } 168 169 message UpdateParticipantRequest { 170 string room = 1; 171 string identity = 2; 172 // metadata to update. skipping updates if left empty 173 string metadata = 3; 174 // set to update the participant's permissions 175 ParticipantPermission permission = 4; 176 // display name to update 177 string name = 5; 178 // attributes to update. it only updates attributes that have been set 179 // to delete attributes, set the value to an empty string 180 map<string, string> attributes = 6; 181 } 182 183 message UpdateSubscriptionsRequest { 184 string room = 1; 185 string identity = 2; 186 // list of sids of tracks 187 repeated string track_sids = 3; 188 // set to true to subscribe, false to unsubscribe from tracks 189 bool subscribe = 4; 190 // list of participants and their tracks 191 repeated ParticipantTracks participant_tracks = 5; 192 } 193 194 message UpdateSubscriptionsResponse { 195 // empty for now 196 } 197 198 message SendDataRequest { 199 string room = 1; 200 bytes data = 2; 201 DataPacket.Kind kind = 3; 202 // mark deprecated 203 repeated string destination_sids = 4 [deprecated=true]; 204 // when set, only forward to these identities 205 repeated string destination_identities = 6; 206 optional string topic = 5; 207 // added by SDK to enable de-duping of messages, for INTERNAL USE ONLY 208 bytes nonce = 7; 209 210 // NEXT_ID: 8 211 } 212 213 message SendDataResponse { 214 // 215 } 216 217 message UpdateRoomMetadataRequest { 218 string room = 1; 219 // metadata to update. skipping updates if left empty 220 string metadata = 2; 221 } 222 223 message RoomConfiguration { 224 string name = 1; // Used as ID, must be unique 225 // number of seconds to keep the room open if no one joins 226 uint32 empty_timeout = 2; 227 // number of seconds to keep the room open after everyone leaves 228 uint32 departure_timeout = 3; 229 // limit number of participants that can be in a room, excluding Egress and Ingress participants 230 uint32 max_participants = 4; 231 // egress 232 RoomEgress egress = 5; 233 // playout delay of subscriber 234 uint32 min_playout_delay = 7; 235 uint32 max_playout_delay = 8; 236 // improves A/V sync when playout_delay set to a value larger than 200ms. It will disables transceiver re-use 237 // so not recommended for rooms with frequent subscription changes 238 bool sync_streams = 9; 239 240 // Define agents that should be dispatched to this room 241 repeated RoomAgentDispatch agents = 10; 242 } 243 244 message ForwardParticipantRequest { 245 // room to forward participant from 246 string room = 1; 247 // identity of the participant to forward 248 string identity = 2; 249 // room to forward participant to 250 string destination_room = 3; 251 } 252 253 message ForwardParticipantResponse { 254 } 255 256 message MoveParticipantRequest { 257 // room to move participant from 258 string room = 1; 259 // identity of the participant to move to 260 string identity = 2; 261 // room to move participant to 262 string destination_room = 3; 263 } 264 265 message MoveParticipantResponse { 266 }