V4l2Access.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* ---------------------------------------------------------------------------
  2. ** This software is in the public domain, furnished "as is", without technical
  3. ** support, and with no warranty, express or implied, as to its usefulness for
  4. ** any purpose.
  5. **
  6. ** V4l2Access.h
  7. **
  8. ** V4L2 wrapper
  9. **
  10. ** -------------------------------------------------------------------------*/
  11. #ifndef V4L2_ACCESS
  12. #define V4L2_ACCESS
  13. #include "V4l2Device.h"
  14. class V4l2Access
  15. {
  16. public:
  17. enum IoType
  18. {
  19. IOTYPE_READWRITE,
  20. IOTYPE_MMAP
  21. };
  22. V4l2Access(V4l2Device* device);
  23. virtual ~V4l2Access();
  24. int getFd() { return m_device->getFd(); }
  25. unsigned int getBufferSize() { return m_device->getBufferSize(); }
  26. unsigned int getFormat() { return m_device->getFormat(); }
  27. unsigned int getWidth() { return m_device->getWidth(); }
  28. unsigned int getHeight() { return m_device->getHeight(); }
  29. void queryFormat() { m_device->queryFormat(); }
  30. int isReady() { return m_device->isReady(); }
  31. int start() { return m_device->start(); }
  32. int stop() { return m_device->stop(); }
  33. private:
  34. V4l2Access(const V4l2Access&);
  35. V4l2Access & operator=(const V4l2Access&);
  36. protected:
  37. V4l2Device* m_device;
  38. };
  39. #endif