using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using bbiwarg.InputProviders; namespace bbiwarg { class VideoHandle { private IInputProvider inputProvider; private InputFrame inputFrame; private DepthImage depthImage; public VideoHandle(IInputProvider inputProvider) { this.inputProvider = inputProvider; inputProvider.init(); inputProvider.start(); inputProvider.updateFrame(); inputFrame = inputProvider.getInputFrame(); depthImage = inputFrame.getDepthImage(); } public void nextFrame() { if (inputProvider.isActive()) { inputProvider.releaseFrame(); inputProvider.updateFrame(); inputFrame = inputProvider.getInputFrame(); depthImage = inputFrame.getDepthImage(); } else { inputProvider.stop(); } } public int getWidth() { return inputFrame.getWidth(); } public int getHeight() { return inputFrame.getHeight(); } public DepthImage getDepthImage() { return depthImage; } } }