Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 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 |
| 11 #ifndef WEBRTC_P2P_BASE_SESSIONDESCRIPTION_H_ | 11 #ifndef WEBRTC_P2P_BASE_SESSIONDESCRIPTION_H_ |
| 12 #define WEBRTC_P2P_BASE_SESSIONDESCRIPTION_H_ | 12 #define WEBRTC_P2P_BASE_SESSIONDESCRIPTION_H_ |
| 13 | 13 |
| 14 #include <string> | 14 #include <string> |
| 15 #include <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 #include "webrtc/base/constructormagic.h" | |
| 18 #include "webrtc/base/optional.h" | |
| 19 #include "webrtc/base/socketaddress.h" | |
| 17 #include "webrtc/p2p/base/transportinfo.h" | 20 #include "webrtc/p2p/base/transportinfo.h" |
| 18 #include "webrtc/base/constructormagic.h" | |
| 19 | 21 |
| 20 namespace cricket { | 22 namespace cricket { |
| 21 | 23 |
| 22 // Describes a session content. Individual content types inherit from | 24 // Describes a session content. Individual content types inherit from |
| 23 // this class. Analagous to a <jingle><content><description> or | 25 // this class. Analagous to a <jingle><content><description> or |
| 24 // <session><description>. | 26 // <session><description>. |
| 25 class ContentDescription { | 27 class ContentDescription { |
| 26 public: | 28 public: |
| 27 virtual ~ContentDescription() {} | 29 virtual ~ContentDescription() {} |
| 28 virtual ContentDescription* Copy() const = 0; | 30 virtual ContentDescription* Copy() const = 0; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 173 | 175 |
| 174 // Group mutators. | 176 // Group mutators. |
| 175 void AddGroup(const ContentGroup& group) { content_groups_.push_back(group); } | 177 void AddGroup(const ContentGroup& group) { content_groups_.push_back(group); } |
| 176 // Remove the first group with the same semantics specified by |name|. | 178 // Remove the first group with the same semantics specified by |name|. |
| 177 void RemoveGroupByName(const std::string& name); | 179 void RemoveGroupByName(const std::string& name); |
| 178 | 180 |
| 179 // Global attributes. | 181 // Global attributes. |
| 180 void set_msid_supported(bool supported) { msid_supported_ = supported; } | 182 void set_msid_supported(bool supported) { msid_supported_ = supported; } |
| 181 bool msid_supported() const { return msid_supported_; } | 183 bool msid_supported() const { return msid_supported_; } |
| 182 | 184 |
| 185 void set_session_connection_addr( | |
|
Taylor Brandstetter
2017/03/10 22:41:17
I think it would be simpler to only store this add
Zhi Huang
2017/03/15 04:04:59
Done.
| |
| 186 const rtc::Optional<rtc::SocketAddress>& addr) { | |
| 187 session_connection_addr_ = addr; | |
| 188 } | |
| 189 rtc::Optional<rtc::SocketAddress> session_connection_addr() { | |
| 190 return session_connection_addr_; | |
| 191 } | |
| 192 | |
| 183 private: | 193 private: |
| 184 ContentInfos contents_; | 194 ContentInfos contents_; |
| 185 TransportInfos transport_infos_; | 195 TransportInfos transport_infos_; |
| 186 ContentGroups content_groups_; | 196 ContentGroups content_groups_; |
| 187 bool msid_supported_ = true; | 197 bool msid_supported_ = true; |
| 198 // https://tools.ietf.org/html/rfc4566#page-21 | |
| 199 // The session level connection data indicating the address of the remote | |
| 200 // endpoint. | |
| 201 rtc::Optional<rtc::SocketAddress> session_connection_addr_; | |
| 188 }; | 202 }; |
| 189 | 203 |
| 190 // Indicates whether a ContentDescription was an offer or an answer, as | 204 // Indicates whether a ContentDescription was an offer or an answer, as |
| 191 // described in http://www.ietf.org/rfc/rfc3264.txt. CA_UPDATE | 205 // described in http://www.ietf.org/rfc/rfc3264.txt. CA_UPDATE |
| 192 // indicates a jingle update message which contains a subset of a full | 206 // indicates a jingle update message which contains a subset of a full |
| 193 // session description | 207 // session description |
| 194 enum ContentAction { | 208 enum ContentAction { |
| 195 CA_OFFER, CA_PRANSWER, CA_ANSWER, CA_UPDATE | 209 CA_OFFER, CA_PRANSWER, CA_ANSWER, CA_UPDATE |
| 196 }; | 210 }; |
| 197 | 211 |
| 198 // Indicates whether a ContentDescription was sent by the local client | 212 // Indicates whether a ContentDescription was sent by the local client |
| 199 // or received from the remote client. | 213 // or received from the remote client. |
| 200 enum ContentSource { | 214 enum ContentSource { |
| 201 CS_LOCAL, CS_REMOTE | 215 CS_LOCAL, CS_REMOTE |
| 202 }; | 216 }; |
| 203 | 217 |
| 204 } // namespace cricket | 218 } // namespace cricket |
| 205 | 219 |
| 206 #endif // WEBRTC_P2P_BASE_SESSIONDESCRIPTION_H_ | 220 #endif // WEBRTC_P2P_BASE_SESSIONDESCRIPTION_H_ |
| OLD | NEW |