diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9e3d2f3 --- /dev/null +++ b/Makefile @@ -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) *~ diff --git a/WebcamTracker.cc b/WebcamTracker.cc new file mode 100644 index 0000000..1916b17 --- /dev/null +++ b/WebcamTracker.cc @@ -0,0 +1,24 @@ + +#include +#include +#include +#include /* exit() */ +#include /* ioctl() */ +#include +#include +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); +}