This commit is contained in:
Théo Monnom
2022-09-16 11:45:39 +02:00
parent f643f458f8
commit 06587d154f
20 changed files with 261 additions and 267 deletions
@@ -7,8 +7,10 @@
#include <memory>
#include "api/data_channel_interface.h"
#include "rust_types.h"
namespace livekit {
using NativeDataChannelInit = webrtc::DataChannelInit;
class DataChannel {
public:
@@ -18,9 +20,12 @@ namespace livekit {
rtc::scoped_refptr<webrtc::DataChannelInterface> data_channel_;
};
std::unique_ptr<NativeDataChannelInit> create_data_channel_init(DataChannelInit init);
static std::unique_ptr<DataChannel> _unique_data_channel(){
return nullptr; // Ignore
}
} // livekit
#endif //CLIENT_SDK_NATIVE_DATA_CHANNEL_H
@@ -40,10 +40,6 @@ namespace livekit {
return nullptr; // Ignore
}
static std::shared_ptr<SessionDescription> _shared_session_description(){
return nullptr; // Ignore
}
// SetCreateSdpObserver
class NativeCreateSdpObserver : public webrtc::CreateSessionDescriptionObserver {
@@ -19,11 +19,12 @@ namespace livekit {
public:
explicit PeerConnection(rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection, std::unique_ptr<NativePeerConnectionObserver> observer);
void close();
void create_offer(std::unique_ptr<NativeCreateSdpObserverHandle> observer, RTCOfferAnswerOptions options);
void create_answer(std::unique_ptr<NativeCreateSdpObserverHandle> observer, RTCOfferAnswerOptions options);
void set_local_description(std::unique_ptr<SessionDescription> desc, std::unique_ptr<NativeSetLocalSdpObserverHandle> observer);
void set_remote_description(std::unique_ptr<SessionDescription> desc, std::unique_ptr<NativeSetRemoteSdpObserverHandle> observer);
std::unique_ptr<DataChannel> create_data_channel(rust::String label, std::unique_ptr<NativeDataChannelInit> init);
void close();
private:
rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_;
@@ -18,6 +18,7 @@ namespace livekit {
// Shared types
struct RTCOfferAnswerOptions;
struct RTCError;
struct DataChannelInit;
}
#endif //RUST_TYPES_H