#ifndef KYLINCAMERA_GLOBAL_H
#define KYLINCAMERA_GLOBAL_H

#include <QtCore/qglobal.h>
#include <linux/videodev2.h>
#if defined(KYLINCAMERA_LIBRARY)
#  define KYLINCAMERA_EXPORT Q_DECL_EXPORT
#else
#  define KYLINCAMERA_EXPORT Q_DECL_IMPORT
#endif

#define MAX_WIDTH   1920
#define MAX_HEIGHT  1080

struct TypeFramesizes {
    struct v4l2_frmsizeenum frm_size;
    size_t frm_ivals_len;
    struct v4l2_frmivalenum frm_ivals[10];
};

struct TypePixFormats {
    struct v4l2_fmtdesc fmt;
    size_t frm_sizes_len;
    TypeFramesizes frm_sizes[50];
};

struct V4l2DeviceInfo {
    char dev_path[16];
    char dev_name[32];
    int fd;
    int cur_index;
    TypePixFormats fmt_supported[10];
    int fmt_size;
};

struct KylinCameraInfo {
    char devname[16];
    unsigned int format;
    unsigned int width;
    unsigned int height;
    int fps;
};

enum CameraMode
{
    photo,
    photos,
    video
};

#endif // KYLINCAMERA_GLOBAL_H
