OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 const char SessionDescriptionInterface::kPrAnswer[] = "pranswer"; | 42 const char SessionDescriptionInterface::kPrAnswer[] = "pranswer"; |
43 const char SessionDescriptionInterface::kAnswer[] = "answer"; | 43 const char SessionDescriptionInterface::kAnswer[] = "answer"; |
44 | 44 |
45 const int JsepSessionDescription::kDefaultVideoCodecId = 100; | 45 const int JsepSessionDescription::kDefaultVideoCodecId = 100; |
46 const char JsepSessionDescription::kDefaultVideoCodecName[] = "VP8"; | 46 const char JsepSessionDescription::kDefaultVideoCodecName[] = "VP8"; |
47 | 47 |
48 SessionDescriptionInterface* CreateSessionDescription(const std::string& type, | 48 SessionDescriptionInterface* CreateSessionDescription(const std::string& type, |
49 const std::string& sdp, | 49 const std::string& sdp, |
50 SdpParseError* error) { | 50 SdpParseError* error) { |
51 if (!IsTypeSupported(type)) { | 51 if (!IsTypeSupported(type)) { |
52 return NULL; | 52 return nullptr; |
53 } | 53 } |
54 | 54 |
55 JsepSessionDescription* jsep_desc = new JsepSessionDescription(type); | 55 JsepSessionDescription* jsep_desc = new JsepSessionDescription(type); |
56 if (!jsep_desc->Initialize(sdp, error)) { | 56 if (!jsep_desc->Initialize(sdp, error)) { |
57 delete jsep_desc; | 57 delete jsep_desc; |
58 return NULL; | 58 return nullptr; |
59 } | 59 } |
60 return jsep_desc; | 60 return jsep_desc; |
61 } | 61 } |
62 | 62 |
63 JsepSessionDescription::JsepSessionDescription(const std::string& type) | 63 JsepSessionDescription::JsepSessionDescription(const std::string& type) |
64 : type_(type) { | 64 : type_(type) { |
65 } | 65 } |
66 | 66 |
67 JsepSessionDescription::~JsepSessionDescription() {} | 67 JsepSessionDescription::~JsepSessionDescription() {} |
68 | 68 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 size_t JsepSessionDescription::number_of_mediasections() const { | 140 size_t JsepSessionDescription::number_of_mediasections() const { |
141 if (!description_) | 141 if (!description_) |
142 return 0; | 142 return 0; |
143 return description_->contents().size(); | 143 return description_->contents().size(); |
144 } | 144 } |
145 | 145 |
146 const IceCandidateCollection* JsepSessionDescription::candidates( | 146 const IceCandidateCollection* JsepSessionDescription::candidates( |
147 size_t mediasection_index) const { | 147 size_t mediasection_index) const { |
148 if (mediasection_index >= candidate_collection_.size()) | 148 if (mediasection_index >= candidate_collection_.size()) |
149 return NULL; | 149 return nullptr; |
150 return &candidate_collection_[mediasection_index]; | 150 return &candidate_collection_[mediasection_index]; |
151 } | 151 } |
152 | 152 |
153 bool JsepSessionDescription::ToString(std::string* out) const { | 153 bool JsepSessionDescription::ToString(std::string* out) const { |
154 if (!description_ || !out) { | 154 if (!description_ || !out) { |
155 return false; | 155 return false; |
156 } | 156 } |
157 *out = SdpSerialize(*this, false); | 157 *out = SdpSerialize(*this, false); |
158 return !out->empty(); | 158 return !out->empty(); |
159 } | 159 } |
(...skipping 30 matching lines...) Expand all Loading... |
190 const std::string& transport_name = candidate.transport_name(); | 190 const std::string& transport_name = candidate.transport_name(); |
191 for (size_t i = 0; i < description_->contents().size(); ++i) { | 191 for (size_t i = 0; i < description_->contents().size(); ++i) { |
192 if (transport_name == description_->contents().at(i).name) { | 192 if (transport_name == description_->contents().at(i).name) { |
193 return static_cast<int>(i); | 193 return static_cast<int>(i); |
194 } | 194 } |
195 } | 195 } |
196 return -1; | 196 return -1; |
197 } | 197 } |
198 | 198 |
199 } // namespace webrtc | 199 } // namespace webrtc |
OLD | NEW |