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

Side by Side Diff: webrtc/media/base/mediachannel.h

Issue 2564333002: Reland of: Separating SCTP code from BaseChannel/MediaChannel. (Closed)
Patch Set: Merge with master. Created 3 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 unified diff | Download patch
« no previous file with comments | « webrtc/media/base/hybriddataengine.h ('k') | webrtc/media/base/mediaconstants.h » ('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 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 DMT_CONTROL = 1, 1070 DMT_CONTROL = 1,
1071 DMT_BINARY = 2, 1071 DMT_BINARY = 2,
1072 DMT_TEXT = 3, 1072 DMT_TEXT = 3,
1073 }; 1073 };
1074 1074
1075 // Info about data received in DataMediaChannel. For use in 1075 // Info about data received in DataMediaChannel. For use in
1076 // DataMediaChannel::SignalDataReceived and in all of the signals that 1076 // DataMediaChannel::SignalDataReceived and in all of the signals that
1077 // signal fires, on up the chain. 1077 // signal fires, on up the chain.
1078 struct ReceiveDataParams { 1078 struct ReceiveDataParams {
1079 // The in-packet stream indentifier. 1079 // The in-packet stream indentifier.
1080 // For SCTP, this is really SID, not SSRC. 1080 // RTP data channels use SSRCs, SCTP data channels use SIDs.
1081 uint32_t ssrc; 1081 union {
1082 uint32_t ssrc;
1083 int sid;
1084 };
1082 // The type of message (binary, text, or control). 1085 // The type of message (binary, text, or control).
1083 DataMessageType type; 1086 DataMessageType type;
1084 // A per-stream value incremented per packet in the stream. 1087 // A per-stream value incremented per packet in the stream.
1085 int seq_num; 1088 int seq_num;
1086 // A per-stream value monotonically increasing with time. 1089 // A per-stream value monotonically increasing with time.
1087 int timestamp; 1090 int timestamp;
1088 1091
1089 ReceiveDataParams() : 1092 ReceiveDataParams() : sid(0), type(DMT_TEXT), seq_num(0), timestamp(0) {}
1090 ssrc(0),
1091 type(DMT_TEXT),
1092 seq_num(0),
1093 timestamp(0) {
1094 }
1095 }; 1093 };
1096 1094
1097 struct SendDataParams { 1095 struct SendDataParams {
1098 // The in-packet stream indentifier. 1096 // The in-packet stream indentifier.
1099 // For SCTP, this is really SID, not SSRC. 1097 // RTP data channels use SSRCs, SCTP data channels use SIDs.
1100 uint32_t ssrc; 1098 union {
1099 uint32_t ssrc;
1100 int sid;
1101 };
1101 // The type of message (binary, text, or control). 1102 // The type of message (binary, text, or control).
1102 DataMessageType type; 1103 DataMessageType type;
1103 1104
1104 // For SCTP, whether to send messages flagged as ordered or not. 1105 // For SCTP, whether to send messages flagged as ordered or not.
1105 // If false, messages can be received out of order. 1106 // If false, messages can be received out of order.
1106 bool ordered; 1107 bool ordered;
1107 // For SCTP, whether the messages are sent reliably or not. 1108 // For SCTP, whether the messages are sent reliably or not.
1108 // If false, messages may be lost. 1109 // If false, messages may be lost.
1109 bool reliable; 1110 bool reliable;
1110 // For SCTP, if reliable == false, provide partial reliability by 1111 // For SCTP, if reliable == false, provide partial reliability by
1111 // resending up to this many times. Either count or millis 1112 // resending up to this many times. Either count or millis
1112 // is supported, not both at the same time. 1113 // is supported, not both at the same time.
1113 int max_rtx_count; 1114 int max_rtx_count;
1114 // For SCTP, if reliable == false, provide partial reliability by 1115 // For SCTP, if reliable == false, provide partial reliability by
1115 // resending for up to this many milliseconds. Either count or millis 1116 // resending for up to this many milliseconds. Either count or millis
1116 // is supported, not both at the same time. 1117 // is supported, not both at the same time.
1117 int max_rtx_ms; 1118 int max_rtx_ms;
1118 1119
1119 SendDataParams() : 1120 SendDataParams()
1120 ssrc(0), 1121 : sid(0),
1121 type(DMT_TEXT), 1122 type(DMT_TEXT),
1122 // TODO(pthatcher): Make these true by default? 1123 // TODO(pthatcher): Make these true by default?
1123 ordered(false), 1124 ordered(false),
1124 reliable(false), 1125 reliable(false),
1125 max_rtx_count(0), 1126 max_rtx_count(0),
1126 max_rtx_ms(0) { 1127 max_rtx_ms(0) {}
1127 }
1128 }; 1128 };
1129 1129
1130 enum SendDataResult { SDR_SUCCESS, SDR_ERROR, SDR_BLOCK }; 1130 enum SendDataResult { SDR_SUCCESS, SDR_ERROR, SDR_BLOCK };
1131 1131
1132 struct DataSendParameters : RtpSendParameters<DataCodec> { 1132 struct DataSendParameters : RtpSendParameters<DataCodec> {
1133 std::string ToString() const { 1133 std::string ToString() const {
1134 std::ostringstream ost; 1134 std::ostringstream ost;
1135 // Options and extensions aren't used. 1135 // Options and extensions aren't used.
1136 ost << "{"; 1136 ost << "{";
1137 ost << "codecs: " << VectorToString(codecs) << ", "; 1137 ost << "codecs: " << VectorToString(codecs) << ", ";
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1176 const SendDataParams& params, 1176 const SendDataParams& params,
1177 const rtc::CopyOnWriteBuffer& payload, 1177 const rtc::CopyOnWriteBuffer& payload,
1178 SendDataResult* result = NULL) = 0; 1178 SendDataResult* result = NULL) = 0;
1179 // Signals when data is received (params, data, len) 1179 // Signals when data is received (params, data, len)
1180 sigslot::signal3<const ReceiveDataParams&, 1180 sigslot::signal3<const ReceiveDataParams&,
1181 const char*, 1181 const char*,
1182 size_t> SignalDataReceived; 1182 size_t> SignalDataReceived;
1183 // Signal when the media channel is ready to send the stream. Arguments are: 1183 // Signal when the media channel is ready to send the stream. Arguments are:
1184 // writable(bool) 1184 // writable(bool)
1185 sigslot::signal1<bool> SignalReadyToSend; 1185 sigslot::signal1<bool> SignalReadyToSend;
1186 // Signal for notifying that the remote side has closed the DataChannel.
1187 sigslot::signal1<uint32_t> SignalStreamClosedRemotely;
1188 }; 1186 };
1189 1187
1190 } // namespace cricket 1188 } // namespace cricket
1191 1189
1192 #endif // WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_ 1190 #endif // WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_
OLDNEW
« no previous file with comments | « webrtc/media/base/hybriddataengine.h ('k') | webrtc/media/base/mediaconstants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698