Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 1 | syntax = "proto2"; |
| 2 | option optimize_for = LITE_RUNTIME; |
| 3 | package webrtc.rtclog; |
| 4 | |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 5 | enum MediaType { |
| 6 | ANY = 0; |
| 7 | AUDIO = 1; |
| 8 | VIDEO = 2; |
| 9 | DATA = 3; |
| 10 | } |
| 11 | |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 12 | // 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. |
| 16 | message EventStream { |
| 17 | repeated Event stream = 1; |
| 18 | } |
| 19 | |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 20 | message 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 Creusen | 301aaed | 2015-10-08 18:07:41 +0200 | [diff] [blame] | 29 | LOG_START = 1; |
| 30 | LOG_END = 2; |
| 31 | RTP_EVENT = 3; |
| 32 | RTCP_EVENT = 4; |
| 33 | AUDIO_PLAYOUT_EVENT = 5; |
terelius | 424e6cf | 2017-02-20 05:14:41 -0800 | [diff] [blame] | 34 | LOSS_BASED_BWE_UPDATE = 6; |
| 35 | DELAY_BASED_BWE_UPDATE = 7; |
terelius | 006d93d | 2015-11-05 12:02:15 -0800 | [diff] [blame] | 36 | VIDEO_RECEIVER_CONFIG_EVENT = 8; |
| 37 | VIDEO_SENDER_CONFIG_EVENT = 9; |
| 38 | AUDIO_RECEIVER_CONFIG_EVENT = 10; |
| 39 | AUDIO_SENDER_CONFIG_EVENT = 11; |
minyue | 4b7c952 | 2017-01-24 04:54:59 -0800 | [diff] [blame] | 40 | AUDIO_NETWORK_ADAPTATION_EVENT = 16; |
philipel | 32d0010 | 2017-02-27 02:18:46 -0800 | [diff] [blame] | 41 | BWE_PROBE_CLUSTER_CREATED_EVENT = 17; |
| 42 | BWE_PROBE_RESULT_EVENT = 18; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 43 | } |
| 44 | |
| 45 | // required - Indicates the type of this event |
| 46 | optional EventType type = 2; |
| 47 | |
terelius | 8b2b9ef | 2017-05-31 05:45:56 -0700 | [diff] [blame] | 48 | oneof subtype { |
| 49 | // required if type == RTP_EVENT |
| 50 | RtpPacket rtp_packet = 3; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 51 | |
terelius | 8b2b9ef | 2017-05-31 05:45:56 -0700 | [diff] [blame] | 52 | // required if type == RTCP_EVENT |
| 53 | RtcpPacket rtcp_packet = 4; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 54 | |
terelius | 8b2b9ef | 2017-05-31 05:45:56 -0700 | [diff] [blame] | 55 | // required if type == AUDIO_PLAYOUT_EVENT |
| 56 | AudioPlayoutEvent audio_playout_event = 5; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 57 | |
terelius | 8b2b9ef | 2017-05-31 05:45:56 -0700 | [diff] [blame] | 58 | // required if type == LOSS_BASED_BWE_UPDATE |
| 59 | LossBasedBweUpdate loss_based_bwe_update = 6; |
terelius | 006d93d | 2015-11-05 12:02:15 -0800 | [diff] [blame] | 60 | |
terelius | 8b2b9ef | 2017-05-31 05:45:56 -0700 | [diff] [blame] | 61 | // required if type == DELAY_BASED_BWE_UPDATE |
| 62 | DelayBasedBweUpdate delay_based_bwe_update = 7; |
terelius | 0baf55d | 2017-02-17 03:38:28 -0800 | [diff] [blame] | 63 | |
terelius | 8b2b9ef | 2017-05-31 05:45:56 -0700 | [diff] [blame] | 64 | // required if type == VIDEO_RECEIVER_CONFIG_EVENT |
| 65 | VideoReceiveConfig video_receiver_config = 8; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 66 | |
terelius | 8b2b9ef | 2017-05-31 05:45:56 -0700 | [diff] [blame] | 67 | // required if type == VIDEO_SENDER_CONFIG_EVENT |
| 68 | VideoSendConfig video_sender_config = 9; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 69 | |
terelius | 8b2b9ef | 2017-05-31 05:45:56 -0700 | [diff] [blame] | 70 | // required if type == AUDIO_RECEIVER_CONFIG_EVENT |
| 71 | AudioReceiveConfig audio_receiver_config = 10; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 72 | |
terelius | 8b2b9ef | 2017-05-31 05:45:56 -0700 | [diff] [blame] | 73 | // required if type == AUDIO_SENDER_CONFIG_EVENT |
| 74 | AudioSendConfig audio_sender_config = 11; |
minyue | 4b7c952 | 2017-01-24 04:54:59 -0800 | [diff] [blame] | 75 | |
terelius | 8b2b9ef | 2017-05-31 05:45:56 -0700 | [diff] [blame] | 76 | // required if type == AUDIO_NETWORK_ADAPTATION_EVENT |
| 77 | AudioNetworkAdaptation audio_network_adaptation = 16; |
philipel | 32d0010 | 2017-02-27 02:18:46 -0800 | [diff] [blame] | 78 | |
terelius | 8b2b9ef | 2017-05-31 05:45:56 -0700 | [diff] [blame] | 79 | // required if type == BWE_PROBE_CLUSTER_CREATED_EVENT |
| 80 | BweProbeCluster probe_cluster = 17; |
philipel | 32d0010 | 2017-02-27 02:18:46 -0800 | [diff] [blame] | 81 | |
terelius | 8b2b9ef | 2017-05-31 05:45:56 -0700 | [diff] [blame] | 82 | // required if type == BWE_PROBE_RESULT_EVENT |
| 83 | BweProbeResult probe_result = 18; |
| 84 | } |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 85 | } |
| 86 | |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 87 | message RtpPacket { |
| 88 | // required - True if the packet is incoming w.r.t. the user logging the data |
| 89 | optional bool incoming = 1; |
| 90 | |
perkj | 77cd58e | 2017-05-30 03:52:10 -0700 | [diff] [blame] | 91 | optional MediaType type = 2 [deprecated = true]; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 92 | |
| 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 | |
philipel | 32d0010 | 2017-02-27 02:18:46 -0800 | [diff] [blame] | 99 | // optional - The probe cluster id. |
| 100 | optional uint32 probe_cluster_id = 5; |
| 101 | |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 102 | // Do not add code to log user payload data without a privacy review! |
| 103 | } |
| 104 | |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 105 | message RtcpPacket { |
| 106 | // required - True if the packet is incoming w.r.t. the user logging the data |
| 107 | optional bool incoming = 1; |
| 108 | |
perkj | 77cd58e | 2017-05-30 03:52:10 -0700 | [diff] [blame] | 109 | optional MediaType type = 2 [deprecated = true]; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 110 | |
| 111 | // required - The whole packet including both payload and header. |
| 112 | optional bytes packet_data = 3; |
| 113 | } |
| 114 | |
Ivo Creusen | 301aaed | 2015-10-08 18:07:41 +0200 | [diff] [blame] | 115 | message AudioPlayoutEvent { |
nisse | 7d59f6b | 2017-02-21 03:40:24 -0800 | [diff] [blame] | 116 | // 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 Creusen | 301aaed | 2015-10-08 18:07:41 +0200 | [diff] [blame] | 118 | // required - The SSRC of the audio stream associated with the playout event. |
Ivo Creusen | ae856f2 | 2015-09-17 16:30:16 +0200 | [diff] [blame] | 119 | optional uint32 local_ssrc = 2; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 120 | } |
| 121 | |
terelius | 424e6cf | 2017-02-20 05:14:41 -0800 | [diff] [blame] | 122 | message LossBasedBweUpdate { |
terelius | 006d93d | 2015-11-05 12:02:15 -0800 | [diff] [blame] | 123 | // required - Bandwidth estimate (in bps) after the update. |
terelius | 424e6cf | 2017-02-20 05:14:41 -0800 | [diff] [blame] | 124 | optional int32 bitrate_bps = 1; |
terelius | 006d93d | 2015-11-05 12:02:15 -0800 | [diff] [blame] | 125 | |
| 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 Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 135 | |
terelius | 424e6cf | 2017-02-20 05:14:41 -0800 | [diff] [blame] | 136 | message DelayBasedBweUpdate { |
terelius | 0baf55d | 2017-02-17 03:38:28 -0800 | [diff] [blame] | 137 | 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. |
terelius | 424e6cf | 2017-02-20 05:14:41 -0800 | [diff] [blame] | 144 | optional int32 bitrate_bps = 1; |
terelius | 0baf55d | 2017-02-17 03:38:28 -0800 | [diff] [blame] | 145 | |
| 146 | // required - The state of the overuse detector. |
| 147 | optional DetectorState detector_state = 2; |
| 148 | } |
| 149 | |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 150 | // 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. |
| 154 | message 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 Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 169 | // required - Receiver estimated maximum bandwidth. |
terelius | d66daa2 | 2015-11-06 09:00:18 -0800 | [diff] [blame] | 170 | optional bool remb = 4; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 171 | |
| 172 | // Map from video RTP payload type -> RTX config. |
terelius | d66daa2 | 2015-11-06 09:00:18 -0800 | [diff] [blame] | 173 | repeated RtxMap rtx_map = 5; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 174 | |
| 175 | // RTP header extensions used for the received stream. |
terelius | d66daa2 | 2015-11-06 09:00:18 -0800 | [diff] [blame] | 176 | repeated RtpHeaderExtension header_extensions = 6; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 177 | |
| 178 | // List of decoders associated with the stream. |
terelius | d66daa2 | 2015-11-06 09:00:18 -0800 | [diff] [blame] | 179 | repeated DecoderConfig decoders = 7; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 180 | } |
| 181 | |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 182 | // Maps decoder names to payload types. |
| 183 | message DecoderConfig { |
| 184 | // required |
| 185 | optional string name = 1; |
| 186 | |
| 187 | // required |
terelius | 006d93d | 2015-11-05 12:02:15 -0800 | [diff] [blame] | 188 | optional int32 payload_type = 2; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 189 | } |
| 190 | |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 191 | // Maps RTP header extension names to numerical IDs. |
| 192 | message RtpHeaderExtension { |
| 193 | // required |
| 194 | optional string name = 1; |
| 195 | |
| 196 | // required |
terelius | 006d93d | 2015-11-05 12:02:15 -0800 | [diff] [blame] | 197 | optional int32 id = 2; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 198 | } |
| 199 | |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 200 | // RTX settings for incoming video payloads that may be received. |
| 201 | // RTX is disabled if there's no config present. |
| 202 | message 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. |
terelius | 006d93d | 2015-11-05 12:02:15 -0800 | [diff] [blame] | 207 | optional int32 rtx_payload_type = 2; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 208 | } |
| 209 | |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 210 | message RtxMap { |
| 211 | // required |
terelius | 006d93d | 2015-11-05 12:02:15 -0800 | [diff] [blame] | 212 | optional int32 payload_type = 1; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 213 | |
| 214 | // required |
| 215 | optional RtxConfig config = 2; |
| 216 | } |
| 217 | |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 218 | message 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. |
terelius | 006d93d | 2015-11-05 12:02:15 -0800 | [diff] [blame] | 231 | optional int32 rtx_payload_type = 4; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 232 | |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 233 | // required - Encoder associated with the stream. |
terelius | d66daa2 | 2015-11-06 09:00:18 -0800 | [diff] [blame] | 234 | optional EncoderConfig encoder = 5; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 235 | } |
| 236 | |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 237 | // Maps encoder names to payload types. |
| 238 | message EncoderConfig { |
| 239 | // required |
| 240 | optional string name = 1; |
| 241 | |
| 242 | // required |
terelius | 006d93d | 2015-11-05 12:02:15 -0800 | [diff] [blame] | 243 | optional int32 payload_type = 2; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 244 | } |
| 245 | |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 246 | message AudioReceiveConfig { |
Ivo Creusen | 301aaed | 2015-10-08 18:07:41 +0200 | [diff] [blame] | 247 | // 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 Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 255 | } |
| 256 | |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 257 | message AudioSendConfig { |
Ivo Creusen | 301aaed | 2015-10-08 18:07:41 +0200 | [diff] [blame] | 258 | // 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 Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 263 | } |
minyue | 4b7c952 | 2017-01-24 04:54:59 -0800 | [diff] [blame] | 264 | |
| 265 | message 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; |
terelius | 0baf55d | 2017-02-17 03:38:28 -0800 | [diff] [blame] | 284 | } |
philipel | 32d0010 | 2017-02-27 02:18:46 -0800 | [diff] [blame] | 285 | |
| 286 | message 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 | |
| 300 | message 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 | } |