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

Unified Diff: webrtc/media/base/fakertp.h

Issue 2761143002: Support encrypted RTP extensions (RFC 6904) (Closed)
Patch Set: Fix compile error on win_x64 bots. Created 3 years, 6 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 | « webrtc/media/BUILD.gn ('k') | webrtc/media/base/fakertp.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/base/fakertp.h
diff --git a/webrtc/media/base/fakertp.h b/webrtc/media/base/fakertp.h
index a9c6fe01632654a3b93bce9a03c1975d29cf73bd..88419a55e88c83d87d1ca27f3a5cfdc2610589b8 100644
--- a/webrtc/media/base/fakertp.h
+++ b/webrtc/media/base/fakertp.h
@@ -13,6 +13,8 @@
#ifndef WEBRTC_MEDIA_BASE_FAKERTP_H_
#define WEBRTC_MEDIA_BASE_FAKERTP_H_
+#include <vector>
+
// A typical PCMU RTP packet.
// PT=0, SN=1, TS=0, SSRC=1
// all data FF
@@ -40,6 +42,48 @@ static const unsigned char kPcmuFrame[] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
};
+// A typical PCMU RTP packet with header extensions.
+// PT=0, SN=1, TS=0, SSRC=1
+// all data FF
+static const unsigned char kPcmuFrameWithExtensions[] = {
+ 0x90, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+ // RFC 5285, section 4.2. One-Byte Header.
+ 0xBE, 0xDE,
+ // Header extension length 6 * 32 bits.
+ 0x00, 0x06,
+ // 8 bytes header id 1.
+ 0x17, 0x41, 0x42, 0x73, 0xA4, 0x75, 0x26, 0x27, 0x48,
+ // 3 bytes header id 2.
+ 0x22, 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FF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+};
+
// A typical Receiver Report RTCP packet.
// PT=RR, LN=1, SSRC=1
// send SSRC=2, all other fields 0
@@ -84,4 +128,11 @@ static const unsigned char kDataPacket[] = {
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
};
+// This expects both packets to be based on kPcmuFrameWithExtensions.
+// Header extensions with an id in "encrypted_headers" are expected to be
+// different in the packets unless "expect_equal" is set to "true".
+void CompareHeaderExtensions(const char* packet1, size_t packet1_size,
+ const char* packet2, size_t packet2_size,
+ const std::vector<int> encrypted_headers, bool expect_equal);
+
#endif // WEBRTC_MEDIA_BASE_FAKERTP_H_
« no previous file with comments | « webrtc/media/BUILD.gn ('k') | webrtc/media/base/fakertp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698