Ejemplo n.º 1
0
 public static void EnsureCurrentThread(this RtcThread thread)
 {
     if (!thread.IsCurrent)
     {
         throw new InvalidOperationException();
     }
 }
Ejemplo n.º 2
0
 public void Initialize()
 {
     if (Interlocked.CompareExchange(ref _initialisationState, 1, 0) >= 1)
     {
         throw new InvalidOperationException();
     }
     PeerConnectionFactoryInterop.Initialize(Handle);
     SignallingThread = new RtcThread(PeerConnectionFactoryInterop.GetSignallingThread(Handle));
 }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="unmanagedPointer"></param>
        /// <param name="observer">Keep ref only, does not own observer</param>
        internal PeerConnection(IntPtr unmanagedPointer, PeerConnectionObserver observer, RtcThread signallingThread)
        {
            _handle           = new PeerConnectionSafeHandle(unmanagedPointer);
            _signallingThread = signallingThread
                                ?? throw new ArgumentNullException(nameof(signallingThread));
            Observer = observer;
            Id       = Guid.NewGuid();

            if (Debugger.IsAttached)
            {
                var index = Interlocked.Increment(ref _debugIdPtr);
                if (index < _debugIds.Count)
                {
                    Id = _debugIds[index];
                }
            }
        }
Ejemplo n.º 4
0
 public RtcThreadAdapter(RtcThread original)
 {
     _original = original ?? throw new ArgumentNullException(nameof(original));
 }
Ejemplo n.º 5
0
 public RtpSender(IntPtr rtpSenderPtr, RtcThread signallingThread)
 {
     Handle            = new RtpSenderSafeHandle(rtpSenderPtr);
     _signallingThread = signallingThread
                         ?? throw new ArgumentNullException(nameof(signallingThread));
 }