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 |
(...skipping 14 matching lines...) Loading... |
25 class ContentDescription { | 25 class ContentDescription { |
26 public: | 26 public: |
27 virtual ~ContentDescription() {} | 27 virtual ~ContentDescription() {} |
28 virtual ContentDescription* Copy() const = 0; | 28 virtual ContentDescription* Copy() const = 0; |
29 }; | 29 }; |
30 | 30 |
31 // Analagous to a <jingle><content> or <session><description>. | 31 // Analagous to a <jingle><content> or <session><description>. |
32 // name = name of <content name="..."> | 32 // name = name of <content name="..."> |
33 // type = xmlns of <content> | 33 // type = xmlns of <content> |
34 struct ContentInfo { | 34 struct ContentInfo { |
35 ContentInfo() : description(NULL) {} | 35 ContentInfo() {} |
36 ContentInfo(const std::string& name, | 36 ContentInfo(const std::string& name, |
37 const std::string& type, | 37 const std::string& type, |
38 ContentDescription* description) : | 38 ContentDescription* description) |
39 name(name), type(type), rejected(false), description(description) {} | 39 : name(name), type(type), description(description) {} |
40 ContentInfo(const std::string& name, | 40 ContentInfo(const std::string& name, |
41 const std::string& type, | 41 const std::string& type, |
42 bool rejected, | 42 bool rejected, |
43 ContentDescription* description) : | 43 ContentDescription* description) : |
44 name(name), type(type), rejected(rejected), description(description) {} | 44 name(name), type(type), rejected(rejected), description(description) {} |
| 45 ContentInfo(const std::string& name, |
| 46 const std::string& type, |
| 47 bool rejected, |
| 48 bool bundle_only, |
| 49 ContentDescription* description) |
| 50 : name(name), |
| 51 type(type), |
| 52 rejected(rejected), |
| 53 bundle_only(bundle_only), |
| 54 description(description) {} |
45 std::string name; | 55 std::string name; |
46 std::string type; | 56 std::string type; |
47 bool rejected; | 57 bool rejected = false; |
48 ContentDescription* description; | 58 bool bundle_only = false; |
| 59 ContentDescription* description = nullptr; |
49 }; | 60 }; |
50 | 61 |
51 typedef std::vector<std::string> ContentNames; | 62 typedef std::vector<std::string> ContentNames; |
52 | 63 |
53 // This class provides a mechanism to aggregate different media contents into a | 64 // This class provides a mechanism to aggregate different media contents into a |
54 // group. This group can also be shared with the peers in a pre-defined format. | 65 // group. This group can also be shared with the peers in a pre-defined format. |
55 // GroupInfo should be populated only with the |content_name| of the | 66 // GroupInfo should be populated only with the |content_name| of the |
56 // MediaDescription. | 67 // MediaDescription. |
57 class ContentGroup { | 68 class ContentGroup { |
58 public: | 69 public: |
(...skipping 61 matching lines...) Loading... |
120 | 131 |
121 // Content mutators. | 132 // Content mutators. |
122 // Adds a content to this description. Takes ownership of ContentDescription*. | 133 // Adds a content to this description. Takes ownership of ContentDescription*. |
123 void AddContent(const std::string& name, | 134 void AddContent(const std::string& name, |
124 const std::string& type, | 135 const std::string& type, |
125 ContentDescription* description); | 136 ContentDescription* description); |
126 void AddContent(const std::string& name, | 137 void AddContent(const std::string& name, |
127 const std::string& type, | 138 const std::string& type, |
128 bool rejected, | 139 bool rejected, |
129 ContentDescription* description); | 140 ContentDescription* description); |
| 141 void AddContent(const std::string& name, |
| 142 const std::string& type, |
| 143 bool rejected, |
| 144 bool bundle_only, |
| 145 ContentDescription* description); |
130 bool RemoveContentByName(const std::string& name); | 146 bool RemoveContentByName(const std::string& name); |
131 | 147 |
132 // Transport accessors. | 148 // Transport accessors. |
133 const TransportInfos& transport_infos() const { return transport_infos_; } | 149 const TransportInfos& transport_infos() const { return transport_infos_; } |
134 TransportInfos& transport_infos() { return transport_infos_; } | 150 TransportInfos& transport_infos() { return transport_infos_; } |
135 const TransportInfo* GetTransportInfoByName( | 151 const TransportInfo* GetTransportInfoByName( |
136 const std::string& name) const; | 152 const std::string& name) const; |
137 TransportInfo* GetTransportInfoByName(const std::string& name); | 153 TransportInfo* GetTransportInfoByName(const std::string& name); |
138 const TransportDescription* GetTransportDescriptionByName( | 154 const TransportDescription* GetTransportDescriptionByName( |
139 const std::string& name) const { | 155 const std::string& name) const { |
(...skipping 41 matching lines...) Loading... |
181 | 197 |
182 // Indicates whether a ContentDescription was sent by the local client | 198 // Indicates whether a ContentDescription was sent by the local client |
183 // or received from the remote client. | 199 // or received from the remote client. |
184 enum ContentSource { | 200 enum ContentSource { |
185 CS_LOCAL, CS_REMOTE | 201 CS_LOCAL, CS_REMOTE |
186 }; | 202 }; |
187 | 203 |
188 } // namespace cricket | 204 } // namespace cricket |
189 | 205 |
190 #endif // WEBRTC_P2P_BASE_SESSIONDESCRIPTION_H_ | 206 #endif // WEBRTC_P2P_BASE_SESSIONDESCRIPTION_H_ |
OLD | NEW |