libv4l2cpp icon indicating copy to clipboard operation
libv4l2cpp copied to clipboard

what is the different between writePartial function and write function in V4l2Output ?

Open how0723 opened this issue 5 years ago • 2 comments
trafficstars

what is the different between writePartial function and write function in V4l2Output ?

class V4l2Output : public V4l2Access
{		
	protected:
		V4l2Output(V4l2Device* device);

	public:
		static V4l2Output* create(const V4L2DeviceParameters & param, IoType iotype = V4l2Access::IOTYPE_MMAP);
		virtual ~V4l2Output();
	
		size_t write(char* buffer, size_t bufferSize);
		int    isWritable(timeval* tv);
		bool   startPartialWrite(void);
		size_t writePartial(char* buffer, size_t bufferSize);
		bool   endPartialWrite(void);
};

how0723 avatar Aug 29 '20 14:08 how0723

Hi,

This come from a pull request, I hesitated to merge. It implements a buffer management inside library. Using startPartialWrite, multiple call to writePartial will fill up the buffer and then endPartialWrite will write the concatenated buffers. Same thing could be achieved concatenating buffer and call write. Best Regards Michel

mpromonet avatar Aug 30 '20 16:08 mpromonet

thanks very much

how0723 avatar Aug 30 '20 16:08 how0723