www.pudn.com > UVC.zip > videodevice.h, change:2014-11-14,size:1160b


#ifndef VIDEODEVICE_H
#define VIDEODEVICE_H

#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <linux/videodev2.h>
#include <QString>
#include <QObject>
#include <asm/types.h>
#include <assert.h>
#include <linux/types.h>
#include <setjmp.h>
#include <getopt.h>

#include <malloc.h>
#include <sys/select.h>

#include "data.h"


#define CLEAR(x) memset(&(x), 0, sizeof(x))
class VideoDevice:public QObject
{
     Q_OBJECT
public:
    VideoDevice(QString dev_name);
    //VideoDevice();
    int open_device();
    int close_device();
    int init_device();
    int start_capturing();
    int stop_capturing();
    int uninit_device();
    int get_frame(void **, size_t*);
    int unget_frame();
    bool pushed;

private:
    int init_mmap();

    struct buffer
    {
        void * start;
        size_t length;
    };
    QString dev_name;
    int fd;
    buffer* buffers;
    unsigned int n_buffers;
    int index;

signals:
    void display_error(QString );

};

#endif // VIDEODEVICE_H