1syntax = "proto2"; 2option optimize_for = LITE_RUNTIME; 3package webrtc.rtclog; 4 5enum MediaType { 6 ANY = 0; 7 AUDIO = 1; 8 VIDEO = 2; 9 DATA = 3; 10} 11 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. 16message EventStream { 17 repeated Event stream = 1; 18} 19 20message 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; 29 LOG_START = 1; 30 LOG_END = 2; 31 RTP_EVENT = 3; 32 RTCP_EVENT = 4; 33 AUDIO_PLAYOUT_EVENT = 5; 34 LOSS_BASED_BWE_UPDATE = 6; 35 DELAY_BASED_BWE_UPDATE = 7; 36 VIDEO_RECEIVER_CONFIG_EVENT = 8; 37 VIDEO_SENDER_CONFIG_EVENT = 9; 38 AUDIO_RECEIVER_CONFIG_EVENT = 10; 39 AUDIO_SENDER_CONFIG_EVENT = 11; 40 AUDIO_NETWORK_ADAPTATION_EVENT = 16; 41 BWE_PROBE_CLUSTER_CREATED_EVENT = 17; 42 BWE_PROBE_RESULT_EVENT = 18; 43 ALR_STATE_EVENT = 19; 44 ICE_CANDIDATE_PAIR_CONFIG = 20; 45 ICE_CANDIDATE_PAIR_EVENT = 21; 46 } 47 48 // required - Indicates the type of this event 49 optional EventType type = 2; 50 51 oneof subtype { 52 // required if type == RTP_EVENT 53 RtpPacket rtp_packet = 3; 54 55 // required if type == RTCP_EVENT 56 RtcpPacket rtcp_packet = 4; 57 58 // required if type == AUDIO_PLAYOUT_EVENT 59 AudioPlayoutEvent audio_playout_event = 5; 60 61 // required if type == LOSS_BASED_BWE_UPDATE 62 LossBasedBweUpdate loss_based_bwe_update = 6; 63 64 // required if type == DELAY_BASED_BWE_UPDATE 65 DelayBasedBweUpdate delay_based_bwe_update = 7; 66 67 // required if type == VIDEO_RECEIVER_CONFIG_EVENT 68 VideoReceiveConfig video_receiver_config = 8; 69 70 // required if type == VIDEO_SENDER_CONFIG_EVENT 71 VideoSendConfig video_sender_config = 9; 72 73 // required if type == AUDIO_RECEIVER_CONFIG_EVENT 74 AudioReceiveConfig audio_receiver_config = 10; 75 76 // required if type == AUDIO_SENDER_CONFIG_EVENT 77 AudioSendConfig audio_sender_config = 11; 78 79 // required if type == AUDIO_NETWORK_ADAPTATION_EVENT 80 AudioNetworkAdaptation audio_network_adaptation = 16; 81 82 // required if type == BWE_PROBE_CLUSTER_CREATED_EVENT 83 BweProbeCluster probe_cluster = 17; 84 85 // required if type == BWE_PROBE_RESULT_EVENT 86 BweProbeResult probe_result = 18; 87 88 // required if type == ALR_STATE_EVENT 89 AlrState alr_state = 19; 90 91 // required if type == ICE_CANDIDATE_PAIR_CONFIG 92 IceCandidatePairConfig ice_candidate_pair_config = 20; 93 94 // required if type == ICE_CANDIDATE_PAIR_EVENT 95 IceCandidatePairEvent ice_candidate_pair_event = 21; 96 } 97} 98 99message RtpPacket { 100 // required - True if the packet is incoming w.r.t. the user logging the data 101 optional bool incoming = 1; 102 103 optional MediaType type = 2 [deprecated = true]; 104 105 // required - The size of the packet including both payload and header. 106 optional uint32 packet_length = 3; 107 108 // required - The RTP header only. 109 optional bytes header = 4; 110 111 // optional - The probe cluster id. 112 optional int32 probe_cluster_id = 5; 113 114 // Do not add code to log user payload data without a privacy review! 115} 116 117message RtcpPacket { 118 // required - True if the packet is incoming w.r.t. the user logging the data 119 optional bool incoming = 1; 120 121 optional MediaType type = 2 [deprecated = true]; 122 123 // required - The whole packet including both payload and header. 124 optional bytes packet_data = 3; 125} 126 127message AudioPlayoutEvent { 128 // TODO(ivoc): Rename, we currently use the "remote" ssrc, i.e. identifying 129 // the receive stream, while local_ssrc identifies the send stream, if any. 130 // required - The SSRC of the audio stream associated with the playout event. 131 optional uint32 local_ssrc = 2; 132} 133 134message LossBasedBweUpdate { 135 // required - Bandwidth estimate (in bps) after the update. 136 optional int32 bitrate_bps = 1; 137 138 // required - Fraction of lost packets since last receiver report 139 // computed as floor( 256 * (#lost_packets / #total_packets) ). 140 // The possible values range from 0 to 255. 141 optional uint32 fraction_loss = 2; 142 143 // TODO(terelius): Is this really needed? Remove or make optional? 144 // required - Total number of packets that the BWE update is based on. 145 optional int32 total_packets = 3; 146} 147 148message DelayBasedBweUpdate { 149 enum DetectorState { 150 BWE_NORMAL = 0; 151 BWE_UNDERUSING = 1; 152 BWE_OVERUSING = 2; 153 } 154 155 // required - Bandwidth estimate (in bps) after the update. 156 optional int32 bitrate_bps = 1; 157 158 // required - The state of the overuse detector. 159 optional DetectorState detector_state = 2; 160} 161 162// TODO(terelius): Video and audio streams could in principle share SSRC, 163// so identifying a stream based only on SSRC might not work. 164// It might be better to use a combination of SSRC and media type 165// or SSRC and port number, but for now we will rely on SSRC only. 166message VideoReceiveConfig { 167 // required - Synchronization source (stream identifier) to be received. 168 optional uint32 remote_ssrc = 1; 169 // required - Sender SSRC used for sending RTCP (such as receiver reports). 170 optional uint32 local_ssrc = 2; 171 172 // Compound mode is described by RFC 4585 and reduced-size 173 // RTCP mode is described by RFC 5506. 174 enum RtcpMode { 175 RTCP_COMPOUND = 1; 176 RTCP_REDUCEDSIZE = 2; 177 } 178 // required - RTCP mode to use. 179 optional RtcpMode rtcp_mode = 3; 180 181 // required - Receiver estimated maximum bandwidth. 182 optional bool remb = 4; 183 184 // Map from video RTP payload type -> RTX config. 185 repeated RtxMap rtx_map = 5; 186 187 // RTP header extensions used for the received stream. 188 repeated RtpHeaderExtension header_extensions = 6; 189 190 // List of decoders associated with the stream. 191 repeated DecoderConfig decoders = 7; 192} 193 194// Maps decoder names to payload types. 195message DecoderConfig { 196 // required 197 optional string name = 1; 198 199 // required 200 optional int32 payload_type = 2; 201} 202 203// Maps RTP header extension names to numerical IDs. 204message RtpHeaderExtension { 205 // required 206 optional string name = 1; 207 208 // required 209 optional int32 id = 2; 210} 211 212// RTX settings for incoming video payloads that may be received. 213// RTX is disabled if there's no config present. 214message RtxConfig { 215 // required - SSRC to use for the RTX stream. 216 optional uint32 rtx_ssrc = 1; 217 218 // required - Payload type to use for the RTX stream. 219 optional int32 rtx_payload_type = 2; 220} 221 222message RtxMap { 223 // required 224 optional int32 payload_type = 1; 225 226 // required 227 optional RtxConfig config = 2; 228} 229 230message VideoSendConfig { 231 // Synchronization source (stream identifier) for outgoing stream. 232 // One stream can have several ssrcs for e.g. simulcast. 233 // At least one ssrc is required. 234 repeated uint32 ssrcs = 1; 235 236 // RTP header extensions used for the outgoing stream. 237 repeated RtpHeaderExtension header_extensions = 2; 238 239 // List of SSRCs for retransmitted packets. 240 repeated uint32 rtx_ssrcs = 3; 241 242 // required if rtx_ssrcs is used - Payload type for retransmitted packets. 243 optional int32 rtx_payload_type = 4; 244 245 // required - Encoder associated with the stream. 246 optional EncoderConfig encoder = 5; 247} 248 249// Maps encoder names to payload types. 250message EncoderConfig { 251 // required 252 optional string name = 1; 253 254 // required 255 optional int32 payload_type = 2; 256} 257 258message AudioReceiveConfig { 259 // required - Synchronization source (stream identifier) to be received. 260 optional uint32 remote_ssrc = 1; 261 262 // required - Sender SSRC used for sending RTCP (such as receiver reports). 263 optional uint32 local_ssrc = 2; 264 265 // RTP header extensions used for the received audio stream. 266 repeated RtpHeaderExtension header_extensions = 3; 267} 268 269message AudioSendConfig { 270 // required - Synchronization source (stream identifier) for outgoing stream. 271 optional uint32 ssrc = 1; 272 273 // RTP header extensions used for the outgoing audio stream. 274 repeated RtpHeaderExtension header_extensions = 2; 275} 276 277message AudioNetworkAdaptation { 278 // Bit rate that the audio encoder is operating at. 279 optional int32 bitrate_bps = 1; 280 281 // Frame length that each encoded audio packet consists of. 282 optional int32 frame_length_ms = 2; 283 284 // Packet loss fraction that the encoder's forward error correction (FEC) is 285 // optimized for. 286 optional float uplink_packet_loss_fraction = 3; 287 288 // Whether forward error correction (FEC) is turned on or off. 289 optional bool enable_fec = 4; 290 291 // Whether discontinuous transmission (DTX) is turned on or off. 292 optional bool enable_dtx = 5; 293 294 // Number of audio channels that each encoded packet consists of. 295 optional uint32 num_channels = 6; 296} 297 298message BweProbeCluster { 299 // required - The id of this probe cluster. 300 optional int32 id = 1; 301 302 // required - The bitrate in bps that this probe cluster is meant to probe. 303 optional int32 bitrate_bps = 2; 304 305 // required - The minimum number of packets used to probe the given bitrate. 306 optional uint32 min_packets = 3; 307 308 // required - The minimum number of bytes used to probe the given bitrate. 309 optional uint32 min_bytes = 4; 310} 311 312message BweProbeResult { 313 // required - The id of this probe cluster. 314 optional int32 id = 1; 315 316 enum ResultType { 317 SUCCESS = 0; 318 INVALID_SEND_RECEIVE_INTERVAL = 1; 319 INVALID_SEND_RECEIVE_RATIO = 2; 320 TIMEOUT = 3; 321 } 322 323 // required - The result of this probing attempt. 324 optional ResultType result = 2; 325 326 // optional - but required if result == SUCCESS. The resulting bitrate in bps. 327 optional int32 bitrate_bps = 3; 328} 329 330message AlrState { 331 // required - If we are in ALR or not. 332 optional bool in_alr = 1; 333} 334 335message IceCandidatePairConfig { 336 enum IceCandidatePairConfigType { 337 ADDED = 0; 338 UPDATED = 1; 339 DESTROYED = 2; 340 SELECTED = 3; 341 } 342 343 enum IceCandidateType { 344 LOCAL = 0; 345 STUN = 1; 346 PRFLX = 2; 347 RELAY = 3; 348 UNKNOWN_CANDIDATE_TYPE = 4; 349 } 350 351 enum Protocol { 352 UDP = 0; 353 TCP = 1; 354 SSLTCP = 2; 355 TLS = 3; 356 UNKNOWN_PROTOCOL = 4; 357 } 358 359 enum AddressFamily { 360 IPV4 = 0; 361 IPV6 = 1; 362 UNKNOWN_ADDRESS_FAMILY = 2; 363 } 364 365 enum NetworkType { 366 ETHERNET = 0; 367 LOOPBACK = 1; 368 WIFI = 2; 369 VPN = 3; 370 CELLULAR = 4; 371 UNKNOWN_NETWORK_TYPE = 5; 372 } 373 374 // required 375 optional IceCandidatePairConfigType config_type = 1; 376 377 // required 378 optional uint32 candidate_pair_id = 2; 379 380 // required 381 optional IceCandidateType local_candidate_type = 3; 382 383 // required 384 optional Protocol local_relay_protocol = 4; 385 386 // required 387 optional NetworkType local_network_type = 5; 388 389 // required 390 optional AddressFamily local_address_family = 6; 391 392 // required 393 optional IceCandidateType remote_candidate_type = 7; 394 395 // required 396 optional AddressFamily remote_address_family = 8; 397 398 // required 399 optional Protocol candidate_pair_protocol = 9; 400} 401 402message IceCandidatePairEvent { 403 enum IceCandidatePairEventType { 404 CHECK_SENT = 0; 405 CHECK_RECEIVED = 1; 406 CHECK_RESPONSE_SENT = 2; 407 CHECK_RESPONSE_RECEIVED = 3; 408 } 409 410 // required 411 optional IceCandidatePairEventType event_type = 1; 412 413 // required 414 optional uint32 candidate_pair_id = 2; 415} 416