* EASYCAP_DEBUG
* EASYCAP_IS_VIDEODEV_CLIENT
* EASYCAP_NEEDS_USBVIDEO_H
- * EASYCAP_NEEDS_V4L2_DEVICE_H
- * EASYCAP_NEEDS_V4L2_FOPS
*
* IF REQUIRED THEY MUST BE EXTERNALLY DEFINED, FOR EXAMPLE AS COMPILER
* OPTIONS.
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
#include <media/v4l2-dev.h>
-#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
#include <media/v4l2-device.h>
-#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
#include <linux/videodev2.h>
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
struct video_device video_device;
-#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
struct v4l2_device v4l2_device;
-#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
int status;
};
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
-#ifdef EASYCAP_NEEDS_V4L2_FOPS
static const struct v4l2_file_operations v4l2_fops = {
.owner = THIS_MODULE,
.open = easycap_open_noinode,
.poll = easycap_poll,
.mmap = easycap_mmap,
};
-#endif /*EASYCAP_NEEDS_V4L2_FOPS*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*****************************************************************************/
/*---------------------------------------------------------------------------*/
struct easycap_format *peasycap_format;
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
-#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
struct v4l2_device *pv4l2_device;
-#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
SAM("where 0x%08lX=&peasycap->video_device\n",
(unsigned long int) &peasycap->video_device);
-#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
SAM("and 0x%08lX=&peasycap->v4l2_device\n",
(unsigned long int) &peasycap->v4l2_device);
-#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*---------------------------------------------------------------------------*/
bInterfaceNumber);
return -ENODEV;
}
-#ifndef EASYCAP_IS_VIDEODEV_CLIENT
-#
-/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
-#else
-#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
+#ifdef EASYCAP_IS_VIDEODEV_CLIENT
/*---------------------------------------------------------------------------*/
/*
* SOME VERSIONS OF THE videodev MODULE OVERWRITE THE DATA WHICH HAS
peasycap = (struct easycap *)
container_of(pv4l2_device, struct easycap, v4l2_device);
}
-#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
}
/*---------------------------------------------------------------------------*/
}
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#else
-#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
if (0 != (v4l2_device_register(&(pusb_interface->dev),
&(peasycap->v4l2_device)))) {
SAM("v4l2_device_register() failed\n");
peasycap->video_device.v4l2_dev = NULL;
/*---------------------------------------------------------------------------*/
-#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
strcpy(&peasycap->video_device.name[0], "easycapdc60");
-#ifdef EASYCAP_NEEDS_V4L2_FOPS
peasycap->video_device.fops = &v4l2_fops;
-#else
- peasycap->video_device.fops = &easycap_fops;
-#endif /*EASYCAP_NEEDS_V4L2_FOPS*/
peasycap->video_device.minor = -1;
peasycap->video_device.release = (void *)(&videodev_release);
int minor, m, kd;
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
-#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
struct v4l2_device *pv4l2_device;
-#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
}
/*---------------------------------------------------------------------------*/
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
-#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
/*---------------------------------------------------------------------------*/
/*
* SOME VERSIONS OF THE videodev MODULE OVERWRITE THE DATA WHICH HAS
peasycap = (struct easycap *)
container_of(pv4l2_device, struct easycap, v4l2_device);
}
-#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
-#
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*---------------------------------------------------------------------------*/
}
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#else
-#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
if (!peasycap->v4l2_device.name[0]) {
SAM("ERROR: peasycap->v4l2_device.name is empty\n");
if (0 <= kd && DONGLE_MANY > kd)
JOM(4, "v4l2_device_disconnect() OK\n");
v4l2_device_unregister(&peasycap->v4l2_device);
JOM(4, "v4l2_device_unregister() OK\n");
-#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
video_unregister_device(&peasycap->video_device);
JOM(4, "intf[%i]: video_unregister_device() OK\n", bInterfaceNumber);
int subminor;
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
-#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
struct v4l2_device *pv4l2_device;
-#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
return -1;
}
/*---------------------------------------------------------------------------*/
-#ifndef EASYCAP_IS_VIDEODEV_CLIENT
-#
-/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
-#else
-#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
+#ifdef EASYCAP_IS_VIDEODEV_CLIENT
/*---------------------------------------------------------------------------*/
/*
* SOME VERSIONS OF THE videodev MODULE OVERWRITE THE DATA WHICH HAS
peasycap = (struct easycap *)
container_of(pv4l2_device, struct easycap, v4l2_device);
}
-#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
-#
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*---------------------------------------------------------------------------*/