LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-21-2007, 04:37 AM   #1
zaebala
LQ Newbie
 
Registered: Jul 2007
Posts: 3

Rep: Reputation: 0
i have some problems with ioctl...


I am trying to grab pictures from my Labtec Webcam in RedHat Ent 4. Firstly I have installed spcaview, and during sturtup it finds my camera and does all other stuff. Now I took a soure code to write a gimple own grabber exactly for my cam. And some code from spcaview doesn't want to work in my program. Here is a pice of code:

Code:
#include <linux/videodev.h>
#include <sys/ioctl.h>
//...
struct video_capability videocap;
int fd;

if ((fd = open ("/dev/video0", O_RDWR)) == -1) {
         perror ("ERROR opening V4L interface \n");
         exit (1);
      }
// ok here

if (ioctl (fd, VIDIOCGCAP, &videocap) == -1) {
         printf ("wrong device\n"); 
         exit (1);
      }
A on a display I have "wrong device" message. ioctl returns an error while spcaview didn't! What can cause this problem?
 
Old 07-21-2007, 04:37 AM   #2
zaebala
LQ Newbie
 
Registered: Jul 2007
Posts: 3

Original Poster
Rep: Reputation: 0
ps. lsusb finds my cam
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MadWifi problems: wlanconfig ioctl no such device Spearhawk Debian 2 04-13-2007 11:26 AM
ioctl.h blackzone Programming 1 07-26-2004 03:30 AM
ioctl question h/w Programming 2 10-26-2003 01:28 AM
ioctl dummyagain Programming 2 10-06-2003 07:22 AM
ioctl unosoft Linux - Software 0 09-12-2003 06:58 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration