From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Kassey Lee <kassey1216@gmail.com>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>,
Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH 2.6.39] soc_camera: OMAP1: fix missing bytesperline and sizeimage initialization
Date: Tue, 12 Apr 2011 09:57:22 +0200 [thread overview]
Message-ID: <4DA405E2.3080708@samsung.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1104120820020.23770@axis700.grange>
Hi,
On 04/12/2011 08:28 AM, Guennadi Liakhovetski wrote:
> Hi
>
> On Tue, 12 Apr 2011, Kassey Lee wrote:
>
>> hi, Guennadi:
>> a lot of sensors support JPEG output.
>> 1) bytesperline is defined by sensor timing.
Im not sure whether this is the case. Doesn't bytesperline refer only
to the data layout in memory buffer written by the DMA?
i.e. does padding really makes sens for JPEG files?
>> 2) and sizeimage is unknow for jpeg.
>>
>> how about for JPEG
>> 1) host driver gets bytesperline from sensor driver.
>> 2) sizeimage refilled by host driver after dma transfer done( a
>> frame is received)
You might want to use v4l2_buffer::bytesused to inform user space about
the actual size of the captured frame, which would be set before a buffer
is dequeued from the driver. The size of JPEG file will depend on the content,
so IMHO you could not use v4l2_pix_fmt::sizeimage in such way.
>> thanks.
>
> How is this done currently on other V4L2 drivers? To transfer a frame you
> usually first do at least one of S_FMT and G_FMT, at which time you
> already have to report sizeimage to the user - before any transfer has
> taken place. Currently with soc-camera it is already possible to override
> sizeimage and bytesperline from the host driver. Just set them to whatever
> you need in your try_fmt and they will be kept. Not sure how you want to
> do that, if you need to first read in a frame - do you want to perform
> some dummy frame transfer? You might not even have any buffers queued yet,
> so, it has to be a read without writing to RAM. Don't such compressed
> formats just put a value in sizeimage, that is a calculated maximum size?
I the S5P FIMC driver I used to set sizeimage to some arbitrary value,
(it's not yet in mainline kernel), e.g.
sizeimage = width * height * C, where C = 1
bytesperline = width.
However it would be useful to make the C coefficient dependent on JPEG
compression quality, not to make the image buffer unnecessary large.
I thought about creating a separate control class for JPEG but the quality
control was so far everything I would need to put in this class. It's on my
to do list to figure out what controls set would cover the standard.
Regards,
--
Sylwester Nawrocki
Samsung Poland R&D Center
next prev parent reply other threads:[~2011-04-12 7:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-08 23:57 [PATCH 2.6.39] soc_camera: OMAP1: fix missing bytesperline and sizeimage initialization Janusz Krzysztofik
2011-04-10 16:00 ` Guennadi Liakhovetski
2011-04-10 22:00 ` Janusz Krzysztofik
2011-04-10 22:46 ` Guennadi Liakhovetski
2011-04-11 9:02 ` Guennadi Liakhovetski
2011-04-12 2:26 ` Kassey Lee
2011-04-12 6:28 ` Guennadi Liakhovetski
2011-04-12 7:57 ` Sylwester Nawrocki [this message]
[not found] ` <BANLkTimc_3wcLMP116B+BkGdJaapZSVkpw@mail.gmail.com>
2011-04-12 8:06 ` Kassey Lee
2011-04-12 8:24 ` Guennadi Liakhovetski
2011-04-12 8:41 ` Kassey Lee
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=4DA405E2.3080708@samsung.com \
--to=s.nawrocki@samsung.com \
--cc=g.liakhovetski@gmx.de \
--cc=jkrzyszt@tis.icnet.pl \
--cc=kassey1216@gmail.com \
--cc=linux-media@vger.kernel.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