Search code examples
android-cameralinux-device-driverembedded-linuxv4l2

V4l2 : difference between : Enque, Deque and Queue(ing) of the buffer?


I am a noob in v4l2 and tryign to find out the difference between the various ioctl calls made during the camera image capture. I am following this pdf from the linuxtv.org site I wanted to know the difference between the following :

Query, Enque, Deque and Queue(ing) of the buffer. Is there a particular sequence in fetching the raw data from the camera? Does the sequence varies in case of streaming and capture mode?

Can any one plz explain.


Solution

  • Following state machine describes a V4L2-buffer's life-cycle:

    enter image description here

    The sequence is the same for both streaming as well as capture.
    Its just that during capture one does the Q/DQ just once to obtain one buffer (i.e. a single "frame"). Streaming does this repeatedly.

    Detailed info in this series of V4L2 articles...
    Part 1: The Video4Linux2 API
    Part 2: registration and open()
    Part 3: Basic ioctl() handling
    Part 4: Inputs and Outputs
    Part 5a: Colors and formats
    Part 5b: Format negotiation
    Part 6a: Basic frame I/O
    Part 6b: Streaming I/O
    Part 7: Controls