WebcamTracker/WebcamTracker.h
josh c261550290 added width, height parameters to setFormat(), working to set YUYV format but not RGB formats I tried
git-svn-id: svn://anubis/misc/WebcamTracker@127 bd8a9e45-a331-0410-811e-c64571078777
2009-08-12 03:29:35 +00:00

36 lines
843 B
C++

#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>
#include <vector>
class WebcamTracker
{
public:
WebcamTracker();
~WebcamTracker();
bool open(const char * device);
void start();
protected:
void requestBuffers(int num);
void mapBuffer(int i);
void queueBuffer(int i);
void beginStreaming();
void endStreaming();
void dequeueBuffer(v4l2_buffer * dqbuf);
void unmapBuffer(int i);
void freeBuffers();
void setFormat(int width, int height);
bool m_open;
int m_fd;
int m_numbufs;
void ** m_buffers;
int * m_lengths;
};