public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* Genius Look 317
@ 2009-02-21 10:55 Sergei Antonov
  2009-02-22 20:49 ` CityK
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Antonov @ 2009-02-21 10:55 UTC (permalink / raw)
  To: video4linux-list

Hi!
I'm trying to make 'Genius Look 317' (0c45:60b0, gspca recognizes it) webcam work.

v4lgrab.c (from linux-2.6.28.5\Documentation\video4linux) loops infinitely in this code:

  do {
    int newbright;
    read(fd, buffer, win.width * win.height * bpp);
    f = get_brightness_adj(buffer, win.width * win.height, &newbright);
    if (f) {
      vpic.brightness += (newbright << 8);
      if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) {
        perror("VIDIOSPICT");
        break;
      }
    }
  } while (f);

because variable 'f' is always non-zero.
If I write 'while(0);' the resulting .ppm contains some random pixels in the top and the rest of the picture is black.
Need help.

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Genius Look 317
  2009-02-21 10:55 Genius Look 317 Sergei Antonov
@ 2009-02-22 20:49 ` CityK
  2009-02-23  8:52   ` Sergei Antonov
  0 siblings, 1 reply; 3+ messages in thread
From: CityK @ 2009-02-22 20:49 UTC (permalink / raw)
  To: Sergei Antonov; +Cc: video4linux-list

Sergei Antonov wrote:
> Hi!
> I'm trying to make 'Genius Look 317' (0c45:60b0, gspca recognizes it)
> webcam work.
>
> v4lgrab.c (from linux-2.6.28.5\Documentation\video4linux) loops
> infinitely in this code:
>
>  do {
>    int newbright;
>    read(fd, buffer, win.width * win.height * bpp);
>    f = get_brightness_adj(buffer, win.width * win.height, &newbright);
>    if (f) {
>      vpic.brightness += (newbright << 8);
>      if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) {
>        perror("VIDIOSPICT");
>        break;
>      }
>    }
>  } while (f);
>
> because variable 'f' is always non-zero.
> If I write 'while(0);' the resulting .ppm contains some random pixels
> in the top and the rest of the picture is black.
> Need help.

Hi, I'd re-title your message to include the fact that its a gspca based
webcam (to attract those developers attention) and send it off to the
linux-media mailing list (which is where discussion is transitioning to:
http://www.linuxtv.org/news.php?entry=2009-01-06.mchehab)

Cheers

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Genius Look 317
  2009-02-22 20:49 ` CityK
@ 2009-02-23  8:52   ` Sergei Antonov
  0 siblings, 0 replies; 3+ messages in thread
From: Sergei Antonov @ 2009-02-23  8:52 UTC (permalink / raw)
  To: CityK; +Cc: video4linux-list

> Sergei Antonov wrote:
>> Hi!
>> I'm trying to make 'Genius Look 317' (0c45:60b0, gspca recognizes it)
>> webcam work.
>>
>> v4lgrab.c (from linux-2.6.28.5\Documentation\video4linux) loops
>> infinitely in this code:
>>
>>  do {
>>    int newbright;
>>    read(fd, buffer, win.width * win.height * bpp);
>>    f = get_brightness_adj(buffer, win.width * win.height, &newbright);
>>    if (f) {
>>      vpic.brightness += (newbright << 8);
>>      if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) {
>>        perror("VIDIOSPICT");
>>        break;
>>      }
>>    }
>>  } while (f);
>>
>> because variable 'f' is always non-zero.
>> If I write 'while(0);' the resulting .ppm contains some random pixels
>> in the top and the rest of the picture is black.
>> Need help.
> 
> Hi, I'd re-title your message to include the fact that its a gspca based
> webcam (to attract those developers attention) and send it off to the
> linux-media mailing list (which is where discussion is transitioning to:
> http://www.linuxtv.org/news.php?entry=2009-01-06.mchehab)

Thank you for the advice. But I've already found a solution. V4L2 API works for this webcam.

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-02-23  8:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-21 10:55 Genius Look 317 Sergei Antonov
2009-02-22 20:49 ` CityK
2009-02-23  8:52   ` Sergei Antonov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox