mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
staging/easycap: repace #if defined with simpler #ifdef
for sake of readability replace #if defined with #ifdef and #if (!defined with #ifndef Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
f2b3c685b9
commit
3fc0dae888
7 changed files with 61 additions and 64 deletions
|
@ -90,22 +90,22 @@
|
||||||
#include <sound/control.h>
|
#include <sound/control.h>
|
||||||
#endif /* !CONFIG_EASYCAP_OSS */
|
#endif /* !CONFIG_EASYCAP_OSS */
|
||||||
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
||||||
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
|
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
|
||||||
#include <media/v4l2-dev.h>
|
#include <media/v4l2-dev.h>
|
||||||
#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
|
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
|
||||||
#include <media/v4l2-device.h>
|
#include <media/v4l2-device.h>
|
||||||
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
|
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
|
||||||
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
|
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
|
||||||
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
|
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
|
||||||
#include <linux/videodev2.h>
|
#include <linux/videodev2.h>
|
||||||
#include <linux/soundcard.h>
|
#include <linux/soundcard.h>
|
||||||
#if defined(EASYCAP_NEEDS_USBVIDEO_H)
|
#ifdef EASYCAP_NEEDS_USBVIDEO_H
|
||||||
#include <config/video/usbvideo.h>
|
#include <config/video/usbvideo.h>
|
||||||
#endif /*EASYCAP_NEEDS_USBVIDEO_H*/
|
#endif /*EASYCAP_NEEDS_USBVIDEO_H*/
|
||||||
|
|
||||||
#if (!defined(PAGE_SIZE))
|
#ifndef PAGE_SIZE
|
||||||
#error "PAGE_SIZE not defined"
|
#error "PAGE_SIZE not defined"
|
||||||
#endif
|
#endif /* PAGE_SIZE */
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/* VENDOR, PRODUCT: Syntek Semiconductor Co., Ltd
|
/* VENDOR, PRODUCT: Syntek Semiconductor Co., Ltd
|
||||||
|
@ -309,9 +309,9 @@ struct easycap {
|
||||||
int minor;
|
int minor;
|
||||||
|
|
||||||
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
||||||
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
|
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
|
||||||
struct video_device video_device;
|
struct video_device video_device;
|
||||||
#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
|
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
|
||||||
struct v4l2_device v4l2_device;
|
struct v4l2_device v4l2_device;
|
||||||
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
|
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
|
||||||
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
|
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
|
||||||
|
@ -322,8 +322,8 @@ struct easycap {
|
||||||
unsigned int audio_buffer_page_many;
|
unsigned int audio_buffer_page_many;
|
||||||
|
|
||||||
#define UPSAMPLE
|
#define UPSAMPLE
|
||||||
#if defined(UPSAMPLE)
|
#ifdef UPSAMPLE
|
||||||
__s16 oldaudio;
|
__s16 oldaudio;
|
||||||
#endif /*UPSAMPLE*/
|
#endif /*UPSAMPLE*/
|
||||||
|
|
||||||
int ilk;
|
int ilk;
|
||||||
|
|
|
@ -1387,7 +1387,7 @@ case VIDIOC_G_CTRL: {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||||
#if defined(VIDIOC_S_CTRL_OLD)
|
#ifdef VIDIOC_S_CTRL_OLD
|
||||||
case VIDIOC_S_CTRL_OLD: {
|
case VIDIOC_S_CTRL_OLD: {
|
||||||
JOM(8, "VIDIOC_S_CTRL_OLD required at least for xawtv\n");
|
JOM(8, "VIDIOC_S_CTRL_OLD required at least for xawtv\n");
|
||||||
}
|
}
|
||||||
|
@ -2156,7 +2156,7 @@ case VIDIOC_QBUF: {
|
||||||
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||||
case VIDIOC_DQBUF:
|
case VIDIOC_DQBUF:
|
||||||
{
|
{
|
||||||
#if defined(AUDIOTIME)
|
#ifdef AUDIOTIME
|
||||||
struct signed_div_result sdr;
|
struct signed_div_result sdr;
|
||||||
long long int above, below, dnbydt, fudge, sll;
|
long long int above, below, dnbydt, fudge, sll;
|
||||||
unsigned long long int ull;
|
unsigned long long int ull;
|
||||||
|
@ -2269,7 +2269,7 @@ case VIDIOC_DQBUF:
|
||||||
do_gettimeofday(&timeval);
|
do_gettimeofday(&timeval);
|
||||||
timeval2 = timeval;
|
timeval2 = timeval;
|
||||||
|
|
||||||
#if defined(AUDIOTIME)
|
#ifdef AUDIOTIME
|
||||||
if (!peasycap->timeval0.tv_sec) {
|
if (!peasycap->timeval0.tv_sec) {
|
||||||
timeval8 = timeval;
|
timeval8 = timeval;
|
||||||
timeval1 = timeval;
|
timeval1 = timeval;
|
||||||
|
@ -2389,7 +2389,7 @@ case VIDIOC_STREAMOFF: {
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
JOM(8, "calling wake_up on wq_video and wq_audio\n");
|
JOM(8, "calling wake_up on wq_video and wq_audio\n");
|
||||||
wake_up_interruptible(&(peasycap->wq_video));
|
wake_up_interruptible(&(peasycap->wq_video));
|
||||||
#if defined(EASYCAP_NEEDS_ALSA)
|
#ifdef EASYCAP_NEEDS_ALSA
|
||||||
if (NULL != peasycap->psubstream)
|
if (NULL != peasycap->psubstream)
|
||||||
snd_pcm_period_elapsed(peasycap->psubstream);
|
snd_pcm_period_elapsed(peasycap->psubstream);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -133,7 +133,7 @@ static const struct saa7113config{
|
||||||
int set;
|
int set;
|
||||||
} saa7113configPAL[256] = {
|
} saa7113configPAL[256] = {
|
||||||
{0x01, 0x08},
|
{0x01, 0x08},
|
||||||
#if defined(ANTIALIAS)
|
#ifdef ANTIALIAS
|
||||||
{0x02, 0xC0},
|
{0x02, 0xC0},
|
||||||
#else
|
#else
|
||||||
{0x02, 0x80},
|
{0x02, 0x80},
|
||||||
|
@ -191,7 +191,7 @@ static const struct saa7113config{
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
static const struct saa7113config saa7113configNTSC[256] = {
|
static const struct saa7113config saa7113configNTSC[256] = {
|
||||||
{0x01, 0x08},
|
{0x01, 0x08},
|
||||||
#if defined(ANTIALIAS)
|
#ifdef ANTIALIAS
|
||||||
{0x02, 0xC0},
|
{0x02, 0xC0},
|
||||||
#else
|
#else
|
||||||
{0x02, 0x80},
|
{0x02, 0x80},
|
||||||
|
@ -929,7 +929,7 @@ rc0 = usb_control_msg(pusb_device, usb_sndctrlpipe(pusb_device, 0),
|
||||||
(__u16)0,
|
(__u16)0,
|
||||||
(int)500);
|
(int)500);
|
||||||
|
|
||||||
#if defined(NOREADBACK)
|
#ifdef NOREADBACK
|
||||||
#
|
#
|
||||||
#else
|
#else
|
||||||
rc1 = usb_control_msg(pusb_device, usb_rcvctrlpipe(pusb_device, 0),
|
rc1 = usb_control_msg(pusb_device, usb_rcvctrlpipe(pusb_device, 0),
|
||||||
|
|
|
@ -133,7 +133,7 @@ return -1;
|
||||||
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
|
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
|
||||||
static int easycap_open(struct inode *inode, struct file *file)
|
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;
|
struct usb_interface *pusb_interface;
|
||||||
#else
|
#else
|
||||||
struct video_device *pvideo_device;
|
struct video_device *pvideo_device;
|
||||||
|
@ -146,7 +146,7 @@ SAY("==========OPEN=========\n");
|
||||||
|
|
||||||
peasycap = NULL;
|
peasycap = NULL;
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if (!defined(EASYCAP_IS_VIDEODEV_CLIENT))
|
#ifndef EASYCAP_IS_VIDEODEV_CLIENT
|
||||||
if (NULL == inode) {
|
if (NULL == inode) {
|
||||||
SAY("ERROR: inode is NULL.\n");
|
SAY("ERROR: inode is NULL.\n");
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
@ -728,7 +728,7 @@ return 0;
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
static int easycap_release(struct inode *inode, struct file *file)
|
static int easycap_release(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
#if (!defined(EASYCAP_IS_VIDEODEV_CLIENT))
|
#ifndef EASYCAP_IS_VIDEODEV_CLIENT
|
||||||
struct easycap *peasycap;
|
struct easycap *peasycap;
|
||||||
|
|
||||||
JOT(4, "\n");
|
JOT(4, "\n");
|
||||||
|
@ -756,7 +756,7 @@ JOM(4, "ending successfully\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
|
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
|
||||||
static int easycap_open_noinode(struct file *file)
|
static int easycap_open_noinode(struct file *file)
|
||||||
{
|
{
|
||||||
return easycap_open(NULL, file);
|
return easycap_open(NULL, file);
|
||||||
|
@ -1375,7 +1375,7 @@ if (peasycap->field_read == peasycap->field_fill) {
|
||||||
peasycap->field_read);
|
peasycap->field_read);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#if defined(EASYCAP_TESTCARD)
|
#ifdef EASYCAP_TESTCARD
|
||||||
easycap_testcard(peasycap, peasycap->field_read);
|
easycap_testcard(peasycap, peasycap->field_read);
|
||||||
#else
|
#else
|
||||||
if (0 <= input && INPUT_MANY > input) {
|
if (0 <= input && INPUT_MANY > input) {
|
||||||
|
@ -3128,8 +3128,8 @@ static const struct usb_class_driver easycap_class = {
|
||||||
.minor_base = USB_SKEL_MINOR_BASE,
|
.minor_base = USB_SKEL_MINOR_BASE,
|
||||||
};
|
};
|
||||||
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
||||||
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
|
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
|
||||||
#if defined(EASYCAP_NEEDS_V4L2_FOPS)
|
#ifdef EASYCAP_NEEDS_V4L2_FOPS
|
||||||
static const struct v4l2_file_operations v4l2_fops = {
|
static const struct v4l2_file_operations v4l2_fops = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.open = easycap_open_noinode,
|
.open = easycap_open_noinode,
|
||||||
|
@ -3180,8 +3180,8 @@ __u16 mask;
|
||||||
__s32 value;
|
__s32 value;
|
||||||
struct easycap_format *peasycap_format;
|
struct easycap_format *peasycap_format;
|
||||||
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
||||||
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
|
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
|
||||||
#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
|
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
|
||||||
struct v4l2_device *pv4l2_device;
|
struct v4l2_device *pv4l2_device;
|
||||||
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
|
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
|
||||||
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
|
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
|
||||||
|
@ -3303,10 +3303,10 @@ if (0 == bInterfaceNumber) {
|
||||||
}
|
}
|
||||||
SAM("allocated 0x%08lX=peasycap\n", (unsigned long int) peasycap);
|
SAM("allocated 0x%08lX=peasycap\n", (unsigned long int) peasycap);
|
||||||
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
||||||
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
|
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
|
||||||
SAM("where 0x%08lX=&peasycap->video_device\n",
|
SAM("where 0x%08lX=&peasycap->video_device\n",
|
||||||
(unsigned long int) &peasycap->video_device);
|
(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",
|
SAM("and 0x%08lX=&peasycap->v4l2_device\n",
|
||||||
(unsigned long int) &peasycap->v4l2_device);
|
(unsigned long int) &peasycap->v4l2_device);
|
||||||
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
|
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
|
||||||
|
@ -3559,11 +3559,11 @@ if (0 == bInterfaceNumber) {
|
||||||
bInterfaceNumber);
|
bInterfaceNumber);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
#if (!defined(EASYCAP_IS_VIDEODEV_CLIENT))
|
#ifndef EASYCAP_IS_VIDEODEV_CLIENT
|
||||||
#
|
#
|
||||||
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
||||||
#else
|
#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
|
* SOME VERSIONS OF THE videodev MODULE OVERWRITE THE DATA WHICH HAS
|
||||||
|
@ -4128,7 +4128,7 @@ case 0: {
|
||||||
* BEWARE.
|
* BEWARE.
|
||||||
*/
|
*/
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if defined(PREFER_NTSC)
|
#ifdef PREFER_NTSC
|
||||||
peasycap->ntsc = true;
|
peasycap->ntsc = true;
|
||||||
JOM(8, "defaulting initially to NTSC\n");
|
JOM(8, "defaulting initially to NTSC\n");
|
||||||
#else
|
#else
|
||||||
|
@ -4145,7 +4145,7 @@ case 0: {
|
||||||
* THE VIDEO DEVICE CAN BE REGISTERED NOW, AS IT IS READY.
|
* 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))) {
|
if (0 != (usb_register_dev(pusb_interface, &easycap_class))) {
|
||||||
err("Not able to get a minor for this device");
|
err("Not able to get a minor for this device");
|
||||||
usb_set_intfdata(pusb_interface, NULL);
|
usb_set_intfdata(pusb_interface, NULL);
|
||||||
|
@ -4158,7 +4158,7 @@ case 0: {
|
||||||
}
|
}
|
||||||
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
||||||
#else
|
#else
|
||||||
#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
|
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
|
||||||
if (0 != (v4l2_device_register(&(pusb_interface->dev),
|
if (0 != (v4l2_device_register(&(pusb_interface->dev),
|
||||||
&(peasycap->v4l2_device)))) {
|
&(peasycap->v4l2_device)))) {
|
||||||
SAM("v4l2_device_register() failed\n");
|
SAM("v4l2_device_register() failed\n");
|
||||||
|
@ -4181,7 +4181,7 @@ case 0: {
|
||||||
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
|
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
|
||||||
|
|
||||||
strcpy(&peasycap->video_device.name[0], "easycapdc60");
|
strcpy(&peasycap->video_device.name[0], "easycapdc60");
|
||||||
#if defined(EASYCAP_NEEDS_V4L2_FOPS)
|
#ifdef EASYCAP_NEEDS_V4L2_FOPS
|
||||||
peasycap->video_device.fops = &v4l2_fops;
|
peasycap->video_device.fops = &v4l2_fops;
|
||||||
#else
|
#else
|
||||||
peasycap->video_device.fops = &easycap_fops;
|
peasycap->video_device.fops = &easycap_fops;
|
||||||
|
@ -4214,7 +4214,7 @@ case 0: {
|
||||||
*/
|
*/
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
case 1: {
|
case 1: {
|
||||||
#if defined(EASYCAP_SILENT)
|
#ifdef EASYCAP_SILENT
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
#endif /*EASYCAP_SILENT*/
|
#endif /*EASYCAP_SILENT*/
|
||||||
if (!peasycap) {
|
if (!peasycap) {
|
||||||
|
@ -4233,7 +4233,7 @@ case 1: {
|
||||||
}
|
}
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
case 2: {
|
case 2: {
|
||||||
#if defined(EASYCAP_SILENT)
|
#ifdef EASYCAP_SILENT
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
#endif /*EASYCAP_SILENT*/
|
#endif /*EASYCAP_SILENT*/
|
||||||
if (!peasycap) {
|
if (!peasycap) {
|
||||||
|
@ -4566,8 +4566,8 @@ struct list_head *plist_head;
|
||||||
struct data_urb *pdata_urb;
|
struct data_urb *pdata_urb;
|
||||||
int minor, m, kd;
|
int minor, m, kd;
|
||||||
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
||||||
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
|
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
|
||||||
#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
|
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
|
||||||
struct v4l2_device *pv4l2_device;
|
struct v4l2_device *pv4l2_device;
|
||||||
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
|
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
|
||||||
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
|
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
|
||||||
|
@ -4602,11 +4602,8 @@ if (NULL == peasycap) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if (!defined(EASYCAP_IS_VIDEODEV_CLIENT))
|
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
|
||||||
#
|
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
|
||||||
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
|
||||||
#else
|
|
||||||
#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/*
|
/*
|
||||||
* SOME VERSIONS OF THE videodev MODULE OVERWRITE THE DATA WHICH HAS
|
* SOME VERSIONS OF THE videodev MODULE OVERWRITE THE DATA WHICH HAS
|
||||||
|
@ -4715,7 +4712,7 @@ case 0: {
|
||||||
} else
|
} else
|
||||||
SAY("ERROR: %i=kd is bad: cannot lock dongle\n", kd);
|
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) {
|
if (NULL == peasycap) {
|
||||||
SAM("ERROR: peasycap has become NULL\n");
|
SAM("ERROR: peasycap has become NULL\n");
|
||||||
} else {
|
} else {
|
||||||
|
@ -4726,7 +4723,7 @@ case 0: {
|
||||||
}
|
}
|
||||||
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
||||||
#else
|
#else
|
||||||
#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
|
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
|
||||||
if (!peasycap->v4l2_device.name[0]) {
|
if (!peasycap->v4l2_device.name[0]) {
|
||||||
SAM("ERROR: peasycap->v4l2_device.name is empty\n");
|
SAM("ERROR: peasycap->v4l2_device.name is empty\n");
|
||||||
if (0 <= kd && DONGLE_MANY > kd)
|
if (0 <= kd && DONGLE_MANY > kd)
|
||||||
|
|
|
@ -75,7 +75,7 @@ int isfragment;
|
||||||
__u8 *p1, *p2;
|
__u8 *p1, *p2;
|
||||||
__s16 s16;
|
__s16 s16;
|
||||||
int i, j, more, much, rc;
|
int i, j, more, much, rc;
|
||||||
#if defined(UPSAMPLE)
|
#ifdef UPSAMPLE
|
||||||
int k;
|
int k;
|
||||||
__s16 oldaudio, newaudio, delta;
|
__s16 oldaudio, newaudio, delta;
|
||||||
#endif /*UPSAMPLE*/
|
#endif /*UPSAMPLE*/
|
||||||
|
@ -131,7 +131,7 @@ if (purb->status) {
|
||||||
*/
|
*/
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#if defined(UPSAMPLE)
|
#ifdef UPSAMPLE
|
||||||
oldaudio = peasycap->oldaudio;
|
oldaudio = peasycap->oldaudio;
|
||||||
#endif /*UPSAMPLE*/
|
#endif /*UPSAMPLE*/
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ for (i = 0; i < purb->number_of_packets; i++) {
|
||||||
p1 += much;
|
p1 += much;
|
||||||
more -= much;
|
more -= much;
|
||||||
} else {
|
} else {
|
||||||
#if defined(UPSAMPLE)
|
#ifdef UPSAMPLE
|
||||||
if (much % 16)
|
if (much % 16)
|
||||||
JOM(8, "MISTAKE? much"
|
JOM(8, "MISTAKE? much"
|
||||||
" is not divisible by 16\n");
|
" is not divisible by 16\n");
|
||||||
|
@ -271,7 +271,7 @@ for (i = 0; i < purb->number_of_packets; i++) {
|
||||||
purb->iso_frame_desc[i].status);
|
purb->iso_frame_desc[i].status);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(UPSAMPLE)
|
#ifdef UPSAMPLE
|
||||||
peasycap->oldaudio = oldaudio;
|
peasycap->oldaudio = oldaudio;
|
||||||
#endif /*UPSAMPLE*/
|
#endif /*UPSAMPLE*/
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ struct data_buffer *paudio_buffer;
|
||||||
__u8 *p1, *p2;
|
__u8 *p1, *p2;
|
||||||
__s16 s16;
|
__s16 s16;
|
||||||
int i, j, more, much, leap, rc;
|
int i, j, more, much, leap, rc;
|
||||||
#if defined(UPSAMPLE)
|
#ifdef UPSAMPLE
|
||||||
int k;
|
int k;
|
||||||
__s16 oldaudio, newaudio, delta;
|
__s16 oldaudio, newaudio, delta;
|
||||||
#endif /*UPSAMPLE*/
|
#endif /*UPSAMPLE*/
|
||||||
|
@ -108,7 +108,7 @@ if (purb->status) {
|
||||||
* PROCEED HERE WHEN NO ERROR
|
* PROCEED HERE WHEN NO ERROR
|
||||||
*/
|
*/
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if defined(UPSAMPLE)
|
#ifdef UPSAMPLE
|
||||||
oldaudio = peasycap->oldaudio;
|
oldaudio = peasycap->oldaudio;
|
||||||
#endif /*UPSAMPLE*/
|
#endif /*UPSAMPLE*/
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ for (i = 0; i < purb->number_of_packets; i++) {
|
||||||
|
|
||||||
more = purb->iso_frame_desc[i].actual_length;
|
more = purb->iso_frame_desc[i].actual_length;
|
||||||
|
|
||||||
#if defined(TESTTONE)
|
#ifdef TESTTONE
|
||||||
if (!more)
|
if (!more)
|
||||||
more = purb->iso_frame_desc[i].length;
|
more = purb->iso_frame_desc[i].length;
|
||||||
#endif
|
#endif
|
||||||
|
@ -167,7 +167,7 @@ for (i = 0; i < purb->number_of_packets; i++) {
|
||||||
if (PAGE_SIZE == (paudio_buffer->pto -
|
if (PAGE_SIZE == (paudio_buffer->pto -
|
||||||
paudio_buffer->pgo)) {
|
paudio_buffer->pgo)) {
|
||||||
|
|
||||||
#if defined(TESTTONE)
|
#ifdef TESTTONE
|
||||||
easyoss_testtone(peasycap,
|
easyoss_testtone(peasycap,
|
||||||
peasycap->audio_fill);
|
peasycap->audio_fill);
|
||||||
#endif /*TESTTONE*/
|
#endif /*TESTTONE*/
|
||||||
|
@ -218,7 +218,7 @@ for (i = 0; i < purb->number_of_packets; i++) {
|
||||||
p1 += much;
|
p1 += much;
|
||||||
more -= much;
|
more -= much;
|
||||||
} else {
|
} else {
|
||||||
#if defined(UPSAMPLE)
|
#ifdef UPSAMPLE
|
||||||
if (much % 16)
|
if (much % 16)
|
||||||
JOM(8, "MISTAKE? much"
|
JOM(8, "MISTAKE? much"
|
||||||
" is not divisible by 16\n");
|
" is not divisible by 16\n");
|
||||||
|
@ -279,7 +279,7 @@ for (i = 0; i < purb->number_of_packets; i++) {
|
||||||
purb->iso_frame_desc[i].status);
|
purb->iso_frame_desc[i].status);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(UPSAMPLE)
|
#ifdef UPSAMPLE
|
||||||
peasycap->oldaudio = oldaudio;
|
peasycap->oldaudio = oldaudio;
|
||||||
#endif /*UPSAMPLE*/
|
#endif /*UPSAMPLE*/
|
||||||
|
|
||||||
|
@ -317,8 +317,8 @@ struct usb_interface *pusb_interface;
|
||||||
struct easycap *peasycap;
|
struct easycap *peasycap;
|
||||||
int subminor;
|
int subminor;
|
||||||
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
||||||
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
|
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
|
||||||
#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
|
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
|
||||||
struct v4l2_device *pv4l2_device;
|
struct v4l2_device *pv4l2_device;
|
||||||
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
|
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
|
||||||
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
|
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
|
||||||
|
@ -341,11 +341,11 @@ if (NULL == peasycap) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if (!defined(EASYCAP_IS_VIDEODEV_CLIENT))
|
#ifndef EASYCAP_IS_VIDEODEV_CLIENT
|
||||||
#
|
#
|
||||||
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
|
||||||
#else
|
#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
|
* SOME VERSIONS OF THE videodev MODULE OVERWRITE THE DATA WHICH HAS
|
||||||
|
@ -787,7 +787,7 @@ case SNDCTL_DSP_GETCAPS: {
|
||||||
int caps;
|
int caps;
|
||||||
JOM(8, "SNDCTL_DSP_GETCAPS\n");
|
JOM(8, "SNDCTL_DSP_GETCAPS\n");
|
||||||
|
|
||||||
#if defined(UPSAMPLE)
|
#ifdef UPSAMPLE
|
||||||
if (true == peasycap->microphone)
|
if (true == peasycap->microphone)
|
||||||
caps = 0x04400000;
|
caps = 0x04400000;
|
||||||
else
|
else
|
||||||
|
@ -809,7 +809,7 @@ case SNDCTL_DSP_GETFMTS: {
|
||||||
int incoming;
|
int incoming;
|
||||||
JOM(8, "SNDCTL_DSP_GETFMTS\n");
|
JOM(8, "SNDCTL_DSP_GETFMTS\n");
|
||||||
|
|
||||||
#if defined(UPSAMPLE)
|
#ifdef UPSAMPLE
|
||||||
if (true == peasycap->microphone)
|
if (true == peasycap->microphone)
|
||||||
incoming = AFMT_S16_LE;
|
incoming = AFMT_S16_LE;
|
||||||
else
|
else
|
||||||
|
@ -836,7 +836,7 @@ case SNDCTL_DSP_SETFMT: {
|
||||||
}
|
}
|
||||||
JOM(8, "........... %i=incoming\n", incoming);
|
JOM(8, "........... %i=incoming\n", incoming);
|
||||||
|
|
||||||
#if defined(UPSAMPLE)
|
#ifdef UPSAMPLE
|
||||||
if (true == peasycap->microphone)
|
if (true == peasycap->microphone)
|
||||||
outgoing = AFMT_S16_LE;
|
outgoing = AFMT_S16_LE;
|
||||||
else
|
else
|
||||||
|
@ -871,7 +871,7 @@ case SNDCTL_DSP_STEREO: {
|
||||||
}
|
}
|
||||||
JOM(8, "........... %i=incoming\n", incoming);
|
JOM(8, "........... %i=incoming\n", incoming);
|
||||||
|
|
||||||
#if defined(UPSAMPLE)
|
#ifdef UPSAMPLE
|
||||||
if (true == peasycap->microphone)
|
if (true == peasycap->microphone)
|
||||||
incoming = 1;
|
incoming = 1;
|
||||||
else
|
else
|
||||||
|
@ -898,7 +898,7 @@ case SNDCTL_DSP_SPEED: {
|
||||||
}
|
}
|
||||||
JOM(8, "........... %i=incoming\n", incoming);
|
JOM(8, "........... %i=incoming\n", incoming);
|
||||||
|
|
||||||
#if defined(UPSAMPLE)
|
#ifdef UPSAMPLE
|
||||||
if (true == peasycap->microphone)
|
if (true == peasycap->microphone)
|
||||||
incoming = 32000;
|
incoming = 32000;
|
||||||
else
|
else
|
||||||
|
|
|
@ -151,7 +151,7 @@ for (line = 0; line < (barheight / 2); line++) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
#if defined(EASYCAP_TESTTONE)
|
#ifdef EASYCAP_TESTTONE
|
||||||
/*-----------------------------------------------------------------------------
|
/*-----------------------------------------------------------------------------
|
||||||
THE tones[] ARRAY BELOW IS THE OUTPUT OF THIS PROGRAM,
|
THE tones[] ARRAY BELOW IS THE OUTPUT OF THIS PROGRAM,
|
||||||
COMPILED gcc -o prog -lm prog.c
|
COMPILED gcc -o prog -lm prog.c
|
||||||
|
|
Loading…
Reference in a new issue