added Makefile and initial WebcamTracker.cc

git-svn-id: svn://anubis/misc/WebcamTracker@119 bd8a9e45-a331-0410-811e-c64571078777
This commit is contained in:
josh 2009-08-06 00:53:16 +00:00
parent e12c02d54d
commit 7d1f710d57
2 changed files with 39 additions and 0 deletions

15
Makefile Normal file
View File

@ -0,0 +1,15 @@
TARGET := test
CXXOBJS := $(patsubst %.cc,%.o,$(wildcard *.cc))
OBJS := $(CXXOBJS)
all: $(TARGET)
$(TARGET): $(OBJS)
$(CXX) -o $@ $^
%.o: %.cc
$(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) $<
clean:
-$(RM) -f *.o $(TARGET) *~

24
WebcamTracker.cc Normal file
View File

@ -0,0 +1,24 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h> /* exit() */
#include <sys/ioctl.h> /* ioctl() */
#include <libv4lconvert.h>
#include <iostream>
using namespace std;
int main(int argc, char * argv[])
{
int fd = open("/dev/video0", O_RDWR);
if (fd < 0)
{
cerr << "bad fd" << endl;
exit(1);
}
struct v4l2_capability cap;
ioctl(fd, VIDIOC_QUERYCAP, &cap);
close(fd);
}