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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
340 class RTCPParserV2 { | 347 class RTCPParserV2 { |
341 public: | 348 public: |
342 RTCPParserV2( | 349 RTCPParserV2( |
343 const uint8_t* rtcpData, | 350 const uint8_t* rtcpData, |
344 size_t rtcpDataLength, | 351 size_t rtcpDataLength, |
345 bool rtcpReducedSizeEnable); // Set to true, to allow non-compound RTCP! | 352 bool rtcpReducedSizeEnable); // Set to true, to allow non-compound RTCP! |
346 ~RTCPParserV2(); | 353 ~RTCPParserV2(); |
347 | 354 |
348 RTCPPacketTypes PacketType() const; | 355 RTCPPacketTypes PacketType() const; |
349 const RTCPPacket& Packet() const; | 356 const RTCPPacket& Packet() const; |
357 rtcp::RtcpPacket* ReleaseRtcpPacket(); | |
stefan-webrtc
2015/09/17 10:33:19
How does this RtcpPacket differ from RTCPPacket? I
sprang_webrtc
2015/09/17 15:08:28
This is the base class for the shiny new RtcpPacke
| |
350 const RTCPRawPacket& RawPacket() const; | 358 const RTCPRawPacket& RawPacket() const; |
351 ptrdiff_t LengthLeft() const; | 359 ptrdiff_t LengthLeft() const; |
352 | 360 |
353 bool IsValid() const; | 361 bool IsValid() const; |
354 | 362 |
355 RTCPPacketTypes Begin(); | 363 RTCPPacketTypes Begin(); |
356 RTCPPacketTypes Iterate(); | 364 RTCPPacketTypes Iterate(); |
357 | 365 |
358 private: | 366 private: |
359 enum class ParseState { | 367 enum class ParseState { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
438 | 446 |
439 bool _validPacket; | 447 bool _validPacket; |
440 const uint8_t* _ptrRTCPData; | 448 const uint8_t* _ptrRTCPData; |
441 const uint8_t* _ptrRTCPBlockEnd; | 449 const uint8_t* _ptrRTCPBlockEnd; |
442 | 450 |
443 ParseState _state; | 451 ParseState _state; |
444 uint8_t _numberOfBlocks; | 452 uint8_t _numberOfBlocks; |
445 | 453 |
446 RTCPPacketTypes _packetType; | 454 RTCPPacketTypes _packetType; |
447 RTCPPacket _packet; | 455 RTCPPacket _packet; |
456 rtc::scoped_ptr<webrtc::rtcp::RtcpPacket> rtcp_packet_; | |
448 }; | 457 }; |
449 | 458 |
450 class RTCPPacketIterator { | 459 class RTCPPacketIterator { |
451 public: | 460 public: |
452 RTCPPacketIterator(uint8_t* rtcpData, size_t rtcpDataLength); | 461 RTCPPacketIterator(uint8_t* rtcpData, size_t rtcpDataLength); |
453 ~RTCPPacketIterator(); | 462 ~RTCPPacketIterator(); |
454 | 463 |
455 const RTCPCommonHeader* Begin(); | 464 const RTCPCommonHeader* Begin(); |
456 const RTCPCommonHeader* Iterate(); | 465 const RTCPCommonHeader* Iterate(); |
457 const RTCPCommonHeader* Current(); | 466 const RTCPCommonHeader* Current(); |
458 | 467 |
459 private: | 468 private: |
460 uint8_t* const _ptrBegin; | 469 uint8_t* const _ptrBegin; |
461 uint8_t* const _ptrEnd; | 470 uint8_t* const _ptrEnd; |
462 | 471 |
463 uint8_t* _ptrBlock; | 472 uint8_t* _ptrBlock; |
464 | 473 |
465 RTCPCommonHeader _header; | 474 RTCPCommonHeader _header; |
466 }; | 475 }; |
467 } // RTCPUtility | 476 } // RTCPUtility |
468 } // namespace webrtc | 477 } // namespace webrtc |
469 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_UTILITY_H_ | 478 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_UTILITY_H_ |
OLD | NEW |