OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 // This indeicates the index (starting at zero) of m-line in the SDP this | 64 // This indeicates the index (starting at zero) of m-line in the SDP this |
65 // candidate is assocated with. | 65 // candidate is assocated with. |
66 virtual int sdp_mline_index() const = 0; | 66 virtual int sdp_mline_index() const = 0; |
67 virtual const cricket::Candidate& candidate() const = 0; | 67 virtual const cricket::Candidate& candidate() const = 0; |
68 // Creates a SDP-ized form of this candidate. | 68 // Creates a SDP-ized form of this candidate. |
69 virtual bool ToString(std::string* out) const = 0; | 69 virtual bool ToString(std::string* out) const = 0; |
70 }; | 70 }; |
71 | 71 |
72 // Creates a IceCandidateInterface based on SDP string. | 72 // Creates a IceCandidateInterface based on SDP string. |
73 // Returns NULL if the sdp string can't be parsed. | 73 // Returns NULL if the sdp string can't be parsed. |
74 // TODO(ronghuawu): Deprecated. | |
75 IceCandidateInterface* CreateIceCandidate(const std::string& sdp_mid, | |
76 int sdp_mline_index, | |
77 const std::string& sdp); | |
78 | |
79 // |error| can be NULL if doesn't care about the failure reason. | 74 // |error| can be NULL if doesn't care about the failure reason. |
80 IceCandidateInterface* CreateIceCandidate(const std::string& sdp_mid, | 75 IceCandidateInterface* CreateIceCandidate(const std::string& sdp_mid, |
81 int sdp_mline_index, | 76 int sdp_mline_index, |
82 const std::string& sdp, | 77 const std::string& sdp, |
83 SdpParseError* error); | 78 SdpParseError* error); |
84 | 79 |
85 // This class represents a collection of candidates for a specific m-line. | 80 // This class represents a collection of candidates for a specific m-line. |
86 // This class is used in SessionDescriptionInterface to represent all known | 81 // This class is used in SessionDescriptionInterface to represent all known |
87 // candidates for a certain m-line. | 82 // candidates for a certain m-line. |
88 class IceCandidateCollection { | 83 class IceCandidateCollection { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 virtual size_t number_of_mediasections() const = 0; | 116 virtual size_t number_of_mediasections() const = 0; |
122 // Returns a collection of all candidates that belong to a certain m-line | 117 // Returns a collection of all candidates that belong to a certain m-line |
123 virtual const IceCandidateCollection* candidates( | 118 virtual const IceCandidateCollection* candidates( |
124 size_t mediasection_index) const = 0; | 119 size_t mediasection_index) const = 0; |
125 // Serializes the description to SDP. | 120 // Serializes the description to SDP. |
126 virtual bool ToString(std::string* out) const = 0; | 121 virtual bool ToString(std::string* out) const = 0; |
127 }; | 122 }; |
128 | 123 |
129 // Creates a SessionDescriptionInterface based on SDP string and the type. | 124 // Creates a SessionDescriptionInterface based on SDP string and the type. |
130 // Returns NULL if the sdp string can't be parsed or the type is unsupported. | 125 // Returns NULL if the sdp string can't be parsed or the type is unsupported. |
131 // TODO(ronghuawu): Deprecated. | |
132 SessionDescriptionInterface* CreateSessionDescription(const std::string& type, | |
133 const std::string& sdp); | |
134 | |
135 // |error| can be NULL if doesn't care about the failure reason. | 126 // |error| can be NULL if doesn't care about the failure reason. |
136 SessionDescriptionInterface* CreateSessionDescription(const std::string& type, | 127 SessionDescriptionInterface* CreateSessionDescription(const std::string& type, |
137 const std::string& sdp, | 128 const std::string& sdp, |
138 SdpParseError* error); | 129 SdpParseError* error); |
139 | 130 |
140 // Jsep CreateOffer and CreateAnswer callback interface. | 131 // Jsep CreateOffer and CreateAnswer callback interface. |
141 class CreateSessionDescriptionObserver : public rtc::RefCountInterface { | 132 class CreateSessionDescriptionObserver : public rtc::RefCountInterface { |
142 public: | 133 public: |
143 // The implementation of the CreateSessionDescriptionObserver takes | 134 // The implementation of the CreateSessionDescriptionObserver takes |
144 // the ownership of the |desc|. | 135 // the ownership of the |desc|. |
(...skipping 10 matching lines...) Expand all Loading... |
155 virtual void OnSuccess() = 0; | 146 virtual void OnSuccess() = 0; |
156 virtual void OnFailure(const std::string& error) = 0; | 147 virtual void OnFailure(const std::string& error) = 0; |
157 | 148 |
158 protected: | 149 protected: |
159 ~SetSessionDescriptionObserver() {} | 150 ~SetSessionDescriptionObserver() {} |
160 }; | 151 }; |
161 | 152 |
162 } // namespace webrtc | 153 } // namespace webrtc |
163 | 154 |
164 #endif // TALK_APP_WEBRTC_JSEP_H_ | 155 #endif // TALK_APP_WEBRTC_JSEP_H_ |
OLD | NEW |