OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 virtual ~RtcpBandwidthObserver() {} | 244 virtual ~RtcpBandwidthObserver() {} |
245 }; | 245 }; |
246 | 246 |
247 struct PacketInfo { | 247 struct PacketInfo { |
248 PacketInfo(int64_t arrival_time_ms, uint16_t sequence_number) | 248 PacketInfo(int64_t arrival_time_ms, uint16_t sequence_number) |
249 : PacketInfo(-1, | 249 : PacketInfo(-1, |
250 arrival_time_ms, | 250 arrival_time_ms, |
251 -1, | 251 -1, |
252 sequence_number, | 252 sequence_number, |
253 0, | 253 0, |
254 PacedPacketInfo::kNotAProbe) {} | 254 PacedPacketInfo()) {} |
255 | 255 |
256 PacketInfo(int64_t arrival_time_ms, | 256 PacketInfo(int64_t arrival_time_ms, |
257 int64_t send_time_ms, | 257 int64_t send_time_ms, |
258 uint16_t sequence_number, | 258 uint16_t sequence_number, |
259 size_t payload_size, | 259 size_t payload_size, |
260 int probe_cluster_id) | 260 const PacedPacketInfo& pacing_info) |
261 : PacketInfo(-1, | 261 : PacketInfo(-1, |
262 arrival_time_ms, | 262 arrival_time_ms, |
263 send_time_ms, | 263 send_time_ms, |
264 sequence_number, | 264 sequence_number, |
265 payload_size, | 265 payload_size, |
266 probe_cluster_id) {} | 266 pacing_info) {} |
267 | 267 |
268 PacketInfo(int64_t creation_time_ms, | 268 PacketInfo(int64_t creation_time_ms, |
269 int64_t arrival_time_ms, | 269 int64_t arrival_time_ms, |
270 int64_t send_time_ms, | 270 int64_t send_time_ms, |
271 uint16_t sequence_number, | 271 uint16_t sequence_number, |
272 size_t payload_size, | 272 size_t payload_size, |
273 int probe_cluster_id) | 273 const PacedPacketInfo& pacing_info) |
274 : creation_time_ms(creation_time_ms), | 274 : creation_time_ms(creation_time_ms), |
275 arrival_time_ms(arrival_time_ms), | 275 arrival_time_ms(arrival_time_ms), |
276 send_time_ms(send_time_ms), | 276 send_time_ms(send_time_ms), |
277 sequence_number(sequence_number), | 277 sequence_number(sequence_number), |
278 payload_size(payload_size), | 278 payload_size(payload_size), |
279 probe_cluster_id(probe_cluster_id) {} | 279 pacing_info(pacing_info) {} |
| 280 |
| 281 static constexpr int kNotAProbe = -1; |
| 282 |
| 283 // NOTE! The variable |creation_time_ms| is not used when testing equality. |
| 284 // This is due to |creation_time_ms| only being used by SendTimeHistory |
| 285 // for book-keeping, and is of no interest outside that class. |
| 286 // TODO(philipel): Remove |creation_time_ms| from PacketInfo when cleaning up |
| 287 // SendTimeHistory. |
| 288 bool operator==(const PacketInfo& rhs) const { |
| 289 return arrival_time_ms == rhs.arrival_time_ms && |
| 290 send_time_ms == rhs.send_time_ms && |
| 291 sequence_number == rhs.sequence_number && |
| 292 payload_size == rhs.payload_size && pacing_info == rhs.pacing_info; |
| 293 } |
280 | 294 |
281 // Time corresponding to when this object was created. | 295 // Time corresponding to when this object was created. |
282 int64_t creation_time_ms; | 296 int64_t creation_time_ms; |
283 // Time corresponding to when the packet was received. Timestamped with the | 297 // Time corresponding to when the packet was received. Timestamped with the |
284 // receiver's clock. | 298 // receiver's clock. |
285 int64_t arrival_time_ms; | 299 int64_t arrival_time_ms; |
286 // Time corresponding to when the packet was sent, timestamped with the | 300 // Time corresponding to when the packet was sent, timestamped with the |
287 // sender's clock. | 301 // sender's clock. |
288 int64_t send_time_ms; | 302 int64_t send_time_ms; |
289 // Packet identifier, incremented with 1 for every packet generated by the | 303 // Packet identifier, incremented with 1 for every packet generated by the |
290 // sender. | 304 // sender. |
291 uint16_t sequence_number; | 305 uint16_t sequence_number; |
292 // Size of the packet excluding RTP headers. | 306 // Size of the packet excluding RTP headers. |
293 size_t payload_size; | 307 size_t payload_size; |
294 // Which probing cluster this packets belongs to. | 308 // Pacing information about this packet. |
295 // TODO(philipel): replace this with pacing information when it is available. | 309 PacedPacketInfo pacing_info; |
296 int probe_cluster_id; | |
297 }; | 310 }; |
298 | 311 |
299 class TransportFeedbackObserver { | 312 class TransportFeedbackObserver { |
300 public: | 313 public: |
301 TransportFeedbackObserver() {} | 314 TransportFeedbackObserver() {} |
302 virtual ~TransportFeedbackObserver() {} | 315 virtual ~TransportFeedbackObserver() {} |
303 | 316 |
304 // Note: Transport-wide sequence number as sequence number. Arrival time | 317 // Note: Transport-wide sequence number as sequence number. |
305 // must be set to 0. | |
306 virtual void AddPacket(uint16_t sequence_number, | 318 virtual void AddPacket(uint16_t sequence_number, |
307 size_t length, | 319 size_t length, |
308 int probe_cluster_id) = 0; | 320 const PacedPacketInfo& pacing_info) = 0; |
309 | 321 |
310 virtual void OnTransportFeedback(const rtcp::TransportFeedback& feedback) = 0; | 322 virtual void OnTransportFeedback(const rtcp::TransportFeedback& feedback) = 0; |
311 | 323 |
312 virtual std::vector<PacketInfo> GetTransportFeedbackVector() const = 0; | 324 virtual std::vector<PacketInfo> GetTransportFeedbackVector() const = 0; |
313 }; | 325 }; |
314 | 326 |
315 class RtcpRttStats { | 327 class RtcpRttStats { |
316 public: | 328 public: |
317 virtual void OnRttUpdate(int64_t rtt) = 0; | 329 virtual void OnRttUpdate(int64_t rtt) = 0; |
318 | 330 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 class TransportSequenceNumberAllocator { | 405 class TransportSequenceNumberAllocator { |
394 public: | 406 public: |
395 TransportSequenceNumberAllocator() {} | 407 TransportSequenceNumberAllocator() {} |
396 virtual ~TransportSequenceNumberAllocator() {} | 408 virtual ~TransportSequenceNumberAllocator() {} |
397 | 409 |
398 virtual uint16_t AllocateSequenceNumber() = 0; | 410 virtual uint16_t AllocateSequenceNumber() = 0; |
399 }; | 411 }; |
400 | 412 |
401 } // namespace webrtc | 413 } // namespace webrtc |
402 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_RTCP_DEFINES_H_ | 414 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_RTCP_DEFINES_H_ |
OLD | NEW |