added Makefile and initial WebcamTracker.cc
git-svn-id: svn://anubis/misc/WebcamTracker@119 bd8a9e45-a331-0410-811e-c64571078777
This commit is contained in:
parent
e12c02d54d
commit
7d1f710d57
15
Makefile
Normal file
15
Makefile
Normal 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
24
WebcamTracker.cc
Normal 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);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user