public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* v4l2_pix_format doubts
@ 2008-06-17  9:05 Veda N
  2008-06-17  9:24 ` Daniel Glöckner
  2008-06-17  9:33 ` Xuesong Yang
  0 siblings, 2 replies; 11+ messages in thread
From: Veda N @ 2008-06-17  9:05 UTC (permalink / raw)
  To: video4linux-list

I am trying to fill the structure v4l2_pix_format in the camera driver.

The v4l2_pix_format has the following variables to fill
  a) bytesperline
  b) width
  c) height
  4) pixelformat

 My datasheet says the size of each pixel is 12 bits per color channel.

 Hence for RGB will be 36bits.

 I wanted to know if the same hold true for YUV data.

In that case i was confused how to fill the bytesperline, width and
height field.

Can anyone help on this?

For 640x480 pixels what should be the value i should fill.

I am confused because for most drivers they take as 2 bytes per pixel.


Where are in my case i think it would be 36bits per pixel. am i wrong?



Regards,
vedan

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: v4l2_pix_format doubts
  2008-06-17  9:05 v4l2_pix_format doubts Veda N
@ 2008-06-17  9:24 ` Daniel Glöckner
  2008-06-17  9:39   ` Veda N
  2008-06-17  9:33 ` Xuesong Yang
  1 sibling, 1 reply; 11+ messages in thread
From: Daniel Glöckner @ 2008-06-17  9:24 UTC (permalink / raw)
  To: Veda N; +Cc: video4linux-list

On Tue, Jun 17, 2008 at 02:35:04PM +0530, Veda N wrote:
>  My datasheet says the size of each pixel is 12 bits per color channel.
> 
>  Hence for RGB will be 36bits.
> 
>  I wanted to know if the same hold true for YUV data.

Can you tell us for which hardware you want to write a driver?

The values to fill in depend on the final layout of the data in memory.
As you should not convert to YUV in software, it depends solely on the
hardware.

  Daniel

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: v4l2_pix_format doubts
  2008-06-17  9:05 v4l2_pix_format doubts Veda N
  2008-06-17  9:24 ` Daniel Glöckner
@ 2008-06-17  9:33 ` Xuesong Yang
  1 sibling, 0 replies; 11+ messages in thread
From: Xuesong Yang @ 2008-06-17  9:33 UTC (permalink / raw)
  To: Veda N; +Cc: video4linux-list

在 2008-06-17二的 14:35 +0530,Veda N写道:

> The v4l2_pix_format has the following variables to fill
>   a) bytesperline
>   b) width
>   c) height
>   4) pixelformat

Just a guess
a  640x12x3/8
b 640
c 480
4 this should be one of the enum type

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: v4l2_pix_format doubts
  2008-06-17  9:24 ` Daniel Glöckner
@ 2008-06-17  9:39   ` Veda N
  2008-06-17  9:45     ` Daniel Glöckner
  0 siblings, 1 reply; 11+ messages in thread
From: Veda N @ 2008-06-17  9:39 UTC (permalink / raw)
  To: video4linux-list

Hi Daniel,

  Thank you for your quick response.


On Tue, Jun 17, 2008 at 2:54 PM, Daniel Glöckner <daniel-gl@gmx.net> wrote:
> On Tue, Jun 17, 2008 at 02:35:04PM +0530, Veda N wrote:
>>  My datasheet says the size of each pixel is 12 bits per color channel.
>>
>>  Hence for RGB will be 36bits.
>>
>>  I wanted to know if the same hold true for YUV data.
>
> Can you tell us for which hardware you want to write a driver?
>
> The values to fill in depend on the final layout of the data in memory.
> As you should not convert to YUV in software, it depends solely on the
> hardware.


  As i understand, my camera has a image processor inside it. what i
want to say is it is
  not a plain raw sensor.

  For every pixel clock a pixel is fetched from the device and is
placed in memory
  Once a entire frame is captured. it is returned to the application.
>From the application
   i can write this data into LCD or a file to be viewed by a YUV/RGB
viewer like YUVTOOLS.

  This is same for both RGB and YUV data.


  my only concern is i should fill proper values to v4l2_pix_format structure.

  Thank you.

Regards,
vedan

>
>  Daniel
>

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: v4l2_pix_format doubts
  2008-06-17  9:39   ` Veda N
@ 2008-06-17  9:45     ` Daniel Glöckner
  2008-06-17 10:22       ` Veda N
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel Glöckner @ 2008-06-17  9:45 UTC (permalink / raw)
  To: Veda N; +Cc: video4linux-list

On Tue, Jun 17, 2008 at 03:09:04PM +0530, Veda N wrote:
>   As i understand, my camera has a image processor inside it. what i
> want to say is it is
>   not a plain raw sensor.

So this image processor converts RGB to YUV?

>   For every pixel clock a pixel is fetched from the device and is
> placed in memory
>   Once a entire frame is captured. it is returned to the application.

And if you look at this data in memory, what does it look like?

  Daniel

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: v4l2_pix_format doubts
  2008-06-17  9:45     ` Daniel Glöckner
@ 2008-06-17 10:22       ` Veda N
  2008-06-17 10:46         ` Daniel Glöckner
  0 siblings, 1 reply; 11+ messages in thread
From: Veda N @ 2008-06-17 10:22 UTC (permalink / raw)
  To: Veda N, video4linux-list

I think you got confused by RGB and YUV.

The device is capable of giving RGB and YUV data. This is done by a
setting in the sensor register.

Once i set the value, For every pixel clock a pixel is fetched from
the device and is
placed in memory  Once a entire frame is captured. it is returned to
the application.
>From the application   i can write this data into LCD or a file to be
viewed by a YUV/RGB
viewer like YUVTOOLS.


