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

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_utility.h

Issue 1539423003: [rtp_rtcp] Lint errors cleaned from rtp_utility (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_utility.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/rtp_utility.h
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_utility.h b/webrtc/modules/rtp_rtcp/source/rtp_utility.h
index bdcb11ccc266a526332fdf6e442f686d8d956367..57f54c1afc7f4ef036cb49d274a4599c5a9599ce 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_utility.h
+++ b/webrtc/modules/rtp_rtcp/source/rtp_utility.h
@@ -11,8 +11,6 @@
#ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_UTILITY_H_
#define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_UTILITY_H_
-#include <stddef.h> // size_t, ptrdiff_t
-
#include <map>
#include "webrtc/modules/rtp_rtcp/include/receive_statistics.h"
@@ -31,62 +29,43 @@ RtpAudioFeedback* NullObjectRtpAudioFeedback();
ReceiveStatistics* NullObjectReceiveStatistics();
namespace RtpUtility {
- // January 1970, in NTP seconds.
- const uint32_t NTP_JAN_1970 = 2208988800UL;
-
- // Magic NTP fractional unit.
- const double NTP_FRAC = 4.294967296E+9;
-
- struct Payload
- {
- char name[RTP_PAYLOAD_NAME_SIZE];
- bool audio;
- PayloadUnion typeSpecific;
- };
-
- typedef std::map<int8_t, Payload*> PayloadTypeMap;
-
- uint32_t pow2(uint8_t exp);
-
- // Returns true if |newTimestamp| is older than |existingTimestamp|.
- // |wrapped| will be set to true if there has been a wraparound between the
- // two timestamps.
- bool OldTimestamp(uint32_t newTimestamp,
- uint32_t existingTimestamp,
- bool* wrapped);
-
- bool StringCompare(const char* str1,
- const char* str2,
- const uint32_t length);
-
- // Round up to the nearest size that is a multiple of 4.
- size_t Word32Align(size_t size);
-
- class RtpHeaderParser {
- public:
- RtpHeaderParser(const uint8_t* rtpData, size_t rtpDataLength);
- ~RtpHeaderParser();
-
- bool RTCP() const;
- bool ParseRtcp(RTPHeader* header) const;
- bool Parse(RTPHeader& parsedPacket,
- RtpHeaderExtensionMap* ptrExtensionMap = NULL) const;
-
- private:
- void ParseOneByteExtensionHeader(
- RTPHeader& parsedPacket,
- const RtpHeaderExtensionMap* ptrExtensionMap,
- const uint8_t* ptrRTPDataExtensionEnd,
- const uint8_t* ptr) const;
-
- uint8_t ParsePaddingBytes(
- const uint8_t* ptrRTPDataExtensionEnd,
- const uint8_t* ptr) const;
-
- const uint8_t* const _ptrRTPDataBegin;
- const uint8_t* const _ptrRTPDataEnd;
- };
+
+struct Payload {
+ char name[RTP_PAYLOAD_NAME_SIZE];
+ bool audio;
+ PayloadUnion typeSpecific;
+};
+
+typedef std::map<int8_t, Payload*> PayloadTypeMap;
+
+bool StringCompare(const char* str1, const char* str2, const uint32_t length);
+
+// Round up to the nearest size that is a multiple of 4.
+size_t Word32Align(size_t size);
+
+class RtpHeaderParser {
+ public:
+ RtpHeaderParser(const uint8_t* rtpData, size_t rtpDataLength);
+ ~RtpHeaderParser();
+
+ bool RTCP() const;
+ bool ParseRtcp(RTPHeader* header) const;
+ bool Parse(RTPHeader* parsedPacket,
+ RtpHeaderExtensionMap* ptrExtensionMap = nullptr) const;
+
+ private:
+ void ParseOneByteExtensionHeader(RTPHeader* parsedPacket,
+ const RtpHeaderExtensionMap* ptrExtensionMap,
+ const uint8_t* ptrRTPDataExtensionEnd,
+ const uint8_t* ptr) const;
+
+ uint8_t ParsePaddingBytes(const uint8_t* ptrRTPDataExtensionEnd,
+ const uint8_t* ptr) const;
+
+ const uint8_t* const _ptrRTPDataBegin;
+ const uint8_t* const _ptrRTPDataEnd;
+};
} // namespace RtpUtility
} // namespace webrtc
-#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_UTILITY_H_
+#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_UTILITY_H_
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_utility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698