mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
Do not use UI thread as signaling thread.
peerconnection_client sample on Windows is using the current UI thread as signaling thread. Create a dedicated thread for that purpose. Bug: webrtc:13104 Change-Id: Iccff8165373101996913c4389cf134a60051462c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/230729 Reviewed-by: Per Kjellander <perkj@webrtc.org> Commit-Queue: Per Kjellander <perkj@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35078}
This commit is contained in:
parent
7e01b85526
commit
a3d8c61313
2 changed files with 7 additions and 1 deletions
|
@ -130,9 +130,13 @@ bool Conductor::InitializePeerConnection() {
|
|||
RTC_DCHECK(!peer_connection_factory_);
|
||||
RTC_DCHECK(!peer_connection_);
|
||||
|
||||
if (!signaling_thread_.get()) {
|
||||
signaling_thread_ = rtc::Thread::CreateWithSocketServer();
|
||||
signaling_thread_->Start();
|
||||
}
|
||||
peer_connection_factory_ = webrtc::CreatePeerConnectionFactory(
|
||||
nullptr /* network_thread */, nullptr /* worker_thread */,
|
||||
nullptr /* signaling_thread */, nullptr /* default_adm */,
|
||||
signaling_thread_.get(), nullptr /* default_adm */,
|
||||
webrtc::CreateBuiltinAudioEncoderFactory(),
|
||||
webrtc::CreateBuiltinAudioDecoderFactory(),
|
||||
webrtc::CreateBuiltinVideoEncoderFactory(),
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "api/peer_connection_interface.h"
|
||||
#include "examples/peerconnection/client/main_wnd.h"
|
||||
#include "examples/peerconnection/client/peer_connection_client.h"
|
||||
#include "rtc_base/thread.h"
|
||||
|
||||
namespace webrtc {
|
||||
class VideoCaptureModule;
|
||||
|
@ -122,6 +123,7 @@ class Conductor : public webrtc::PeerConnectionObserver,
|
|||
|
||||
int peer_id_;
|
||||
bool loopback_;
|
||||
std::unique_ptr<rtc::Thread> signaling_thread_;
|
||||
rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_;
|
||||
rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface>
|
||||
peer_connection_factory_;
|
||||
|
|
Loading…
Reference in a new issue