fork/rust-sdks
git clone https://git.julia.blue/fork/rust-sdks
1d85bac
main
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 15syntax = "proto2" ; 16 17package livekit . proto ; 18option csharp_namespace= "LiveKit.Proto" ; 19 20import "e2ee.proto" ; 21import "handle.proto" ; 22import "stats.proto" ; 23 24// Create a new VideoTrack from a VideoSource 25message CreateVideoTrackRequest { 26required string name = 1 ; 27required uint64 source_handle = 2 ; 28} 29message CreateVideoTrackResponse { 30required OwnedTrack track = 1 ; 31} 32 33// Create a new AudioTrack from a AudioSource 34message CreateAudioTrackRequest { 35required string name = 1 ; 36required uint64 source_handle = 2 ; 37} 38message CreateAudioTrackResponse { 39required OwnedTrack track = 1 ; 40} 41 42message GetStatsRequest { 43required uint64 track_handle = 1 ; 44} 45message GetStatsResponse { 46required uint64 async_id = 1 ; 47} 48message GetStatsCallback { 49required uint64 async_id = 1 ; 50optional string error = 2 ; 51repeated RtcStats stats = 3 ; 52} 53 54// 55// Track 56// 57 58message TrackEvent {} 59 60enum TrackKind { 61KIND_UNKNOWN = 0 ; 62KIND_AUDIO = 1 ; 63KIND_VIDEO = 2 ; 64} 65 66enum TrackSource { 67SOURCE_UNKNOWN = 0 ; 68SOURCE_CAMERA = 1 ; 69SOURCE_MICROPHONE = 2 ; 70SOURCE_SCREENSHARE = 3 ; 71SOURCE_SCREENSHARE_AUDIO = 4 ; 72} 73 74enum StreamState { 75STATE_UNKNOWN = 0 ; 76STATE_ACTIVE = 1 ; 77STATE_PAUSED = 2 ; 78} 79 80message TrackPublicationInfo { 81required string sid = 1 ; 82required string name = 2 ; 83required TrackKind kind = 3 ; 84required TrackSource source = 4 ; 85required bool simulcasted = 5 ; 86required uint32 width = 6 ; 87required uint32 height = 7 ; 88required string mime_type = 8 ; 89required bool muted = 9 ; 90required bool remote = 10 ; 91required EncryptionType encryption_type = 11 ; 92} 93 94message OwnedTrackPublication { 95required FfiOwnedHandle handle = 1 ; 96required TrackPublicationInfo info = 2 ; 97} 98 99message TrackInfo { 100required string sid = 1 ; 101required string name = 2 ; 102required TrackKind kind = 3 ; 103required StreamState stream_state = 4 ; 104required bool muted = 5 ; 105required bool remote = 6 ; 106} 107 108message OwnedTrack { 109required FfiOwnedHandle handle = 1 ; 110required TrackInfo info = 2 ; 111} 112 113// Mute/UnMute a track 114message LocalTrackMuteRequest { 115required uint64 track_handle = 1 ; 116required bool mute = 2 ; 117} 118 119message LocalTrackMuteResponse { 120required bool muted = 1 ; 121} 122 123// Enable/Disable a remote track 124message EnableRemoteTrackRequest { 125required uint64 track_handle = 1 ; 126required bool enabled = 2 ; 127} 128 129message EnableRemoteTrackResponse { 130required bool enabled = 1 ; 131} 132 133message SetTrackSubscriptionPermissionsRequest { 134required uint64 local_participant_handle = 1 ; 135required bool all_participants_allowed = 2 ; 136repeated ParticipantTrackPermission permissions = 3 ; 137} 138 139message ParticipantTrackPermission { 140// The participant identity this permission applies to. 141required string participant_identity = 1 ; 142// Grant permission to all all tracks. Takes precedence over allowedTrackSids. 143optional bool allow_all = 2 ; 144// List of track sids to grant permission to. 145repeated string allowed_track_sids = 3 ; 146} 147 148message SetTrackSubscriptionPermissionsResponse { 149}