1
+ syntax = "proto3" ;
2
+ import "common.proto" ;
3
+
4
+ package vts.server ;
5
+
6
+ message Peer {
7
+ string peerId = 1 ;
8
+ bool isServer = 2 ;
9
+ string nick = 3 ;
10
+ int64 rtt = 4 ;
11
+ int32 natType = 5 ;
12
+ int32 sortingOrder = 6 ;
13
+ }
14
+
15
+ message Sdp {
16
+ string sdp = 1 ;
17
+ string type = 2 ;
18
+ string fromPeerId = 3 ;
19
+ string toPeerId = 4 ;
20
+ }
21
+
22
+ message Candidate {
23
+ string candidate = 1 ;
24
+ string mid = 2 ;
25
+ string fromPeerId = 3 ;
26
+ string toPeerId = 4 ;
27
+ }
28
+
29
+ message ReqCreateRoom {
30
+ string peerId = 1 ;
31
+ FrameFormatSetting format = 2 ;
32
+ string nick = 4 ;
33
+ string turn = 5 ;
34
+ }
35
+
36
+ message ReqJoinRoom {
37
+ string roomId = 1 ;
38
+ string peerId = 2 ;
39
+ string nick = 3 ;
40
+ }
41
+
42
+ message ReqNickname {
43
+ string nick = 2 ;
44
+ }
45
+
46
+ message ReqNatType {
47
+ int32 natType = 2 ;
48
+ }
49
+
50
+ message ReqRtt {
51
+ map <string , int64 > rtt = 1 ;
52
+ }
53
+
54
+ message StatInfo {
55
+ int64 rtt = 1 ;
56
+ uint64 txBytes = 2 ;
57
+ uint64 rxBytes = 3 ;
58
+ uint64 txSpeed = 4 ;
59
+ uint64 rxSpeed = 5 ;
60
+ }
61
+
62
+ message ReqStat {
63
+ map <string , StatInfo > stats = 1 ;
64
+ }
65
+
66
+ message RspRoomInfo {
67
+ string roomId = 2 ;
68
+ FrameFormatSetting format = 3 ;
69
+ string hostPeerId = 4 ;
70
+ string turn = 5 ;
71
+ }
72
+
73
+ message TurnInfo {
74
+ string turn = 1 ;
75
+ }
76
+
77
+ message ReqShareInfo {
78
+ string gpu = 1 ;
79
+ string capture = 2 ;
80
+ bool start = 3 ;
81
+ bool isWireless = 4 ;
82
+ bool is2G4 = 5 ;
83
+ }
84
+
85
+ message ReqIdr {
86
+ string reason = 1 ;
87
+ uint64 timestamp = 2 ;
88
+ string peerId = 3 ;
89
+ }
90
+
91
+ message Notify {
92
+ oneof notify {
93
+ NotifyPeers peers = 2 ;
94
+ Sdp sdp = 3 ;
95
+ FrameFormatSetting frame = 4 ;
96
+ NotifyCommon roomDestroy = 5 ;
97
+ NotifyCommon forceIdr = 6 ;
98
+ Candidate candidate = 7 ;
99
+ TurnInfo turn = 8 ;
100
+ }
101
+ }
102
+
103
+ message NotifyPeers {
104
+ repeated Peer peers = 1 ;
105
+ }
106
+
107
+ service RoomService {
108
+ rpc Hello (ReqCommon ) returns (RspCommon );
109
+
110
+ rpc CreateRoom (ReqCreateRoom ) returns (RspRoomInfo );
111
+ rpc JoinRoom (ReqJoinRoom ) returns (RspRoomInfo );
112
+
113
+ rpc ReceiveNotify (ReqCommon ) returns (stream Notify );
114
+
115
+ rpc SetSdp (Sdp ) returns (RspCommon );
116
+ rpc SetFrameFormat (FrameFormatSetting ) returns (RspCommon );
117
+ rpc SetNickName (ReqNickname ) returns (RspCommon );
118
+ rpc SetNatType (ReqNatType ) returns (RspCommon );
119
+ rpc SetRtt (ReqRtt ) returns (RspCommon );
120
+ rpc SetStat (ReqStat ) returns (RspCommon );
121
+ rpc SetShareInfo (ReqShareInfo ) returns (RspCommon );
122
+ rpc SetCandidate (Candidate ) returns (RspCommon );
123
+ rpc SetTurn (TurnInfo ) returns (RspCommon );
124
+
125
+ rpc RequestIdr (ReqIdr ) returns (RspCommon );
126
+
127
+ rpc Exit (ReqCommon ) returns (RspCommon );
128
+ }
0 commit comments