mirror of
https://github.com/patjak/facetimehd.git
synced 2026-04-09 19:10:01 +02:00
compile in 4.4.0 kernel
This commit is contained in:
22
fthd_v4l2.c
22
fthd_v4l2.c
@@ -41,17 +41,27 @@
|
|||||||
#define FTHD_MIN_HEIGHT 240
|
#define FTHD_MIN_HEIGHT 240
|
||||||
#define FTHD_NUM_FORMATS 2 /* NV16 is disabled for now */
|
#define FTHD_NUM_FORMATS 2 /* NV16 is disabled for now */
|
||||||
|
|
||||||
static int fthd_buffer_queue_setup(struct vb2_queue *vq,
|
static int fthd_buffer_queue_setup(
|
||||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,4,0)
|
struct vb2_queue *vq,
|
||||||
const struct v4l2_format *fmt,
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0)
|
||||||
|
const struct v4l2_format *fmt,
|
||||||
#endif
|
#endif
|
||||||
unsigned int *nbuffers, unsigned int *nplanes,
|
#if !(LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
|
||||||
unsigned int sizes[], void *alloc_ctxs[])
|
const void *parg,
|
||||||
{
|
#endif
|
||||||
|
unsigned int *nbuffers,
|
||||||
|
unsigned int *nplanes,
|
||||||
|
unsigned int sizes[],
|
||||||
|
void *alloc_ctxs[]
|
||||||
|
) {
|
||||||
|
|
||||||
struct fthd_private *dev_priv = vb2_get_drv_priv(vq);
|
struct fthd_private *dev_priv = vb2_get_drv_priv(vq);
|
||||||
struct v4l2_pix_format *cur_fmt = &dev_priv->fmt.fmt;
|
struct v4l2_pix_format *cur_fmt = &dev_priv->fmt.fmt;
|
||||||
int i, total_size = 0;
|
int i, total_size = 0;
|
||||||
|
|
||||||
|
if (*nplanes)
|
||||||
|
return sizes[0] < (cur_fmt->bytesperline * cur_fmt->height) ? -EINVAL : 0;
|
||||||
|
|
||||||
*nplanes = dev_priv->fmt.planes;
|
*nplanes = dev_priv->fmt.planes;
|
||||||
|
|
||||||
if (!*nplanes)
|
if (!*nplanes)
|
||||||
|
|||||||
Reference in New Issue
Block a user