Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 219113
b: refs/heads/master
c: 479567c
h: refs/heads/master
i:
  219111: d4216cf
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Oct 21, 2010
1 parent 88d1d12 commit 2d75c63
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 340 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a1de2e4b72f27b906cb2eea3003fd62377dbf5ea
refs/heads/master: 479567ce3af7b99d645a3c53b8ca2fc65e46efdc
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/pwc/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config USB_PWC
tristate "USB Philips Cameras"
depends on VIDEO_V4L1
depends on VIDEO_V4L2
---help---
Say Y or M here if you want to use one of these Philips & OEM
webcams:
Expand Down
20 changes: 10 additions & 10 deletions trunk/drivers/media/video/pwc/pwc-ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ static int set_video_mode_Nala(struct pwc_device *pdev, int size, int frames)
PWC_DEBUG_MODULE("Failed to send video command... %d\n", ret);
return ret;
}
if (pEntry->compressed && pdev->vpalette != VIDEO_PALETTE_RAW)
if (pEntry->compressed && pdev->pixfmt == V4L2_PIX_FMT_YUV420)
pwc_dec1_init(pdev->type, pdev->release, buf, pdev->decompress_data);

pdev->cmd_len = 3;
Expand Down Expand Up @@ -321,7 +321,7 @@ static int set_video_mode_Timon(struct pwc_device *pdev, int size, int frames, i
if (ret < 0)
return ret;

if (pChoose->bandlength > 0 && pdev->vpalette != VIDEO_PALETTE_RAW)
if (pChoose->bandlength > 0 && pdev->pixfmt == V4L2_PIX_FMT_YUV420)
pwc_dec23_init(pdev, pdev->type, buf);

pdev->cmd_len = 13;
Expand Down Expand Up @@ -356,7 +356,7 @@ static int set_video_mode_Kiara(struct pwc_device *pdev, int size, int frames, i
fps = (frames / 5) - 1;

/* special case: VGA @ 5 fps and snapshot is raw bayer mode */
if (size == PSZ_VGA && frames == 5 && snapshot && pdev->vpalette == VIDEO_PALETTE_RAW)
if (size == PSZ_VGA && frames == 5 && snapshot && pdev->pixfmt != V4L2_PIX_FMT_YUV420)
{
/* Only available in case the raw palette is selected or
we have the decompressor available. This mode is
Expand Down Expand Up @@ -394,7 +394,7 @@ static int set_video_mode_Kiara(struct pwc_device *pdev, int size, int frames, i
if (ret < 0)
return ret;

if (pChoose->bandlength > 0 && pdev->vpalette != VIDEO_PALETTE_RAW)
if (pChoose->bandlength > 0 && pdev->pixfmt == V4L2_PIX_FMT_YUV420)
pwc_dec23_init(pdev, pdev->type, buf);

pdev->cmd_len = 12;
Expand Down Expand Up @@ -429,7 +429,7 @@ int pwc_set_video_mode(struct pwc_device *pdev, int width, int height, int frame
{
int ret, size;

PWC_DEBUG_FLOW("set_video_mode(%dx%d @ %d, palette %d).\n", width, height, frames, pdev->vpalette);
PWC_DEBUG_FLOW("set_video_mode(%dx%d @ %d, pixfmt %08x).\n", width, height, frames, pdev->pixfmt);
size = pwc_decode_size(pdev, width, height);
if (size < 0) {
PWC_DEBUG_MODULE("Could not find suitable size.\n");
Expand Down Expand Up @@ -519,13 +519,13 @@ static void pwc_set_image_buffer_size(struct pwc_device *pdev)
{
int i, factor = 0;

/* for PALETTE_YUV420P */
switch(pdev->vpalette)
{
case VIDEO_PALETTE_YUV420P:
/* for V4L2_PIX_FMT_YUV420 */
switch (pdev->pixfmt) {
case V4L2_PIX_FMT_YUV420:
factor = 6;
break;
case VIDEO_PALETTE_RAW:
case V4L2_PIX_FMT_PWC1:
case V4L2_PIX_FMT_PWC2:
factor = 6; /* can be uncompressed YUV420P */
break;
}
Expand Down
23 changes: 12 additions & 11 deletions trunk/drivers/media/video/pwc/pwc-if.c
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@ static ssize_t pwc_video_read(struct file *file, char __user *buf,
}

PWC_DEBUG_READ("Copying data to user space.\n");
if (pdev->vpalette == VIDEO_PALETTE_RAW)
if (pdev->pixfmt != V4L2_PIX_FMT_YUV420)
bytes_to_read = pdev->frame_size + sizeof(struct pwc_raw_frame);
else
bytes_to_read = pdev->view.size;
Expand Down Expand Up @@ -1800,28 +1800,29 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
}

pdev->vdev->release = video_device_release;
rc = video_register_device(pdev->vdev, VFL_TYPE_GRABBER, video_nr);
if (rc < 0) {
PWC_ERROR("Failed to register as video device (%d).\n", rc);
goto err_video_release;
}

PWC_INFO("Registered as %s.\n", video_device_node_name(pdev->vdev));

/* occupy slot */
if (hint < MAX_DEV_HINTS)
device_hint[hint].pdev = pdev;

PWC_DEBUG_PROBE("probe() function returning struct at 0x%p.\n", pdev);
usb_set_intfdata(intf, pdev);
rc = pwc_create_sysfs_files(pdev->vdev);
if (rc)
goto err_video_unreg;

/* Set the leds off */
pwc_set_leds(pdev, 0, 0);
pwc_camera_power(pdev, 0);

rc = video_register_device(pdev->vdev, VFL_TYPE_GRABBER, video_nr);
if (rc < 0) {
PWC_ERROR("Failed to register as video device (%d).\n", rc);
goto err_video_release;
}
rc = pwc_create_sysfs_files(pdev->vdev);
if (rc)
goto err_video_unreg;

PWC_INFO("Registered as %s.\n", video_device_node_name(pdev->vdev));

#ifdef CONFIG_USB_PWC_INPUT_EVDEV
/* register webcam snapshot button input device */
pdev->button_dev = input_allocate_device();
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/media/video/pwc/pwc-misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int pwc_decode_size(struct pwc_device *pdev, int width, int height)
you don't have the decompressor loaded or use RAW mode,
the maximum viewable size is smaller.
*/
if (pdev->vpalette == VIDEO_PALETTE_RAW)
if (pdev->pixfmt != V4L2_PIX_FMT_YUV420)
{
if (width > pdev->abs_max.x || height > pdev->abs_max.y)
{
Expand Down Expand Up @@ -123,7 +123,7 @@ void pwc_construct(struct pwc_device *pdev)
pdev->frame_header_size = 0;
pdev->frame_trailer_size = 0;
}
pdev->vpalette = VIDEO_PALETTE_YUV420P; /* default */
pdev->pixfmt = V4L2_PIX_FMT_YUV420; /* default */
pdev->view_min.size = pdev->view_min.x * pdev->view_min.y;
pdev->view_max.size = pdev->view_max.x * pdev->view_max.y;
/* length of image, in YUV format; always allocate enough memory. */
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/pwc/pwc-uncompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ int pwc_decompress(struct pwc_device *pdev)
yuv = fbuf->data + pdev->frame_header_size; /* Skip header */

/* Raw format; that's easy... */
if (pdev->vpalette == VIDEO_PALETTE_RAW)
if (pdev->pixfmt != V4L2_PIX_FMT_YUV420)
{
struct pwc_raw_frame *raw_frame = image;
raw_frame->type = cpu_to_le16(pdev->type);
Expand Down
Loading

0 comments on commit 2d75c63

Please sign in to comment.