Commit ab8f12cf authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab

V4L/DVB (8197): gspca: pac207 frames no more decoded in the subdriver.

videodev2: New pixfmt
pac207:   Remove the specific decoding.
main:     get_buff_size operation added for the subdriver.
Signed-off-by: default avatarHans de Goede <j.w.r.degoede@hhs.nl>
Signed-off-by: default avatarJean-Francois Moine <moinejf@free.fr>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 24c530b4
...@@ -321,6 +321,7 @@ static int gspca_is_compressed(__u32 format) ...@@ -321,6 +321,7 @@ static int gspca_is_compressed(__u32 format)
case V4L2_PIX_FMT_MJPEG: case V4L2_PIX_FMT_MJPEG:
case V4L2_PIX_FMT_JPEG: case V4L2_PIX_FMT_JPEG:
case V4L2_PIX_FMT_SPCA561: case V4L2_PIX_FMT_SPCA561:
case V4L2_PIX_FMT_PAC207:
return 1; return 1;
} }
return 0; return 0;
...@@ -380,7 +381,8 @@ static __u32 get_v4l2_depth(__u32 pixfmt) ...@@ -380,7 +381,8 @@ static __u32 get_v4l2_depth(__u32 pixfmt)
case V4L2_PIX_FMT_JPEG: case V4L2_PIX_FMT_JPEG:
case V4L2_PIX_FMT_SBGGR8: /* 'BA81' Bayer */ case V4L2_PIX_FMT_SBGGR8: /* 'BA81' Bayer */
case V4L2_PIX_FMT_SN9C10X: /* 'S910' SN9C10x compression */ 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; return 8;
} }
PDEBUG(D_ERR|D_CONF, "Unknown pixel format %c%c%c%c", PDEBUG(D_ERR|D_CONF, "Unknown pixel format %c%c%c%c",
...@@ -395,6 +397,9 @@ static int gspca_get_buff_size(struct gspca_dev *gspca_dev, int mode) ...@@ -395,6 +397,9 @@ static int gspca_get_buff_size(struct gspca_dev *gspca_dev, int mode)
{ {
unsigned int size; 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 * size = gspca_dev->cam.cam_mode[mode].width *
gspca_dev->cam.cam_mode[mode].height * gspca_dev->cam.cam_mode[mode].height *
get_v4l2_depth(gspca_dev->cam.cam_mode[mode].pixfmt) / 8; get_v4l2_depth(gspca_dev->cam.cam_mode[mode].pixfmt) / 8;
......
...@@ -80,6 +80,7 @@ typedef void (*cam_pkt_op) (struct gspca_dev *gspca_dev, ...@@ -80,6 +80,7 @@ typedef void (*cam_pkt_op) (struct gspca_dev *gspca_dev,
struct gspca_frame *frame, struct gspca_frame *frame,
__u8 *data, __u8 *data,
int len); int len);
typedef int (*cam_get_buff_size_op) (struct gspca_dev *gspca_dev, int mode);
struct ctrl { struct ctrl {
struct v4l2_queryctrl qctrl; struct v4l2_queryctrl qctrl;
...@@ -106,6 +107,7 @@ struct sd_desc { ...@@ -106,6 +107,7 @@ struct sd_desc {
cam_jpg_op get_jcomp; cam_jpg_op get_jcomp;
cam_jpg_op set_jcomp; cam_jpg_op set_jcomp;
cam_qmnu_op querymenu; cam_qmnu_op querymenu;
cam_get_buff_size_op get_buff_size; /* optional */
}; };
/* packet types when moving from iso buf to frame buf */ /* packet types when moving from iso buf to frame buf */
......
This diff is collapsed.
...@@ -326,7 +326,8 @@ struct v4l2_pix_format ...@@ -326,7 +326,8 @@ struct v4l2_pix_format
#define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P','W','C','2') /* pwc newer webcam */ #define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P','W','C','2') /* pwc newer webcam */
#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E','6','2','5') /* ET61X251 compression */ #define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E','6','2','5') /* ET61X251 compression */
#define V4L2_PIX_FMT_SPCA501 v4l2_fourcc('S','5','0','1') /* YUYV per line */ #define V4L2_PIX_FMT_SPCA501 v4l2_fourcc('S','5','0','1') /* YUYV per line */
#define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S','5','6','1') /* compressed BGGR bayer */ #define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S','5','6','1') /* compressed GBRG bayer */
#define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P','2','0','7') /* compressed BGGR bayer */
/* /*
* F O R M A T E N U M E R A T I O N * F O R M A T E N U M E R A T I O N
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment