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_SOURCE_RTCP_UTILITY_H_ | 11 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_UTILITY_H_ |
12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_UTILITY_H_ | 12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_UTILITY_H_ |
13 | 13 |
14 #include <stddef.h> // size_t, ptrdiff_t | 14 #include <stddef.h> // size_t, ptrdiff_t |
15 | 15 |
| 16 #include "webrtc/base/scoped_ptr.h" |
16 #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h" | 17 #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h" |
17 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h" | 18 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h" |
18 #include "webrtc/typedefs.h" | 19 #include "webrtc/typedefs.h" |
19 | 20 |
20 namespace webrtc { | 21 namespace webrtc { |
| 22 namespace rtcp { |
| 23 class RtcpPacket; |
| 24 } |
21 namespace RTCPUtility { | 25 namespace RTCPUtility { |
22 | 26 |
23 class NackStats { | 27 class NackStats { |
24 public: | 28 public: |
25 NackStats(); | 29 NackStats(); |
26 ~NackStats(); | 30 ~NackStats(); |
27 | 31 |
28 // Updates stats with requested sequence number. | 32 // Updates stats with requested sequence number. |
29 // This function should be called for each NACK request to calculate the | 33 // This function should be called for each NACK request to calculate the |
30 // number of unique NACKed RTP packets. | 34 // number of unique NACKed RTP packets. |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 291 |
288 // RFC 3611 | 292 // RFC 3611 |
289 kXrHeader, | 293 kXrHeader, |
290 kXrReceiverReferenceTime, | 294 kXrReceiverReferenceTime, |
291 kXrDlrrReportBlock, | 295 kXrDlrrReportBlock, |
292 kXrDlrrReportBlockItem, | 296 kXrDlrrReportBlockItem, |
293 kXrVoipMetric, | 297 kXrVoipMetric, |
294 | 298 |
295 kApp, | 299 kApp, |
296 kAppItem, | 300 kAppItem, |
| 301 |
| 302 // draft-holmer-rmcat-transport-wide-cc-extensions |
| 303 kTransportFeedback, |
297 }; | 304 }; |
298 | 305 |
299 struct RTCPRawPacket { | 306 struct RTCPRawPacket { |
300 const uint8_t* _ptrPacketBegin; | 307 const uint8_t* _ptrPacketBegin; |
301 const uint8_t* _ptrPacketEnd; | 308 const uint8_t* _ptrPacketEnd; |
302 }; | 309 }; |
303 | 310 |
304 struct RTCPModRawPacket { | 311 struct RTCPModRawPacket { |
305 uint8_t* _ptrPacketBegin; | 312 uint8_t* _ptrPacketBegin; |
306 uint8_t* _ptrPacketEnd; | 313 uint8_t* _ptrPacketEnd; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 class RTCPParserV2 { | 359 class RTCPParserV2 { |
353 public: | 360 public: |
354 RTCPParserV2( | 361 RTCPParserV2( |
355 const uint8_t* rtcpData, | 362 const uint8_t* rtcpData, |
356 size_t rtcpDataLength, | 363 size_t rtcpDataLength, |
357 bool rtcpReducedSizeEnable); // Set to true, to allow non-compound RTCP! | 364 bool rtcpReducedSizeEnable); // Set to true, to allow non-compound RTCP! |
358 ~RTCPParserV2(); | 365 ~RTCPParserV2(); |
359 | 366 |
360 RTCPPacketTypes PacketType() const; | 367 RTCPPacketTypes PacketType() const; |
361 const RTCPPacket& Packet() const; | 368 const RTCPPacket& Packet() const; |
| 369 rtcp::RtcpPacket* ReleaseRtcpPacket(); |
362 const RTCPRawPacket& RawPacket() const; | 370 const RTCPRawPacket& RawPacket() const; |
363 ptrdiff_t LengthLeft() const; | 371 ptrdiff_t LengthLeft() const; |
364 | 372 |
365 bool IsValid() const; | 373 bool IsValid() const; |
| 374 size_t NumSkippedBlocks() const; |
366 | 375 |
367 RTCPPacketTypes Begin(); | 376 RTCPPacketTypes Begin(); |
368 RTCPPacketTypes Iterate(); | 377 RTCPPacketTypes Iterate(); |
369 | 378 |
370 private: | 379 private: |
371 enum class ParseState { | 380 enum class ParseState { |
372 State_TopLevel, // Top level packet | 381 State_TopLevel, // Top level packet |
373 State_ReportBlockItem, // SR/RR report block | 382 State_ReportBlockItem, // SR/RR report block |
374 State_SDESChunk, // SDES chunk | 383 State_SDESChunk, // SDES chunk |
375 State_BYEItem, // BYE item | 384 State_BYEItem, // BYE item |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 const uint8_t* const _ptrRTCPDataBegin; | 456 const uint8_t* const _ptrRTCPDataBegin; |
448 const bool _RTCPReducedSizeEnable; | 457 const bool _RTCPReducedSizeEnable; |
449 const uint8_t* const _ptrRTCPDataEnd; | 458 const uint8_t* const _ptrRTCPDataEnd; |
450 | 459 |
451 bool _validPacket; | 460 bool _validPacket; |
452 const uint8_t* _ptrRTCPData; | 461 const uint8_t* _ptrRTCPData; |
453 const uint8_t* _ptrRTCPBlockEnd; | 462 const uint8_t* _ptrRTCPBlockEnd; |
454 | 463 |
455 ParseState _state; | 464 ParseState _state; |
456 uint8_t _numberOfBlocks; | 465 uint8_t _numberOfBlocks; |
| 466 size_t num_skipped_blocks_; |
457 | 467 |
458 RTCPPacketTypes _packetType; | 468 RTCPPacketTypes _packetType; |
459 RTCPPacket _packet; | 469 RTCPPacket _packet; |
| 470 rtc::scoped_ptr<webrtc::rtcp::RtcpPacket> rtcp_packet_; |
460 }; | 471 }; |
461 | 472 |
462 class RTCPPacketIterator { | 473 class RTCPPacketIterator { |
463 public: | 474 public: |
464 RTCPPacketIterator(uint8_t* rtcpData, size_t rtcpDataLength); | 475 RTCPPacketIterator(uint8_t* rtcpData, size_t rtcpDataLength); |
465 ~RTCPPacketIterator(); | 476 ~RTCPPacketIterator(); |
466 | 477 |
467 const RtcpCommonHeader* Begin(); | 478 const RtcpCommonHeader* Begin(); |
468 const RtcpCommonHeader* Iterate(); | 479 const RtcpCommonHeader* Iterate(); |
469 const RtcpCommonHeader* Current(); | 480 const RtcpCommonHeader* Current(); |
470 | 481 |
471 private: | 482 private: |
472 uint8_t* const _ptrBegin; | 483 uint8_t* const _ptrBegin; |
473 uint8_t* const _ptrEnd; | 484 uint8_t* const _ptrEnd; |
474 | 485 |
475 uint8_t* _ptrBlock; | 486 uint8_t* _ptrBlock; |
476 | 487 |
477 RtcpCommonHeader _header; | 488 RtcpCommonHeader _header; |
478 }; | 489 }; |
479 } // RTCPUtility | 490 } // RTCPUtility |
480 } // namespace webrtc | 491 } // namespace webrtc |
481 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_UTILITY_H_ | 492 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_UTILITY_H_ |
OLD | NEW |