Re: [PATCH] vb2: vb2_find_timestamp: drop restriction on buffer state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Hans,

On Wed, Jan 23, 2019 at 5:30 PM Hans Verkuil <hverkuil@xxxxxxxxx> wrote:
>
> There really is no reason why vb2_find_timestamp can't just find
> buffers in any state. Drop that part of the test.
>
> This also means that vb->timestamp should only be set to 0 when a
> capture buffer is queued AND when the driver doesn't copy timestamps.
>
> This change allows for more efficient pipelining (i.e. you can use
> a buffer for a reference frame even when it is queued).
>
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xxxxxxxxx>
> ---
> diff --git a/drivers/media/common/videobuf2/videobuf2-v4l2.c b/drivers/media/common/videobuf2/videobuf2-v4l2.c
> index 75ea90e795d8..2a093bff0bf5 100644
> --- a/drivers/media/common/videobuf2/videobuf2-v4l2.c
> +++ b/drivers/media/common/videobuf2/videobuf2-v4l2.c
> @@ -567,7 +567,7 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb, struct vb2_plane *planes)
>         struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
>         unsigned int plane;
>
> -       if (!vb->vb2_queue->is_output || !vb->vb2_queue->copy_timestamp)
> +       if (!vb->vb2_queue->is_output && !vb->vb2_queue->copy_timestamp)

Is the change fully as expected?

Current behavior:

      COPY   !COPY
CAP   0      0
OUT   keep   0

New behavior:

      COPY   !COPY
CAP   keep   0
OUT   keep   keep

Don't we still want to zero OUT if !COPY? I suppose that would make
the condition as simple as if (!vb->vb2_queue->copy_timestamp).

Best regards,
Tomasz



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux