cleanup: webrtc-sys & fix RtcRuntime disposing crashes (#81)
This commit is contained in:
@@ -21,30 +21,31 @@
|
||||
#include "peer_connection.h"
|
||||
#include "rtp_parameters.h"
|
||||
#include "rust/cxx.h"
|
||||
#include "webrtc-sys/src/peer_connection.rs.h"
|
||||
#include "webrtc.h"
|
||||
|
||||
namespace livekit {
|
||||
using NativeRTCConfiguration =
|
||||
webrtc::PeerConnectionInterface::RTCConfiguration;
|
||||
|
||||
class PeerConnectionFactory;
|
||||
} // namespace livekit
|
||||
#include "webrtc-sys/src/peer_connection_factory.rs.h"
|
||||
|
||||
namespace livekit {
|
||||
|
||||
webrtc::PeerConnectionInterface::RTCConfiguration to_native_rtc_configuration(
|
||||
RtcConfiguration config);
|
||||
|
||||
class PeerConnectionFactory {
|
||||
public:
|
||||
explicit PeerConnectionFactory(std::shared_ptr<RTCRuntime> rtc_runtime);
|
||||
explicit PeerConnectionFactory(std::shared_ptr<RtcRuntime> rtc_runtime);
|
||||
~PeerConnectionFactory();
|
||||
|
||||
std::shared_ptr<PeerConnection> create_peer_connection(
|
||||
std::unique_ptr<NativeRTCConfiguration> config,
|
||||
NativePeerConnectionObserver* observer) const;
|
||||
RtcConfiguration config,
|
||||
std::unique_ptr<NativePeerConnectionObserver> observer) const;
|
||||
|
||||
std::shared_ptr<VideoTrack> create_video_track(
|
||||
rust::String label,
|
||||
std::shared_ptr<AdaptedVideoTrackSource> source) const;
|
||||
std::shared_ptr<VideoTrackSource> source) const;
|
||||
|
||||
std::shared_ptr<AudioTrack> create_audio_track(
|
||||
rust::String label,
|
||||
@@ -55,12 +56,9 @@ class PeerConnectionFactory {
|
||||
RtpCapabilities get_rtp_receiver_capabilities(MediaType type) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<RTCRuntime> rtc_runtime_;
|
||||
std::shared_ptr<RtcRuntime> rtc_runtime_;
|
||||
rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> peer_factory_;
|
||||
};
|
||||
|
||||
std::shared_ptr<PeerConnectionFactory> create_peer_connection_factory(
|
||||
std::shared_ptr<RTCRuntime> rtc_runtime);
|
||||
std::unique_ptr<NativeRTCConfiguration> create_rtc_configuration(
|
||||
RTCConfiguration conf);
|
||||
std::shared_ptr<PeerConnectionFactory> create_peer_connection_factory();
|
||||
} // namespace livekit
|
||||
|
||||
Reference in New Issue
Block a user