# README
Example: using handcrafted types (Deprecated)
:warning:
This example is here to illustrate the complexity of v4l2 when using hand-crafted Go types to communicate with the driver. This approach was abandoned in favor of cgo-generated types (see v4l2 package) for stability.
Do not use it.
If you want to play around with image capture, use the capture0 or capture1 examples.
:warning:
The example in this directory shows most of the moving pieces that make the V4L2 API works using Go. It illustrates the steps, in detail, that are required to communicate with a device driver to configure, initiate, and capture images without using the Go v4l2 device type provided.
# Constants
V4L2_BUF_TYPE_VIDEO_OVERLAY = 3.
V4L2_BUF_TYPE_VIDEO_CAPTURE = 1.
V4L2_BUF_TYPE_VIDEO_OUTPUT = 2.
V4L2_FIELD_ANY.
V4L2_FIELD_NONE.
V4L2_MEMORY_DMABUF = 4,.
V4L2_MEMORY_MMAP = 1,.
V4L2_MEMORY_OVERLAY = 3,.
V4L2_MEMORY_USERPTR = 2,.
# Variables
V4L2_PIX_FMT_MJPEG.
# Structs
BufferInfo represents C type v4l2_buffer https://elixir.bootlin.com/linux/v5.13-rc6/source/include/uapi/linux/videodev2.h#L1037.
BufferService is embedded union m in v4l2_buffer C type.
Format represents C type v4l2_format https://elixir.bootlin.com/linux/v5.13-rc6/source/include/uapi/linux/videodev2.h#L2324.
PixFormat represents v4l2_pix_format https://elixir.bootlin.com/linux/v5.13-rc6/source/include/uapi/linux/videodev2.h#L496.
RequestBuffers represents C type https://elixir.bootlin.com/linux/v5.13-rc6/source/include/uapi/linux/videodev2.h#L951.
Timecode represents C type v4l2_timecode https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/videodev2.h#L875.