mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-02-27 10:40:52 +08:00
修复拼写错误,并精简WebRtcClient无用代码
This commit is contained in:
@@ -1060,7 +1060,7 @@ IceAgent::IceAgent(Listener* listener, Implementation implementation, Role role,
|
||||
}, getPoller());
|
||||
}
|
||||
|
||||
void IceAgent::gatheringCandidate(const CandidateTuple::Ptr& candidate_tuple, bool gathering_rflx, bool gathering_realy) {
|
||||
void IceAgent::gatheringCandidate(const CandidateTuple::Ptr& candidate_tuple, bool gathering_rflx, bool gathering_relay) {
|
||||
// TraceL;
|
||||
|
||||
auto interfaces = SockUtil::getInterfaceList();
|
||||
@@ -1091,11 +1091,11 @@ void IceAgent::gatheringCandidate(const CandidateTuple::Ptr& candidate_tuple, bo
|
||||
gatheringSrflxCandidate(pair);
|
||||
}
|
||||
|
||||
if (gathering_realy) {
|
||||
if (gathering_relay) {
|
||||
//TODO: 代优化relay_socket 复用host socket当前SocketCandidateManager数据结构不支持
|
||||
auto relay_socket = createSocket(candidate_tuple->_transport, candidate_tuple->_addr._host, candidate_tuple->_addr._port, local_ip);
|
||||
_socket_candidate_manager.addRelaySocket(relay_socket);
|
||||
gatheringRealyCandidate(std::make_shared<Pair>(std::move(relay_socket)));
|
||||
gatheringRelayCandidate(std::make_shared<Pair>(std::move(relay_socket)));
|
||||
}
|
||||
} catch (std::exception &ex) {
|
||||
WarnL << ex.what();
|
||||
@@ -1163,7 +1163,7 @@ void IceAgent::gatheringSrflxCandidate(const Pair::Ptr& pair) {
|
||||
sendBindRequest(pair, std::move(handle));
|
||||
}
|
||||
|
||||
void IceAgent::gatheringRealyCandidate(const Pair::Ptr &pair) {
|
||||
void IceAgent::gatheringRelayCandidate(const Pair::Ptr &pair) {
|
||||
// TraceL;
|
||||
sendAllocateRequest(pair);
|
||||
}
|
||||
@@ -1850,12 +1850,12 @@ void IceAgent::sendSocketData(const Buffer::Ptr& buf, const Pair::Ptr& pair, boo
|
||||
}
|
||||
|
||||
if (use_pair->_relayed_addr) {
|
||||
return sendRealyPacket(buf, use_pair, flush);
|
||||
return sendRelayPacket(buf, use_pair, flush);
|
||||
}
|
||||
return sendSocketData_l(buf, use_pair, flush);
|
||||
}
|
||||
|
||||
void IceAgent::sendRealyPacket(const Buffer::Ptr& buffer, const Pair::Ptr& pair, bool flush) {
|
||||
void IceAgent::sendRelayPacket(const Buffer::Ptr &buffer, const Pair::Ptr &pair, bool flush) {
|
||||
// TraceL;
|
||||
auto forward_pair = std::make_shared<Pair>(*pair);
|
||||
auto peer_addr = std::move(forward_pair->_relayed_addr);
|
||||
|
||||
@@ -509,7 +509,7 @@ public:
|
||||
_ice_server = std::move(ice_server);
|
||||
}
|
||||
|
||||
void gatheringCandidate(const CandidateTuple::Ptr& candidate_tuple, bool gathering_rflx, bool gathering_realy);
|
||||
void gatheringCandidate(const CandidateTuple::Ptr& candidate_tuple, bool gathering_rflx, bool gathering_relay);
|
||||
void connectivityCheck(CandidateInfo& candidate);
|
||||
void nominated(const Pair::Ptr& pair, CandidateTuple& candidate);
|
||||
|
||||
@@ -556,7 +556,7 @@ public:
|
||||
|
||||
protected:
|
||||
void gatheringSrflxCandidate(const Pair::Ptr& pair);
|
||||
void gatheringRealyCandidate(const Pair::Ptr& pair);
|
||||
void gatheringRelayCandidate(const Pair::Ptr& pair);
|
||||
void localRelayedConnectivityCheck(CandidateInfo& candidate);
|
||||
void connectivityCheck(const Pair::Ptr& pair, CandidateTuple& candidate);
|
||||
void tryTriggerredCheck(const Pair::Ptr& pair);
|
||||
@@ -587,7 +587,7 @@ protected:
|
||||
void refreshChannelBindings();
|
||||
|
||||
void sendSendIndication(const sockaddr_storage& peer_addr, const toolkit::Buffer::Ptr& buffer, const Pair::Ptr& pair);
|
||||
void sendRealyPacket(const toolkit::Buffer::Ptr& buffer, const Pair::Ptr& pair, bool flush);
|
||||
void sendRelayPacket(const toolkit::Buffer::Ptr& buffer, const Pair::Ptr& pair, bool flush);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -11,9 +11,6 @@
|
||||
#ifndef ZLMEDIAKIT_WEBRTC_CLIENT_H
|
||||
#define ZLMEDIAKIT_WEBRTC_CLIENT_H
|
||||
|
||||
#include "Network/Socket.h"
|
||||
#include "Poller/Timer.h"
|
||||
#include "Util/TimeTicker.h"
|
||||
#include "Http/HttpRequester.h"
|
||||
#include "Sdp.h"
|
||||
#include "WebRtcTransport.h"
|
||||
@@ -46,14 +43,6 @@ public:
|
||||
private:
|
||||
};
|
||||
|
||||
namespace Rtc {
|
||||
typedef enum {
|
||||
Signaling_Invalid = -1,
|
||||
Signaling_WHEP_WHIP = 0,
|
||||
Signaling_WEBSOCKET = 1,
|
||||
} eSignalingProtocols;
|
||||
} // namespace Rtc
|
||||
|
||||
// 实现了webrtc代理功能
|
||||
class WebRtcClient : public std::enable_shared_from_this<WebRtcClient> {
|
||||
public:
|
||||
@@ -97,8 +86,6 @@ protected:
|
||||
WebRtcTransport::Ptr _transport = nullptr;
|
||||
bool _is_negotiate_finished = false;
|
||||
|
||||
private:
|
||||
std::map<std::string /*candidate key*/, toolkit::SocketHelper::Ptr> _socket_map;
|
||||
};
|
||||
|
||||
} /*namespace mediakit */
|
||||
|
||||
Reference in New Issue
Block a user