public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* Query the meaning of variable in v4l2_pix_format and v4l2_plane
@ 2011-11-04 13:07 Jonghun Han
  2011-11-04 13:28 ` Marek Szyprowski
  2011-11-04 16:02 ` Tomasz Stanislawski
  0 siblings, 2 replies; 4+ messages in thread
From: Jonghun Han @ 2011-11-04 13:07 UTC (permalink / raw)
  To: linux-media; +Cc: m.szyprowski


Hi,

I'm not sure the meaning of variables in v4l2_pix_format and v4l2_plane.
Especially bytesperline, sizeimage, length and bytesused.

v4l2_pix_format.width		= width
v4l2_pix_format.height		= height
v4l2_pix_format.bytesperline	= bytesperline [in bytes]
v4l2_pix_format.sizeimage	= bytesperline * buf height  -> Is this
right ?

v4l2_plane.length	= bytesperline * buf height  -> Is this right ?
I don't which is right.
v4l2_plane.bytesused	= bytesperline * (top + height)
v4l2_plane.bytesused	= bytesperline * height
v4l2_plane.bytesused	= width * height * bytesperpixel
v4l2_plane.bytesused	= bytesperline * (top + height) - (pixelperline -
(left + width)) * bytesperpixel

I assumed the following buffer.

|                                                          |
|<--------------------- bytesperline --------------------->|
|                                                          |
+----------------------------------------------------------+-----
|          ^                                               |  ^
|          |                                               |  |
|                                                          |  |
|          t                                               |  |
|          o                                               |  |
|          p                                               |  |
|                                                          |  |
|          |                                               |  |
|          V |<--------- width ---------->|                |  |
|<-- left -->+----------------------------+ -              |  |
|            |                            | ^              |
|            |                            | |              |  b
|            |                            | |              |  u
|            |                            |                |  f
|            |                            | h              |
|            |                            | e              |  h
|            |                            | i              |  e
|            |                            | g              |  i
|            |                            | h              |  g
|            |                            | t              |  h
|            |                            |                |  t
|            |                            | |              |  
|            |                            | |              |  |
|            |                            | v              |  |
|            +----------------------------+ -              |  |
|                                                          |  |
|                                                          |  |
|                                                          |  v
+----------------------------------------------------------+-----


Best regards,



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-11-04 16:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-04 13:07 Query the meaning of variable in v4l2_pix_format and v4l2_plane Jonghun Han
2011-11-04 13:28 ` Marek Szyprowski
2011-11-04 14:48   ` Hans Verkuil
2011-11-04 16:02 ` Tomasz Stanislawski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox