Remove now-redundant SdpSerializeCandidate from webrtc_sdp.*
Bug: webrtc:42222470
Change-Id: Ib1d2ce50f772a4f65236d483f8dd2b7b0f1bd790
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/413701
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45849}
diff --git a/pc/BUILD.gn b/pc/BUILD.gn
index d12b50d..53c5da8 100644
--- a/pc/BUILD.gn
+++ b/pc/BUILD.gn
@@ -2702,6 +2702,7 @@
"../test/pc/sctp:fake_sctp_transport",
"scenario_tests:pc_scenario_tests",
"//third_party/abseil-cpp/absl/algorithm:container",
+ "//third_party/abseil-cpp/absl/base:nullability",
"//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/strings",
"//third_party/abseil-cpp/absl/strings:str_format",
diff --git a/pc/webrtc_sdp.cc b/pc/webrtc_sdp.cc
index 468cb27..75490da 100644
--- a/pc/webrtc_sdp.cc
+++ b/pc/webrtc_sdp.cc
@@ -3248,17 +3248,6 @@
return message;
}
-// Serializes the passed in IceCandidate to a SDP string.
-// candidate - The candidate to be serialized.
-std::string SdpSerializeCandidate(const IceCandidate& candidate) {
- return SdpSerializeCandidate(candidate.candidate());
-}
-
-// Serializes a cricket Candidate.
-std::string SdpSerializeCandidate(const Candidate& candidate) {
- return candidate.ToCandidateAttribute(true);
-}
-
std::unique_ptr<SessionDescriptionInterface> SdpDeserialize(
SdpType sdp_type,
absl::string_view message,
diff --git a/pc/webrtc_sdp.h b/pc/webrtc_sdp.h
index 0ff06c4..deb5042 100644
--- a/pc/webrtc_sdp.h
+++ b/pc/webrtc_sdp.h
@@ -41,14 +41,6 @@
// return - SDP string serialized from the arguments.
std::string SdpSerialize(const SessionDescriptionInterface& jdesc);
-// Serializes the passed in IceCandidate to a SDP string.
-// candidate - The candidate to be serialized.
-std::string SdpSerializeCandidate(const IceCandidate& candidate);
-
-// Serializes a cricket Candidate.
-// candidate - The candidate to be serialized.
-RTC_EXPORT std::string SdpSerializeCandidate(const Candidate& candidate);
-
// Deserializes the `sdp` to construct a SessionDescriptionInterface object.
// sdp_type - The type of session description object that should be constructed.
// sdp - The SDP string to be Deserialized.
diff --git a/pc/webrtc_sdp_unittest.cc b/pc/webrtc_sdp_unittest.cc
index 7a541cd..119fec6 100644
--- a/pc/webrtc_sdp_unittest.cc
+++ b/pc/webrtc_sdp_unittest.cc
@@ -20,6 +20,7 @@
#include <vector>
#include "absl/algorithm/container.h"
+#include "absl/base/nullability.h"
#include "absl/memory/memory.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_replace.h"
@@ -36,7 +37,6 @@
#include "media/base/rid_description.h"
#include "media/base/stream_params.h"
#include "p2p/base/p2p_constants.h"
-#include "p2p/base/port.h"
#include "p2p/base/transport_description.h"
#include "p2p/base/transport_info.h"
#include "pc/media_protocol_names.h"
@@ -840,6 +840,15 @@
// Helper functions
+// Serializes a cricket Candidate.
+std::string SdpSerializeCandidate(const Candidate& candidate) {
+ return candidate.ToCandidateAttribute(true);
+}
+
+std::string SdpSerializeCandidate(const IceCandidate& candidate) {
+ return SdpSerializeCandidate(candidate.candidate());
+}
+
// Creates a new session description with a supplied sdp, of type
// SdpType::kOffer (kDummyType).
std::unique_ptr<SessionDescriptionInterface> SdpDeserialize(
diff --git a/sdk/android/src/jni/pc/ice_candidate.cc b/sdk/android/src/jni/pc/ice_candidate.cc
index 3a8d761..1a76d13 100644
--- a/sdk/android/src/jni/pc/ice_candidate.cc
+++ b/sdk/android/src/jni/pc/ice_candidate.cc
@@ -54,7 +54,7 @@
JNIEnv* env,
absl::string_view mid,
const Candidate& candidate) {
- std::string sdp = SdpSerializeCandidate(candidate);
+ std::string sdp = candidate.ToCandidateAttribute(true);
RTC_CHECK(!sdp.empty()) << "got an empty ICE candidate";
// sdp_mline_index is not used, pass an invalid value -1.
return CreateJavaIceCandidate(env, mid, -1 /* sdp_mline_index */, sdp,