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