示例#1
0
        void ReleaseSenderObjects()
        {
            // Total synchronization: This may cause a frame hiccup, but it's
            // needed to dispose the readback buffers safely.
            AsyncGPUReadback.WaitAllRequests();

            // Game view capture method: Leave the sender instance without
            // disposing (we're not the owner) but synchronize it. It's needed to
            // dispose the readback buffers safely too.
            if (SharedInstance.IsGameViewSend(_send))
            {
                _send.SendVideoAsync(); // Sync by null-send
                _send = null;
            }

            // Private objet disposal
            _send?.Dispose();
            _send = null;

            _pool?.Dispose();
            _pool = null;

            _converter?.Dispose();
            _converter = null;

            // We don't dispose _onReadback because it's reusable.
        }
示例#2
0
        void PrepareInternalObjects()
        {
            emptyVideoFrame = new Interop.VideoFrame
            {
                Width      = 0,
                Height     = 0,
                LineStride = 0,
                FourCC     = _enableAlpha ?
                             Interop.FourCC.UYVA : Interop.FourCC.UYVY,
                FrameFormat = Interop.FrameFormat.Progressive,
                Data        = IntPtr.Zero,
                Metadata    = IntPtr.Zero
            };

            if (_send == null)
            {
                _send = _captureMethod == CaptureMethod.GameView ?
                        SharedInstance.GameViewSend : Interop.Send.Create(_ndiName);
            }
            if (_converter == null)
            {
                _converter = new FormatConverter(_resources);
            }
            if (_onReadback == null)
            {
                _onReadback = OnReadback;
            }
        }
示例#3
0
        void PrepareSenderObjects()
        {
            // Game view capture method: Borrow the shared sender instance.
            if (_send == null && captureMethod == CaptureMethod.GameView)
            {
                _send = SharedInstance.GameViewSend;
            }

            // Private object initialization
            if (_send == null)
            {
                _send = Interop.Send.Create(ndiName);
            }
            if (_pool == null)
            {
                _pool = new ReadbackPool();
            }
            if (_converter == null)
            {
                _converter = new FormatConverter(_resources);
            }
            if (_onReadback == null)
            {
                _onReadback = OnReadback;
            }
        }
示例#4
0
        void ReleaseInternalObjects()
        {
            _send?.Dispose();
            _send = null;

            _converter?.Dispose();
            _converter = null;
        }
示例#5
0
        void ReleaseInternalObjects()
        {
            _recv?.Dispose();
            _recv = null;

            _converter?.Dispose();
            _converter = null;
        }
示例#6
0
        void ReleaseReceiverObjects()
        {
            _recv?.Dispose();
            _recv = null;

            _converter?.Dispose();
            _converter = null;

            // We don't dispose _override because it's reusable.
        }
示例#7
0
        void ReleaseInternalObjects()
        {
            if (_send != null && !SharedInstance.IsGameViewSend(_send))
            {
                _send.Dispose();
            }
            _send = null;

            _converter?.Dispose();
            _converter = null;
        }
示例#8
0
 void PrepareInternalObjects()
 {
     if (_send == null)
     {
         _send = Interop.Send.Create(_ndiName);
     }
     if (_converter == null)
     {
         _converter = new FormatConverter(_resources);
     }
     if (_onReadback == null)
     {
         _onReadback = OnReadback;
     }
 }
示例#9
0
 void PrepareInternalObjects()
 {
     if (_recv == null)
     {
         _recv = RecvHelper.TryCreateRecv(_ndiName);
     }
     if (_converter == null)
     {
         _converter = new FormatConverter(_resources);
     }
     if (_override == null)
     {
         _override = new MaterialPropertyBlock();
     }
 }
示例#10
0
        void ReleaseInternalObjects()
        {
            lock (threadlock)
            {
                videoFrameQueue.Clear();
                audioBuffer.Clear();
                metadataFrameQueue.Clear();
                audioMetadataQueue.Clear();

                _recv?.Dispose();
                _recv = null;
            }
            _converter?.Dispose();
            _converter = null;
        }
示例#11
0
 void PrepareInternalObjects()
 {
     if (_send == null)
     {
         _send = _captureMethod == CaptureMethod.GameView ?
                 SharedInstance.GameViewSend : Interop.Send.Create(_ndiName);
     }
     if (_converter == null)
     {
         _converter = new FormatConverter(_resources);
     }
     if (_onReadback == null)
     {
         _onReadback = OnReadback;
     }
 }
示例#12
0
        void PrepareInternalObjects()
        {
            if (_recv == null)
            {
                _recv = RecvHelper.TryCreateRecv(_ndiName, _colorFormat, _bandwidth);
                if (_recv != null)
                {
                    // Send Connection acknowledgment
                    SendMetadataFrame(connectionAcknowledgement);
                }
            }

            if (_converter == null)
            {
                _converter = new FormatConverter(_resources);
            }
            if (_override == null)
            {
                _override = new MaterialPropertyBlock();
            }
        }