mirror of
https://github.com/patjak/facetimehd.git
synced 2026-04-09 11:02:31 +02:00
fthd/v4l2: Fix queue setup because of API changes
We also remove the multiple plane support from queue setup. This will need to be fixed up again to support planar formats. Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
This commit is contained in:
17
fthd_v4l2.c
17
fthd_v4l2.c
@@ -41,31 +41,22 @@
|
||||
#define FTHD_NUM_FORMATS 2 /* NV16 is disabled for now */
|
||||
|
||||
static int fthd_buffer_queue_setup(struct vb2_queue *vq,
|
||||
const struct v4l2_format *fmt,
|
||||
unsigned int *nbuffers, unsigned int *nplanes,
|
||||
unsigned int sizes[], void *alloc_ctxs[])
|
||||
{
|
||||
struct fthd_private *dev_priv = vb2_get_drv_priv(vq);
|
||||
struct v4l2_pix_format *cur_fmt = &dev_priv->fmt.fmt;
|
||||
int i, total_size = 0;
|
||||
|
||||
*nplanes = dev_priv->fmt.planes;
|
||||
|
||||
if (!*nplanes)
|
||||
return -EINVAL;
|
||||
|
||||
/* FIXME: We assume single plane format here but not below */
|
||||
if (fmt && fmt->fmt.pix.sizeimage <
|
||||
(cur_fmt->bytesperline * cur_fmt->height))
|
||||
return -EINVAL;
|
||||
/* FIXME: We assume 1 plane format here */
|
||||
sizes[0] = cur_fmt->sizeimage;
|
||||
alloc_ctxs[0] = dev_priv->alloc_ctx;
|
||||
|
||||
for (i = 0; i < *nplanes; i++) {
|
||||
sizes[i] = cur_fmt->sizeimage;
|
||||
alloc_ctxs[i] = dev_priv->alloc_ctx;
|
||||
total_size += sizes[i];
|
||||
}
|
||||
|
||||
*nbuffers = (4096 * 4096) / total_size;
|
||||
*nbuffers = (4096 * 4096) / sizes[0];
|
||||
if (*nbuffers > 4)
|
||||
*nbuffers = 4;
|
||||
if (*nbuffers <= 1)
|
||||
|
||||
Reference in New Issue
Block a user