OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. and Robin Seggelmann | 3 * Copyright 2012 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, |
11 * this list of conditions and the following disclaimer in the documentation | 11 * this list of conditions and the following disclaimer in the documentation |
12 * and/or other materials provided with the distribution. | 12 * and/or other materials provided with the distribution. |
13 * 3. The name of the author may not be used to endorse or promote products | 13 * 3. The name of the author may not be used to endorse or promote products |
14 * derived from this software without specific prior written permission. | 14 * derived from this software without specific prior written permission. |
15 * | 15 * |
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED | 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO | 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
19 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 19 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | 21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | 22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | 23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 */ | 26 */ |
27 | 27 |
28 #include "talk/media/sctp/sctpdataengine.h" | 28 #include "webrtc/media/sctp/sctpdataengine.h" |
29 | 29 |
30 #include <stdarg.h> | 30 #include <stdarg.h> |
31 #include <stdio.h> | 31 #include <stdio.h> |
32 #include <sstream> | 32 #include <sstream> |
33 #include <vector> | 33 #include <vector> |
34 | 34 |
35 #include "talk/media/base/codec.h" | |
36 #include "talk/media/base/constants.h" | |
37 #include "talk/media/base/streamparams.h" | |
38 #include "usrsctplib/usrsctp.h" | 35 #include "usrsctplib/usrsctp.h" |
39 #include "webrtc/base/arraysize.h" | 36 #include "webrtc/base/arraysize.h" |
40 #include "webrtc/base/buffer.h" | 37 #include "webrtc/base/buffer.h" |
41 #include "webrtc/base/helpers.h" | 38 #include "webrtc/base/helpers.h" |
42 #include "webrtc/base/logging.h" | 39 #include "webrtc/base/logging.h" |
43 #include "webrtc/base/safe_conversions.h" | 40 #include "webrtc/base/safe_conversions.h" |
| 41 #include "webrtc/media/base/codec.h" |
| 42 #include "webrtc/media/base/constants.h" |
| 43 #include "webrtc/media/base/streamparams.h" |
44 | 44 |
45 namespace { | 45 namespace { |
46 typedef cricket::SctpDataMediaChannel::StreamSet StreamSet; | 46 typedef cricket::SctpDataMediaChannel::StreamSet StreamSet; |
47 // Returns a comma-separated, human-readable list of the stream IDs in 's' | 47 // Returns a comma-separated, human-readable list of the stream IDs in 's' |
48 std::string ListStreams(const StreamSet& s) { | 48 std::string ListStreams(const StreamSet& s) { |
49 std::stringstream result; | 49 std::stringstream result; |
50 bool first = true; | 50 bool first = true; |
51 for (StreamSet::const_iterator it = s.begin(); it != s.end(); ++it) { | 51 for (StreamSet::const_iterator it = s.begin(); it != s.end(); ++it) { |
52 if (!first) { | 52 if (!first) { |
53 result << ", " << *it; | 53 result << ", " << *it; |
(...skipping 16 matching lines...) Expand all Loading... |
70 int value; | 70 int value; |
71 const char* name; | 71 const char* name; |
72 } flaginfo[] = { | 72 } flaginfo[] = { |
73 MAKEFLAG(SCTP_STREAM_RESET_INCOMING_SSN), | 73 MAKEFLAG(SCTP_STREAM_RESET_INCOMING_SSN), |
74 MAKEFLAG(SCTP_STREAM_RESET_OUTGOING_SSN), | 74 MAKEFLAG(SCTP_STREAM_RESET_OUTGOING_SSN), |
75 MAKEFLAG(SCTP_STREAM_RESET_DENIED), | 75 MAKEFLAG(SCTP_STREAM_RESET_DENIED), |
76 MAKEFLAG(SCTP_STREAM_RESET_FAILED), | 76 MAKEFLAG(SCTP_STREAM_RESET_FAILED), |
77 MAKEFLAG(SCTP_STREAM_CHANGE_DENIED) | 77 MAKEFLAG(SCTP_STREAM_CHANGE_DENIED) |
78 }; | 78 }; |
79 #undef MAKEFLAG | 79 #undef MAKEFLAG |
80 for (int i = 0; i < arraysize(flaginfo); ++i) { | 80 for (uint32_t i = 0; i < arraysize(flaginfo); ++i) { |
81 if (flags & flaginfo[i].value) { | 81 if (flags & flaginfo[i].value) { |
82 if (!first) result << " | "; | 82 if (!first) result << " | "; |
83 result << flaginfo[i].name; | 83 result << flaginfo[i].name; |
84 first = false; | 84 first = false; |
85 } | 85 } |
86 } | 86 } |
87 return result.str(); | 87 return result.str(); |
88 } | 88 } |
89 | 89 |
90 // Returns a comma-separated, human-readable list of the integers in 'array'. | 90 // Returns a comma-separated, human-readable list of the integers in 'array'. |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 } | 1044 } |
1045 case MSG_SCTPOUTBOUNDPACKET: { | 1045 case MSG_SCTPOUTBOUNDPACKET: { |
1046 rtc::scoped_ptr<OutboundPacketMessage> pdata( | 1046 rtc::scoped_ptr<OutboundPacketMessage> pdata( |
1047 static_cast<OutboundPacketMessage*>(msg->pdata)); | 1047 static_cast<OutboundPacketMessage*>(msg->pdata)); |
1048 OnPacketFromSctpToNetwork(pdata->data().get()); | 1048 OnPacketFromSctpToNetwork(pdata->data().get()); |
1049 break; | 1049 break; |
1050 } | 1050 } |
1051 } | 1051 } |
1052 } | 1052 } |
1053 } // namespace cricket | 1053 } // namespace cricket |
OLD | NEW |