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