This commit is contained in:
Théo Monnom
2022-05-23 19:36:13 +02:00
parent 8d20e35f02
commit 112bc2de9c
9 changed files with 206 additions and 30 deletions
+29 -5
View File
@@ -6,20 +6,44 @@
#define LIVEKIT_NATIVE_RTC_ENGINE_H
#include "signal_client.h"
#include "peer_observer.h"
#include <api/peer_connection_interface.h>
namespace livekit{
class RTCEngine {
public:
RTCEngine();
void Join(const std::string &url, const std::string &token);
void Update();
private:
void configure();
void Configure();
void OnJoin(const JoinResponse &res);
private:
SignalClient m_Client;
// Wrapper for our PeerConnection ( Int. Impl. )
class PeerTransport {
public:
explicit PeerTransport(const RTCEngine &rtc_engine);
rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection;
std::unique_ptr<PeerObserver> observer;
};
SignalClient client_;
rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> peer_factory_;
webrtc::PeerConnectionInterface::RTCConfiguration configuration_;
std::unique_ptr<rtc::Thread> network_thread_;
std::unique_ptr<rtc::Thread> worker_thread_;
std::unique_ptr<rtc::Thread> signaling_thread_;
std::unique_ptr<PeerTransport> publisher_;
std::unique_ptr<PeerTransport> subscriber_;
};
};
} // livekit
#endif //LIVEKIT_NATIVE_RTC_ENGINE_H