From: Boris Brezillon <boris.brezillon@collabora.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hans.verkuil@cisco.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Sakari Ailus <sakari.ailus@iki.fi>,
linux-media@vger.kernel.org, Tomasz Figa <tfiga@chromium.org>,
Nicolas Dufresne <nicolas@ndufresne.ca>,
kernel@collabora.com,
Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
Maxime Ripard <maxime.ripard@bootlin.com>,
Ezequiel Garcia <ezequiel@collabora.com>,
Jonas Karlman <jonas@kwiboo.se>,
Jernej Skrabec <jernej.skrabec@siol.net>,
Alexandre Courbot <acourbot@chromium.org>,
Thierry Reding <thierry.reding@gmail.com>,
Philipp Zabel <p.zabel@pengutronix.de>
Subject: Re: [RFC PATCH 3/5] media: v4l2: Add m2m codec helpers
Date: Mon, 5 Aug 2019 19:59:00 +0200 [thread overview]
Message-ID: <20190805195900.7c25d99c@collabora.com> (raw)
In-Reply-To: <bca63b3d-7254-99db-bcf4-cb3f2511c69a@xs4all.nl>
On Mon, 5 Aug 2019 13:53:20 -0300
Hans Verkuil <hverkuil@xs4all.nl> wrote:
> > +/**
> > + * struct v4l2_m2m_codec_ctx - Codec context
> > + * @fh: file handle
> > + * @coded_fmt: current coded format
> > + * @decoded_fmt: current decoded format
> > + * @coded_fmt_desc: current coded format desc
> > + * @decoded_fmt_desc: current decoded format desc
> > + * @ctrl_hdl: control handler
> > + * @codec: the codec that has created this context
> > + */
> > +struct v4l2_m2m_codec_ctx {
> > + struct v4l2_fh fh;
> > + struct v4l2_format coded_fmt;
> > + struct v4l2_format decoded_fmt;
> > + const struct v4l2_m2m_codec_coded_fmt_desc *coded_fmt_desc;
> > + const struct v4l2_m2m_codec_decoded_fmt_desc *decoded_fmt_desc;
> > + struct v4l2_ctrl_handler ctrl_hdl;
> > + struct v4l2_m2m_codec *codec;
> > +};
>
> ...this struct.
>
> So basically everything in this header :-)
>
> I haven't done an in-depth review, but my main concern is that I
> believe these structs and the helpers depending on them are too
> high-level.
>
> The helpers themselves often look reasonable, except that they could
> be more generic if it wasn't for these high-level structs.
I'll have to double check, but I fear most of those helpers are useless
if we don't have these generic structs.
>
> My feeling is that it would make more sense if you would create structs
> dealing just with formats and structs just for controls and don't try
> to mix in things like struct video_device or struct v4l2_fh.
Except that's where most of the boiler-plate code is (basically all the
ioctl and vb2_queue ops).
>
> I think that will create a better balance between providing helpers
> for codec drivers without hiding too much inside v4l2_m2m_codec_* structs.
I'm fine with that, just not sure this will significantly reduce code
duplication...
next prev parent reply other threads:[~2019-08-05 17:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-05 9:48 [RFC PATCH 0/5] media: v4l2: Add m2m codec helpers Boris Brezillon
2019-08-05 9:48 ` [RFC PATCH 1/5] media: vb2: Add a helper to get the vb2 buffer attached to a request Boris Brezillon
2019-08-05 13:12 ` Hans Verkuil
2019-08-05 14:13 ` Boris Brezillon
2019-08-05 16:56 ` Hans Verkuil
2019-08-05 9:48 ` [RFC PATCH 2/5] media: v4l2: Prepare things for addition of m2m codec helpers Boris Brezillon
2019-08-05 9:48 ` [RFC PATCH 3/5] media: v4l2: Add " Boris Brezillon
2019-08-05 16:53 ` Hans Verkuil
2019-08-05 17:59 ` Boris Brezillon [this message]
2019-08-05 9:48 ` [RFC PATCH 4/5] media: v4l2: Provide helpers for H264 codecs Boris Brezillon
2019-08-05 9:48 ` [RFC PATCH 5/5] media: rockchip: Add the rkvdec driver Boris Brezillon
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=20190805195900.7c25d99c@collabora.com \
--to=boris.brezillon@collabora.com \
--cc=acourbot@chromium.org \
--cc=ezequiel@collabora.com \
--cc=hans.verkuil@cisco.com \
--cc=hverkuil@xs4all.nl \
--cc=jernej.skrabec@siol.net \
--cc=jonas@kwiboo.se \
--cc=kernel@collabora.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=maxime.ripard@bootlin.com \
--cc=mchehab@kernel.org \
--cc=nicolas@ndufresne.ca \
--cc=p.zabel@pengutronix.de \
--cc=paul.kocialkowski@bootlin.com \
--cc=sakari.ailus@iki.fi \
--cc=tfiga@chromium.org \
--cc=thierry.reding@gmail.com \
/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