UVCStreamer.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * TI Voxel Lib component.
  3. *
  4. * Copyright (c) 2014 Texas Instruments Inc.
  5. */
  6. #ifndef VOXEL_UVCSTREAMER_H
  7. #define VOXEL_UVCSTREAMER_H
  8. #include "Streamer.h"
  9. #include "UVC.h"
  10. namespace Voxel
  11. {
  12. /**
  13. * \addtogroup IO
  14. * @{
  15. */
  16. // Parts of this class are borrowed from http://linuxtv.org/downloads/v4l-dvb-apis/capture-example.html
  17. // TODO This currently seeks only YUYV as pixel format
  18. class VOXEL_EXPORT UVCStreamer : public Streamer
  19. {
  20. protected:
  21. class UVCStreamerPrivate;
  22. Ptr<UVCStreamerPrivate> _uvcStreamerPrivate;
  23. Ptr<VideoMode> _currentVideoMode;
  24. void _storeCurrentVideoMode(const VideoMode &videoMode);
  25. bool _uvcInit();
  26. bool _initForCapture();
  27. virtual bool _start();
  28. virtual bool _capture(RawDataFramePtr &p);
  29. virtual bool _stop();
  30. public:
  31. UVCStreamer(DevicePtr device);
  32. virtual bool isInitialized();
  33. virtual bool getSupportedVideoModes(Vector<VideoMode> &videoModes);
  34. virtual bool getCurrentVideoMode(VideoMode &videoMode);
  35. virtual bool setVideoMode(const VideoMode &videoMode);
  36. virtual ~UVCStreamer();
  37. };
  38. /**
  39. * @}
  40. */
  41. }
  42. #endif // VOXEL_UVCSTREAMER_H