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 |
11 // Interfaces matching the draft-ietf-rtcweb-jsep-01. | 11 // Interfaces matching the draft-ietf-rtcweb-jsep-01. |
12 | 12 |
13 #ifndef WEBRTC_API_JSEP_H_ | 13 #ifndef WEBRTC_API_JSEP_H_ |
14 #define WEBRTC_API_JSEP_H_ | 14 #define WEBRTC_API_JSEP_H_ |
15 | 15 |
16 #include <string> | 16 #include <string> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "webrtc/base/basictypes.h" | 19 #include "webrtc/base/basictypes.h" |
20 #include "webrtc/base/refcount.h" | 20 #include "webrtc/base/refcount.h" |
21 | 21 |
22 namespace cricket { | 22 namespace cricket { |
| 23 class SessionDescription; |
23 class Candidate; | 24 class Candidate; |
24 class SessionDescription; | |
25 } // namespace cricket | 25 } // namespace cricket |
26 | 26 |
27 namespace webrtc { | 27 namespace webrtc { |
28 | 28 |
29 struct SdpParseError { | 29 struct SdpParseError { |
30 public: | 30 public: |
31 // The sdp line that causes the error. | 31 // The sdp line that causes the error. |
32 std::string line; | 32 std::string line; |
33 // Explains the error. | 33 // Explains the error. |
34 std::string description; | 34 std::string description; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // Get the session id and session version, which are defined based on | 88 // Get the session id and session version, which are defined based on |
89 // RFC 4566 for the SDP o= line. | 89 // RFC 4566 for the SDP o= line. |
90 virtual std::string session_id() const = 0; | 90 virtual std::string session_id() const = 0; |
91 virtual std::string session_version() const = 0; | 91 virtual std::string session_version() const = 0; |
92 virtual std::string type() const = 0; | 92 virtual std::string type() const = 0; |
93 // Adds the specified candidate to the description. | 93 // Adds the specified candidate to the description. |
94 // Ownership is not transferred. | 94 // Ownership is not transferred. |
95 // Returns false if the session description does not have a media section that | 95 // Returns false if the session description does not have a media section that |
96 // corresponds to the |candidate| label. | 96 // corresponds to the |candidate| label. |
97 virtual bool AddCandidate(const IceCandidateInterface* candidate) = 0; | 97 virtual bool AddCandidate(const IceCandidateInterface* candidate) = 0; |
98 // Removes the candidates from the description. | |
99 // Returns the number of candidates removed. | |
100 virtual size_t RemoveCandidates( | |
101 const std::vector<cricket::Candidate>& candidates) = 0; | |
102 | |
103 // Returns the number of m- lines in the session description. | 98 // Returns the number of m- lines in the session description. |
104 virtual size_t number_of_mediasections() const = 0; | 99 virtual size_t number_of_mediasections() const = 0; |
105 // Returns a collection of all candidates that belong to a certain m-line | 100 // Returns a collection of all candidates that belong to a certain m-line |
106 virtual const IceCandidateCollection* candidates( | 101 virtual const IceCandidateCollection* candidates( |
107 size_t mediasection_index) const = 0; | 102 size_t mediasection_index) const = 0; |
108 // Serializes the description to SDP. | 103 // Serializes the description to SDP. |
109 virtual bool ToString(std::string* out) const = 0; | 104 virtual bool ToString(std::string* out) const = 0; |
110 }; | 105 }; |
111 | 106 |
112 // Creates a SessionDescriptionInterface based on SDP string and the type. | 107 // Creates a SessionDescriptionInterface based on SDP string and the type. |
(...skipping 21 matching lines...) Expand all Loading... |
134 virtual void OnSuccess() = 0; | 129 virtual void OnSuccess() = 0; |
135 virtual void OnFailure(const std::string& error) = 0; | 130 virtual void OnFailure(const std::string& error) = 0; |
136 | 131 |
137 protected: | 132 protected: |
138 ~SetSessionDescriptionObserver() {} | 133 ~SetSessionDescriptionObserver() {} |
139 }; | 134 }; |
140 | 135 |
141 } // namespace webrtc | 136 } // namespace webrtc |
142 | 137 |
143 #endif // WEBRTC_API_JSEP_H_ | 138 #endif // WEBRTC_API_JSEP_H_ |
OLD | NEW |