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

Unified Diff: webrtc/p2p/base/rtppacketutil.h

Issue 1578323002: Add rtppacketuil.h/cc (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/p2p/base/rtppacketutil.cc » ('j') | webrtc/p2p/base/rtppacketutil.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/rtppacketutil.h
diff --git a/webrtc/p2p/base/rtppacketutil.h b/webrtc/p2p/base/rtppacketutil.h
new file mode 100644
index 0000000000000000000000000000000000000000..9108456bec83c60df782b84f88634a50cf243d19
--- /dev/null
+++ b/webrtc/p2p/base/rtppacketutil.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2016 The WebRTC Project Authors. All rights reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef WEBRTC_P2P_BASE_RTPPACKETUTIL_H_
+#define WEBRTC_P2P_BASE_RTPPACKETUTIL_H_
+
+#include <cstddef>
+#include <cstdint>
+
+namespace rtc {
+
+struct PacketOptions;
+
+// Returns true if the packet in |data| is a DTLS packet.
+bool IsDtlsPacket(const char* data, size_t length);
+
+// Returns true if the packet in |data| is an RTCP packet.
+bool IsRtcpPacket(const char* data, size_t length);
+
+// Applies specified |options| to the packet. It updates absolute send time
+// extension header if it is present present then updates HMAC.
+// If |abs_send_time| is 0 then current system time is used.
+bool ApplyPacketOptions(char* data,
+ size_t length,
+ const PacketOptions& options,
+ uint32_t abs_send_time);
+
+// Verifies that a packet has a valid RTP header.
+bool ValidateRtpHeader(const char* rtp, size_t length, size_t* header_length);
+
+// Finds RTP offset and length if the packet is encapsulated in a TURN Channel
+// Message or TURN Send Indication message.
+bool GetRtpPacketStartPositionAndLength(const char* data,
+ size_t length,
+ size_t* rtp_start_pos,
+ size_t* rtp_packet_length);
+
+// Helper method which updates absolute send time extension if present.
+bool UpdateRtpAbsSendTimeExtension(char* rtp,
+ size_t length,
+ int extension_id,
+ uint32_t abs_send_time);
+
+} // namespace rtc
+
+#endif // WEBRTC_P2P_BASE_RTPPACKETUTIL_H_
« no previous file with comments | « no previous file | webrtc/p2p/base/rtppacketutil.cc » ('j') | webrtc/p2p/base/rtppacketutil.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698