1syntax = "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; 32 LOG_START = 1; 33 LOG_END = 2; 34 RTP_EVENT = 3; 35 RTCP_EVENT = 4; 36 AUDIO_PLAYOUT_EVENT = 5; 37 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; 43 } 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 54 // optional - but required if type == AUDIO_PLAYOUT_EVENT 55 optional AudioPlayoutEvent audio_playout_event = 5; 56 57 // optional - but required if type == BWE_PACKET_LOSS_EVENT 58 optional BwePacketLossEvent bwe_packet_loss_event = 6; 59 60 // optional - but required if type == VIDEO_RECEIVER_CONFIG_EVENT 61 optional VideoReceiveConfig video_receiver_config = 8; 62 63 // optional - but required if type == VIDEO_SENDER_CONFIG_EVENT 64 optional VideoSendConfig video_sender_config = 9; 65 66 // optional - but required if type == AUDIO_RECEIVER_CONFIG_EVENT 67 optional AudioReceiveConfig audio_receiver_config = 10; 68 69 // optional - but required if type == AUDIO_SENDER_CONFIG_EVENT 70 optional AudioSendConfig audio_sender_config = 11; 71} 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 102message AudioPlayoutEvent { 103 // required - The SSRC of the audio stream associated with the playout event. 104 optional uint32 local_ssrc = 2; 105} 106 107message 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} 120 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 140 // required - Receiver estimated maximum bandwidth. 141 optional bool remb = 4; 142 143 // Map from video RTP payload type -> RTX config. 144 repeated RtxMap rtx_map = 5; 145 146 // RTP header extensions used for the received stream. 147 repeated RtpHeaderExtension header_extensions = 6; 148 149 // List of decoders associated with the stream. 150 repeated DecoderConfig decoders = 7; 151} 152 153 154// Maps decoder names to payload types. 155message DecoderConfig { 156 // required 157 optional string name = 1; 158 159 // required 160 optional int32 payload_type = 2; 161} 162 163 164// Maps RTP header extension names to numerical IDs. 165message RtpHeaderExtension { 166 // required 167 optional string name = 1; 168 169 // required 170 optional int32 id = 2; 171} 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. 181 optional int32 rtx_payload_type = 2; 182} 183 184 185message RtxMap { 186 // required 187 optional int32 payload_type = 1; 188 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. 207 optional int32 rtx_payload_type = 4; 208 209 // required - Encoder associated with the stream. 210 optional EncoderConfig encoder = 5; 211} 212 213 214// Maps encoder names to payload types. 215message EncoderConfig { 216 // required 217 optional string name = 1; 218 219 // required 220 optional int32 payload_type = 2; 221} 222 223 224message AudioReceiveConfig { 225 // 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; 233} 234 235 236message AudioSendConfig { 237 // 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; 242} 243