提交 27d683ab 编写于 作者: T Tomas Winkler 提交者: Greg Kroah-Hartman

staging/easycap: replace if(true == var) with if (var)

's/(true == \([^ ]\+\))/(\1)/g'

Cc: Mike Thomas <rmthomas@sciolus.org>
Signed-off-by: NTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 a90f3620
...@@ -330,7 +330,7 @@ int adjust_standard(struct easycap *peasycap, v4l2_std_id std_id) ...@@ -330,7 +330,7 @@ int adjust_standard(struct easycap *peasycap, v4l2_std_id std_id)
JOM(8, "SAA register 0x%02X changed " JOM(8, "SAA register 0x%02X changed "
"from 0x%02X to 0x%02X\n", reg, itwas, isnow); "from 0x%02X to 0x%02X\n", reg, itwas, isnow);
} }
if (true == resubmit) if (resubmit)
submit_video_urbs(peasycap); submit_video_urbs(peasycap);
return 0; return 0;
} }
...@@ -548,7 +548,7 @@ int adjust_format(struct easycap *peasycap, ...@@ -548,7 +548,7 @@ int adjust_format(struct easycap *peasycap,
peasycap->offerfields = true; peasycap->offerfields = true;
else else
peasycap->offerfields = false; peasycap->offerfields = false;
if (true == peasycap->decimatepixel) if (peasycap->decimatepixel)
multiplier = 2; multiplier = 2;
else else
multiplier = 1; multiplier = 1;
...@@ -1439,7 +1439,7 @@ long easycap_unlocked_ioctl(struct file *file, ...@@ -1439,7 +1439,7 @@ long easycap_unlocked_ioctl(struct file *file,
int mute; int mute;
JOM(8, "user requests mute %i\n", v4l2_control.value); JOM(8, "user requests mute %i\n", v4l2_control.value);
if (true == v4l2_control.value) if (v4l2_control.value)
mute = 1; mute = 1;
else else
mute = 0; mute = 0;
...@@ -1560,7 +1560,7 @@ long easycap_unlocked_ioctl(struct file *file, ...@@ -1560,7 +1560,7 @@ long easycap_unlocked_ioctl(struct file *file,
v4l2_frmsizeenum.type = (u32) V4L2_FRMSIZE_TYPE_DISCRETE; v4l2_frmsizeenum.type = (u32) V4L2_FRMSIZE_TYPE_DISCRETE;
if (true == peasycap->ntsc) { if (peasycap->ntsc) {
switch (index) { switch (index) {
case 0: { case 0: {
v4l2_frmsizeenum.discrete.width = 640; v4l2_frmsizeenum.discrete.width = 640;
...@@ -1690,7 +1690,7 @@ long easycap_unlocked_ioctl(struct file *file, ...@@ -1690,7 +1690,7 @@ long easycap_unlocked_ioctl(struct file *file,
if (peasycap->fps) if (peasycap->fps)
denominator = peasycap->fps; denominator = peasycap->fps;
else { else {
if (true == peasycap->ntsc) if (peasycap->ntsc)
denominator = 30; denominator = 30;
else else
denominator = 25; denominator = 25;
...@@ -2265,7 +2265,7 @@ long easycap_unlocked_ioctl(struct file *file, ...@@ -2265,7 +2265,7 @@ long easycap_unlocked_ioctl(struct file *file,
v4l2_buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; v4l2_buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
v4l2_buffer.bytesused = peasycap->frame_buffer_used; v4l2_buffer.bytesused = peasycap->frame_buffer_used;
v4l2_buffer.flags = V4L2_BUF_FLAG_MAPPED | V4L2_BUF_FLAG_DONE; v4l2_buffer.flags = V4L2_BUF_FLAG_MAPPED | V4L2_BUF_FLAG_DONE;
if (true == peasycap->offerfields) if (peasycap->offerfields)
v4l2_buffer.field = V4L2_FIELD_BOTTOM; v4l2_buffer.field = V4L2_FIELD_BOTTOM;
else else
v4l2_buffer.field = V4L2_FIELD_NONE; v4l2_buffer.field = V4L2_FIELD_NONE;
...@@ -2399,7 +2399,7 @@ long easycap_unlocked_ioctl(struct file *file, ...@@ -2399,7 +2399,7 @@ long easycap_unlocked_ioctl(struct file *file,
pv4l2_streamparm->parm.capture.timeperframe. pv4l2_streamparm->parm.capture.timeperframe.
denominator = peasycap->fps; denominator = peasycap->fps;
} else { } else {
if (true == peasycap->ntsc) { if (peasycap->ntsc) {
pv4l2_streamparm->parm.capture.timeperframe. pv4l2_streamparm->parm.capture.timeperframe.
denominator = 30; denominator = 30;
} else { } else {
......
...@@ -388,7 +388,7 @@ int setup_stk(struct usb_device *p, bool ntsc) ...@@ -388,7 +388,7 @@ int setup_stk(struct usb_device *p, bool ntsc)
if (NULL == p) if (NULL == p)
return -ENODEV; return -ENODEV;
i0 = 0; i0 = 0;
if (true == ntsc) { if (ntsc) {
while (0xFFF != stk1160configNTSC[i0].reg) { while (0xFFF != stk1160configNTSC[i0].reg) {
SET(p, stk1160configNTSC[i0].reg, SET(p, stk1160configNTSC[i0].reg,
stk1160configNTSC[i0].set); stk1160configNTSC[i0].set);
...@@ -414,7 +414,7 @@ int setup_saa(struct usb_device *p, bool ntsc) ...@@ -414,7 +414,7 @@ int setup_saa(struct usb_device *p, bool ntsc)
if (NULL == p) if (NULL == p)
return -ENODEV; return -ENODEV;
i0 = 0; i0 = 0;
if (true == ntsc) { if (ntsc) {
while (0xFF != saa7113configNTSC[i0].reg) { while (0xFF != saa7113configNTSC[i0].reg) {
ir = write_saa(p, saa7113configNTSC[i0].reg, ir = write_saa(p, saa7113configNTSC[i0].reg,
saa7113configNTSC[i0].set); saa7113configNTSC[i0].set);
...@@ -552,7 +552,7 @@ int check_saa(struct usb_device *p, bool ntsc) ...@@ -552,7 +552,7 @@ int check_saa(struct usb_device *p, bool ntsc)
return -ENODEV; return -ENODEV;
i0 = 0; i0 = 0;
rc = 0; rc = 0;
if (true == ntsc) { if (ntsc) {
while (0xFF != saa7113configNTSC[i0].reg) { while (0xFF != saa7113configNTSC[i0].reg) {
if (0x0F == saa7113configNTSC[i0].reg) { if (0x0F == saa7113configNTSC[i0].reg) {
i0++; i0++;
...@@ -663,7 +663,7 @@ int check_stk(struct usb_device *p, bool ntsc) ...@@ -663,7 +663,7 @@ int check_stk(struct usb_device *p, bool ntsc)
if (NULL == p) if (NULL == p)
return -ENODEV; return -ENODEV;
i0 = 0; i0 = 0;
if (true == ntsc) { if (ntsc) {
while (0xFFF != stk1160configNTSC[i0].reg) { while (0xFFF != stk1160configNTSC[i0].reg) {
if (0x000 == stk1160configNTSC[i0].reg) { if (0x000 == stk1160configNTSC[i0].reg) {
i0++; continue; i0++; continue;
......
...@@ -247,7 +247,7 @@ static int reset(struct easycap *peasycap) ...@@ -247,7 +247,7 @@ static int reset(struct easycap *peasycap)
rate = ready_saa(peasycap->pusb_device); rate = ready_saa(peasycap->pusb_device);
if (0 > rate) { if (0 > rate) {
JOM(8, "not ready to capture after %i ms ...\n", PATIENCE); JOM(8, "not ready to capture after %i ms ...\n", PATIENCE);
if (true == peasycap->ntsc) { if (peasycap->ntsc) {
JOM(8, "... trying PAL ...\n"); ntsc = false; JOM(8, "... trying PAL ...\n"); ntsc = false;
} else { } else {
JOM(8, "... trying NTSC ...\n"); ntsc = true; JOM(8, "... trying NTSC ...\n"); ntsc = true;
...@@ -566,7 +566,7 @@ newinput(struct easycap *peasycap, int input) ...@@ -566,7 +566,7 @@ newinput(struct easycap *peasycap, int input)
SAM("ERROR: start_100() rc = %i\n", rc); SAM("ERROR: start_100() rc = %i\n", rc);
return -EFAULT; return -EFAULT;
} }
if (true == resubmit) if (resubmit)
submit_video_urbs(peasycap); submit_video_urbs(peasycap);
peasycap->video_isoc_sequence = VIDEO_ISOC_BUFFER_MANY - 1; peasycap->video_isoc_sequence = VIDEO_ISOC_BUFFER_MANY - 1;
...@@ -1335,7 +1335,7 @@ field2frame(struct easycap *peasycap) ...@@ -1335,7 +1335,7 @@ field2frame(struct easycap *peasycap)
peasycap->field_buffer[peasycap->field_read][0].input, peasycap->field_buffer[peasycap->field_read][0].input,
peasycap->field_read, peasycap->frame_fill); peasycap->field_read, peasycap->frame_fill);
JOM(8, "===== %i=bytesperpixel\n", peasycap->bytesperpixel); JOM(8, "===== %i=bytesperpixel\n", peasycap->bytesperpixel);
if (true == peasycap->offerfields) if (peasycap->offerfields)
JOM(8, "===== offerfields\n"); JOM(8, "===== offerfields\n");
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
...@@ -1368,7 +1368,7 @@ field2frame(struct easycap *peasycap) ...@@ -1368,7 +1368,7 @@ field2frame(struct easycap *peasycap)
SAM("MISTAKE: %i=bytesperpixel\n", bytesperpixel); SAM("MISTAKE: %i=bytesperpixel\n", bytesperpixel);
return -EFAULT; return -EFAULT;
} }
if (true == decimatepixel) if (decimatepixel)
multiplier = 2; multiplier = 2;
else else
multiplier = 1; multiplier = 1;
...@@ -1385,7 +1385,7 @@ field2frame(struct easycap *peasycap) ...@@ -1385,7 +1385,7 @@ field2frame(struct easycap *peasycap)
pad = peasycap->frame_buffer[kad][0].pgo; rad = PAGE_SIZE; pad = peasycap->frame_buffer[kad][0].pgo; rad = PAGE_SIZE;
odd = !!(peasycap->field_buffer[kex][0].kount); odd = !!(peasycap->field_buffer[kex][0].kount);
if ((true == odd) && (false == decimatepixel)) { if (odd && (false == decimatepixel)) {
JOM(8, "initial skipping %4i bytes p.%4i\n", JOM(8, "initial skipping %4i bytes p.%4i\n",
w3/multiplier, mad); w3/multiplier, mad);
pad += (w3 / multiplier); rad -= (w3 / multiplier); pad += (w3 / multiplier); rad -= (w3 / multiplier);
...@@ -1445,7 +1445,7 @@ field2frame(struct easycap *peasycap) ...@@ -1445,7 +1445,7 @@ field2frame(struct easycap *peasycap)
} }
if (rump) if (rump)
caches++; caches++;
if (true == badinput) { if (badinput) {
JOM(8, "ERROR: 0x%02X=->field_buffer" JOM(8, "ERROR: 0x%02X=->field_buffer"
"[%i][%i].input, " "[%i][%i].input, "
"0x%02X=(0x08|->input)\n", "0x%02X=(0x08|->input)\n",
...@@ -1561,7 +1561,7 @@ field2frame(struct easycap *peasycap) ...@@ -1561,7 +1561,7 @@ field2frame(struct easycap *peasycap)
if (rump) if (rump)
caches++; caches++;
if (true == badinput) { if (badinput) {
JOM(8, "ERROR: 0x%02X=->field_buffer" JOM(8, "ERROR: 0x%02X=->field_buffer"
"[%i][%i].input, " "[%i][%i].input, "
"0x%02X=(0x08|->input)\n", "0x%02X=(0x08|->input)\n",
...@@ -1663,7 +1663,7 @@ field2frame(struct easycap *peasycap) ...@@ -1663,7 +1663,7 @@ field2frame(struct easycap *peasycap)
JOM(8, "===== field2frame(): %i bytes --> %i bytes (incl skip)\n", c2, c3); JOM(8, "===== field2frame(): %i bytes --> %i bytes (incl skip)\n", c2, c3);
JOM(8, "===== field2frame(): %i=mad %i=rad\n", mad, rad); JOM(8, "===== field2frame(): %i=mad %i=rad\n", mad, rad);
if (true == odd) if (odd)
JOM(8, "+++++ field2frame(): frame buffer %i is full\n", kad); JOM(8, "+++++ field2frame(): frame buffer %i is full\n", kad);
if (peasycap->field_read == peasycap->field_fill) if (peasycap->field_read == peasycap->field_fill)
...@@ -1819,7 +1819,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -1819,7 +1819,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
p2 = (u8 *)pex; pz = p2 + much; pr = p3 + more; last = false; p2 = (u8 *)pex; pz = p2 + much; pr = p3 + more; last = false;
p2++; p2++;
if (true == isuy) if (isuy)
u = *(p2 - 1); u = *(p2 - 1);
else else
v = *(p2 - 1); v = *(p2 - 1);
...@@ -1884,9 +1884,9 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -1884,9 +1884,9 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
else else
last = false; last = false;
y = *p2; y = *p2;
if ((true == last) && (0x0C & mask)) { if (last && (0x0C & mask)) {
if (0x04 & mask) { if (0x04 & mask) {
if (true == isuy) if (isuy)
v = margin; v = margin;
else else
u = margin; u = margin;
...@@ -1894,7 +1894,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -1894,7 +1894,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
if (0x08 & mask) if (0x08 & mask)
; ;
} else { } else {
if (true == isuy) if (isuy)
v = *(p2 + 1); v = *(p2 + 1);
else else
u = *(p2 + 1); u = *(p2 + 1);
...@@ -1910,7 +1910,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -1910,7 +1910,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
b = (255 < tmp) ? 255 : ((0 > tmp) ? b = (255 < tmp) ? 255 : ((0 > tmp) ?
0 : (u8)tmp); 0 : (u8)tmp);
if ((true == last) && rump) { if (last && rump) {
pcache = &peasycap->cache[0]; pcache = &peasycap->cache[0];
switch (bytesperpixel - rump) { switch (bytesperpixel - rump) {
case 1: { case 1: {
...@@ -1937,7 +1937,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -1937,7 +1937,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
*(p3 + 2) = b; *(p3 + 2) = b;
} }
p2 += 2; p2 += 2;
if (true == isuy) if (isuy)
isuy = false; isuy = false;
else else
isuy = true; isuy = true;
...@@ -1952,9 +1952,9 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -1952,9 +1952,9 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
else else
last = false; last = false;
y = *p2; y = *p2;
if ((true == last) && (0x0C & mask)) { if (last && (0x0C & mask)) {
if (0x04 & mask) { if (0x04 & mask) {
if (true == isuy) if (isuy)
v = margin; v = margin;
else else
u = margin; u = margin;
...@@ -1963,7 +1963,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -1963,7 +1963,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
if (0x08 & mask) if (0x08 & mask)
; ;
} else { } else {
if (true == isuy) if (isuy)
v = *(p2 + 1); v = *(p2 + 1);
else else
u = *(p2 + 1); u = *(p2 + 1);
...@@ -1979,7 +1979,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -1979,7 +1979,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
b = (255 < tmp) ? 255 : ((0 > tmp) ? b = (255 < tmp) ? 255 : ((0 > tmp) ?
0 : (u8)tmp); 0 : (u8)tmp);
if ((true == last) && rump) { if (last && rump) {
pcache = &peasycap->cache[0]; pcache = &peasycap->cache[0];
switch (bytesperpixel - rump) { switch (bytesperpixel - rump) {
case 1: { case 1: {
...@@ -2006,7 +2006,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -2006,7 +2006,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
*(p3 + 2) = r; *(p3 + 2) = r;
} }
p2 += 2; p2 += 2;
if (true == isuy) if (isuy)
isuy = false; isuy = false;
else else
isuy = true; isuy = true;
...@@ -2023,9 +2023,9 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -2023,9 +2023,9 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
else else
last = false; last = false;
y = *p2; y = *p2;
if ((true == last) && (0x0C & mask)) { if (last && (0x0C & mask)) {
if (0x04 & mask) { if (0x04 & mask) {
if (true == isuy) if (isuy)
v = margin; v = margin;
else else
u = margin; u = margin;
...@@ -2033,13 +2033,13 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -2033,13 +2033,13 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
if (0x08 & mask) if (0x08 & mask)
; ;
} else { } else {
if (true == isuy) if (isuy)
v = *(p2 + 1); v = *(p2 + 1);
else else
u = *(p2 + 1); u = *(p2 + 1);
} }
if (true == isuy) { if (isuy) {
tmp = ay[(int)y] + rv[(int)v]; tmp = ay[(int)y] + rv[(int)v];
r = (255 < tmp) ? 255 : ((0 > tmp) ? r = (255 < tmp) ? 255 : ((0 > tmp) ?
0 : (u8)tmp); 0 : (u8)tmp);
...@@ -2051,7 +2051,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -2051,7 +2051,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
b = (255 < tmp) ? 255 : ((0 > tmp) ? b = (255 < tmp) ? 255 : ((0 > tmp) ?
0 : (u8)tmp); 0 : (u8)tmp);
if ((true == last) && rump) { if (last && rump) {
pcache = &peasycap->cache[0]; pcache = &peasycap->cache[0];
switch (bytesperpixel - rump) { switch (bytesperpixel - rump) {
case 1: { case 1: {
...@@ -2094,9 +2094,9 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -2094,9 +2094,9 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
else else
last = false; last = false;
y = *p2; y = *p2;
if ((true == last) && (0x0C & mask)) { if (last && (0x0C & mask)) {
if (0x04 & mask) { if (0x04 & mask) {
if (true == isuy) if (isuy)
v = margin; v = margin;
else else
u = margin; u = margin;
...@@ -2104,13 +2104,13 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -2104,13 +2104,13 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
if (0x08 & mask) if (0x08 & mask)
; ;
} else { } else {
if (true == isuy) if (isuy)
v = *(p2 + 1); v = *(p2 + 1);
else else
u = *(p2 + 1); u = *(p2 + 1);
} }
if (true == isuy) { if (isuy) {
tmp = ay[(int)y] + rv[(int)v]; tmp = ay[(int)y] + rv[(int)v];
r = (255 < tmp) ? 255 : ((0 > tmp) ? r = (255 < tmp) ? 255 : ((0 > tmp) ?
...@@ -2123,7 +2123,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -2123,7 +2123,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
b = (255 < tmp) ? 255 : ((0 > tmp) ? b = (255 < tmp) ? 255 : ((0 > tmp) ?
0 : (u8)tmp); 0 : (u8)tmp);
if ((true == last) && rump) { if (last && rump) {
pcache = &peasycap->cache[0]; pcache = &peasycap->cache[0];
switch (bytesperpixel - rump) { switch (bytesperpixel - rump) {
case 1: { case 1: {
...@@ -2173,9 +2173,9 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -2173,9 +2173,9 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
else else
last = false; last = false;
y = *p2; y = *p2;
if ((true == last) && (0x0C & mask)) { if (last && (0x0C & mask)) {
if (0x04 & mask) { if (0x04 & mask) {
if (true == isuy) if (isuy)
v = margin; v = margin;
else else
u = margin; u = margin;
...@@ -2183,7 +2183,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -2183,7 +2183,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
if (0x08 & mask) if (0x08 & mask)
; ;
} else { } else {
if (true == isuy) if (isuy)
v = *(p2 + 1); v = *(p2 + 1);
else else
u = *(p2 + 1); u = *(p2 + 1);
...@@ -2199,7 +2199,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -2199,7 +2199,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
b = (255 < tmp) ? 255 : ((0 > tmp) ? b = (255 < tmp) ? 255 : ((0 > tmp) ?
0 : (u8)tmp); 0 : (u8)tmp);
if ((true == last) && rump) { if (last && rump) {
pcache = &peasycap->cache[0]; pcache = &peasycap->cache[0];
switch (bytesperpixel - rump) { switch (bytesperpixel - rump) {
case 1: { case 1: {
...@@ -2236,7 +2236,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -2236,7 +2236,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
*(p3 + 3) = 0; *(p3 + 3) = 0;
} }
p2 += 2; p2 += 2;
if (true == isuy) if (isuy)
isuy = false; isuy = false;
else else
isuy = true; isuy = true;
...@@ -2253,9 +2253,9 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -2253,9 +2253,9 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
else else
last = false; last = false;
y = *p2; y = *p2;
if ((true == last) && (0x0C & mask)) { if (last && (0x0C & mask)) {
if (0x04 & mask) { if (0x04 & mask) {
if (true == isuy) if (isuy)
v = margin; v = margin;
else else
u = margin; u = margin;
...@@ -2263,7 +2263,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -2263,7 +2263,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
if (0x08 & mask) if (0x08 & mask)
; ;
} else { } else {
if (true == isuy) if (isuy)
v = *(p2 + 1); v = *(p2 + 1);
else else
u = *(p2 + 1); u = *(p2 + 1);
...@@ -2279,7 +2279,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -2279,7 +2279,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
b = (255 < tmp) ? 255 : ((0 > tmp) ? b = (255 < tmp) ? 255 : ((0 > tmp) ?
0 : (u8)tmp); 0 : (u8)tmp);
if ((true == last) && rump) { if (last && rump) {
pcache = &peasycap->cache[0]; pcache = &peasycap->cache[0];
switch (bytesperpixel - rump) { switch (bytesperpixel - rump) {
case 1: { case 1: {
...@@ -2315,7 +2315,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -2315,7 +2315,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
*(p3 + 3) = 0; *(p3 + 3) = 0;
} }
p2 += 2; p2 += 2;
if (true == isuy) if (isuy)
isuy = false; isuy = false;
else else
isuy = true; isuy = true;
...@@ -2334,9 +2334,9 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -2334,9 +2334,9 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
else else
last = false; last = false;
y = *p2; y = *p2;
if ((true == last) && (0x0C & mask)) { if (last && (0x0C & mask)) {
if (0x04 & mask) { if (0x04 & mask) {
if (true == isuy) if (isuy)
v = margin; v = margin;
else else
u = margin; u = margin;
...@@ -2344,13 +2344,13 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -2344,13 +2344,13 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
if (0x08 & mask) if (0x08 & mask)
; ;
} else { } else {
if (true == isuy) if (isuy)
v = *(p2 + 1); v = *(p2 + 1);
else else
u = *(p2 + 1); u = *(p2 + 1);
} }
if (true == isuy) { if (isuy) {
tmp = ay[(int)y] + rv[(int)v]; tmp = ay[(int)y] + rv[(int)v];
r = (255 < tmp) ? 255 : ((0 > tmp) ? r = (255 < tmp) ? 255 : ((0 > tmp) ?
...@@ -2363,7 +2363,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -2363,7 +2363,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
b = (255 < tmp) ? 255 : ((0 > tmp) ? b = (255 < tmp) ? 255 : ((0 > tmp) ?
0 : (u8)tmp); 0 : (u8)tmp);
if ((true == last) && rump) { if (last && rump) {
pcache = &peasycap->cache[0]; pcache = &peasycap->cache[0];
switch (bytesperpixel - rump) { switch (bytesperpixel - rump) {
case 1: { case 1: {
...@@ -2418,9 +2418,9 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -2418,9 +2418,9 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
else else
last = false; last = false;
y = *p2; y = *p2;
if ((true == last) && (0x0C & mask)) { if (last && (0x0C & mask)) {
if (0x04 & mask) { if (0x04 & mask) {
if (true == isuy) if (isuy)
v = margin; v = margin;
else else
u = margin; u = margin;
...@@ -2428,13 +2428,13 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -2428,13 +2428,13 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
if (0x08 & mask) if (0x08 & mask)
; ;
} else { } else {
if (true == isuy) if (isuy)
v = *(p2 + 1); v = *(p2 + 1);
else else
u = *(p2 + 1); u = *(p2 + 1);
} }
if (true == isuy) { if (isuy) {
tmp = ay[(int)y] + rv[(int)v]; tmp = ay[(int)y] + rv[(int)v];
r = (255 < tmp) ? 255 : ((0 > tmp) ? r = (255 < tmp) ? 255 : ((0 > tmp) ?
0 : (u8)tmp); 0 : (u8)tmp);
...@@ -2446,7 +2446,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more, ...@@ -2446,7 +2446,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
b = (255 < tmp) ? 255 : ((0 > tmp) ? b = (255 < tmp) ? 255 : ((0 > tmp) ?
0 : (u8)tmp); 0 : (u8)tmp);
if ((true == last) && rump) { if (last && rump) {
pcache = &peasycap->cache[0]; pcache = &peasycap->cache[0];
switch (bytesperpixel - rump) { switch (bytesperpixel - rump) {
case 1: { case 1: {
......
...@@ -598,7 +598,7 @@ int easycap_alsa_probe(struct easycap *peasycap) ...@@ -598,7 +598,7 @@ int easycap_alsa_probe(struct easycap *peasycap)
} }
peasycap->alsa_hardware = alsa_hardware; peasycap->alsa_hardware = alsa_hardware;
if (true == peasycap->microphone) { if (peasycap->microphone) {
peasycap->alsa_hardware.rates = SNDRV_PCM_RATE_32000; peasycap->alsa_hardware.rates = SNDRV_PCM_RATE_32000;
peasycap->alsa_hardware.rate_min = 32000; peasycap->alsa_hardware.rate_min = 32000;
peasycap->alsa_hardware.rate_max = 32000; peasycap->alsa_hardware.rate_max = 32000;
......
...@@ -734,12 +734,12 @@ static long easyoss_unlocked_ioctl(struct file *file, ...@@ -734,12 +734,12 @@ static long easyoss_unlocked_ioctl(struct file *file,
JOM(8, "SNDCTL_DSP_GETCAPS\n"); JOM(8, "SNDCTL_DSP_GETCAPS\n");
#ifdef UPSAMPLE #ifdef UPSAMPLE
if (true == peasycap->microphone) if (peasycap->microphone)
caps = 0x04400000; caps = 0x04400000;
else else
caps = 0x04400000; caps = 0x04400000;
#else #else
if (true == peasycap->microphone) if (peasycap->microphone)
caps = 0x02400000; caps = 0x02400000;
else else
caps = 0x04400000; caps = 0x04400000;
...@@ -783,12 +783,12 @@ static long easyoss_unlocked_ioctl(struct file *file, ...@@ -783,12 +783,12 @@ static long easyoss_unlocked_ioctl(struct file *file,
JOM(8, "........... %i=incoming\n", incoming); JOM(8, "........... %i=incoming\n", incoming);
#ifdef UPSAMPLE #ifdef UPSAMPLE
if (true == peasycap->microphone) if (peasycap->microphone)
outgoing = AFMT_S16_LE; outgoing = AFMT_S16_LE;
else else
outgoing = AFMT_S16_LE; outgoing = AFMT_S16_LE;
#else #else
if (true == peasycap->microphone) if (peasycap->microphone)
outgoing = AFMT_S16_LE; outgoing = AFMT_S16_LE;
else else
outgoing = AFMT_S16_LE; outgoing = AFMT_S16_LE;
...@@ -817,12 +817,12 @@ static long easyoss_unlocked_ioctl(struct file *file, ...@@ -817,12 +817,12 @@ static long easyoss_unlocked_ioctl(struct file *file,
JOM(8, "........... %i=incoming\n", incoming); JOM(8, "........... %i=incoming\n", incoming);
#ifdef UPSAMPLE #ifdef UPSAMPLE
if (true == peasycap->microphone) if (peasycap->microphone)
incoming = 1; incoming = 1;
else else
incoming = 1; incoming = 1;
#else #else
if (true == peasycap->microphone) if (peasycap->microphone)
incoming = 0; incoming = 0;
else else
incoming = 1; incoming = 1;
...@@ -844,12 +844,12 @@ static long easyoss_unlocked_ioctl(struct file *file, ...@@ -844,12 +844,12 @@ static long easyoss_unlocked_ioctl(struct file *file,
JOM(8, "........... %i=incoming\n", incoming); JOM(8, "........... %i=incoming\n", incoming);
#ifdef UPSAMPLE #ifdef UPSAMPLE
if (true == peasycap->microphone) if (peasycap->microphone)
incoming = 32000; incoming = 32000;
else else
incoming = 48000; incoming = 48000;
#else #else
if (true == peasycap->microphone) if (peasycap->microphone)
incoming = 8000; incoming = 8000;
else else
incoming = 48000; incoming = 48000;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册