I've been able to successfully build and link against webrtc.lib to create an audio only peer connection. I'm now looking at adding video but am stuck at missing symbols for webrtc::CreateBuiltinVideoEncoderFactory() and webrtc::CreateBuiltinVideoDecoderFactory().
I've checked the gn options and done some trial and error testing with enabling h264, h265, vp9 to see if that makes a difference but to no avail.
Is there any kind of trick to get the libwebrtc build on Windows to include video encoding or is it always meant to be included? A few years ago I built against m90 and those two symbols were there. I'm now building m132 and they're missing for me.
My gn args are:
gn gen out/Default --args="is_debug=false rtc_include_tests=false treat_warnings_as_errors=false use_custom_libcxx=false"
The relevant app code is:
SignalingThread = rtc::Thread::Create();
SignalingThread->Start();
webrtc::AudioProcessing::Config apmConfig;
apmConfig.gain_controller1.enabled = false;
apmConfig.gain_controller2.enabled = false;
auto apm = webrtc::BuiltinAudioProcessingBuilder(apmConfig).Build(webrtc::CreateEnvironment());
webrtc::PeerConnectionFactoryDependencies _pcf_deps;
_pcf_deps.task_queue_factory = webrtc::CreateDefaultTaskQueueFactory();
_pcf_deps.signaling_thread = SignalingThread.get();
_pcf_deps.event_log_factory = std::make_unique<webrtc::RtcEventLogFactory>(_pcf_deps.task_queue_factory.get());
_pcf_deps.audio_encoder_factory = webrtc::CreateBuiltinAudioEncoderFactory();
_pcf_deps.audio_decoder_factory = webrtc::CreateBuiltinAudioDecoderFactory();
//_pcf_deps.video_encoder_factory = webrtc::CreateBuiltinVideoEncoderFactory(); // Missing symbol in my m132 build.
//_pcf_deps.video_decoder_factory = webrtc::CreateBuiltinVideoDecoderFactory(); // Missing symbol in my m132 build.
_pcf_deps.adm = rtc::scoped_refptr<webrtc::AudioDeviceModule>(FakeAudioCaptureModule::Create());
_pcf_deps.audio_processing = apm; // Gets moved in EnableMedia.
webrtc::EnableMedia(_pcf_deps);
_peerConnectionFactory = webrtc::CreateModularPeerConnectionFactory(std::move(_pcf_deps));
And the linker errors when the two lines are uncommented:
undefined symbol: class std::unique_ptr<class webrtc::VideoEncoderFactory, struct std::default_delete<class webrtc::VideoEncoderFactory>> __cdecl webrtc::CreateBuiltinVideoEncoderFactory(void)
undefined symbol: class std::unique_ptr<class webrtc::VideoDecoderFactory, struct std::default_delete<class webrtc::VideoDecoderFactory>> __cdecl webrtc::CreateBuiltinVideoDecoderFactory(void)
Any hints or tips appreciated.
Aaron