houxiao
2017-07-13 b022b91c0c6fa807424b6c12cc92ac5946838083
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* ---------------------------------------------------------------------------
** This software is in the public domain, furnished "as is", without technical
** support, and with no warranty, express or implied, as to its usefulness for
** any purpose.
**
** V4l2ReadWriteDevice.h
** 
** V4L2 source using read/write API
**
** -------------------------------------------------------------------------*/
 
 
#ifndef V4L2_RW_DEVICE
#define V4L2_RW_DEVICE
 
#include "V4l2Device.h"
 
 
class V4l2ReadWriteDevice : public V4l2Device
{    
    protected:    
        virtual size_t writeInternal(char* buffer, size_t bufferSize) { return ::write(m_fd, buffer,  bufferSize); };
        virtual size_t readInternal(char* buffer, size_t bufferSize)  { return ::read(m_fd, buffer,  bufferSize); };
        
    public:
        V4l2ReadWriteDevice(const V4L2DeviceParameters&  params, v4l2_buf_type deviceType) : V4l2Device(params, deviceType) {};
    
};
 
 
#endif