Browse Source

Fixed compilation with libjuice

Paul-Louis Ageneau 5 years ago
parent
commit
17ba9af2e1
4 changed files with 5 additions and 10 deletions
  1. 0 4
      include/rtc/candidate.hpp
  2. 0 2
      include/rtc/peerconnection.hpp
  3. 0 2
      src/candidate.cpp
  4. 5 2
      src/peerconnection.cpp

+ 0 - 4
include/rtc/candidate.hpp

@@ -25,7 +25,6 @@
 
 namespace rtc {
 
-#if not USE_JUICE
 enum class CandidateType { Host = 0, ServerReflexive, PeerReflexive, Relayed };
 enum class CandidateTransportType { Udp = 0, TcpActive, TcpPassive, TcpSo };
 struct CandidateInfo {
@@ -34,7 +33,6 @@ struct CandidateInfo {
 	CandidateType type;
 	CandidateTransportType transportType;
 };
-#endif
 
 class Candidate {
 public:
@@ -57,10 +55,8 @@ private:
 } // namespace rtc
 
 std::ostream &operator<<(std::ostream &out, const rtc::Candidate &candidate);
-#if not USE_JUICE
 std::ostream &operator<<(std::ostream &out, const rtc::CandidateType &type);
 std::ostream &operator<<(std::ostream &out, const rtc::CandidateTransportType &transportType);
-#endif
 
 #endif
 

+ 0 - 2
include/rtc/peerconnection.hpp

@@ -87,9 +87,7 @@ public:
 	void onStateChange(std::function<void(State state)> callback);
 	void onGatheringStateChange(std::function<void(GatheringState state)> callback);
 
-#if not USE_JUICE
 	bool getSelectedCandidatePair(CandidateInfo *local, CandidateInfo *remote);
-#endif
 
 private:
 	init_token mInitToken = Init::Token();

+ 0 - 2
src/candidate.cpp

@@ -132,7 +132,6 @@ std::ostream &operator<<(std::ostream &out, const rtc::Candidate &candidate) {
 	return out << std::string(candidate);
 }
 
-#if not USE_JUICE
 std::ostream &operator<<(std::ostream &out, const rtc::CandidateType &type) {
 	switch (type) {
 	case rtc::CandidateType::Host:
@@ -162,4 +161,3 @@ std::ostream &operator<<(std::ostream &out, const rtc::CandidateTransportType &t
 		return out << "Unknown";
 	}
 }
-#endif

+ 5 - 2
src/peerconnection.cpp

@@ -569,12 +569,15 @@ void PeerConnection::resetCallbacks() {
 	mGatheringStateChangeCallback = nullptr;
 }
 
-#if not USE_JUICE
 bool PeerConnection::getSelectedCandidatePair(CandidateInfo *local, CandidateInfo *remote) {
+#if not USE_JUICE
 	auto iceTransport = std::atomic_load(&mIceTransport);
 	return iceTransport->getSelectedCandidatePair(local, remote);
-}
+#else
+	PLOG_WARNING << "getSelectedCandidatePair is not implemented for libjuice";
+	return false;
 #endif
+}
 
 } // namespace rtc