v4l2: add alternate interlace mode
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 8 Aug 2018 07:27:19 +0000 (09:27 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.com>
Wed, 25 Mar 2020 11:42:12 +0000 (12:42 +0100)
commitd1501f095240748e5a10b8c54f7fdbff175b8a48
tree243bfef00ec1e3bd7baea77c6747bdfa649f4ab8
parent0834ef15ce76b2d3768aab03e5c43007fd78e668
v4l2: add alternate interlace mode

When using this mode each frame is split in two fields, each one being
transferred using its own buffer.
This is implemented with the V4L2_FIELD_ALTERNATE field format in v4l2.

This mode is enabled using a caps filter such as
"v4l2src ! video/x-raw\(format:Interlaced\)"

Here are the main changes related to this feature:

- use the INTERLACED caps feature with this mode.

- in this mode both fields of a given frame have the same sequence/offset
so adjust the algorithm checking for lost field/frame accordingly.

- double pool's min number of buffers as each frame requires 2 buffers.

Fix #504
Co-authored-by: Zeeshan Ali <zeenix@collabora.co.uk>
sys/v4l2/gstv4l2bufferpool.c
sys/v4l2/gstv4l2object.c
sys/v4l2/gstv4l2object.h
sys/v4l2/gstv4l2src.c
sys/v4l2/gstv4l2src.h