12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- 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;
- }
- public void start() {
- inputProvider.init();
- inputProvider.start();
- inputProvider.updateFrame();
- inputFrame = inputProvider.getInputFrame();
- depthImage = inputFrame.getDepthImage();
- }
-
- public void stop() {
- inputProvider.stop();
- }
- 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;
- }
- }
- }
|