| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2012 Google Inc. | 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, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 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/app/webrtc/jsepsessiondescription.h" | 28 #include "talk/app/webrtc/jsepsessiondescription.h" |
| 29 | 29 |
| 30 #include "talk/app/webrtc/webrtcsdp.h" | 30 #include "talk/app/webrtc/webrtcsdp.h" |
| 31 #include "talk/session/media/mediasession.h" | 31 #include "talk/session/media/mediasession.h" |
| 32 #include "webrtc/base/arraysize.h" |
| 32 #include "webrtc/base/stringencode.h" | 33 #include "webrtc/base/stringencode.h" |
| 33 | 34 |
| 34 using rtc::scoped_ptr; | 35 using rtc::scoped_ptr; |
| 35 using cricket::SessionDescription; | 36 using cricket::SessionDescription; |
| 36 | 37 |
| 37 namespace webrtc { | 38 namespace webrtc { |
| 38 | 39 |
| 39 static const char* kSupportedTypes[] = { | 40 static const char* kSupportedTypes[] = { |
| 40 JsepSessionDescription::kOffer, | 41 JsepSessionDescription::kOffer, |
| 41 JsepSessionDescription::kPrAnswer, | 42 JsepSessionDescription::kPrAnswer, |
| 42 JsepSessionDescription::kAnswer | 43 JsepSessionDescription::kAnswer |
| 43 }; | 44 }; |
| 44 | 45 |
| 45 static bool IsTypeSupported(const std::string& type) { | 46 static bool IsTypeSupported(const std::string& type) { |
| 46 bool type_supported = false; | 47 bool type_supported = false; |
| 47 for (size_t i = 0; i < ARRAY_SIZE(kSupportedTypes); ++i) { | 48 for (size_t i = 0; i < arraysize(kSupportedTypes); ++i) { |
| 48 if (kSupportedTypes[i] == type) { | 49 if (kSupportedTypes[i] == type) { |
| 49 type_supported = true; | 50 type_supported = true; |
| 50 break; | 51 break; |
| 51 } | 52 } |
| 52 } | 53 } |
| 53 return type_supported; | 54 return type_supported; |
| 54 } | 55 } |
| 55 | 56 |
| 56 const char SessionDescriptionInterface::kOffer[] = "offer"; | 57 const char SessionDescriptionInterface::kOffer[] = "offer"; |
| 57 const char SessionDescriptionInterface::kPrAnswer[] = "pranswer"; | 58 const char SessionDescriptionInterface::kPrAnswer[] = "pranswer"; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 if (!found) { | 194 if (!found) { |
| 194 // If the sdp_mid is presented but we can't find a match, we consider | 195 // If the sdp_mid is presented but we can't find a match, we consider |
| 195 // this as an error. | 196 // this as an error. |
| 196 return false; | 197 return false; |
| 197 } | 198 } |
| 198 } | 199 } |
| 199 return true; | 200 return true; |
| 200 } | 201 } |
| 201 | 202 |
| 202 } // namespace webrtc | 203 } // namespace webrtc |
| OLD | NEW |