Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_utility.h

Issue 1338203003: Wire up send-side bandwidth estimation. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed comments, rebase Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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;
366 374
367 RTCPPacketTypes Begin(); 375 RTCPPacketTypes Begin();
368 RTCPPacketTypes Iterate(); 376 RTCPPacketTypes Iterate();
369 377
370 private: 378 private:
371 enum class ParseState { 379 enum class ParseState {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 458
451 bool _validPacket; 459 bool _validPacket;
452 const uint8_t* _ptrRTCPData; 460 const uint8_t* _ptrRTCPData;
453 const uint8_t* _ptrRTCPBlockEnd; 461 const uint8_t* _ptrRTCPBlockEnd;
454 462
455 ParseState _state; 463 ParseState _state;
456 uint8_t _numberOfBlocks; 464 uint8_t _numberOfBlocks;
457 465
458 RTCPPacketTypes _packetType; 466 RTCPPacketTypes _packetType;
459 RTCPPacket _packet; 467 RTCPPacket _packet;
468 rtc::scoped_ptr<webrtc::rtcp::RtcpPacket> rtcp_packet_;
460 }; 469 };
461 470
462 class RTCPPacketIterator { 471 class RTCPPacketIterator {
463 public: 472 public:
464 RTCPPacketIterator(uint8_t* rtcpData, size_t rtcpDataLength); 473 RTCPPacketIterator(uint8_t* rtcpData, size_t rtcpDataLength);
465 ~RTCPPacketIterator(); 474 ~RTCPPacketIterator();
466 475
467 const RtcpCommonHeader* Begin(); 476 const RtcpCommonHeader* Begin();
468 const RtcpCommonHeader* Iterate(); 477 const RtcpCommonHeader* Iterate();
469 const RtcpCommonHeader* Current(); 478 const RtcpCommonHeader* Current();
470 479
471 private: 480 private:
472 uint8_t* const _ptrBegin; 481 uint8_t* const _ptrBegin;
473 uint8_t* const _ptrEnd; 482 uint8_t* const _ptrEnd;
474 483
475 uint8_t* _ptrBlock; 484 uint8_t* _ptrBlock;
476 485
477 RtcpCommonHeader _header; 486 RtcpCommonHeader _header;
478 }; 487 };
479 } // RTCPUtility 488 } // RTCPUtility
480 } // namespace webrtc 489 } // namespace webrtc
481 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_UTILITY_H_ 490 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_UTILITY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698