1// THIS FILE IS EXPERIMENTAL. BREAKING CHANGES MAY BE MADE AT ANY TIME
2// WITHOUT PRIOR WARNING. THIS FILE SHOULD NOT BE USED IN PRODUCTION CODE.
3
4syntax = "proto2";
5option optimize_for = LITE_RUNTIME;
6package webrtc.rtclog2;
7
8// At the top level, a WebRTC event log is just an EventStream object. Note that
9// concatenating multiple EventStreams in the same file is equivalent to a
10// single EventStream object containing the same events. Hence, it is not
11// necessary to wait for the entire log to be complete before beginning to
12// write it to a file.
13// Note: For all X_deltas fields, we rely on the default value being an
14// empty string.
15message EventStream {
16  // Deprecated - Maintained for compatibility with the old event log.
17  repeated Event stream = 1 [deprecated = true];
18  repeated IncomingRtpPackets incoming_rtp_packets = 2;
19  repeated OutgoingRtpPackets outgoing_rtp_packets = 3;
20  repeated IncomingRtcpPackets incoming_rtcp_packets = 4;
21  repeated OutgoingRtcpPackets outgoing_rtcp_packets = 5;
22  repeated AudioPlayoutEvents audio_playout_events = 6;
23  // The field tags 7-15 are reserved for the most common events.
24  repeated BeginLogEvent begin_log_events = 16;
25  repeated EndLogEvent end_log_events = 17;
26  repeated LossBasedBweUpdates loss_based_bwe_updates = 18;
27  repeated DelayBasedBweUpdates delay_based_bwe_updates = 19;
28  repeated AudioNetworkAdaptations audio_network_adaptations = 20;
29  repeated BweProbeCluster probe_clusters = 21;
30  repeated BweProbeResultSuccess probe_success = 22;
31  repeated BweProbeResultFailure probe_failure = 23;
32  repeated AlrState alr_states = 24;
33  repeated IceCandidatePairConfig ice_candidate_configs = 25;
34  repeated IceCandidatePairEvent ice_candidate_events = 26;
35  repeated DtlsTransportStateEvent dtls_transport_state_events = 27;
36  repeated DtlsWritableState dtls_writable_states = 28;
37  repeated GenericPacketSent generic_packets_sent = 29;
38  repeated GenericPacketReceived generic_packets_received = 30;
39  repeated GenericAckReceived generic_acks_received = 31;
40  repeated RouteChange route_changes = 32;
41  repeated RemoteEstimates remote_estimates = 33;
42
43  repeated AudioRecvStreamConfig audio_recv_stream_configs = 101;
44  repeated AudioSendStreamConfig audio_send_stream_configs = 102;
45  repeated VideoRecvStreamConfig video_recv_stream_configs = 103;
46  repeated VideoSendStreamConfig video_send_stream_configs = 104;
47}
48
49// DEPRECATED.
50message Event {
51  // TODO(terelius): Do we want to preserve the old Event definition here?
52}
53
54message GenericPacketReceived {
55  // All fields are required.
56  optional int64 timestamp_ms = 1;
57  optional int64 packet_number = 2;
58  // Length of the packet in bytes.
59  optional int32 packet_length = 3;
60
61  // Provided if there are deltas in the batch.
62  optional uint32 number_of_deltas = 16;
63  optional bytes timestamp_ms_deltas = 17;
64  optional bytes packet_number_deltas = 18;
65  optional bytes packet_length_deltas = 19;
66}
67
68message GenericPacketSent {
69  // All fields are required. All lengths in bytes.
70  optional int64 timestamp_ms = 1;
71  optional int64 packet_number = 2;
72  // overhead+payload+padding length = packet_length in bytes.
73  optional int32 overhead_length = 3;
74  optional int32 payload_length = 4;
75  optional int32 padding_length = 5;
76
77  optional uint32 number_of_deltas = 16;
78  optional bytes timestamp_ms_deltas = 17;
79  optional bytes packet_number_deltas = 18;
80  optional bytes overhead_length_deltas = 19;
81  optional bytes payload_length_deltas = 20;
82  optional bytes padding_length_deltas = 21;
83}
84
85message GenericAckReceived {
86  optional int64 timestamp_ms = 1;
87
88  // ID of the received packet.
89  optional int64 packet_number = 2;
90
91  // ID of the packet that was acked.
92  optional int64 acked_packet_number = 3;
93
94  // Timestamp in ms when the packet was received by the other side.
95  optional int64 receive_acked_packet_time_ms = 4;
96
97  optional uint32 number_of_deltas = 16;
98  optional bytes timestamp_ms_deltas = 17;
99  optional bytes packet_number_deltas = 18;
100  optional bytes acked_packet_number_deltas = 19;
101  optional bytes receive_acked_packet_time_ms_deltas = 20;
102}
103
104message IncomingRtpPackets {
105  // required
106  optional int64 timestamp_ms = 1;
107
108  // required - RTP marker bit, used to label boundaries between video frames.
109  optional bool marker = 2;
110
111  // required - RTP payload type.
112  optional uint32 payload_type = 3;
113
114  // required - RTP sequence number.
115  optional uint32 sequence_number = 4;
116
117  // required - RTP monotonic clock timestamp (not actual time).
118  optional fixed32 rtp_timestamp = 5;
119
120  // required - Synchronization source of this packet's RTP stream.
121  optional fixed32 ssrc = 6;
122
123  // TODO(terelius/dinor): Add CSRCs. Field number 7 reserved for this purpose.
124
125  // required - The size (in bytes) of the media payload, not including
126  // RTP header or padding. The packet size is the sum of payload, header and
127  // padding.
128  optional uint32 payload_size = 8;
129
130  // required - The size (in bytes) of the RTP header.
131  optional uint32 header_size = 9;
132
133  // required - The size (in bytes) of the padding.
134  optional uint32 padding_size = 10;
135
136  // optional - required if the batch contains delta encoded events.
137  optional uint32 number_of_deltas = 11;
138
139  // Field numbers 12-14 reserved for future use.
140
141  // Optional header extensions.
142  optional uint32 transport_sequence_number = 15;
143  optional int32 transmission_time_offset = 16;
144  optional uint32 absolute_send_time = 17;
145  optional uint32 video_rotation = 18;
146  // |audio_level| and |voice_activity| are always used in conjunction.
147  optional uint32 audio_level = 19;
148  optional bool voice_activity = 20;
149  // TODO(terelius): Add other header extensions like playout delay?
150
151  // Delta encodings.
152  optional bytes timestamp_ms_deltas = 101;
153  optional bytes marker_deltas = 102;
154  optional bytes payload_type_deltas = 103;
155  optional bytes sequence_number_deltas = 104;
156  optional bytes rtp_timestamp_deltas = 105;
157  // Field number 107 reserved for CSRC.
158  optional bytes ssrc_deltas = 106;
159  optional bytes payload_size_deltas = 108;
160  optional bytes header_size_deltas = 109;
161  optional bytes padding_size_deltas = 110;
162  // Field number 111-114 reserved for future use.
163  optional bytes transport_sequence_number_deltas = 115;
164  optional bytes transmission_time_offset_deltas = 116;
165  optional bytes absolute_send_time_deltas = 117;
166  optional bytes video_rotation_deltas = 118;
167  // |audio_level| and |voice_activity| are always used in conjunction.
168  optional bytes audio_level_deltas = 119;
169  optional bytes voice_activity_deltas = 120;
170}
171
172message OutgoingRtpPackets {
173  // required
174  optional int64 timestamp_ms = 1;
175
176  // required - RTP marker bit, used to label boundaries between video frames.
177  optional bool marker = 2;
178
179  // required - RTP payload type.
180  optional uint32 payload_type = 3;
181
182  // required - RTP sequence number.
183  optional uint32 sequence_number = 4;
184
185  // required - RTP monotonic clock timestamp (not actual time).
186  optional fixed32 rtp_timestamp = 5;
187
188  // required - Synchronization source of this packet's RTP stream.
189  optional fixed32 ssrc = 6;
190
191  // TODO(terelius/dinor): Add CSRCs. Field number 7 reserved for this purpose.
192
193  // required - The size (in bytes) of the media payload, not including
194  // RTP header or padding. The packet size is the sum of payload, header and
195  // padding.
196  optional uint32 payload_size = 8;
197
198  // required - The size (in bytes) of the RTP header.
199  optional uint32 header_size = 9;
200
201  // required - The size (in bytes) of the padding.
202  optional uint32 padding_size = 10;
203
204  // optional - required if the batch contains delta encoded events.
205  optional uint32 number_of_deltas = 11;
206
207  // Field numbers 12-14 reserved for future use.
208
209  // Optional header extensions.
210  optional uint32 transport_sequence_number = 15;
211  optional int32 transmission_time_offset = 16;
212  optional uint32 absolute_send_time = 17;
213  optional uint32 video_rotation = 18;
214  // |audio_level| and |voice_activity| are always used in conjunction.
215  optional uint32 audio_level = 19;
216  optional bool voice_activity = 20;
217  // TODO(terelius): Add other header extensions like playout delay?
218
219  // Delta encodings.
220  optional bytes timestamp_ms_deltas = 101;
221  optional bytes marker_deltas = 102;
222  optional bytes payload_type_deltas = 103;
223  optional bytes sequence_number_deltas = 104;
224  optional bytes rtp_timestamp_deltas = 105;
225  optional bytes ssrc_deltas = 106;
226  // Field number 107 reserved for CSRC.
227  optional bytes payload_size_deltas = 108;
228  optional bytes header_size_deltas = 109;
229  optional bytes padding_size_deltas = 110;
230  // Field number 111-114 reserved for future use.
231  optional bytes transport_sequence_number_deltas = 115;
232  optional bytes transmission_time_offset_deltas = 116;
233  optional bytes absolute_send_time_deltas = 117;
234  optional bytes video_rotation_deltas = 118;
235  // |audio_level| and |voice_activity| are always used in conjunction.
236  optional bytes audio_level_deltas = 119;
237  optional bytes voice_activity_deltas = 120;
238}
239
240message IncomingRtcpPackets {
241  // required
242  optional int64 timestamp_ms = 1;
243
244  // required - The whole packet including both payload and header.
245  optional bytes raw_packet = 2;
246  // TODO(terelius): Feasible to log parsed RTCP instead?
247
248  // optional - required if the batch contains delta encoded events.
249  optional uint32 number_of_deltas = 3;
250
251  // Delta/blob encodings.
252  optional bytes timestamp_ms_deltas = 101;
253  optional bytes raw_packet_blobs = 102;
254}
255
256message OutgoingRtcpPackets {
257  // required
258  optional int64 timestamp_ms = 1;
259
260  // required - The whole packet including both payload and header.
261  optional bytes raw_packet = 2;
262  // TODO(terelius): Feasible to log parsed RTCP instead?
263
264  // optional - required if the batch contains delta encoded events.
265  optional uint32 number_of_deltas = 3;
266
267  // Delta/blob encodings.
268  optional bytes timestamp_ms_deltas = 101;
269  optional bytes raw_packet_blobs = 102;
270}
271
272message AudioPlayoutEvents {
273  // required
274  optional int64 timestamp_ms = 1;
275
276  // required - The SSRC of the audio stream associated with the playout event.
277  optional uint32 local_ssrc = 2;
278
279  // optional - required if the batch contains delta encoded events.
280  optional uint32 number_of_deltas = 3;
281
282  // Delta encodings.
283  optional bytes timestamp_ms_deltas = 101;
284  optional bytes local_ssrc_deltas = 102;
285}
286
287message BeginLogEvent {
288  // required
289  optional int64 timestamp_ms = 1;
290
291  // required
292  optional uint32 version = 2;
293
294  // required
295  optional int64 utc_time_ms = 3;
296}
297
298message EndLogEvent {
299  // required
300  optional int64 timestamp_ms = 1;
301}
302
303message LossBasedBweUpdates {
304  // required
305  optional int64 timestamp_ms = 1;
306
307  // TODO(terelius): Update log interface to unsigned.
308  // required - Bandwidth estimate (in bps) after the update.
309  optional uint32 bitrate_bps = 2;
310
311  // required - Fraction of lost packets since last receiver report
312  // computed as floor( 256 * (#lost_packets / #total_packets) ).
313  // The possible values range from 0 to 255.
314  optional uint32 fraction_loss = 3;
315
316  // TODO(terelius): Is this really needed? Remove or make optional?
317  // TODO(terelius): Update log interface to unsigned.
318  // required - Total number of packets that the BWE update is based on.
319  optional uint32 total_packets = 4;
320
321  // optional - required if the batch contains delta encoded events.
322  optional uint32 number_of_deltas = 5;
323
324  // Delta encodings.
325  optional bytes timestamp_ms_deltas = 101;
326  optional bytes bitrate_bps_deltas = 102;
327  optional bytes fraction_loss_deltas = 103;
328  optional bytes total_packets_deltas = 104;
329}
330
331message DelayBasedBweUpdates {
332  // required
333  optional int64 timestamp_ms = 1;
334
335  // required - Bandwidth estimate (in bps) after the update.
336  optional uint32 bitrate_bps = 2;
337
338  enum DetectorState {
339    BWE_UNKNOWN_STATE = 0;
340    BWE_NORMAL = 1;
341    BWE_UNDERUSING = 2;
342    BWE_OVERUSING = 3;
343  }
344  optional DetectorState detector_state = 3;
345
346  // optional - required if the batch contains delta encoded events.
347  optional uint32 number_of_deltas = 4;
348
349  // Delta encodings.
350  optional bytes timestamp_ms_deltas = 101;
351  optional bytes bitrate_bps_deltas = 102;
352  optional bytes detector_state_deltas = 103;
353}
354
355// Maps RTP header extension names to numerical IDs.
356message RtpHeaderExtensionConfig {
357  // Optional IDs for the header extensions. Each ID is a 4-bit number that is
358  // only set if that extension is configured.
359  // TODO: Can we skip audio level?
360  optional int32 transmission_time_offset_id = 1;
361  optional int32 absolute_send_time_id = 2;
362  optional int32 transport_sequence_number_id = 3;
363  optional int32 video_rotation_id = 4;
364  optional int32 audio_level_id = 5;
365  // TODO(terelius): Add other header extensions like playout delay?
366}
367
368message VideoRecvStreamConfig {
369  // required
370  optional int64 timestamp_ms = 1;
371
372  // required - Synchronization source (stream identifier) to be received.
373  optional uint32 remote_ssrc = 2;
374
375  // required - Sender SSRC used for sending RTCP (such as receiver reports).
376  optional uint32 local_ssrc = 3;
377
378  // optional - required if RTX is configured. SSRC for the RTX stream.
379  optional uint32 rtx_ssrc = 4;
380
381  // IDs for the header extension we care about. Only required if there are
382  // header extensions configured.
383  optional RtpHeaderExtensionConfig header_extensions = 5;
384
385  // TODO(terelius): Do we need codec-payload mapping? If so and rtx_ssrc is
386  // used, we also need a map between RTP payload type and RTX payload type.
387}
388
389message VideoSendStreamConfig {
390  // required
391  optional int64 timestamp_ms = 1;
392
393  // required - Synchronization source (stream identifier) for outgoing stream.
394  // When using simulcast, a separate config should be logged for each stream.
395  optional uint32 ssrc = 2;
396
397  // optional - required if RTX is configured. SSRC for the RTX stream.
398  optional uint32 rtx_ssrc = 3;
399
400  // IDs for the header extension we care about. Only required if there are
401  // header extensions configured.
402  optional RtpHeaderExtensionConfig header_extensions = 4;
403
404  // TODO(terelius): Do we need codec-payload mapping? If so and rtx_ssrc is
405  // used, we also need a map between RTP payload type and RTX payload type.
406}
407
408message AudioRecvStreamConfig {
409  // required
410  optional int64 timestamp_ms = 1;
411
412  // required - Synchronization source (stream identifier) to be received.
413  optional uint32 remote_ssrc = 2;
414
415  // required - Sender SSRC used for sending RTCP (such as receiver reports).
416  optional uint32 local_ssrc = 3;
417
418  // Field number 4 reserved for RTX SSRC.
419
420  // IDs for the header extension we care about. Only required if there are
421  // header extensions configured.
422  optional RtpHeaderExtensionConfig header_extensions = 5;
423
424  // TODO(terelius): Do we need codec-payload mapping? If so and rtx_ssrc is
425  // used, we also need a map between RTP payload type and RTX payload type.
426}
427
428message AudioSendStreamConfig {
429  // required
430  optional int64 timestamp_ms = 1;
431
432  // required - Synchronization source (stream identifier) for outgoing stream.
433  optional uint32 ssrc = 2;
434
435  // Field number 3 reserved for RTX SSRC.
436
437  // IDs for the header extension we care about. Only required if there are
438  // header extensions configured.
439  optional RtpHeaderExtensionConfig header_extensions = 4;
440
441  // TODO(terelius): Do we need codec-payload mapping? If so and rtx_ssrc is
442  // used, we also need a map between RTP payload type and RTX payload type.
443}
444
445message AudioNetworkAdaptations {
446  // required
447  optional int64 timestamp_ms = 1;
448
449  // Bit rate that the audio encoder is operating at.
450  // TODO(terelius): Signed vs unsigned?
451  optional int32 bitrate_bps = 2;
452
453  // Frame length that each encoded audio packet consists of.
454  // TODO(terelius): Signed vs unsigned?
455  optional int32 frame_length_ms = 3;
456
457  // Packet loss fraction that the encoder's forward error correction (FEC) is
458  // optimized for.
459  // Instead of encoding a float, we encode a value between 0 and 16383, which
460  // if divided by 16383, will give a value close to the original float.
461  // The value 16383 (2^14 - 1) was chosen so that it would give good precision
462  // on the one hand, and would be encodable with two bytes in varint form
463  // on the other hand.
464  optional uint32 uplink_packet_loss_fraction = 4;
465
466  // Whether forward error correction (FEC) is turned on or off.
467  optional bool enable_fec = 5;
468
469  // Whether discontinuous transmission (DTX) is turned on or off.
470  optional bool enable_dtx = 6;
471
472  // Number of audio channels that each encoded packet consists of.
473  optional uint32 num_channels = 7;
474
475  // optional - required if the batch contains delta encoded events.
476  optional uint32 number_of_deltas = 8;
477
478  // Delta encodings.
479  optional bytes timestamp_ms_deltas = 101;
480  optional bytes bitrate_bps_deltas = 102;
481  optional bytes frame_length_ms_deltas = 103;
482  optional bytes uplink_packet_loss_fraction_deltas = 104;
483  optional bytes enable_fec_deltas = 105;
484  optional bytes enable_dtx_deltas = 106;
485  optional bytes num_channels_deltas = 107;
486}
487
488message BweProbeCluster {
489  // required
490  optional int64 timestamp_ms = 1;
491
492  // required - The id of this probe cluster.
493  optional uint32 id = 2;
494
495  // required - The bitrate in bps that this probe cluster is meant to probe.
496  optional uint32 bitrate_bps = 3;
497
498  // required - The minimum number of packets used to probe the given bitrate.
499  optional uint32 min_packets = 4;
500
501  // required - The minimum number of bytes used to probe the given bitrate.
502  optional uint32 min_bytes = 5;
503}
504
505message BweProbeResultSuccess {
506  // required
507  optional int64 timestamp_ms = 1;
508
509  // required - The id of this probe cluster.
510  optional uint32 id = 2;
511
512  // required - The resulting bitrate in bps.
513  optional uint32 bitrate_bps = 3;
514}
515
516message BweProbeResultFailure {
517  // required
518  optional int64 timestamp_ms = 1;
519
520  // required - The id of this probe cluster.
521  optional uint32 id = 2;
522
523  enum FailureReason {
524    UNKNOWN = 0;
525    INVALID_SEND_RECEIVE_INTERVAL = 1;
526    INVALID_SEND_RECEIVE_RATIO = 2;
527    TIMEOUT = 3;
528  }
529
530  // required
531  optional FailureReason failure = 3;
532}
533
534message AlrState {
535  // required
536  optional int64 timestamp_ms = 1;
537
538  // required - True if the send rate is application limited.
539  optional bool in_alr = 2;
540}
541
542message IceCandidatePairConfig {
543  enum IceCandidatePairConfigType {
544    UNKNOWN_CONFIG_TYPE = 0;
545    ADDED = 1;
546    UPDATED = 2;
547    DESTROYED = 3;
548    SELECTED = 4;
549  }
550
551  enum IceCandidateType {
552    UNKNOWN_CANDIDATE_TYPE = 0;
553    LOCAL = 1;
554    STUN = 2;
555    PRFLX = 3;
556    RELAY = 4;
557  }
558
559  enum Protocol {
560    UNKNOWN_PROTOCOL = 0;
561    UDP = 1;
562    TCP = 2;
563    SSLTCP = 3;
564    TLS = 4;
565  }
566
567  enum AddressFamily {
568    UNKNOWN_ADDRESS_FAMILY = 0;
569    IPV4 = 1;
570    IPV6 = 2;
571  }
572
573  enum NetworkType {
574    UNKNOWN_NETWORK_TYPE = 0;
575    ETHERNET = 1;
576    WIFI = 2;
577    CELLULAR = 3;
578    VPN = 4;
579    LOOPBACK = 5;
580  }
581
582  // required
583  optional int64 timestamp_ms = 1;
584
585  // required
586  optional IceCandidatePairConfigType config_type = 2;
587
588  // required
589  optional uint32 candidate_pair_id = 3;
590
591  // required
592  optional IceCandidateType local_candidate_type = 4;
593
594  // required
595  optional Protocol local_relay_protocol = 5;
596
597  // required
598  optional NetworkType local_network_type = 6;
599
600  // required
601  optional AddressFamily local_address_family = 7;
602
603  // required
604  optional IceCandidateType remote_candidate_type = 8;
605
606  // required
607  optional AddressFamily remote_address_family = 9;
608
609  // required
610  optional Protocol candidate_pair_protocol = 10;
611}
612
613message IceCandidatePairEvent {
614  enum IceCandidatePairEventType {
615    UNKNOWN_CHECK_TYPE = 0;
616    CHECK_SENT = 1;
617    CHECK_RECEIVED = 2;
618    CHECK_RESPONSE_SENT = 3;
619    CHECK_RESPONSE_RECEIVED = 4;
620  }
621
622  // required
623  optional int64 timestamp_ms = 1;
624
625  // required
626  optional IceCandidatePairEventType event_type = 2;
627
628  // required
629  optional uint32 candidate_pair_id = 3;
630
631  // required
632  optional uint32 transaction_id = 4;
633}
634
635message DtlsTransportStateEvent {
636  enum DtlsTransportState {
637    UNKNOWN_DTLS_TRANSPORT_STATE = 0;
638    DTLS_TRANSPORT_NEW = 1;
639    DTLS_TRANSPORT_CONNECTING = 2;
640    DTLS_TRANSPORT_CONNECTED = 3;
641    DTLS_TRANSPORT_CLOSED = 4;
642    DTLS_TRANSPORT_FAILED = 5;
643  }
644
645  // required
646  optional int64 timestamp_ms = 1;
647
648  // required
649  optional DtlsTransportState dtls_transport_state = 2;
650}
651
652message DtlsWritableState {
653  // required
654  optional int64 timestamp_ms = 1;
655
656  // required
657  optional bool writable = 2;
658}
659
660message RouteChange {
661  // required
662  optional int64 timestamp_ms = 1;
663  // required - True if the route is ready for sending packets.
664  optional bool connected = 2;
665  // required - The per packet data overhead for this route.
666  optional uint32 overhead = 3;
667}
668
669message RemoteEstimates {
670  // required
671  optional int64 timestamp_ms = 1;
672  // optional - value used as a safe measure of available capacity.
673  optional uint32 link_capacity_lower_kbps = 2;
674  // optional - value used as limit for increasing bitrate.
675  optional uint32 link_capacity_upper_kbps = 3;
676
677  // optional - required if the batch contains delta encoded events.
678  optional uint32 number_of_deltas = 4;
679
680  // Delta encodings.
681  optional bytes timestamp_ms_deltas = 101;
682  optional bytes link_capacity_lower_kbps_deltas = 102;
683  optional bytes link_capacity_upper_kbps_deltas = 103;
684}
685