Skip to content

Commit

Permalink
V4L/DVB (8197): gspca: pac207 frames no more decoded in the subdriver.
Browse files Browse the repository at this point in the history
videodev2: New pixfmt
pac207:   Remove the specific decoding.
main:     get_buff_size operation added for the subdriver.

Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Hans de Goede authored and Mauro Carvalho Chehab committed Jul 20, 2008
1 parent 24c530b commit ab8f12c
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 312 deletions.
7 changes: 6 additions & 1 deletion drivers/media/video/gspca/gspca.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ static int gspca_is_compressed(__u32 format)
case V4L2_PIX_FMT_MJPEG:
case V4L2_PIX_FMT_JPEG:
case V4L2_PIX_FMT_SPCA561:
case V4L2_PIX_FMT_PAC207:
return 1;
}
return 0;
Expand Down Expand Up @@ -380,7 +381,8 @@ static __u32 get_v4l2_depth(__u32 pixfmt)
case V4L2_PIX_FMT_JPEG:
case V4L2_PIX_FMT_SBGGR8: /* 'BA81' Bayer */
case V4L2_PIX_FMT_SN9C10X: /* 'S910' SN9C10x compression */
case V4L2_PIX_FMT_SPCA561: /* 'S561' compressed BGGR bayer */
case V4L2_PIX_FMT_SPCA561: /* 'S561' compressed GBRG bayer */
case V4L2_PIX_FMT_PAC207: /* 'P207' compressed BGGR bayer */
return 8;
}
PDEBUG(D_ERR|D_CONF, "Unknown pixel format %c%c%c%c",
Expand All @@ -395,6 +397,9 @@ static int gspca_get_buff_size(struct gspca_dev *gspca_dev, int mode)
{
unsigned int size;

if (gspca_dev->sd_desc->get_buff_size)
return gspca_dev->sd_desc->get_buff_size(gspca_dev, mode);

size = gspca_dev->cam.cam_mode[mode].width *
gspca_dev->cam.cam_mode[mode].height *
get_v4l2_depth(gspca_dev->cam.cam_mode[mode].pixfmt) / 8;
Expand Down
2 changes: 2 additions & 0 deletions drivers/media/video/gspca/gspca.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ typedef void (*cam_pkt_op) (struct gspca_dev *gspca_dev,
struct gspca_frame *frame,
__u8 *data,
int len);
typedef int (*cam_get_buff_size_op) (struct gspca_dev *gspca_dev, int mode);

struct ctrl {
struct v4l2_queryctrl qctrl;
Expand All @@ -106,6 +107,7 @@ struct sd_desc {
cam_jpg_op get_jcomp;
cam_jpg_op set_jcomp;
cam_qmnu_op querymenu;
cam_get_buff_size_op get_buff_size; /* optional */
};

/* packet types when moving from iso buf to frame buf */
Expand Down
Loading

0 comments on commit ab8f12c

Please sign in to comment.