7.70. V4L2 write()¶
v4l2-write - Write to a V4L2 device
- File descriptor returned by
- Buffer with data to be written
- Number of bytes at the buffer
write() writes up to
count bytes to the device
referenced by the file descriptor
fd from the buffer starting at
buf. When the hardware outputs are not active yet, this function
enables them. When
count is zero,
write() returns 0
without any other effect.
When the application does not provide more data in time, the previous video frame, raw VBI image, sliced VPS or WSS data is displayed again. Sliced Teletext or Closed Caption data is not repeated, the driver inserts a blank line instead.
7.70.5. Return Value¶
On success, the number of bytes written are returned. Zero indicates
nothing was written. On error, -1 is returned, and the
variable is set appropriately. In this case the next write will start at
the beginning of a new frame. Possible error codes are:
- Non-blocking I/O has been selected using the O_NONBLOCK flag and no buffer space was available to write the data immediately.
fdis not a valid file descriptor or is not open for writing.
- The driver does not support multiple write streams and the device is already in use.
bufreferences an inaccessible memory area.
- The call was interrupted by a signal before any data was written.
- I/O error. This indicates some hardware problem.
write()function is not supported by this driver, not on this device, or generally not on this type of device.