OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 bool operator==(const RtpHeaderExtension& ext) const { | 406 bool operator==(const RtpHeaderExtension& ext) const { |
407 // id is a reserved word in objective-c. Therefore the id attribute has to | 407 // id is a reserved word in objective-c. Therefore the id attribute has to |
408 // be a fully qualified name in order to compile on IOS. | 408 // be a fully qualified name in order to compile on IOS. |
409 return this->id == ext.id && | 409 return this->id == ext.id && |
410 uri == ext.uri; | 410 uri == ext.uri; |
411 } | 411 } |
412 | 412 |
413 std::string ToString() const { | 413 std::string ToString() const { |
414 std::ostringstream ost; | 414 std::ostringstream ost; |
415 ost << "{"; | 415 ost << "{"; |
416 ost << "id: , " << id; | |
417 ost << "uri: " << uri; | 416 ost << "uri: " << uri; |
| 417 ost << ", id: " << id; |
418 ost << "}"; | 418 ost << "}"; |
419 return ost.str(); | 419 return ost.str(); |
420 } | 420 } |
421 | 421 |
422 std::string uri; | 422 std::string uri; |
423 int id; | 423 int id; |
424 // TODO(juberti): SendRecv direction; | 424 // TODO(juberti): SendRecv direction; |
425 }; | 425 }; |
426 | 426 |
427 // Returns the named header extension if found among all extensions, NULL | 427 // Returns the named header extension if found among all extensions, NULL |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 void Clear() { | 929 void Clear() { |
930 senders.clear(); | 930 senders.clear(); |
931 receivers.clear(); | 931 receivers.clear(); |
932 } | 932 } |
933 std::vector<DataSenderInfo> senders; | 933 std::vector<DataSenderInfo> senders; |
934 std::vector<DataReceiverInfo> receivers; | 934 std::vector<DataReceiverInfo> receivers; |
935 }; | 935 }; |
936 | 936 |
937 template <class Codec> | 937 template <class Codec> |
938 struct RtpParameters { | 938 struct RtpParameters { |
939 virtual std::string ToString() { | 939 virtual std::string ToString() const { |
940 std::ostringstream ost; | 940 std::ostringstream ost; |
941 ost << "{"; | 941 ost << "{"; |
942 ost << "codecs: " << VectorToString(codecs) << ", "; | 942 ost << "codecs: " << VectorToString(codecs) << ", "; |
943 ost << "extensions: " << VectorToString(extensions); | 943 ost << "extensions: " << VectorToString(extensions); |
944 ost << "}"; | 944 ost << "}"; |
945 return ost.str(); | 945 return ost.str(); |
946 } | 946 } |
947 | 947 |
948 std::vector<Codec> codecs; | 948 std::vector<Codec> codecs; |
949 std::vector<RtpHeaderExtension> extensions; | 949 std::vector<RtpHeaderExtension> extensions; |
950 // TODO(pthatcher): Add streams. | 950 // TODO(pthatcher): Add streams. |
951 }; | 951 }; |
952 | 952 |
953 template <class Codec, class Options> | 953 template <class Codec, class Options> |
954 struct RtpSendParameters : RtpParameters<Codec> { | 954 struct RtpSendParameters : RtpParameters<Codec> { |
955 std::string ToString() override { | 955 std::string ToString() const override { |
956 std::ostringstream ost; | 956 std::ostringstream ost; |
957 ost << "{"; | 957 ost << "{"; |
958 ost << "codecs: " << VectorToString(this->codecs) << ", "; | 958 ost << "codecs: " << VectorToString(this->codecs) << ", "; |
959 ost << "extensions: " << VectorToString(this->extensions) << ", "; | 959 ost << "extensions: " << VectorToString(this->extensions) << ", "; |
960 ost << "max_bandiwidth_bps: " << max_bandwidth_bps << ", "; | 960 ost << "max_bandiwidth_bps: " << max_bandwidth_bps << ", "; |
961 ost << "options: " << options.ToString(); | 961 ost << "options: " << options.ToString(); |
962 ost << "}"; | 962 ost << "}"; |
963 return ost.str(); | 963 return ost.str(); |
964 } | 964 } |
965 | 965 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1153 ordered(false), | 1153 ordered(false), |
1154 reliable(false), | 1154 reliable(false), |
1155 max_rtx_count(0), | 1155 max_rtx_count(0), |
1156 max_rtx_ms(0) { | 1156 max_rtx_ms(0) { |
1157 } | 1157 } |
1158 }; | 1158 }; |
1159 | 1159 |
1160 enum SendDataResult { SDR_SUCCESS, SDR_ERROR, SDR_BLOCK }; | 1160 enum SendDataResult { SDR_SUCCESS, SDR_ERROR, SDR_BLOCK }; |
1161 | 1161 |
1162 struct DataOptions { | 1162 struct DataOptions { |
1163 std::string ToString() { | 1163 std::string ToString() const { |
1164 return "{}"; | 1164 return "{}"; |
1165 } | 1165 } |
1166 }; | 1166 }; |
1167 | 1167 |
1168 struct DataSendParameters : RtpSendParameters<DataCodec, DataOptions> { | 1168 struct DataSendParameters : RtpSendParameters<DataCodec, DataOptions> { |
1169 std::string ToString() { | 1169 std::string ToString() const { |
1170 std::ostringstream ost; | 1170 std::ostringstream ost; |
1171 // Options and extensions aren't used. | 1171 // Options and extensions aren't used. |
1172 ost << "{"; | 1172 ost << "{"; |
1173 ost << "codecs: " << VectorToString(codecs) << ", "; | 1173 ost << "codecs: " << VectorToString(codecs) << ", "; |
1174 ost << "max_bandiwidth_bps: " << max_bandwidth_bps; | 1174 ost << "max_bandiwidth_bps: " << max_bandwidth_bps; |
1175 ost << "}"; | 1175 ost << "}"; |
1176 return ost.str(); | 1176 return ost.str(); |
1177 } | 1177 } |
1178 }; | 1178 }; |
1179 | 1179 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1214 // Signal when the media channel is ready to send the stream. Arguments are: | 1214 // Signal when the media channel is ready to send the stream. Arguments are: |
1215 // writable(bool) | 1215 // writable(bool) |
1216 sigslot::signal1<bool> SignalReadyToSend; | 1216 sigslot::signal1<bool> SignalReadyToSend; |
1217 // Signal for notifying that the remote side has closed the DataChannel. | 1217 // Signal for notifying that the remote side has closed the DataChannel. |
1218 sigslot::signal1<uint32_t> SignalStreamClosedRemotely; | 1218 sigslot::signal1<uint32_t> SignalStreamClosedRemotely; |
1219 }; | 1219 }; |
1220 | 1220 |
1221 } // namespace cricket | 1221 } // namespace cricket |
1222 | 1222 |
1223 #endif // TALK_MEDIA_BASE_MEDIACHANNEL_H_ | 1223 #endif // TALK_MEDIA_BASE_MEDIACHANNEL_H_ |
OLD | NEW |