forked from ionorg/ion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrtc.proto
146 lines (121 loc) · 2.36 KB
/
rtc.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
syntax = "proto3";
option go_package = "github.com/pion/ion/proto/rtc";
package rtc;
service RTC {
rpc Signal(stream Request) returns (stream Reply) {}
}
message JoinRequest {
string sid = 1;
string uid = 2;
map<string, string> config = 3;
SessionDescription description = 4;
}
message JoinReply {
bool success = 1;
Error error = 2;
SessionDescription description = 3;
}
enum Target {
PUBLISHER = 0;
SUBSCRIBER = 1;
}
enum MediaType {
MediaUnknown = 0;
UserMedia = 1;
ScreenCapture = 2;
Cavans = 3;
Streaming = 4;
VoIP = 5;
}
message TrackInfo {
// basic info
string id = 1;
string kind = 2;
bool muted = 3;
MediaType type = 4;
string streamId = 5;
string label = 6;
// extra info
string layer = 7; // simulcast or svc layer
uint32 width = 8;
uint32 height = 9;
uint32 frameRate = 10;
}
message SessionDescription {
Target target = 1;
// 'offer' | 'answer'
string type = 2;
// sdp contents
string sdp = 3;
// sdp metdata
repeated TrackInfo trackInfos = 4;
}
message Trickle {
Target target = 1;
string init = 2;
}
message Error {
int32 code = 1;
string reason = 2;
}
message TrackEvent {
enum State {
ADD = 0;
UPDATE = 1;
REMOVE = 2;
}
State state = 1;
string uid = 2;
repeated TrackInfo tracks = 3;
}
message Subscription{
string trackId = 2;
bool mute = 3; // mute track or not
bool subscribe = 4; // sub track or not
string layer = 5; // simulcast or svc layer
}
message SubscriptionRequest {
repeated Subscription subscriptions = 1;
}
message SubscriptionReply {
bool success = 1;
Error error = 2;
}
message UpdateTrackReply {
bool success = 1;
Error error = 2;
}
message ActiveSpeaker {
repeated AudioLevelSpeaker speakers = 1;
}
message AudioLevelSpeaker {
string sid = 1;
// audio level
float level = 2;
// speaker active or not
bool active = 3;
}
message Request {
oneof payload {
// Basic API Request
JoinRequest join = 1;
SessionDescription description = 2;
Trickle trickle = 3;
// Command
SubscriptionRequest subscription = 4;
}
}
message Reply {
oneof payload {
// Basic API Reply
JoinReply join = 1;
SessionDescription description = 2;
Trickle trickle = 3;
// Event
TrackEvent trackEvent = 4;
// Command Reply
SubscriptionReply subscription = 5;
// Error
Error error = 7;
}
}