// // Created by Théo Monnom on 01/09/2022. // #ifndef CLIENT_SDK_NATIVE_JSEP_H #define CLIENT_SDK_NATIVE_JSEP_H #include #include "api/jsep.h" #include "rust/cxx.h" #include "rust_types.h" #include "api/ref_counted_base.h" namespace livekit { class IceCandidate { public: explicit IceCandidate(std::unique_ptr ice_candidate); private: std::unique_ptr ice_candidate_; }; static std::unique_ptr _unique_ice_candidate(){ return nullptr; // Ignore } class SessionDescription { public: explicit SessionDescription(std::unique_ptr session_description); rust::String stringify() const; std::unique_ptr clone() const; std::unique_ptr release(); private: std::unique_ptr session_description_; }; static std::unique_ptr _unique_session_description(){ return nullptr; // Ignore } static std::shared_ptr _shared_session_description(){ return nullptr; // Ignore } // SetCreateSdpObserver class NativeCreateSdpObserver : public webrtc::CreateSessionDescriptionObserver { public: explicit NativeCreateSdpObserver(rust::Box observer); void OnSuccess(webrtc::SessionDescriptionInterface* desc) override; void OnFailure(webrtc::RTCError error) override; private: rust::Box observer_; }; struct NativeCreateSdpObserverHandle { rtc::scoped_refptr observer; }; std::unique_ptr create_native_create_sdp_observer(rust::Box observer); // SetLocalSdpObserver class NativeSetLocalSdpObserver : public webrtc::SetLocalDescriptionObserverInterface{ public: explicit NativeSetLocalSdpObserver(rust::Box observer); void OnSetLocalDescriptionComplete(webrtc::RTCError error) override; private: rust::Box observer_; }; struct NativeSetLocalSdpObserverHandle { rtc::scoped_refptr observer; }; std::unique_ptr create_native_set_local_sdp_observer(rust::Box observer); // SetRemoteSdpObserver class NativeSetRemoteSdpObserver : public webrtc::SetRemoteDescriptionObserverInterface{ public: explicit NativeSetRemoteSdpObserver(rust::Box observer); void OnSetRemoteDescriptionComplete(webrtc::RTCError error) override; private: rust::Box observer_; }; struct NativeSetRemoteSdpObserverHandle { rtc::scoped_refptr observer; }; std::unique_ptr create_native_set_remote_sdp_observer(rust::Box observer); } // livekit #endif //CLIENT_SDK_NATIVE_JSEP_H