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

Side by Side Diff: talk/app/webrtc/sctputils.cc

Issue 1403633005: Revert of Moving MediaStreamSignaling logic into PeerConnection. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « talk/app/webrtc/sctputils.h ('k') | talk/app/webrtc/sctputils_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 30 matching lines...) Expand all
41 41
42 enum DataChannelOpenMessageChannelType { 42 enum DataChannelOpenMessageChannelType {
43 DCOMCT_ORDERED_RELIABLE = 0x00, 43 DCOMCT_ORDERED_RELIABLE = 0x00,
44 DCOMCT_ORDERED_PARTIAL_RTXS = 0x01, 44 DCOMCT_ORDERED_PARTIAL_RTXS = 0x01,
45 DCOMCT_ORDERED_PARTIAL_TIME = 0x02, 45 DCOMCT_ORDERED_PARTIAL_TIME = 0x02,
46 DCOMCT_UNORDERED_RELIABLE = 0x80, 46 DCOMCT_UNORDERED_RELIABLE = 0x80,
47 DCOMCT_UNORDERED_PARTIAL_RTXS = 0x81, 47 DCOMCT_UNORDERED_PARTIAL_RTXS = 0x81,
48 DCOMCT_UNORDERED_PARTIAL_TIME = 0x82, 48 DCOMCT_UNORDERED_PARTIAL_TIME = 0x82,
49 }; 49 };
50 50
51 bool IsOpenMessage(const rtc::Buffer& payload) {
52 // Format defined at
53 // http://tools.ietf.org/html/draft-jesup-rtcweb-data-protocol-04
54
55 rtc::ByteBuffer buffer(payload);
56 uint8_t message_type;
57 if (!buffer.ReadUInt8(&message_type)) {
58 LOG(LS_WARNING) << "Could not read OPEN message type.";
59 return false;
60 }
61 return message_type == DATA_CHANNEL_OPEN_MESSAGE_TYPE;
62 }
63
64 bool ParseDataChannelOpenMessage(const rtc::Buffer& payload, 51 bool ParseDataChannelOpenMessage(const rtc::Buffer& payload,
65 std::string* label, 52 std::string* label,
66 DataChannelInit* config) { 53 DataChannelInit* config) {
67 // Format defined at 54 // Format defined at
68 // http://tools.ietf.org/html/draft-jesup-rtcweb-data-protocol-04 55 // http://tools.ietf.org/html/draft-jesup-rtcweb-data-protocol-04
69 56
70 rtc::ByteBuffer buffer(payload); 57 rtc::ByteBuffer buffer(payload);
71 uint8_t message_type; 58 uint8_t message_type;
72 if (!buffer.ReadUInt8(&message_type)) { 59 if (!buffer.ReadUInt8(&message_type)) {
73 LOG(LS_WARNING) << "Could not read OPEN message type."; 60 LOG(LS_WARNING) << "Could not read OPEN message type.";
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 payload->SetData(buffer.Data(), buffer.Length()); 183 payload->SetData(buffer.Data(), buffer.Length());
197 return true; 184 return true;
198 } 185 }
199 186
200 void WriteDataChannelOpenAckMessage(rtc::Buffer* payload) { 187 void WriteDataChannelOpenAckMessage(rtc::Buffer* payload) {
201 rtc::ByteBuffer buffer(rtc::ByteBuffer::ORDER_NETWORK); 188 rtc::ByteBuffer buffer(rtc::ByteBuffer::ORDER_NETWORK);
202 buffer.WriteUInt8(DATA_CHANNEL_OPEN_ACK_MESSAGE_TYPE); 189 buffer.WriteUInt8(DATA_CHANNEL_OPEN_ACK_MESSAGE_TYPE);
203 payload->SetData(buffer.Data(), buffer.Length()); 190 payload->SetData(buffer.Data(), buffer.Length());
204 } 191 }
205 } // namespace webrtc 192 } // namespace webrtc
OLDNEW
« no previous file with comments | « talk/app/webrtc/sctputils.h ('k') | talk/app/webrtc/sctputils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698