1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- 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;
- }
- }
- }
|