Now, i know what i should set the pix->pixelformat, but what about
other members of the
v4l2_pix_format structure.



Regards,
vedan

On Tue, Jun 17, 2008 at 3:15 PM, Daniel Glöckner <daniel-gl@gmx.net> wrote:
> On Tue, Jun 17, 2008 at 03:09:04PM +0530, Veda N wrote:
>>   As i understand, my camera has a image processor inside it. what i
>> want to say is it is
>>   not a plain raw sensor.
>
> So this image processor converts RGB to YUV?
>
>>   For every pixel clock a pixel is fetched from the device and is
>> placed in memory
>>   Once a entire frame is captured. it is returned to the application.
>
> And if you look at this data in memory, what does it look like?
>
>  Daniel
>

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: v4l2_pix_format doubts
  2008-06-17 10:22       ` Veda N
@ 2008-06-17 10:46         ` Daniel Glöckner
  2008-06-17 15:15           ` Veda N
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel Glöckner @ 2008-06-17 10:46 UTC (permalink / raw)
  To: Veda N; +Cc: video4linux-list

On Tue, Jun 17, 2008 at 03:52:25PM +0530, Veda N wrote:
> I think you got confused by RGB and YUV.

I don't think so

> The device is capable of giving RGB and YUV data. This is done by a
> setting in the sensor register.

That's what I wanted to know

> Now, i know what i should set the pix->pixelformat, but what about
> other members of the
> v4l2_pix_format structure.

for 640x480
width = 640
height = 480

If you tell me pix->pixelformat, I can tell you the minimum bytesperline.
It may be larger if your hardware requires padding of lines.

  Daniel

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: v4l2_pix_format doubts
  2008-06-17 10:46         ` Daniel Glöckner
@ 2008-06-17 15:15           ` Veda N
  2008-06-17 17:24             ` Daniel Glöckner
  0 siblings, 1 reply; 11+ messages in thread
From: Veda N @ 2008-06-17 15:15 UTC (permalink / raw)
  To: Veda N, video4linux-list

Hi Daniel,

Thanks for your quick response.

 1) I am having a pixel format (UYVY)
 2) RGB565

Thank you.

Regards,
sriram

On Tue, Jun 17, 2008 at 4:16 PM, Daniel Glöckner <daniel-gl@gmx.net> wrote:
> On Tue, Jun 17, 2008 at 03:52:25PM +0530, Veda N wrote:
>> I think you got confused by RGB and YUV.
>
> I don't think so
>
>> The device is capable of giving RGB and YUV data. This is done by a
>> setting in the sensor register.
>
> That's what I wanted to know
>
>> Now, i know what i should set the pix->pixelformat, but what about
>> other members of the
>> v4l2_pix_format structure.
>
> for 640x480
> width = 640
> height = 480
>
> If you tell me pix->pixelformat, I can tell you the minimum bytesperline.
> It may be larger if your hardware requires padding of lines.
>
>  Daniel
>

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: v4l2_pix_format doubts
  2008-06-17 15:15           ` Veda N
@ 2008-06-17 17:24             ` Daniel Glöckner
  2008-06-18 15:15               ` Veda N
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel Glöckner @ 2008-06-17 17:24 UTC (permalink / raw)
  To: Veda N; +Cc: video4linux-list

On Tue, Jun 17, 2008 at 08:45:21PM +0530, Veda N wrote:
>  1) I am having a pixel format (UYVY)
>  2) RGB565

In both cases
bytesperline=2*width;
(minimum)

  Daniel

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: v4l2_pix_format doubts
  2008-06-17 17:24             ` Daniel Glöckner
@ 2008-06-18 15:15               ` Veda N
  2008-06-18 18:07                 ` Daniel Glöckner
  0 siblings, 1 reply; 11+ messages in thread
From: Veda N @ 2008-06-18 15:15 UTC (permalink / raw)
  To: Veda N, video4linux-list

Hi,
Thank you for your response.

Does this value depend on any way of bpp (bits per pixel?)

If so, how?

-- 
Regards,
N. S. Veda




On Tue, Jun 17, 2008 at 10:54 PM, Daniel Glöckner <daniel-gl@gmx.net> wrote:
> On Tue, Jun 17, 2008 at 08:45:21PM +0530, Veda N wrote:
>>  1) I am having a pixel format (UYVY)
>>  2) RGB565
>
> In both cases
> bytesperline=2*width;
> (minimum)
>
>  Daniel
>

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: v4l2_pix_format doubts
  2008-06-18 15:15               ` Veda N
@ 2008-06-18 18:07                 ` Daniel Glöckner
  0 siblings, 0 replies; 11+ messages in thread
From: Daniel Glöckner @ 2008-06-18 18:07 UTC (permalink / raw)
  To: Veda N; +Cc: video4linux-list

On Wed, Jun 18, 2008 at 08:45:05PM +0530, Veda N wrote:
> Does this value depend on any way of bpp (bits per pixel?)

Pixelformat depends on bpp.
And bytesperline depends on pixelformat, width, and the padding needed by
the hardware.

  Daniel

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

end of thread, other threads:[~2008-06-18 18:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-17  9:05 v4l2_pix_format doubts Veda N
2008-06-17  9:24 ` Daniel Glöckner
2008-06-17  9:39   ` Veda N
2008-06-17  9:45     ` Daniel Glöckner
2008-06-17 10:22       ` Veda N
2008-06-17 10:46         ` Daniel Glöckner
2008-06-17 15:15           ` Veda N
2008-06-17 17:24             ` Daniel Glöckner
2008-06-18 15:15               ` Veda N
2008-06-18 18:07                 ` Daniel Glöckner
2008-06-17  9:33 ` Xuesong Yang

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