diff --git a/examples/peerconnection/client/conductor.cc b/examples/peerconnection/client/conductor.cc index f15e221d4f..214ccfabec 100644 --- a/examples/peerconnection/client/conductor.cc +++ b/examples/peerconnection/client/conductor.cc @@ -415,18 +415,26 @@ void Conductor::AddStreams() { peer_connection_factory_->CreateAudioTrack( kAudioLabel, peer_connection_factory_->CreateAudioSource(NULL))); - rtc::scoped_refptr video_track( - peer_connection_factory_->CreateVideoTrack( - kVideoLabel, - peer_connection_factory_->CreateVideoSource(OpenVideoCaptureDevice(), - NULL))); - main_wnd_->StartLocalRenderer(video_track); + rtc::scoped_refptr video_track; + auto video_device(OpenVideoCaptureDevice()); + if (video_device) { + video_track = + peer_connection_factory_->CreateVideoTrack( + kVideoLabel, + peer_connection_factory_->CreateVideoSource(std::move(video_device), + NULL)); + main_wnd_->StartLocalRenderer(video_track); + } else { + RTC_LOG(LS_ERROR) << "OpenVideoCaptureDevice failed"; + } rtc::scoped_refptr stream = peer_connection_factory_->CreateLocalMediaStream(kStreamLabel); stream->AddTrack(audio_track); - stream->AddTrack(video_track); + if (video_track) + stream->AddTrack(video_track); + if (!peer_connection_->AddStream(stream)) { RTC_LOG(LS_ERROR) << "Adding stream to PeerConnection failed"; } diff --git a/modules/audio_device/win/audio_device_core_win.cc b/modules/audio_device/win/audio_device_core_win.cc index 834fa4ed25..4aaefc91a4 100644 --- a/modules/audio_device/win/audio_device_core_win.cc +++ b/modules/audio_device/win/audio_device_core_win.cc @@ -2634,6 +2634,10 @@ int32_t AudioDeviceWindowsCore::PlayoutDelay(uint16_t& delayMS) const { return 0; } +bool AudioDeviceWindowsCore::BuiltInAECIsAvailable() const { + return _dmo != nullptr; +} + // ---------------------------------------------------------------------------- // Playing // ---------------------------------------------------------------------------- diff --git a/modules/audio_device/win/audio_device_core_win.h b/modules/audio_device/win/audio_device_core_win.h index b5c2b72d30..a11849da77 100644 --- a/modules/audio_device/win/audio_device_core_win.h +++ b/modules/audio_device/win/audio_device_core_win.h @@ -170,6 +170,8 @@ public: // Delay information and control virtual int32_t PlayoutDelay(uint16_t& delayMS) const; + virtual bool BuiltInAECIsAvailable() const; + virtual int32_t EnableBuiltInAEC(bool enable); public: