| 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 | |
| 12 | |
| 13 | #ifndef V4L2_ACCESS |
| 14 | #define V4L2_ACCESS |
| 15 | |
| 16 | #include "V4l2Device.h" |
| 17 | |
| 18 | class V4l2Access |
| 19 | { |
| 20 | public: |
| 21 | enum IoType |
| 22 | { |
| 23 | IOTYPE_READWRITE, |
| 24 | IOTYPE_MMAP |
| 25 | }; |
| 26 | |
| 27 | V4l2Access(V4l2Device* device); |
| 28 | virtual ~V4l2Access(); |
| 29 | |
| 30 | int getFd() { return m_device->getFd(); } |
| 31 | unsigned int getBufferSize() { return m_device->getBufferSize(); } |
| 32 | unsigned int getFormat() { return m_device->getFormat(); } |
| 33 | unsigned int getWidth() { return m_device->getWidth(); } |
| 34 | unsigned int getHeight() { return m_device->getHeight(); } |
| 35 | void queryFormat() { m_device->queryFormat(); } |
| 36 | |
| 37 | int isReady() { return m_device->isReady(); } |
| 38 | int start() { return m_device->start(); } |
| 39 | int stop() { return m_device->stop(); } |
| 40 | |
| 41 | private: |
| 42 | V4l2Access(const V4l2Access&); |
| 43 | V4l2Access & operator=(const V4l2Access&); |
| 44 | |
| 45 | protected: |
| 46 | V4l2Device* m_device; |
| 47 | }; |
| 48 | |
| 49 | |
| 50 | #endif |
| 51 | |