#include <sound/control.h>
#endif /* !CONFIG_EASYCAP_OSS */
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
-#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
+#ifdef EASYCAP_IS_VIDEODEV_CLIENT
#include <media/v4l2-dev.h>
-#if defined(EASYCAP_NEEDS_V4L2_DEVICE_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>
#include <linux/soundcard.h>
-#if defined(EASYCAP_NEEDS_USBVIDEO_H)
+#ifdef EASYCAP_NEEDS_USBVIDEO_H
#include <config/video/usbvideo.h>
#endif /*EASYCAP_NEEDS_USBVIDEO_H*/
-#if (!defined(PAGE_SIZE))
+#ifndef PAGE_SIZE
#error "PAGE_SIZE not defined"
-#endif
+#endif /* PAGE_SIZE */
/*---------------------------------------------------------------------------*/
/* VENDOR, PRODUCT: Syntek Semiconductor Co., Ltd
int minor;
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
-#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
+#ifdef EASYCAP_IS_VIDEODEV_CLIENT
struct video_device video_device;
-#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
+#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
struct v4l2_device v4l2_device;
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
unsigned int audio_buffer_page_many;
#define UPSAMPLE
-#if defined(UPSAMPLE)
-__s16 oldaudio;
+#ifdef UPSAMPLE
+ __s16 oldaudio;
#endif /*UPSAMPLE*/
int ilk;
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
static int easycap_open(struct inode *inode, struct file *file)
{
-#if (!defined(EASYCAP_IS_VIDEODEV_CLIENT))
+#ifndef EASYCAP_IS_VIDEODEV_CLIENT
struct usb_interface *pusb_interface;
#else
struct video_device *pvideo_device;
peasycap = NULL;
/*---------------------------------------------------------------------------*/
-#if (!defined(EASYCAP_IS_VIDEODEV_CLIENT))
+#ifndef EASYCAP_IS_VIDEODEV_CLIENT
if (NULL == inode) {
SAY("ERROR: inode is NULL.\n");
return -EFAULT;
/*--------------------------------------------------------------------------*/
static int easycap_release(struct inode *inode, struct file *file)
{
-#if (!defined(EASYCAP_IS_VIDEODEV_CLIENT))
+#ifndef EASYCAP_IS_VIDEODEV_CLIENT
struct easycap *peasycap;
JOT(4, "\n");
return 0;
}
-#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
+#ifdef EASYCAP_IS_VIDEODEV_CLIENT
static int easycap_open_noinode(struct file *file)
{
return easycap_open(NULL, file);
peasycap->field_read);
return 0;
}
-#if defined(EASYCAP_TESTCARD)
+#ifdef EASYCAP_TESTCARD
easycap_testcard(peasycap, peasycap->field_read);
#else
if (0 <= input && INPUT_MANY > input) {
.minor_base = USB_SKEL_MINOR_BASE,
};
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
-#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
-#if defined(EASYCAP_NEEDS_V4L2_FOPS)
+#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,
__s32 value;
struct easycap_format *peasycap_format;
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
-#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
-#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
+#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*/
}
SAM("allocated 0x%08lX=peasycap\n", (unsigned long int) peasycap);
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
-#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
+#ifdef EASYCAP_IS_VIDEODEV_CLIENT
SAM("where 0x%08lX=&peasycap->video_device\n",
(unsigned long int) &peasycap->video_device);
-#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
+#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*/
bInterfaceNumber);
return -ENODEV;
}
-#if (!defined(EASYCAP_IS_VIDEODEV_CLIENT))
+#ifndef EASYCAP_IS_VIDEODEV_CLIENT
#
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#else
-#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
+#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
/*---------------------------------------------------------------------------*/
/*
* SOME VERSIONS OF THE videodev MODULE OVERWRITE THE DATA WHICH HAS
* BEWARE.
*/
/*---------------------------------------------------------------------------*/
-#if defined(PREFER_NTSC)
+#ifdef PREFER_NTSC
peasycap->ntsc = true;
JOM(8, "defaulting initially to NTSC\n");
#else
* THE VIDEO DEVICE CAN BE REGISTERED NOW, AS IT IS READY.
*/
/*--------------------------------------------------------------------------*/
-#if (!defined(EASYCAP_IS_VIDEODEV_CLIENT))
+#ifndef EASYCAP_IS_VIDEODEV_CLIENT
if (0 != (usb_register_dev(pusb_interface, &easycap_class))) {
err("Not able to get a minor for this device");
usb_set_intfdata(pusb_interface, NULL);
}
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#else
-#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
+#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
if (0 != (v4l2_device_register(&(pusb_interface->dev),
&(peasycap->v4l2_device)))) {
SAM("v4l2_device_register() failed\n");
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
strcpy(&peasycap->video_device.name[0], "easycapdc60");
-#if defined(EASYCAP_NEEDS_V4L2_FOPS)
+#ifdef EASYCAP_NEEDS_V4L2_FOPS
peasycap->video_device.fops = &v4l2_fops;
#else
peasycap->video_device.fops = &easycap_fops;
*/
/*--------------------------------------------------------------------------*/
case 1: {
-#if defined(EASYCAP_SILENT)
+#ifdef EASYCAP_SILENT
return -ENOENT;
#endif /*EASYCAP_SILENT*/
if (!peasycap) {
}
/*--------------------------------------------------------------------------*/
case 2: {
-#if defined(EASYCAP_SILENT)
+#ifdef EASYCAP_SILENT
return -ENOENT;
#endif /*EASYCAP_SILENT*/
if (!peasycap) {
struct data_urb *pdata_urb;
int minor, m, kd;
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
-#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
-#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
+#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;
}
/*---------------------------------------------------------------------------*/
-#if (!defined(EASYCAP_IS_VIDEODEV_CLIENT))
-#
-/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
-#else
-#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
+#ifdef EASYCAP_IS_VIDEODEV_CLIENT
+#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
/*---------------------------------------------------------------------------*/
/*
* SOME VERSIONS OF THE videodev MODULE OVERWRITE THE DATA WHICH HAS
} else
SAY("ERROR: %i=kd is bad: cannot lock dongle\n", kd);
/*---------------------------------------------------------------------------*/
-#if (!defined(EASYCAP_IS_VIDEODEV_CLIENT))
+#ifndef EASYCAP_IS_VIDEODEV_CLIENT
if (NULL == peasycap) {
SAM("ERROR: peasycap has become NULL\n");
} else {
}
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#else
-#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
+#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)
__u8 *p1, *p2;
__s16 s16;
int i, j, more, much, leap, rc;
-#if defined(UPSAMPLE)
+#ifdef UPSAMPLE
int k;
__s16 oldaudio, newaudio, delta;
#endif /*UPSAMPLE*/
* PROCEED HERE WHEN NO ERROR
*/
/*---------------------------------------------------------------------------*/
-#if defined(UPSAMPLE)
+#ifdef UPSAMPLE
oldaudio = peasycap->oldaudio;
#endif /*UPSAMPLE*/
more = purb->iso_frame_desc[i].actual_length;
-#if defined(TESTTONE)
+#ifdef TESTTONE
if (!more)
more = purb->iso_frame_desc[i].length;
#endif
if (PAGE_SIZE == (paudio_buffer->pto -
paudio_buffer->pgo)) {
-#if defined(TESTTONE)
+#ifdef TESTTONE
easyoss_testtone(peasycap,
peasycap->audio_fill);
#endif /*TESTTONE*/
p1 += much;
more -= much;
} else {
-#if defined(UPSAMPLE)
+#ifdef UPSAMPLE
if (much % 16)
JOM(8, "MISTAKE? much"
" is not divisible by 16\n");
purb->iso_frame_desc[i].status);
}
-#if defined(UPSAMPLE)
+#ifdef UPSAMPLE
peasycap->oldaudio = oldaudio;
#endif /*UPSAMPLE*/
struct easycap *peasycap;
int subminor;
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
-#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
-#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
+#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;
}
/*---------------------------------------------------------------------------*/
-#if (!defined(EASYCAP_IS_VIDEODEV_CLIENT))
+#ifndef EASYCAP_IS_VIDEODEV_CLIENT
#
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#else
-#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
+#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
/*---------------------------------------------------------------------------*/
/*
* SOME VERSIONS OF THE videodev MODULE OVERWRITE THE DATA WHICH HAS
int caps;
JOM(8, "SNDCTL_DSP_GETCAPS\n");
-#if defined(UPSAMPLE)
+#ifdef UPSAMPLE
if (true == peasycap->microphone)
caps = 0x04400000;
else
int incoming;
JOM(8, "SNDCTL_DSP_GETFMTS\n");
-#if defined(UPSAMPLE)
+#ifdef UPSAMPLE
if (true == peasycap->microphone)
incoming = AFMT_S16_LE;
else
}
JOM(8, "........... %i=incoming\n", incoming);
-#if defined(UPSAMPLE)
+#ifdef UPSAMPLE
if (true == peasycap->microphone)
outgoing = AFMT_S16_LE;
else
}
JOM(8, "........... %i=incoming\n", incoming);
-#if defined(UPSAMPLE)
+#ifdef UPSAMPLE
if (true == peasycap->microphone)
incoming = 1;
else
}
JOM(8, "........... %i=incoming\n", incoming);
-#if defined(UPSAMPLE)
+#ifdef UPSAMPLE
if (true == peasycap->microphone)
incoming = 32000;
else