Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(696)

Unified Diff: webrtc/api/jsep.h

Issue 1648813004: Remove candidates when doing continual gathering (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Fix a Windows compiling error Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/api/jsep.h
diff --git a/webrtc/api/jsep.h b/webrtc/api/jsep.h
index 0673ce128e053098bbc87c7ee264ce88d6a01ccf..bb8b2e3cf0d96a9e48c65a18a8a38747a98c9556 100644
--- a/webrtc/api/jsep.h
+++ b/webrtc/api/jsep.h
@@ -18,6 +18,7 @@
#include "webrtc/base/basictypes.h"
#include "webrtc/base/refcount.h"
+#include "webrtc/base/scoped_ref_ptr.h"
namespace cricket {
class SessionDescription;
@@ -37,7 +38,7 @@ struct SdpParseError {
// Class representation of an ICE candidate.
// An instance of this interface is supposed to be owned by one class at
// a time and is therefore not expected to be thread safe.
-class IceCandidateInterface {
+class IceCandidateInterface : public rtc::RefCountInterface {
public:
virtual ~IceCandidateInterface() {}
/// If present, this contains the identierfier of the "media stream
@@ -52,6 +53,8 @@ class IceCandidateInterface {
virtual bool ToString(std::string* out) const = 0;
};
+typedef rtc::scoped_refptr<IceCandidateInterface> IceCandidateInterfaceRefPtr;
+
// Creates a IceCandidateInterface based on SDP string.
// Returns NULL if the sdp string can't be parsed.
// |error| can be NULL if doesn't care about the failure reason.
@@ -95,6 +98,11 @@ class SessionDescriptionInterface {
// Returns false if the session description does not have a media section that
// corresponds to the |candidate| label.
virtual bool AddCandidate(const IceCandidateInterface* candidate) = 0;
+ // Removes the candidates that have a matching address and protocol.
+ // Returns the number of candidates removed.
+ virtual int RemoveCandidates(
+ const std::vector<IceCandidateInterfaceRefPtr>& candidates) = 0;
pthatcher1 2016/03/01 23:51:53 Why do we have to use a scoped_refptr here? Why c
honghaiz3 2016/03/02 19:06:40 We cannot do vector<IceCandidateInterface>. If so,
pthatcher1 2016/03/02 20:37:58 If this is just because we want an IceCandidateInt
honghaiz3 2016/03/03 01:17:40 It is going to be a lot more complicated to try to
+
// Returns the number of m- lines in the session description.
virtual size_t number_of_mediasections() const = 0;
// Returns a collection of all candidates that belong to a certain m-line

Powered by Google App Engine
This is Rietveld 408576698