void HandleFrameArrived(MediaFrameReader sender, MediaFrameArrivedEventArgs args) { if (FrameSampleAcquired == null) { return; } using (var frameReference = _frameReader.TryAcquireLatestFrame()) //frameReference is a MediaFrameReference { if (frameReference != null) { var sample = new VideoCaptureSample(frameReference, worldOrigin); FrameSampleAcquired?.Invoke(sample); } } }
private void OnFrameSampleAcquiredPolling(VideoCaptureSample sample) { FrameSampleAcquired?.Invoke(sample); VideoCapture.RequestNextFrameSample(OnFrameSampleAcquiredPolling); }
private void OnFrameSampleAcquiredListener(VideoCaptureSample sample) { FrameSampleAcquired?.Invoke(sample); }