basic question here.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



hi everybody,
                i'am new on the list and iam a newbie
i have a webcam from a co. called Labtec with no
device driver for linux (only windows). now that it is
connected to the usb port a query revealed that :

# cat /proc/bus/usb/devices 

output:

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1
Spd=12  MxCh= 2
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8
#Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 0.00
S:  Product=USB UHCI Root Hub
S:  SerialNumber=d000
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00
Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=255ms
T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  3
Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=ff(vend.) Sub=ff Prot=ff MxPS= 8
#Cfgs=  1
P:  Vendor=046d ProdID=0870 Rev= 1.00

S:  Product=Camera
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr= 90mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff
Driver=(none)
E:  Ad=81(I) Atr=01(Isoc) MxPS=   0 Ivl=  1ms
E:  Ad=82(I) Atr=03(Int.) MxPS=   1 Ivl= 16ms
I:  If#= 0 Alt= 1 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff
Driver=(none)
E:  Ad=81(I) Atr=01(Isoc) MxPS=1023 Ivl=  1ms
E:  Ad=82(I) Atr=03(Int.) MxPS=   1 Ivl= 16ms


 So it reveals that the camera has been detected!!
 when i unplugged it i couldn't find the Product
=Camera line and the rest of it and thus i beleive it
had been detected.

 Now could any one tell me how i can open device
 :/dev/video and use the v4l api successfully in
reading frames out of it

because the foll code fails to read :

I know that i need to query and use some ioctl calls
but would that be enough..

main()
{
  int fd,n;
  char buffer[2056];

  fd=open("/dev/video",O_RDONLY);


  if(fd < 0)
   {
        printf("\nCannot open device:\n");
          }

 while(1)
   {
         
     printf("\nRead %d bytes:\n",n);

   }
 printf("\nCouldnt read\n"); 

}


open was successfull but cannot read , read returns -1



[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux