linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: "linux-media@vger.kernel.org" <linux-media@vger.kernel.org>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Sakari Ailus <sakari.ailus@iki.fi>,
	Mauro Carvalho Chehab <mchehab@redhat.com>,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	Hans de Goede <hdegoede@redhat.com>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Andrzej Hajda <a.hajda@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>
Subject: [RFC] Processing context in the V4L2 subdev and V4L2 controls API ?
Date: Tue, 18 Sep 2012 17:06:54 +0200	[thread overview]
Message-ID: <50588E0E.9000307@samsung.com> (raw)

Hi All,

I'm trying to fulfil following requirements with V4L2 API that are specific
to most of Samsung camera sensors with embedded SoC ISP and also for local 
SoC camera ISPs:

 - separate pixel format and pixel resolution needs to be configured
   in a device for camera preview and capture;

 - there is a need to set capture or preview mode in a device explicitly
   as it makes various adjustments (in firmware) in each operation mode
   and controls external devices accordingly (e.g. camera Flash);

 - some devices have more than two use case specific contexts that a user
   needs to choose from, e.g. video preview, video capture, still preview, 
   still capture; for each of these modes there are separate settings, 
   especially pixel resolution and others corresponding to existing v4l2 
   controls;

 - some devices can have two processing contexts enabled simultaneously,
   e.g. a sensor emitting YUYV and JPEG streams simultaneously (please see 
   discussion [1]).

This makes me considering making the v4l2 subdev (and maybe v4l2 controls)
API processing (capture) context aware.

If I remember correctly introducing processing context, as the per file 
handle device contexts in case of mem-to-mem devices was considered bad
idea in past discussions. But this was more about v4ll2 video nodes.

And I was considering adding context only to v4l2 subdev API, and possibly
to the (extended) control API. The idea is to extend the subdev (and 
controls ?) ioctls so it is possible to preconfigure sets of parameters 
on subdevs, while V4L2 video node parameters would be switched "manually"
by applications to match a selected subdevs contest. There would also be
needed an API to select specific context (e.g. a control), or maybe 
multiple contexts like in case of a sensor from discussion [1].

I've seen various hacks in some v4l2 drivers trying to fulfil above
requirements, e.g. abusing struct v4l2_mbus_framefmt::colorspace field
to select between capture/preview in a device or using 32-bit integer
control where upper 16-bits are used for pixel width and lower 16 for
pixel height. This may suggest there something missing at the API.

Any suggestions, critics, please ?... :)

--

Regards,
Sylwester

[1] http://www.mail-archive.com/linux-media@vger.kernel.org/msg42707.html

             reply	other threads:[~2012-09-18 15:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-18 15:06 Sylwester Nawrocki [this message]
2012-09-18 15:26 ` [RFC] Processing context in the V4L2 subdev and V4L2 controls API ? Guennadi Liakhovetski
2012-09-21 12:26 ` Hans Verkuil
2012-10-13 20:08   ` Sylwester Nawrocki
2012-10-15  8:20     ` Hans Verkuil
2012-10-16 23:55       ` Laurent Pinchart
2012-10-23 20:36         ` Sakari Ailus

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=50588E0E.9000307@samsung.com \
    --to=s.nawrocki@samsung.com \
    --cc=a.hajda@samsung.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=hdegoede@redhat.com \
    --cc=hverkuil@xs4all.nl \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=sakari.ailus@iki.fi \
    --cc=sw0312.kim@samsung.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;
as well as URLs for NNTP newsgroup(s).