blob: b9053ae87dabd5082587226c396cfed09825a06a [file] [log] [blame]
Bjorn Terelius36411852015-07-30 12:45:18 +02001syntax = "proto2";
2option optimize_for = LITE_RUNTIME;
3package webrtc.rtclog;
4
Bjorn Terelius36411852015-07-30 12:45:18 +02005enum MediaType {
6 ANY = 0;
7 AUDIO = 1;
8 VIDEO = 2;
9 DATA = 3;
10}
11
Bjorn Terelius36411852015-07-30 12:45:18 +020012// This is the main message to dump to a file, it can contain multiple event
13// messages, but it is possible to append multiple EventStreams (each with a
14// single event) to a file.
15// This has the benefit that there's no need to keep all data in memory.
16message EventStream {
17 repeated Event stream = 1;
18}
19
Bjorn Terelius36411852015-07-30 12:45:18 +020020message Event {
21 // required - Elapsed wallclock time in us since the start of the log.
22 optional int64 timestamp_us = 1;
23
24 // The different types of events that can occur, the UNKNOWN_EVENT entry
25 // is added in case future EventTypes are added, in that case old code will
26 // receive the new events as UNKNOWN_EVENT.
27 enum EventType {
28 UNKNOWN_EVENT = 0;
Ivo Creusen301aaed2015-10-08 18:07:41 +020029 LOG_START = 1;
30 LOG_END = 2;
31 RTP_EVENT = 3;
32 RTCP_EVENT = 4;
33 AUDIO_PLAYOUT_EVENT = 5;
terelius424e6cf2017-02-20 05:14:41 -080034 LOSS_BASED_BWE_UPDATE = 6;
35 DELAY_BASED_BWE_UPDATE = 7;
terelius006d93d2015-11-05 12:02:15 -080036 VIDEO_RECEIVER_CONFIG_EVENT = 8;
37 VIDEO_SENDER_CONFIG_EVENT = 9;
38 AUDIO_RECEIVER_CONFIG_EVENT = 10;
39 AUDIO_SENDER_CONFIG_EVENT = 11;
minyue4b7c9522017-01-24 04:54:59 -080040 AUDIO_NETWORK_ADAPTATION_EVENT = 16;
philipel32d00102017-02-27 02:18:46 -080041 BWE_PROBE_CLUSTER_CREATED_EVENT = 17;
42 BWE_PROBE_RESULT_EVENT = 18;
Bjorn Terelius36411852015-07-30 12:45:18 +020043 }
44
45 // required - Indicates the type of this event
46 optional EventType type = 2;
47
terelius8b2b9ef2017-05-31 05:45:56 -070048 oneof subtype {
49 // required if type == RTP_EVENT
50 RtpPacket rtp_packet = 3;
Bjorn Terelius36411852015-07-30 12:45:18 +020051
terelius8b2b9ef2017-05-31 05:45:56 -070052 // required if type == RTCP_EVENT
53 RtcpPacket rtcp_packet = 4;
Bjorn Terelius36411852015-07-30 12:45:18 +020054
terelius8b2b9ef2017-05-31 05:45:56 -070055 // required if type == AUDIO_PLAYOUT_EVENT
56 AudioPlayoutEvent audio_playout_event = 5;
Bjorn Terelius36411852015-07-30 12:45:18 +020057
terelius8b2b9ef2017-05-31 05:45:56 -070058 // required if type == LOSS_BASED_BWE_UPDATE
59 LossBasedBweUpdate loss_based_bwe_update = 6;
terelius006d93d2015-11-05 12:02:15 -080060
terelius8b2b9ef2017-05-31 05:45:56 -070061 // required if type == DELAY_BASED_BWE_UPDATE
62 DelayBasedBweUpdate delay_based_bwe_update = 7;
terelius0baf55d2017-02-17 03:38:28 -080063
terelius8b2b9ef2017-05-31 05:45:56 -070064 // required if type == VIDEO_RECEIVER_CONFIG_EVENT
65 VideoReceiveConfig video_receiver_config = 8;
Bjorn Terelius36411852015-07-30 12:45:18 +020066
terelius8b2b9ef2017-05-31 05:45:56 -070067 // required if type == VIDEO_SENDER_CONFIG_EVENT
68 VideoSendConfig video_sender_config = 9;
Bjorn Terelius36411852015-07-30 12:45:18 +020069
terelius8b2b9ef2017-05-31 05:45:56 -070070 // required if type == AUDIO_RECEIVER_CONFIG_EVENT
71 AudioReceiveConfig audio_receiver_config = 10;
Bjorn Terelius36411852015-07-30 12:45:18 +020072
terelius8b2b9ef2017-05-31 05:45:56 -070073 // required if type == AUDIO_SENDER_CONFIG_EVENT
74 AudioSendConfig audio_sender_config = 11;
minyue4b7c9522017-01-24 04:54:59 -080075
terelius8b2b9ef2017-05-31 05:45:56 -070076 // required if type == AUDIO_NETWORK_ADAPTATION_EVENT
77 AudioNetworkAdaptation audio_network_adaptation = 16;
philipel32d00102017-02-27 02:18:46 -080078
terelius8b2b9ef2017-05-31 05:45:56 -070079 // required if type == BWE_PROBE_CLUSTER_CREATED_EVENT
80 BweProbeCluster probe_cluster = 17;
philipel32d00102017-02-27 02:18:46 -080081
terelius8b2b9ef2017-05-31 05:45:56 -070082 // required if type == BWE_PROBE_RESULT_EVENT
83 BweProbeResult probe_result = 18;
84 }
Bjorn Terelius36411852015-07-30 12:45:18 +020085}
86
Bjorn Terelius36411852015-07-30 12:45:18 +020087message RtpPacket {
88 // required - True if the packet is incoming w.r.t. the user logging the data
89 optional bool incoming = 1;
90
perkj77cd58e2017-05-30 03:52:10 -070091 optional MediaType type = 2 [deprecated = true];
Bjorn Terelius36411852015-07-30 12:45:18 +020092
93 // required - The size of the packet including both payload and header.
94 optional uint32 packet_length = 3;
95
96 // required - The RTP header only.
97 optional bytes header = 4;
98
philipel32d00102017-02-27 02:18:46 -080099 // optional - The probe cluster id.
100 optional uint32 probe_cluster_id = 5;
101
Bjorn Terelius36411852015-07-30 12:45:18 +0200102 // Do not add code to log user payload data without a privacy review!
103}
104
Bjorn Terelius36411852015-07-30 12:45:18 +0200105message RtcpPacket {
106 // required - True if the packet is incoming w.r.t. the user logging the data
107 optional bool incoming = 1;
108
perkj77cd58e2017-05-30 03:52:10 -0700109 optional MediaType type = 2 [deprecated = true];
Bjorn Terelius36411852015-07-30 12:45:18 +0200110
111 // required - The whole packet including both payload and header.
112 optional bytes packet_data = 3;
113}
114
Ivo Creusen301aaed2015-10-08 18:07:41 +0200115message AudioPlayoutEvent {
nisse7d59f6b2017-02-21 03:40:24 -0800116 // TODO(ivoc): Rename, we currently use the "remote" ssrc, i.e. identifying
117 // the receive stream, while local_ssrc identifies the send stream, if any.
Ivo Creusen301aaed2015-10-08 18:07:41 +0200118 // required - The SSRC of the audio stream associated with the playout event.
Ivo Creusenae856f22015-09-17 16:30:16 +0200119 optional uint32 local_ssrc = 2;
Bjorn Terelius36411852015-07-30 12:45:18 +0200120}
121
terelius424e6cf2017-02-20 05:14:41 -0800122message LossBasedBweUpdate {
terelius006d93d2015-11-05 12:02:15 -0800123 // required - Bandwidth estimate (in bps) after the update.
terelius424e6cf2017-02-20 05:14:41 -0800124 optional int32 bitrate_bps = 1;
terelius006d93d2015-11-05 12:02:15 -0800125
126 // required - Fraction of lost packets since last receiver report
127 // computed as floor( 256 * (#lost_packets / #total_packets) ).
128 // The possible values range from 0 to 255.
129 optional uint32 fraction_loss = 2;
130
131 // TODO(terelius): Is this really needed? Remove or make optional?
132 // required - Total number of packets that the BWE update is based on.
133 optional int32 total_packets = 3;
134}
Bjorn Terelius36411852015-07-30 12:45:18 +0200135
terelius424e6cf2017-02-20 05:14:41 -0800136message DelayBasedBweUpdate {
terelius0baf55d2017-02-17 03:38:28 -0800137 enum DetectorState {
138 BWE_NORMAL = 0;
139 BWE_UNDERUSING = 1;
140 BWE_OVERUSING = 2;
141 }
142
143 // required - Bandwidth estimate (in bps) after the update.
terelius424e6cf2017-02-20 05:14:41 -0800144 optional int32 bitrate_bps = 1;
terelius0baf55d2017-02-17 03:38:28 -0800145
146 // required - The state of the overuse detector.
147 optional DetectorState detector_state = 2;
148}
149
Bjorn Terelius36411852015-07-30 12:45:18 +0200150// TODO(terelius): Video and audio streams could in principle share SSRC,
151// so identifying a stream based only on SSRC might not work.
152// It might be better to use a combination of SSRC and media type
153// or SSRC and port number, but for now we will rely on SSRC only.
154message VideoReceiveConfig {
155 // required - Synchronization source (stream identifier) to be received.
156 optional uint32 remote_ssrc = 1;
157 // required - Sender SSRC used for sending RTCP (such as receiver reports).
158 optional uint32 local_ssrc = 2;
159
160 // Compound mode is described by RFC 4585 and reduced-size
161 // RTCP mode is described by RFC 5506.
162 enum RtcpMode {
163 RTCP_COMPOUND = 1;
164 RTCP_REDUCEDSIZE = 2;
165 }
166 // required - RTCP mode to use.
167 optional RtcpMode rtcp_mode = 3;
168
Bjorn Terelius36411852015-07-30 12:45:18 +0200169 // required - Receiver estimated maximum bandwidth.
tereliusd66daa22015-11-06 09:00:18 -0800170 optional bool remb = 4;
Bjorn Terelius36411852015-07-30 12:45:18 +0200171
172 // Map from video RTP payload type -> RTX config.
tereliusd66daa22015-11-06 09:00:18 -0800173 repeated RtxMap rtx_map = 5;
Bjorn Terelius36411852015-07-30 12:45:18 +0200174
175 // RTP header extensions used for the received stream.
tereliusd66daa22015-11-06 09:00:18 -0800176 repeated RtpHeaderExtension header_extensions = 6;
Bjorn Terelius36411852015-07-30 12:45:18 +0200177
178 // List of decoders associated with the stream.
tereliusd66daa22015-11-06 09:00:18 -0800179 repeated DecoderConfig decoders = 7;
Bjorn Terelius36411852015-07-30 12:45:18 +0200180}
181
Bjorn Terelius36411852015-07-30 12:45:18 +0200182// Maps decoder names to payload types.
183message DecoderConfig {
184 // required
185 optional string name = 1;
186
187 // required
terelius006d93d2015-11-05 12:02:15 -0800188 optional int32 payload_type = 2;
Bjorn Terelius36411852015-07-30 12:45:18 +0200189}
190
Bjorn Terelius36411852015-07-30 12:45:18 +0200191// Maps RTP header extension names to numerical IDs.
192message RtpHeaderExtension {
193 // required
194 optional string name = 1;
195
196 // required
terelius006d93d2015-11-05 12:02:15 -0800197 optional int32 id = 2;
Bjorn Terelius36411852015-07-30 12:45:18 +0200198}
199
Bjorn Terelius36411852015-07-30 12:45:18 +0200200// RTX settings for incoming video payloads that may be received.
201// RTX is disabled if there's no config present.
202message RtxConfig {
203 // required - SSRC to use for the RTX stream.
204 optional uint32 rtx_ssrc = 1;
205
206 // required - Payload type to use for the RTX stream.
terelius006d93d2015-11-05 12:02:15 -0800207 optional int32 rtx_payload_type = 2;
Bjorn Terelius36411852015-07-30 12:45:18 +0200208}
209
Bjorn Terelius36411852015-07-30 12:45:18 +0200210message RtxMap {
211 // required
terelius006d93d2015-11-05 12:02:15 -0800212 optional int32 payload_type = 1;
Bjorn Terelius36411852015-07-30 12:45:18 +0200213
214 // required
215 optional RtxConfig config = 2;
216}
217
Bjorn Terelius36411852015-07-30 12:45:18 +0200218message VideoSendConfig {
219 // Synchronization source (stream identifier) for outgoing stream.
220 // One stream can have several ssrcs for e.g. simulcast.
221 // At least one ssrc is required.
222 repeated uint32 ssrcs = 1;
223
224 // RTP header extensions used for the outgoing stream.
225 repeated RtpHeaderExtension header_extensions = 2;
226
227 // List of SSRCs for retransmitted packets.
228 repeated uint32 rtx_ssrcs = 3;
229
230 // required if rtx_ssrcs is used - Payload type for retransmitted packets.
terelius006d93d2015-11-05 12:02:15 -0800231 optional int32 rtx_payload_type = 4;
Bjorn Terelius36411852015-07-30 12:45:18 +0200232
Bjorn Terelius36411852015-07-30 12:45:18 +0200233 // required - Encoder associated with the stream.
tereliusd66daa22015-11-06 09:00:18 -0800234 optional EncoderConfig encoder = 5;
Bjorn Terelius36411852015-07-30 12:45:18 +0200235}
236
Bjorn Terelius36411852015-07-30 12:45:18 +0200237// Maps encoder names to payload types.
238message EncoderConfig {
239 // required
240 optional string name = 1;
241
242 // required
terelius006d93d2015-11-05 12:02:15 -0800243 optional int32 payload_type = 2;
Bjorn Terelius36411852015-07-30 12:45:18 +0200244}
245
Bjorn Terelius36411852015-07-30 12:45:18 +0200246message AudioReceiveConfig {
Ivo Creusen301aaed2015-10-08 18:07:41 +0200247 // required - Synchronization source (stream identifier) to be received.
248 optional uint32 remote_ssrc = 1;
249
250 // required - Sender SSRC used for sending RTCP (such as receiver reports).
251 optional uint32 local_ssrc = 2;
252
253 // RTP header extensions used for the received audio stream.
254 repeated RtpHeaderExtension header_extensions = 3;
Bjorn Terelius36411852015-07-30 12:45:18 +0200255}
256
Bjorn Terelius36411852015-07-30 12:45:18 +0200257message AudioSendConfig {
Ivo Creusen301aaed2015-10-08 18:07:41 +0200258 // required - Synchronization source (stream identifier) for outgoing stream.
259 optional uint32 ssrc = 1;
260
261 // RTP header extensions used for the outgoing audio stream.
262 repeated RtpHeaderExtension header_extensions = 2;
Bjorn Terelius36411852015-07-30 12:45:18 +0200263}
minyue4b7c9522017-01-24 04:54:59 -0800264
265message AudioNetworkAdaptation {
266 // Bit rate that the audio encoder is operating at.
267 optional int32 bitrate_bps = 1;
268
269 // Frame length that each encoded audio packet consists of.
270 optional int32 frame_length_ms = 2;
271
272 // Packet loss fraction that the encoder's forward error correction (FEC) is
273 // optimized for.
274 optional float uplink_packet_loss_fraction = 3;
275
276 // Whether forward error correction (FEC) is turned on or off.
277 optional bool enable_fec = 4;
278
279 // Whether discontinuous transmission (DTX) is turned on or off.
280 optional bool enable_dtx = 5;
281
282 // Number of audio channels that each encoded packet consists of.
283 optional uint32 num_channels = 6;
terelius0baf55d2017-02-17 03:38:28 -0800284}
philipel32d00102017-02-27 02:18:46 -0800285
286message BweProbeCluster {
287 // required - The id of this probe cluster.
288 optional uint32 id = 1;
289
290 // required - The bitrate in bps that this probe cluster is meant to probe.
291 optional uint64 bitrate_bps = 2;
292
293 // required - The minimum number of packets used to probe the given bitrate.
294 optional uint32 min_packets = 3;
295
296 // required - The minimum number of bytes used to probe the given bitrate.
297 optional uint32 min_bytes = 4;
298}
299
300message BweProbeResult {
301 // required - The id of this probe cluster.
302 optional uint32 id = 1;
303
304 enum ResultType {
305 SUCCESS = 0;
306 INVALID_SEND_RECEIVE_INTERVAL = 1;
307 INVALID_SEND_RECEIVE_RATIO = 2;
308 TIMEOUT = 3;
309 }
310
311 // required - The result of this probing attempt.
312 optional ResultType result = 2;
313
314 // optional - but required if result == SUCCESS. The resulting bitrate in bps.
315 optional uint64 bitrate_bps = 3;
316}