-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Description
When attempting to instantiate a Microsoft.WinRTC.WebRtcWrapper.rtc.Thread, the WinRT.BaseActivationFactory throws an TargetInvocationException - Class not registered.
Steps to reproduce the behavior:
- Create C# projection assembly (in order to get it to compile, you must use Microsoft.Windows.CsWinRT 1.3.5) - expose the following namespaces:
<CsWinRTIncludes>
Microsoft.WinRTC.WebRtcWrapper.webrtc;
Microsoft.WinRTC.WebRtcWrapper.rtc;
Microsoft.WinRTC.WebRtcWrapper.rtc.factory_implementation;
Microsoft.WinRTC.WebRtcWrapper.cricket;
Microsoft.WinRTC.WebRtcWrapper.webrtc.PeerConnection;
Microsoft.WinRTC.WebRtcWrapper.webrtc.PeerConnectionFactory;
Microsoft.WinRTC.WebRtcWrapper.webrtc.VideoFrame;
webrtc
</CsWinRTIncludes>
The nuspec for this project contains the following dependencies:
<dependencies>
<group targetFramework="net6.0-windows10.0.19041.0" />
<group targetFramework=".NETCoreApp3.0" />
<group targetFramework="UAP10.0" />
<group targetFramework=".NETFramework4.6" />
</dependencies>
- Create a Console App which references the nuget package via local repository
- In Program.cs, paste the following (adapted from the XAML component in the samples):
using Microsoft.WinRTC.WebRtcWrapper.webrtc;
using Microsoft.WinRTC.WebRtcWrapper.webrtc.PeerConnection;
var networkThread = Microsoft.WinRTC.WebRtcWrapper.rtc.Thread.CreateWithSocketServer();
networkThread.Name = "pc_network_thread";
networkThread.Start();
var workerThread = Microsoft.WinRTC.WebRtcWrapper.rtc.Thread.Create();
workerThread.Name = "pc_worker_thread";
workerThread.Start();
var signalingThread = Microsoft.WinRTC.WebRtcWrapper.rtc.Thread.Create();
signalingThread.Name = "pc_signaling_thread";
signalingThread.Start();
var audioEncoderFactory = WebRTC.CreateBuiltinAudioEncoderFactory();
var audioDecoderFactory = WebRTC.CreateBuiltinAudioDecoderFactory();
var videoDecoderFactory = WebRTC.CreateBuiltinVideoDecoderFactory();
var videoEncoderFactory = WebRTC.CreateBuiltinVideoEncoderFactory();
var peerConnectionFactory = new PeerConnectionFactory(networkThread,
workerThread,
signalingThread,
audioEncoderFactory,
audioDecoderFactory,
videoEncoderFactory,
videoDecoderFactory);
var config = new RTCConfiguration
{
SdpSemantics = SdpSemantics.UnifiedPlan
};
// populate ice servers via (maybe) a signaling call
var iceServer = new IceServer
{
Urls = new List<string> { "stun:stun.l.google.com:19302" }
};
config.IceServers.Add(iceServer);
var peerConnectionObserver = new PeerConnectionObserver();
peerConnectionObserver.OnIceCandidate += Console.WriteLine;
var peerConnectionDependencies = new PeerConnectionDependencies(peerConnectionObserver);
var peerConnection = peerConnectionFactory.CreatePeerConnection(config, peerConnectionDependencies);
Console.WriteLine(peerConnection);
- Run, observe error
Expected behavior
Thread class is constructed without throwing COM Activation error.
Screenshots
Desktop (please complete the following information):
- OS: Windows 11
- Browser N/A
- Version [e.g. 22]
Smartphone (please complete the following information):
N/A
Metadata
Metadata
Assignees
Labels
No labels
