mirror of
https://github.com/mpromonet/v4l2rtspserver
synced 2024-11-17 21:25:40 +00:00
modify read access to not start if captureStart is not called
This commit is contained in:
parent
2d582d5e7c
commit
8bf1eba206
@ -22,13 +22,16 @@ class V4l2ReadCapture : public V4l2Capture
|
|||||||
static V4l2ReadCapture* createNew(V4L2DeviceParameters params);
|
static V4l2ReadCapture* createNew(V4L2DeviceParameters params);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
V4l2ReadCapture(V4L2DeviceParameters params) : V4l2Capture(params) {};
|
V4l2ReadCapture(V4L2DeviceParameters params) : V4l2Capture(params), m_counter(0) {};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual bool captureStart() { return true; };
|
virtual bool captureStart() { m_counter=1; return true; };
|
||||||
virtual size_t read(char* buffer, size_t bufferSize);
|
virtual size_t read(char* buffer, size_t bufferSize);
|
||||||
virtual bool captureStop() { return true; };
|
virtual bool captureStop() { m_counter=0; return true; };
|
||||||
virtual bool isReady() { return m_fd != -1; };
|
virtual bool isReady() { return ((m_fd != -1) && (m_counter>0)); };
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int m_counter;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
Reference in New Issue
Block a user