fix: datachannel deadlocks & dispose crashes (#87)

- Fix datachannel deadlock on dispose
- Fix audio device being disposed on the wrong thread
- Allow multiple RtcRuntime to be created (Useful for unit tests where we use multiple PeerConnectionFactory)
This commit is contained in:
Théo Monnom
2023-06-10 18:49:00 +02:00
committed by GitHub
parent ebbd93b2d8
commit 33dfcb27b0
9 changed files with 90 additions and 39 deletions
@@ -17,6 +17,8 @@
#pragma once
#include "api/peer_connection_interface.h"
#include "api/scoped_refptr.h"
#include "livekit/audio_device.h"
#include "media_stream.h"
#include "peer_connection.h"
#include "rtp_parameters.h"
@@ -57,6 +59,7 @@ class PeerConnectionFactory {
private:
std::shared_ptr<RtcRuntime> rtc_runtime_;
rtc::scoped_refptr<AudioDevice> audio_device_;
rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> peer_factory_;
};