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 | |
| 5 | |
| 6 | enum 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. |
| 18 | message EventStream { |
| 19 | repeated Event stream = 1; |
| 20 | } |
| 21 | |
| 22 | |
| 23 | message 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 Creusen | 301aaed | 2015-10-08 18:07:41 +0200 | [diff] [blame] | 32 | LOG_START = 1; |
| 33 | LOG_END = 2; |
| 34 | RTP_EVENT = 3; |
| 35 | RTCP_EVENT = 4; |
| 36 | AUDIO_PLAYOUT_EVENT = 5; |
| 37 | VIDEO_RECEIVER_CONFIG_EVENT = 6; |
| 38 | VIDEO_SENDER_CONFIG_EVENT = 7; |
| 39 | AUDIO_RECEIVER_CONFIG_EVENT = 8; |
| 40 | AUDIO_SENDER_CONFIG_EVENT = 9; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | // required - Indicates the type of this event |
| 44 | optional EventType type = 2; |
| 45 | |
| 46 | // optional - but required if type == RTP_EVENT |
| 47 | optional RtpPacket rtp_packet = 3; |
| 48 | |
| 49 | // optional - but required if type == RTCP_EVENT |
| 50 | optional RtcpPacket rtcp_packet = 4; |
| 51 | |
Ivo Creusen | 301aaed | 2015-10-08 18:07:41 +0200 | [diff] [blame] | 52 | // optional - but required if type == AUDIO_PLAYOUT_EVENT |
| 53 | optional AudioPlayoutEvent audio_playout_event = 5; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 54 | |
| 55 | // optional - but required if type == VIDEO_RECEIVER_CONFIG_EVENT |
| 56 | optional VideoReceiveConfig video_receiver_config = 6; |
| 57 | |
| 58 | // optional - but required if type == VIDEO_SENDER_CONFIG_EVENT |
| 59 | optional VideoSendConfig video_sender_config = 7; |
| 60 | |
| 61 | // optional - but required if type == AUDIO_RECEIVER_CONFIG_EVENT |
| 62 | optional AudioReceiveConfig audio_receiver_config = 8; |
| 63 | |
| 64 | // optional - but required if type == AUDIO_SENDER_CONFIG_EVENT |
| 65 | optional AudioSendConfig audio_sender_config = 9; |
| 66 | } |
| 67 | |
| 68 | |
| 69 | message RtpPacket { |
| 70 | // required - True if the packet is incoming w.r.t. the user logging the data |
| 71 | optional bool incoming = 1; |
| 72 | |
| 73 | // required |
| 74 | optional MediaType type = 2; |
| 75 | |
| 76 | // required - The size of the packet including both payload and header. |
| 77 | optional uint32 packet_length = 3; |
| 78 | |
| 79 | // required - The RTP header only. |
| 80 | optional bytes header = 4; |
| 81 | |
| 82 | // Do not add code to log user payload data without a privacy review! |
| 83 | } |
| 84 | |
| 85 | |
| 86 | message RtcpPacket { |
| 87 | // required - True if the packet is incoming w.r.t. the user logging the data |
| 88 | optional bool incoming = 1; |
| 89 | |
| 90 | // required |
| 91 | optional MediaType type = 2; |
| 92 | |
| 93 | // required - The whole packet including both payload and header. |
| 94 | optional bytes packet_data = 3; |
| 95 | } |
| 96 | |
Ivo Creusen | 301aaed | 2015-10-08 18:07:41 +0200 | [diff] [blame] | 97 | message AudioPlayoutEvent { |
| 98 | // required - The SSRC of the audio stream associated with the playout event. |
Ivo Creusen | ae856f2 | 2015-09-17 16:30:16 +0200 | [diff] [blame] | 99 | optional uint32 local_ssrc = 2; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 100 | } |
| 101 | |
| 102 | |
| 103 | // TODO(terelius): Video and audio streams could in principle share SSRC, |
| 104 | // so identifying a stream based only on SSRC might not work. |
| 105 | // It might be better to use a combination of SSRC and media type |
| 106 | // or SSRC and port number, but for now we will rely on SSRC only. |
| 107 | message VideoReceiveConfig { |
| 108 | // required - Synchronization source (stream identifier) to be received. |
| 109 | optional uint32 remote_ssrc = 1; |
| 110 | // required - Sender SSRC used for sending RTCP (such as receiver reports). |
| 111 | optional uint32 local_ssrc = 2; |
| 112 | |
| 113 | // Compound mode is described by RFC 4585 and reduced-size |
| 114 | // RTCP mode is described by RFC 5506. |
| 115 | enum RtcpMode { |
| 116 | RTCP_COMPOUND = 1; |
| 117 | RTCP_REDUCEDSIZE = 2; |
| 118 | } |
| 119 | // required - RTCP mode to use. |
| 120 | optional RtcpMode rtcp_mode = 3; |
| 121 | |
| 122 | // required - Extended RTCP settings. |
| 123 | optional bool receiver_reference_time_report = 4; |
| 124 | |
| 125 | // required - Receiver estimated maximum bandwidth. |
| 126 | optional bool remb = 5; |
| 127 | |
| 128 | // Map from video RTP payload type -> RTX config. |
| 129 | repeated RtxMap rtx_map = 6; |
| 130 | |
| 131 | // RTP header extensions used for the received stream. |
| 132 | repeated RtpHeaderExtension header_extensions = 7; |
| 133 | |
| 134 | // List of decoders associated with the stream. |
| 135 | repeated DecoderConfig decoders = 8; |
| 136 | } |
| 137 | |
| 138 | |
| 139 | // Maps decoder names to payload types. |
| 140 | message DecoderConfig { |
| 141 | // required |
| 142 | optional string name = 1; |
| 143 | |
| 144 | // required |
| 145 | optional sint32 payload_type = 2; |
| 146 | } |
| 147 | |
| 148 | |
| 149 | // Maps RTP header extension names to numerical IDs. |
| 150 | message RtpHeaderExtension { |
| 151 | // required |
| 152 | optional string name = 1; |
| 153 | |
| 154 | // required |
| 155 | optional sint32 id = 2; |
| 156 | } |
| 157 | |
| 158 | |
| 159 | // RTX settings for incoming video payloads that may be received. |
| 160 | // RTX is disabled if there's no config present. |
| 161 | message RtxConfig { |
| 162 | // required - SSRC to use for the RTX stream. |
| 163 | optional uint32 rtx_ssrc = 1; |
| 164 | |
| 165 | // required - Payload type to use for the RTX stream. |
| 166 | optional sint32 rtx_payload_type = 2; |
| 167 | } |
| 168 | |
| 169 | |
| 170 | message RtxMap { |
| 171 | // required |
| 172 | optional sint32 payload_type = 1; |
| 173 | |
| 174 | // required |
| 175 | optional RtxConfig config = 2; |
| 176 | } |
| 177 | |
| 178 | |
| 179 | message VideoSendConfig { |
| 180 | // Synchronization source (stream identifier) for outgoing stream. |
| 181 | // One stream can have several ssrcs for e.g. simulcast. |
| 182 | // At least one ssrc is required. |
| 183 | repeated uint32 ssrcs = 1; |
| 184 | |
| 185 | // RTP header extensions used for the outgoing stream. |
| 186 | repeated RtpHeaderExtension header_extensions = 2; |
| 187 | |
| 188 | // List of SSRCs for retransmitted packets. |
| 189 | repeated uint32 rtx_ssrcs = 3; |
| 190 | |
| 191 | // required if rtx_ssrcs is used - Payload type for retransmitted packets. |
| 192 | optional sint32 rtx_payload_type = 4; |
| 193 | |
| 194 | // required - Canonical end-point identifier. |
| 195 | optional string c_name = 5; |
| 196 | |
| 197 | // required - Encoder associated with the stream. |
| 198 | optional EncoderConfig encoder = 6; |
| 199 | } |
| 200 | |
| 201 | |
| 202 | // Maps encoder names to payload types. |
| 203 | message EncoderConfig { |
| 204 | // required |
| 205 | optional string name = 1; |
| 206 | |
| 207 | // required |
| 208 | optional sint32 payload_type = 2; |
| 209 | } |
| 210 | |
| 211 | |
| 212 | message AudioReceiveConfig { |
Ivo Creusen | 301aaed | 2015-10-08 18:07:41 +0200 | [diff] [blame] | 213 | // required - Synchronization source (stream identifier) to be received. |
| 214 | optional uint32 remote_ssrc = 1; |
| 215 | |
| 216 | // required - Sender SSRC used for sending RTCP (such as receiver reports). |
| 217 | optional uint32 local_ssrc = 2; |
| 218 | |
| 219 | // RTP header extensions used for the received audio stream. |
| 220 | repeated RtpHeaderExtension header_extensions = 3; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 221 | } |
| 222 | |
| 223 | |
| 224 | message AudioSendConfig { |
Ivo Creusen | 301aaed | 2015-10-08 18:07:41 +0200 | [diff] [blame] | 225 | // required - Synchronization source (stream identifier) for outgoing stream. |
| 226 | optional uint32 ssrc = 1; |
| 227 | |
| 228 | // RTP header extensions used for the outgoing audio stream. |
| 229 | repeated RtpHeaderExtension header_extensions = 2; |
Bjorn Terelius | 3641185 | 2015-07-30 12:45:18 +0200 | [diff] [blame] | 230 | } |