fork/rust-sdks

git clone https://git.julia.blue/fork/rust-sdks

David Zhaoimplement track permission updates (#563)1d85bac

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