OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2010 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 return FindContentInfoByType(contents_, type); | 115 return FindContentInfoByType(contents_, type); |
116 } | 116 } |
117 | 117 |
118 const ContentInfo* SessionDescription::FirstContent() const { | 118 const ContentInfo* SessionDescription::FirstContent() const { |
119 return (contents_.empty()) ? NULL : &(*contents_.begin()); | 119 return (contents_.empty()) ? NULL : &(*contents_.begin()); |
120 } | 120 } |
121 | 121 |
122 void SessionDescription::AddContent(const std::string& name, | 122 void SessionDescription::AddContent(const std::string& name, |
123 const std::string& type, | 123 const std::string& type, |
124 ContentDescription* description) { | 124 ContentDescription* description) { |
125 contents_.push_back(ContentInfo(name, type, description)); | 125 ContentInfo content_info(name, type, description); |
| 126 content_info.msection_index = contents_.size(); |
| 127 contents_.push_back(content_info); |
126 } | 128 } |
127 | 129 |
128 void SessionDescription::AddContent(const std::string& name, | 130 void SessionDescription::AddContent(const std::string& name, |
129 const std::string& type, | 131 const std::string& type, |
130 bool rejected, | 132 bool rejected, |
131 ContentDescription* description) { | 133 ContentDescription* description) { |
132 contents_.push_back(ContentInfo(name, type, rejected, description)); | 134 ContentInfo content_info(name, type, rejected, description); |
| 135 content_info.msection_index = contents_.size(); |
| 136 contents_.push_back(content_info); |
133 } | 137 } |
134 | 138 |
135 void SessionDescription::AddContent(const std::string& name, | 139 void SessionDescription::AddContent(const std::string& name, |
136 const std::string& type, | 140 const std::string& type, |
137 bool rejected, | 141 bool rejected, |
138 bool bundle_only, | 142 bool bundle_only, |
139 ContentDescription* description) { | 143 ContentDescription* description) { |
140 contents_.push_back( | 144 ContentInfo content_info(name, type, rejected, bundle_only, description); |
141 ContentInfo(name, type, rejected, bundle_only, description)); | 145 content_info.msection_index = contents_.size(); |
| 146 contents_.push_back(content_info); |
142 } | 147 } |
143 | 148 |
144 bool SessionDescription::RemoveContentByName(const std::string& name) { | 149 bool SessionDescription::RemoveContentByName(const std::string& name) { |
145 for (ContentInfos::iterator content = contents_.begin(); | 150 for (ContentInfos::iterator content = contents_.begin(); |
146 content != contents_.end(); ++content) { | 151 content != contents_.end(); ++content) { |
147 if (content->name == name) { | 152 if (content->name == name) { |
148 delete content->description; | 153 delete content->description; |
149 contents_.erase(content); | 154 contents_.erase(content); |
150 return true; | 155 return true; |
151 } | 156 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 for (ContentGroups::const_iterator iter = content_groups_.begin(); | 225 for (ContentGroups::const_iterator iter = content_groups_.begin(); |
221 iter != content_groups_.end(); ++iter) { | 226 iter != content_groups_.end(); ++iter) { |
222 if (iter->semantics() == name) { | 227 if (iter->semantics() == name) { |
223 return &(*iter); | 228 return &(*iter); |
224 } | 229 } |
225 } | 230 } |
226 return NULL; | 231 return NULL; |
227 } | 232 } |
228 | 233 |
229 } // namespace cricket | 234 } // namespace cricket |
OLD | NEW |