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 |
11 #ifndef WEBRTC_MODULES_RTP_RTCP_INTERFACE_RTP_RTCP_DEFINES_H_ | 11 #ifndef WEBRTC_MODULES_RTP_RTCP_INTERFACE_RTP_RTCP_DEFINES_H_ |
12 #define WEBRTC_MODULES_RTP_RTCP_INTERFACE_RTP_RTCP_DEFINES_H_ | 12 #define WEBRTC_MODULES_RTP_RTCP_INTERFACE_RTP_RTCP_DEFINES_H_ |
13 | 13 |
14 #include <stddef.h> | 14 #include <stddef.h> |
15 #include <list> | 15 #include <list> |
16 | 16 |
17 #include "webrtc/modules/interface/module_common_types.h" | 17 #include "webrtc/modules/interface/module_common_types.h" |
18 #include "webrtc/system_wrappers/interface/clock.h" | 18 #include "webrtc/system_wrappers/interface/clock.h" |
19 #include "webrtc/typedefs.h" | 19 #include "webrtc/typedefs.h" |
20 | 20 |
21 #define RTCP_CNAME_SIZE 256 // RFC 3550 page 44, including null termination | 21 #define RTCP_CNAME_SIZE 256 // RFC 3550 page 44, including null termination |
22 #define IP_PACKET_SIZE 1500 // we assume ethernet | 22 #define IP_PACKET_SIZE 1500 // we assume ethernet |
23 #define MAX_NUMBER_OF_PARALLEL_TELEPHONE_EVENTS 10 | 23 #define MAX_NUMBER_OF_PARALLEL_TELEPHONE_EVENTS 10 |
24 #define TIMEOUT_SEI_MESSAGES_MS 30000 // in milliseconds | 24 #define TIMEOUT_SEI_MESSAGES_MS 30000 // in milliseconds |
25 | 25 |
26 namespace webrtc { | 26 namespace webrtc { |
| 27 namespace rtcp { |
| 28 class TransportFeedback; |
| 29 } |
27 | 30 |
28 const int kVideoPayloadTypeFrequency = 90000; | 31 const int kVideoPayloadTypeFrequency = 90000; |
29 | 32 |
30 // Minimum RTP header size in bytes. | 33 // Minimum RTP header size in bytes. |
31 const uint8_t kRtpHeaderSize = 12; | 34 const uint8_t kRtpHeaderSize = 12; |
32 | 35 |
33 struct AudioPayload | 36 struct AudioPayload |
34 { | 37 { |
35 uint32_t frequency; | 38 uint32_t frequency; |
36 uint8_t channels; | 39 uint8_t channels; |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 virtual void OnReceivedEstimatedBitrate(uint32_t bitrate) = 0; | 289 virtual void OnReceivedEstimatedBitrate(uint32_t bitrate) = 0; |
287 | 290 |
288 virtual void OnReceivedRtcpReceiverReport( | 291 virtual void OnReceivedRtcpReceiverReport( |
289 const ReportBlockList& report_blocks, | 292 const ReportBlockList& report_blocks, |
290 int64_t rtt, | 293 int64_t rtt, |
291 int64_t now_ms) = 0; | 294 int64_t now_ms) = 0; |
292 | 295 |
293 virtual ~RtcpBandwidthObserver() {} | 296 virtual ~RtcpBandwidthObserver() {} |
294 }; | 297 }; |
295 | 298 |
296 class SendTimeObserver { | 299 struct PacketInfo { |
| 300 PacketInfo(int64_t arrival_time_ms, |
| 301 int64_t send_time_ms, |
| 302 uint16_t sequence_number, |
| 303 size_t payload_size, |
| 304 bool was_paced) |
| 305 : arrival_time_ms(arrival_time_ms), |
| 306 send_time_ms(send_time_ms), |
| 307 sequence_number(sequence_number), |
| 308 payload_size(payload_size), |
| 309 was_paced(was_paced) {} |
| 310 // Time corresponding to when the packet was received. Timestamped with the |
| 311 // receiver's clock. |
| 312 int64_t arrival_time_ms; |
| 313 // Time corresponding to when the packet was sent, timestamped with the |
| 314 // sender's clock. |
| 315 int64_t send_time_ms; |
| 316 // Packet identifier, incremented with 1 for every packet generated by the |
| 317 // sender. |
| 318 uint16_t sequence_number; |
| 319 // Size of the packet excluding RTP headers. |
| 320 size_t payload_size; |
| 321 // True if the packet was paced out by the pacer. |
| 322 bool was_paced; |
| 323 }; |
| 324 |
| 325 class TransportFeedbackObserver { |
297 public: | 326 public: |
298 SendTimeObserver() {} | 327 TransportFeedbackObserver() {} |
299 virtual ~SendTimeObserver() {} | 328 virtual ~TransportFeedbackObserver() {} |
300 | 329 |
301 // Transport-wide sequence number and timestamp (system time in milliseconds), | 330 // Note: Transport-wide sequence number as sequence number. Arrival time |
302 // of when the packet was put on the wire. | 331 // must be set to 0. |
303 virtual void OnPacketSent(uint16_t transport_sequence_number, | 332 virtual void OnPacketSent(const PacketInfo& info) = 0; |
304 int64_t send_time) = 0; | 333 |
| 334 virtual void OnTransportFeedback(const rtcp::TransportFeedback& feedback) = 0; |
305 }; | 335 }; |
306 | 336 |
307 class RtcpRttStats { | 337 class RtcpRttStats { |
308 public: | 338 public: |
309 virtual void OnRttUpdate(int64_t rtt) = 0; | 339 virtual void OnRttUpdate(int64_t rtt) = 0; |
310 | 340 |
311 virtual int64_t LastProcessedRtt() const = 0; | 341 virtual int64_t LastProcessedRtt() const = 0; |
312 | 342 |
313 virtual ~RtcpRttStats() {}; | 343 virtual ~RtcpRttStats() {}; |
314 }; | 344 }; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 uint64_t single_packet_loss_count; | 399 uint64_t single_packet_loss_count; |
370 // The number of events in which more than one adjacent packet was lost. | 400 // The number of events in which more than one adjacent packet was lost. |
371 uint64_t multiple_packet_loss_event_count; | 401 uint64_t multiple_packet_loss_event_count; |
372 // The number of packets lost in events where more than one adjacent packet | 402 // The number of packets lost in events where more than one adjacent packet |
373 // was lost. | 403 // was lost. |
374 uint64_t multiple_packet_loss_packet_count; | 404 uint64_t multiple_packet_loss_packet_count; |
375 }; | 405 }; |
376 | 406 |
377 } // namespace webrtc | 407 } // namespace webrtc |
378 #endif // WEBRTC_MODULES_RTP_RTCP_INTERFACE_RTP_RTCP_DEFINES_H_ | 408 #endif // WEBRTC_MODULES_RTP_RTCP_INTERFACE_RTP_RTCP_DEFINES_H_ |
OLD | NEW |