• Hans Verkuil's avatar
    media: vb2: add buf_out_validate callback · 28d77c21
    Hans Verkuil authored
    When queueing a buffer to a request the 'field' value is not validated.
    That field is only validated when the _buf_prepare() is called,
    which happens when the request is queued.
    
    However, this validation should happen at QBUF time, since you want
    to know about this as soon as possible. Also, the spec requires that
    the 'field' value is validated at QBUF time.
    
    This patch adds a new buf_out_validate callback to validate the
    output buffer at buf_prepare time or when QBUF queues an unprepared
    buffer to a request. This callback is mandatory for output queues
    that support requests.
    
    This issue was found by v4l2-compliance since it failed to replace
    V4L2_FIELD_ANY by a proper field value when testing the vivid video
    output in combination with requests.
    Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
    28d77c21
videobuf2-core.h 46.5 KB