github.com/livekit/protocol@v1.16.1-0.20240517185851-47e4c6bba773/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 25 // Room service that can be performed on any node 26 // they are Twirp-based HTTP req/responses 27 service RoomService { 28 // Creates a room with settings. Requires `roomCreate` permission. 29 // This method is optional; rooms are automatically created when clients connect to them for the first time. 30 rpc CreateRoom(CreateRoomRequest) returns (Room); 31 32 // List rooms that are active on the server. Requires `roomList` permission. 33 rpc ListRooms(ListRoomsRequest) returns (ListRoomsResponse); 34 35 // Deletes an existing room by name or id. Requires `roomCreate` permission. 36 // DeleteRoom will disconnect all participants that are currently in the room. 37 rpc DeleteRoom(DeleteRoomRequest) returns (DeleteRoomResponse); 38 39 // Lists participants in a room, Requires `roomAdmin` 40 rpc ListParticipants(ListParticipantsRequest) returns (ListParticipantsResponse); 41 42 // Get information on a specific participant, Requires `roomAdmin` 43 rpc GetParticipant(RoomParticipantIdentity) returns (ParticipantInfo); 44 45 // Removes a participant from room. Requires `roomAdmin` 46 rpc RemoveParticipant(RoomParticipantIdentity) returns (RemoveParticipantResponse); 47 48 // Mute/unmute a participant's track, Requires `roomAdmin` 49 rpc MutePublishedTrack(MuteRoomTrackRequest) returns (MuteRoomTrackResponse); 50 51 // Update participant metadata, will cause updates to be broadcasted to everyone in the room. Requires `roomAdmin` 52 rpc UpdateParticipant(UpdateParticipantRequest) returns (ParticipantInfo); 53 54 // Subscribes or unsubscribe a participant from tracks. Requires `roomAdmin` 55 rpc UpdateSubscriptions(UpdateSubscriptionsRequest) returns (UpdateSubscriptionsResponse); 56 57 // Send data over data channel to participants in a room, Requires `roomAdmin` 58 rpc SendData(SendDataRequest) returns (SendDataResponse); 59 60 // Update room metadata, will cause updates to be broadcasted to everyone in the room, Requires `roomAdmin` 61 rpc UpdateRoomMetadata (UpdateRoomMetadataRequest) returns (Room); 62 } 63 64 message CreateRoomRequest { 65 // name of the room 66 string name = 1; 67 // number of seconds to keep the room open if no one joins 68 uint32 empty_timeout = 2; 69 // number of seconds to keep the room open after everyone leaves 70 uint32 departure_timeout = 10; 71 // limit number of participants that can be in a room 72 uint32 max_participants = 3; 73 // override the node room is allocated to, for debugging 74 string node_id = 4; 75 // metadata of room 76 string metadata = 5; 77 // egress 78 RoomEgress egress = 6; 79 // playout delay of subscriber 80 uint32 min_playout_delay = 7; 81 uint32 max_playout_delay = 8; 82 // improves A/V sync when playout_delay set to a value larger than 200ms. It will disables transceiver re-use 83 // so not recommended for rooms with frequent subscription changes 84 bool sync_streams = 9; 85 86 // NEXT-ID: 11 87 } 88 89 message RoomEgress { 90 RoomCompositeEgressRequest room = 1; 91 AutoParticipantEgress participant = 3; 92 AutoTrackEgress tracks = 2; 93 } 94 95 message ListRoomsRequest { 96 // when set, will only return rooms with name match 97 repeated string names = 1; 98 } 99 100 message ListRoomsResponse { 101 repeated Room rooms = 1; 102 } 103 104 message DeleteRoomRequest { 105 // name of the room 106 string room = 1; 107 } 108 109 message DeleteRoomResponse { 110 } 111 112 message ListParticipantsRequest { 113 // name of the room 114 string room = 1; 115 } 116 117 message ListParticipantsResponse { 118 repeated ParticipantInfo participants = 1; 119 } 120 121 message RoomParticipantIdentity { 122 // name of the room 123 string room = 1; 124 // identity of the participant 125 string identity = 2; 126 } 127 128 message RemoveParticipantResponse { 129 } 130 131 message MuteRoomTrackRequest { 132 // name of the room 133 string room = 1; 134 string identity = 2; 135 // sid of the track to mute 136 string track_sid = 3; 137 // set to true to mute, false to unmute 138 bool muted = 4; 139 } 140 141 message MuteRoomTrackResponse { 142 TrackInfo track = 1; 143 } 144 145 message UpdateParticipantRequest { 146 string room = 1; 147 string identity = 2; 148 // metadata to update. skipping updates if left empty 149 string metadata = 3; 150 // set to update the participant's permissions 151 ParticipantPermission permission = 4; 152 // display name to update 153 string name = 5; 154 } 155 156 message UpdateSubscriptionsRequest { 157 string room = 1; 158 string identity = 2; 159 // list of sids of tracks 160 repeated string track_sids = 3; 161 // set to true to subscribe, false to unsubscribe from tracks 162 bool subscribe = 4; 163 // list of participants and their tracks 164 repeated ParticipantTracks participant_tracks = 5; 165 } 166 167 message UpdateSubscriptionsResponse { 168 // empty for now 169 } 170 171 message SendDataRequest { 172 string room = 1; 173 bytes data = 2; 174 DataPacket.Kind kind = 3; 175 // mark deprecated 176 repeated string destination_sids = 4 [deprecated=true]; 177 // when set, only forward to these identities 178 repeated string destination_identities = 6; 179 optional string topic = 5; 180 181 // NEXT_ID: 7 182 } 183 184 message SendDataResponse { 185 // 186 } 187 188 message UpdateRoomMetadataRequest { 189 string room = 1; 190 // metadata to update. skipping updates if left empty 191 string metadata = 2; 192 }