linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: hverkuil-cisco@xs4all.nl
To: linux-media@vger.kernel.org
Cc: Tomasz Figa <tfiga@chromium.org>,
	Ezequiel Garcia <ezequiel@collabora.com>,
	Philipp Zabel <p.zabel@pengutronix.de>
Subject: [PATCH 0/2] v4l2-mem2mem: add job_write() to support encoders
Date: Fri, 14 Dec 2018 16:43:14 +0100	[thread overview]
Message-ID: <20181214154316.62011-1-hverkuil-cisco@xs4all.nl> (raw)

From: Hans Verkuil <hverkuil-cisco@xs4all.nl>

The m2m framework is not quite symmetrical: decoders can process multiple
output buffers in job_ready until enough buffers have arrived so a frame
can be decoded.

However, encoders do not have an equivalent where multiple capture buffers
can be used to write the compressed frame. They expect that the provided
capture buffer is always large enough to contain the full compressed
frame.

This patch adds a job_write() callback and a v4l2_m2m_job_writing()
function to tell the m2m framework that the job isn't finished but that
it is waiting for more capture buffers so it can write the remaining
compressed data to the buffers.

The first patch adds the support for this to the m2m framework, the
second patch adapts vicodec to use it.

Let me know if there are any comments! It would be even better if this
could be tested in a real stateful encoder.

Regards,

	Hans

Hans Verkuil (2):
  v4l2-mem2mem: add job_write callback
  vicodec: add encoder support to write to multiple buffers

 drivers/media/platform/vicodec/vicodec-core.c | 91 +++++++++++++++----
 drivers/media/v4l2-core/v4l2-mem2mem.c        | 61 +++++++++++--
 include/media/v4l2-mem2mem.h                  | 27 +++++-
 3 files changed, 152 insertions(+), 27 deletions(-)

-- 
2.19.2


             reply	other threads:[~2018-12-14 15:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14 15:43 hverkuil-cisco [this message]
2018-12-14 15:43 ` [PATCH 1/2] v4l2-mem2mem: add job_write callback hverkuil-cisco
2019-01-07 14:42   ` Hans Verkuil
2019-01-08  5:49     ` Tomasz Figa
2019-01-08 10:26     ` Philipp Zabel
2018-12-14 15:43 ` [PATCH 2/2] vicodec: add encoder support to write to multiple buffers hverkuil-cisco

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=20181214154316.62011-1-hverkuil-cisco@xs4all.nl \
    --to=hverkuil-cisco@xs4all.nl \
    --cc=ezequiel@collabora.com \
    --cc=linux-media@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).