1. 11 May, 2020 9 commits
  2. 10 May, 2020 29 commits
  3. 09 May, 2020 2 commits
    • Andriy Gelman's avatar
      avcodec/v4l2_context: Finish draining if V4L2_BUF_FLAG_LAST is set · c76b2bf0
      Andriy Gelman authored
      V4L2 api can indicate that flushing of the capture buffers is completed
      by setting the V4L2_BUF_FLAG_LAST flag.
      Use guards because the flag was only defined in Linux v4.2.
      
      Reference:
      linux/Documentation/media/uapi/v4l/dev-decoder.rst
      
          "The client must continue to handle both queues independently,
           similarly to normal decode operation. This includes:
           ...
           - queuing and dequeuing CAPTURE buffers, until a buffer marked with
             the V4L2_BUF_FLAG_LAST flag is dequeued"
      Reviewed-by: 's avatarMing Qian <ming.qian@nxp.com>
      Signed-off-by: 's avatarAndriy Gelman <andriy.gelman@gmail.com>
      c76b2bf0
    • Andriy Gelman's avatar
      avcodec/v4l2_context: Drop empty packet while draining · e3b49aaa
      Andriy Gelman authored
      v4l2_m2m devices may send an empty packet/frame while draining
      to indicate that all capture buffers have been flushed.
      
      Currently, the empty packet/frame is not handled correctly:
      When encoding, the empty packet is forwarded to the muxer, usually
      creating warnings.
      When decoding, a reference to the memory is created anyway. Since in
      the past this memory contained a decoded frame, it results in an extra
      frame being decoded.
      
      This commit discards the empty packet/frame.
      
      References:
      linux/Documentation/media/uapi/v4l/dev-decoder.rst:
      
          "The last buffer may be empty (with :c:type:`v4l2_buffer` bytesused = 0)
           and in that case it must be ignored by the client, as it does not
           contain a decoded frame."
      
      linux/Documentation/media/uapi/media/v4l/vidioc-encoder-cmd.rst:
      
          "...This buffer may be empty, indicated by the
           driver setting the ``bytesused`` field to 0."
      Reviewed-by: 's avatarMing Qian <ming.qian@nxp.com>
      Signed-off-by: 's avatarAndriy Gelman <andriy.gelman@gmail.com>
      e3b49aaa