blob: e8ec99de997da06b5bdda80862973ab2c44e0a7d [file] [log] [blame]
Bjorn Terelius36411852015-07-30 12:45:18 +02001syntax = "proto2";
2option optimize_for = LITE_RUNTIME;
3package webrtc.rtclog;
4
5
6enum MediaType {
7 ANY = 0;
8 AUDIO = 1;
9 VIDEO = 2;
10 DATA = 3;
11}
12
13
14// This is the main message to dump to a file, it can contain multiple event
15// messages, but it is possible to append multiple EventStreams (each with a
16// single event) to a file.
17// This has the benefit that there's no need to keep all data in memory.
18message EventStream {
19 repeated Event stream = 1;
20}
21
22
23message Event {
24 // required - Elapsed wallclock time in us since the start of the log.
25 optional int64 timestamp_us = 1;
26
27 // The different types of events that can occur, the UNKNOWN_EVENT entry
28 // is added in case future EventTypes are added, in that case old code will
29 // receive the new events as UNKNOWN_EVENT.
30 enum EventType {
31 UNKNOWN_EVENT = 0;
Ivo Creusen301aaed2015-10-08 18:07:41 +020032 LOG_START = 1;
33 LOG_END = 2;
34 RTP_EVENT = 3;
35 RTCP_EVENT = 4;
36 AUDIO_PLAYOUT_EVENT = 5;
terelius006d93d2015-11-05 12:02:15 -080037 BWE_PACKET_LOSS_EVENT = 6;
38 BWE_PACKET_DELAY_EVENT = 7;
39 VIDEO_RECEIVER_CONFIG_EVENT = 8;
40 VIDEO_SENDER_CONFIG_EVENT = 9;
41 AUDIO_RECEIVER_CONFIG_EVENT = 10;
42 AUDIO_SENDER_CONFIG_EVENT = 11;
Bjorn Terelius36411852015-07-30 12:45:18 +020043 }
44
45 // required - Indicates the type of this event
46 optional EventType type = 2;
47
48 // optional - but required if type == RTP_EVENT
49 optional RtpPacket rtp_packet = 3;
50
51 // optional - but required if type == RTCP_EVENT
52 optional RtcpPacket rtcp_packet = 4;
53
Ivo Creusen301aaed2015-10-08 18:07:41 +020054 // optional - but required if type == AUDIO_PLAYOUT_EVENT
55 optional AudioPlayoutEvent audio_playout_event = 5;
Bjorn Terelius36411852015-07-30 12:45:18 +020056
terelius006d93d2015-11-05 12:02:15 -080057 // optional - but required if type == BWE_PACKET_LOSS_EVENT
58 optional BwePacketLossEvent bwe_packet_loss_event = 6;
59
Bjorn Terelius36411852015-07-30 12:45:18 +020060 // optional - but required if type == VIDEO_RECEIVER_CONFIG_EVENT
terelius006d93d2015-11-05 12:02:15 -080061 optional VideoReceiveConfig video_receiver_config = 8;
Bjorn Terelius36411852015-07-30 12:45:18 +020062
63 // optional - but required if type == VIDEO_SENDER_CONFIG_EVENT
terelius006d93d2015-11-05 12:02:15 -080064 optional VideoSendConfig video_sender_config = 9;
Bjorn Terelius36411852015-07-30 12:45:18 +020065
66 // optional - but required if type == AUDIO_RECEIVER_CONFIG_EVENT
terelius006d93d2015-11-05 12:02:15 -080067 optional AudioReceiveConfig audio_receiver_config = 10;
Bjorn Terelius36411852015-07-30 12:45:18 +020068
69 // optional - but required if type == AUDIO_SENDER_CONFIG_EVENT
terelius006d93d2015-11-05 12:02:15 -080070 optional AudioSendConfig audio_sender_config = 11;
Bjorn Terelius36411852015-07-30 12:45:18 +020071}
72
73
74message RtpPacket {
75 // required - True if the packet is incoming w.r.t. the user logging the data
76 optional bool incoming = 1;
77
78 // required
79 optional MediaType type = 2;
80
81 // required - The size of the packet including both payload and header.
82 optional uint32 packet_length = 3;
83
84 // required - The RTP header only.
85 optional bytes header = 4;
86
87 // Do not add code to log user payload data without a privacy review!
88}
89
90
91message RtcpPacket {
92 // required - True if the packet is incoming w.r.t. the user logging the data
93 optional bool incoming = 1;
94
95 // required
96 optional MediaType type = 2;
97
98 // required - The whole packet including both payload and header.
99 optional bytes packet_data = 3;
100}
101
Ivo Creusen301aaed2015-10-08 18:07:41 +0200102message AudioPlayoutEvent {
103 // required - The SSRC of the audio stream associated with the playout event.
Ivo Creusenae856f22015-09-17 16:30:16 +0200104 optional uint32 local_ssrc = 2;
Bjorn Terelius36411852015-07-30 12:45:18 +0200105}
106
terelius006d93d2015-11-05 12:02:15 -0800107message BwePacketLossEvent {
108 // required - Bandwidth estimate (in bps) after the update.
109 optional int32 bitrate = 1;
110
111 // required - Fraction of lost packets since last receiver report
112 // computed as floor( 256 * (#lost_packets / #total_packets) ).
113 // The possible values range from 0 to 255.
114 optional uint32 fraction_loss = 2;
115
116 // TODO(terelius): Is this really needed? Remove or make optional?
117 // required - Total number of packets that the BWE update is based on.
118 optional int32 total_packets = 3;
119}
Bjorn Terelius36411852015-07-30 12:45:18 +0200120
121// TODO(terelius): Video and audio streams could in principle share SSRC,
122// so identifying a stream based only on SSRC might not work.
123// It might be better to use a combination of SSRC and media type
124// or SSRC and port number, but for now we will rely on SSRC only.
125message VideoReceiveConfig {
126 // required - Synchronization source (stream identifier) to be received.
127 optional uint32 remote_ssrc = 1;
128 // required - Sender SSRC used for sending RTCP (such as receiver reports).
129 optional uint32 local_ssrc = 2;
130
131 // Compound mode is described by RFC 4585 and reduced-size
132 // RTCP mode is described by RFC 5506.
133 enum RtcpMode {
134 RTCP_COMPOUND = 1;
135 RTCP_REDUCEDSIZE = 2;
136 }
137 // required - RTCP mode to use.
138 optional RtcpMode rtcp_mode = 3;
139
140 // required - Extended RTCP settings.
141 optional bool receiver_reference_time_report = 4;
142
143 // required - Receiver estimated maximum bandwidth.
144 optional bool remb = 5;
145
146 // Map from video RTP payload type -> RTX config.
147 repeated RtxMap rtx_map = 6;
148
149 // RTP header extensions used for the received stream.
150 repeated RtpHeaderExtension header_extensions = 7;
151
152 // List of decoders associated with the stream.
153 repeated DecoderConfig decoders = 8;
154}
155
156
157// Maps decoder names to payload types.
158message DecoderConfig {
159 // required
160 optional string name = 1;
161
162 // required
terelius006d93d2015-11-05 12:02:15 -0800163 optional int32 payload_type = 2;
Bjorn Terelius36411852015-07-30 12:45:18 +0200164}
165
166
167// Maps RTP header extension names to numerical IDs.
168message RtpHeaderExtension {
169 // required
170 optional string name = 1;
171
172 // required
terelius006d93d2015-11-05 12:02:15 -0800173 optional int32 id = 2;
Bjorn Terelius36411852015-07-30 12:45:18 +0200174}
175
176
177// RTX settings for incoming video payloads that may be received.
178// RTX is disabled if there's no config present.
179message RtxConfig {
180 // required - SSRC to use for the RTX stream.
181 optional uint32 rtx_ssrc = 1;
182
183 // required - Payload type to use for the RTX stream.
terelius006d93d2015-11-05 12:02:15 -0800184 optional int32 rtx_payload_type = 2;
Bjorn Terelius36411852015-07-30 12:45:18 +0200185}
186
187
188message RtxMap {
189 // required
terelius006d93d2015-11-05 12:02:15 -0800190 optional int32 payload_type = 1;
Bjorn Terelius36411852015-07-30 12:45:18 +0200191
192 // required
193 optional RtxConfig config = 2;
194}
195
196
197message VideoSendConfig {
198 // Synchronization source (stream identifier) for outgoing stream.
199 // One stream can have several ssrcs for e.g. simulcast.
200 // At least one ssrc is required.
201 repeated uint32 ssrcs = 1;
202
203 // RTP header extensions used for the outgoing stream.
204 repeated RtpHeaderExtension header_extensions = 2;
205
206 // List of SSRCs for retransmitted packets.
207 repeated uint32 rtx_ssrcs = 3;
208
209 // required if rtx_ssrcs is used - Payload type for retransmitted packets.
terelius006d93d2015-11-05 12:02:15 -0800210 optional int32 rtx_payload_type = 4;
Bjorn Terelius36411852015-07-30 12:45:18 +0200211
212 // required - Canonical end-point identifier.
213 optional string c_name = 5;
214
215 // required - Encoder associated with the stream.
216 optional EncoderConfig encoder = 6;
217}
218
219
220// Maps encoder names to payload types.
221message EncoderConfig {
222 // required
223 optional string name = 1;
224
225 // required
terelius006d93d2015-11-05 12:02:15 -0800226 optional int32 payload_type = 2;
Bjorn Terelius36411852015-07-30 12:45:18 +0200227}
228
229
230message AudioReceiveConfig {
Ivo Creusen301aaed2015-10-08 18:07:41 +0200231 // required - Synchronization source (stream identifier) to be received.
232 optional uint32 remote_ssrc = 1;
233
234 // required - Sender SSRC used for sending RTCP (such as receiver reports).
235 optional uint32 local_ssrc = 2;
236
237 // RTP header extensions used for the received audio stream.
238 repeated RtpHeaderExtension header_extensions = 3;
Bjorn Terelius36411852015-07-30 12:45:18 +0200239}
240
241
242message AudioSendConfig {
Ivo Creusen301aaed2015-10-08 18:07:41 +0200243 // required - Synchronization source (stream identifier) for outgoing stream.
244 optional uint32 ssrc = 1;
245
246 // RTP header extensions used for the outgoing audio stream.
247 repeated RtpHeaderExtension header_extensions = 2;
Bjorn Terelius36411852015-07-30 12:45:18 +0200248}