blob: b14306e3628d3982079fcfb906af93a5d34e7507 [file] [log] [blame]
Bjorn Tereliusbd3fce52015-07-30 10:45:181syntax = "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 Creusen39392972015-10-08 16:07:4132 LOG_START = 1;
33 LOG_END = 2;
34 RTP_EVENT = 3;
35 RTCP_EVENT = 4;
36 AUDIO_PLAYOUT_EVENT = 5;
tereliuscfdad3c2015-11-05 20:02:1537 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 Tereliusbd3fce52015-07-30 10:45:1843 }
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 Creusen39392972015-10-08 16:07:4154 // optional - but required if type == AUDIO_PLAYOUT_EVENT
55 optional AudioPlayoutEvent audio_playout_event = 5;
Bjorn Tereliusbd3fce52015-07-30 10:45:1856
tereliuscfdad3c2015-11-05 20:02:1557 // optional - but required if type == BWE_PACKET_LOSS_EVENT
58 optional BwePacketLossEvent bwe_packet_loss_event = 6;
59
Bjorn Tereliusbd3fce52015-07-30 10:45:1860 // optional - but required if type == VIDEO_RECEIVER_CONFIG_EVENT
tereliuscfdad3c2015-11-05 20:02:1561 optional VideoReceiveConfig video_receiver_config = 8;
Bjorn Tereliusbd3fce52015-07-30 10:45:1862
63 // optional - but required if type == VIDEO_SENDER_CONFIG_EVENT
tereliuscfdad3c2015-11-05 20:02:1564 optional VideoSendConfig video_sender_config = 9;
Bjorn Tereliusbd3fce52015-07-30 10:45:1865
66 // optional - but required if type == AUDIO_RECEIVER_CONFIG_EVENT
tereliuscfdad3c2015-11-05 20:02:1567 optional AudioReceiveConfig audio_receiver_config = 10;
Bjorn Tereliusbd3fce52015-07-30 10:45:1868
69 // optional - but required if type == AUDIO_SENDER_CONFIG_EVENT
tereliuscfdad3c2015-11-05 20:02:1570 optional AudioSendConfig audio_sender_config = 11;
Bjorn Tereliusbd3fce52015-07-30 10:45:1871}
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 Creusen39392972015-10-08 16:07:41102message AudioPlayoutEvent {
103 // required - The SSRC of the audio stream associated with the playout event.
Ivo Creusen6ebcb2a2015-09-17 14:30:16104 optional uint32 local_ssrc = 2;
Bjorn Tereliusbd3fce52015-07-30 10:45:18105}
106
tereliuscfdad3c2015-11-05 20:02:15107message 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 Tereliusbd3fce52015-07-30 10:45:18120
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
Bjorn Tereliusbd3fce52015-07-30 10:45:18140 // required - Receiver estimated maximum bandwidth.
tereliuse37a0132015-11-06 17:00:18141 optional bool remb = 4;
Bjorn Tereliusbd3fce52015-07-30 10:45:18142
143 // Map from video RTP payload type -> RTX config.
tereliuse37a0132015-11-06 17:00:18144 repeated RtxMap rtx_map = 5;
Bjorn Tereliusbd3fce52015-07-30 10:45:18145
146 // RTP header extensions used for the received stream.
tereliuse37a0132015-11-06 17:00:18147 repeated RtpHeaderExtension header_extensions = 6;
Bjorn Tereliusbd3fce52015-07-30 10:45:18148
149 // List of decoders associated with the stream.
tereliuse37a0132015-11-06 17:00:18150 repeated DecoderConfig decoders = 7;
Bjorn Tereliusbd3fce52015-07-30 10:45:18151}
152
153
154// Maps decoder names to payload types.
155message DecoderConfig {
156 // required
157 optional string name = 1;
158
159 // required
tereliuscfdad3c2015-11-05 20:02:15160 optional int32 payload_type = 2;
Bjorn Tereliusbd3fce52015-07-30 10:45:18161}
162
163
164// Maps RTP header extension names to numerical IDs.
165message RtpHeaderExtension {
166 // required
167 optional string name = 1;
168
169 // required
tereliuscfdad3c2015-11-05 20:02:15170 optional int32 id = 2;
Bjorn Tereliusbd3fce52015-07-30 10:45:18171}
172
173
174// RTX settings for incoming video payloads that may be received.
175// RTX is disabled if there's no config present.
176message RtxConfig {
177 // required - SSRC to use for the RTX stream.
178 optional uint32 rtx_ssrc = 1;
179
180 // required - Payload type to use for the RTX stream.
tereliuscfdad3c2015-11-05 20:02:15181 optional int32 rtx_payload_type = 2;
Bjorn Tereliusbd3fce52015-07-30 10:45:18182}
183
184
185message RtxMap {
186 // required
tereliuscfdad3c2015-11-05 20:02:15187 optional int32 payload_type = 1;
Bjorn Tereliusbd3fce52015-07-30 10:45:18188
189 // required
190 optional RtxConfig config = 2;
191}
192
193
194message VideoSendConfig {
195 // Synchronization source (stream identifier) for outgoing stream.
196 // One stream can have several ssrcs for e.g. simulcast.
197 // At least one ssrc is required.
198 repeated uint32 ssrcs = 1;
199
200 // RTP header extensions used for the outgoing stream.
201 repeated RtpHeaderExtension header_extensions = 2;
202
203 // List of SSRCs for retransmitted packets.
204 repeated uint32 rtx_ssrcs = 3;
205
206 // required if rtx_ssrcs is used - Payload type for retransmitted packets.
tereliuscfdad3c2015-11-05 20:02:15207 optional int32 rtx_payload_type = 4;
Bjorn Tereliusbd3fce52015-07-30 10:45:18208
Bjorn Tereliusbd3fce52015-07-30 10:45:18209 // required - Encoder associated with the stream.
tereliuse37a0132015-11-06 17:00:18210 optional EncoderConfig encoder = 5;
Bjorn Tereliusbd3fce52015-07-30 10:45:18211}
212
213
214// Maps encoder names to payload types.
215message EncoderConfig {
216 // required
217 optional string name = 1;
218
219 // required
tereliuscfdad3c2015-11-05 20:02:15220 optional int32 payload_type = 2;
Bjorn Tereliusbd3fce52015-07-30 10:45:18221}
222
223
224message AudioReceiveConfig {
Ivo Creusen39392972015-10-08 16:07:41225 // required - Synchronization source (stream identifier) to be received.
226 optional uint32 remote_ssrc = 1;
227
228 // required - Sender SSRC used for sending RTCP (such as receiver reports).
229 optional uint32 local_ssrc = 2;
230
231 // RTP header extensions used for the received audio stream.
232 repeated RtpHeaderExtension header_extensions = 3;
Bjorn Tereliusbd3fce52015-07-30 10:45:18233}
234
235
236message AudioSendConfig {
Ivo Creusen39392972015-10-08 16:07:41237 // required - Synchronization source (stream identifier) for outgoing stream.
238 optional uint32 ssrc = 1;
239
240 // RTP header extensions used for the outgoing audio stream.
241 repeated RtpHeaderExtension header_extensions = 2;
Bjorn Tereliusbd3fce52015-07-30 10:45:18242}