All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hirokazu Honda <hiroh@chromium.org>
To: Alexandre Courbot <acourbot@chromium.org>
Cc: linux-media@vger.kernel.org, Tomasz Figa <tfiga@chromium.org>,
	Fritz Koenig <frkoenig@chromium.org>,
	J Kardatzke <jkardatzke@chromium.org>
Subject: Re: How to get last frames in encode sequence returned by v4l2 encoder driver without V4L2_ENC_CMD_STOP
Date: Fri, 27 Nov 2020 03:13:03 +0900	[thread overview]
Message-ID: <CAO5uPHNGNwXadtRY6CYghsCYaPNCxOkxYR98CYvPfF0ZrqSPHw@mail.gmail.com> (raw)
In-Reply-To: <CAPBb6MXQjG8p2dh9T+GpFncu8WAUwjsWw=ggSMW7QdP0NQrskQ@mail.gmail.com>

HI Alexandre,

On Tue, Nov 24, 2020 at 7:17 PM Alexandre Courbot <acourbot@chromium.org> wrote:
>
> Hi Hiro,
>
> On Fri, Nov 13, 2020 at 6:04 PM Hirokazu Honda <hiroh@chromium.org> wrote:
> >
> > Hi,
> >
> > According to the official v4l2 encoder driver usage description [1],
> > v4l2 steatful encoder driver doesn't have a guarantee when frames fed
> > to a driver will be returned.
> > To make sure all pending frames are output by the driver, an app must
> > call VIDIOC_ENCODER_CMD with cmd=V4L2_ENC_CMD_STOP.
> > However, it is not mandatory to support the command in the current
> > v4l2 stateful encoder API specification.
> > An app can check it by VIDIOC_TRY_ENCODER_CMD beforehand.
> > My question is when an app has to get all the frames of an encoder
> > sequence, how we can achieve this without V4L2_ENC_CMD_STOP support.
> > This demand is natural and in fact WebCodecs [2] requires this.
> >
> > I think there are two options,
> > 1.) Ensure that a driver will eventually output frames if it doesn't
> > support V4L2_ENC_CMD_STOP.
> > 2.) Change V4L2_ENC_CMD_STOP support to be mandatory
>
> Unless I am missing the part of the spec that says the contrary,
> V4L2_ENC_CMD_STOP is part of the encoder specification, and thus is
> mandatory. Some older drivers might not have support for it, in such
> cases the correct course of action would be to fix them.
>

I researched the API documents.
The statement that the support is mandatory to stateful encoders is
added from the latest document v5.9 [1],
It states optional in the API document of v4.19 and v5.8.
Hence my question is obsolete.

[1] https://www.kernel.org/doc/html/v5.9/userspace-api/media/v4l/vidioc-encoder-cmd.html
[2] https://www.kernel.org/doc/html/v4.19/media/uapi/v4l/vidioc-encoder-cmd.html
[3] https://www.kernel.org/doc/html/v5.8/userspace-api/media/v4l/vidioc-encoder-cmd.html?highlight=v4l2_enc_cmd_stop

Best Regards,
-Hiro
> >
> > Any comments are appreciated.
> > Thanks so much in advance.
> >
> > [1] https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/dev-encoder.html#drain
> > [2] https://web.dev/webcodecs/
> >
> > Sincerely,
> > -Hiro

  reply	other threads:[~2020-11-26 18:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13  9:03 How to get last frames in encode sequence returned by v4l2 encoder driver without V4L2_ENC_CMD_STOP Hirokazu Honda
2020-11-24 10:17 ` Alexandre Courbot
2020-11-26 18:13   ` Hirokazu Honda [this message]
2020-12-08 16:43     ` Nicolas Dufresne
2020-12-09  9:51       ` Tomasz Figa
2020-12-09 16:59         ` Nicolas Dufresne
2020-12-10  4:20           ` Tomasz Figa
2020-12-10 20:27             ` Nicolas Dufresne
2020-12-11  3:18               ` Tomasz Figa
2020-12-14 21:12                 ` Nicolas Dufresne
2020-12-15  9:06                   ` Tomasz Figa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAO5uPHNGNwXadtRY6CYghsCYaPNCxOkxYR98CYvPfF0ZrqSPHw@mail.gmail.com \
    --to=hiroh@chromium.org \
    --cc=acourbot@chromium.org \
    --cc=frkoenig@chromium.org \
    --cc=jkardatzke@chromium.org \
    --cc=linux-media@vger.kernel.org \
    --cc=tfiga@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.