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

Unified Diff: content/browser/renderer_host/p2p/socket_host_test_utils.cc

Issue 159353002: This CL adds methods to manipulate RTP header extension, particularly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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
Index: content/browser/renderer_host/p2p/socket_host_test_utils.cc
diff --git a/content/browser/renderer_host/p2p/socket_host_test_utils.cc b/content/browser/renderer_host/p2p/socket_host_test_utils.cc
index 67c461a6b97c64a225ee47521d1ee01f5c366f99..9c3572f204dc5fce55fc56a49b8dafa54833b53e 100644
--- a/content/browser/renderer_host/p2p/socket_host_test_utils.cc
+++ b/content/browser/renderer_host/p2p/socket_host_test_utils.cc
@@ -199,10 +199,29 @@ void CreateStunResponse(std::vector<char>* packet) {
CreateStunPacket(packet, kStunBindingResponse);
}
+
void CreateStunError(std::vector<char>* packet) {
CreateStunPacket(packet, kStunBindingError);
}
+void CreateRtpPacket(std::vector<char>* packet) {
+ CreateRandomPacket(packet); // Minimum length is 20 bytes.
+ *reinterpret_cast<uint8*>(&*packet->begin()) = 0x80;
+ // Extension bit not set.
+}
+
+void CreateRtpPacketWithSendtimeExtension(std::vector<char>* packet,
+ int extension_id) {
+ CreateRandomPacket(packet);
+ *reinterpret_cast<uint8*>(&*packet->begin()) = 0x81;
+ *reinterpret_cast<uint16*>(&*packet->begin() + kRtpHeaderSize) = 0xBEDE;
juberti2 2014/02/22 01:16:05 Need to use SetBE16 to get the right endianness
+ *reinterpret_cast<uint16*>(&*packet->begin() + kRtpHeaderSize + 2) = 1;
+ *reinterpret_cast<uint8*>(&*packet->begin() + kRtpHeaderSize + 4) =
+ (extension_id << 4) + 2;
+}
+
+void CreateTurn
+
net::IPEndPoint ParseAddress(const std::string ip_str, int port) {
net::IPAddressNumber ip;
EXPECT_TRUE(net::ParseIPLiteralToNumber(ip_str, &ip));

Powered by Google App Engine
This is Rietveld 408576698