Commit 8cf1c330 authored by Nicolas Dufresne's avatar Nicolas Dufresne

v4l2object: Move type declaration to the top

parent b4d89b98
......@@ -64,6 +64,85 @@ enum
V4L2_STD_OBJECT_PROPS,
};
/*
* common format / caps utilities:
*/
typedef enum
{
GST_V4L2_RAW = 1 << 0,
GST_V4L2_CODEC = 1 << 1,
GST_V4L2_TRANSPORT = 1 << 2,
GST_V4L2_NO_PARSE = 1 << 3,
GST_V4L2_ALL = 0xffff
} GstV4L2FormatFlags;
typedef struct
{
guint32 format;
gboolean dimensions;
GstV4L2FormatFlags flags;
} GstV4L2FormatDesc;
static const GstV4L2FormatDesc gst_v4l2_formats[] = {
/* from Linux 2.6.15 videodev2.h */
{V4L2_PIX_FMT_RGB332, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_RGB555, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_RGB565, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_RGB555X, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_RGB565X, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_BGR24, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_RGB24, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_BGR32, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_RGB32, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_GREY, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_YVU410, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_YVU420, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_YUYV, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_UYVY, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_YUV422P, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_YUV411P, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_Y41P, TRUE, GST_V4L2_RAW},
/* two planes -- one Y, one Cr + Cb interleaved */
{V4L2_PIX_FMT_NV12, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_NV12M, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_NV12MT, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_NV21, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_NV21M, TRUE, GST_V4L2_RAW},
/* The following formats are not defined in the V4L2 specification */
{V4L2_PIX_FMT_YUV410, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_YUV420, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_YYUV, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_HI240, TRUE, GST_V4L2_RAW},
/* see http://www.siliconimaging.com/RGB%20Bayer.htm */
{V4L2_PIX_FMT_SBGGR8, TRUE, GST_V4L2_CODEC},
/* compressed formats */
{V4L2_PIX_FMT_MJPEG, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_JPEG, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_PJPG, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_DV, FALSE, GST_V4L2_TRANSPORT},
{V4L2_PIX_FMT_MPEG, FALSE, GST_V4L2_TRANSPORT},
{V4L2_PIX_FMT_MPEG1, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_MPEG2, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_MPEG4, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_H263, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_H264, FALSE, GST_V4L2_CODEC},
/* VP8 not parseable */
{V4L2_PIX_FMT_VP8, FALSE, GST_V4L2_CODEC | GST_V4L2_NO_PARSE},
/* Vendor-specific formats */
{V4L2_PIX_FMT_WNVA, TRUE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_SN9C10X, TRUE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_PWC1, TRUE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_PWC2, TRUE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_YVYU, TRUE, GST_V4L2_RAW},
};
#define GST_V4L2_FORMAT_COUNT (G_N_ELEMENTS (gst_v4l2_formats))
static GSList *gst_v4l2_object_get_format_list (GstV4l2Object * v4l2object);
......@@ -703,88 +782,6 @@ gst_v4l2_object_close (GstV4l2Object * v4l2object)
return TRUE;
}
/*
* common format / caps utilities:
*/
typedef enum
{
GST_V4L2_RAW = 1 << 0,
GST_V4L2_CODEC = 1 << 1,
GST_V4L2_TRANSPORT = 1 << 2,
GST_V4L2_NO_PARSE = 1 << 3,
GST_V4L2_ALL = 0xffff
} GstV4L2FormatFlags;
typedef struct
{
guint32 format;
gboolean dimensions;
GstV4L2FormatFlags flags;
} GstV4L2FormatDesc;
static const GstV4L2FormatDesc gst_v4l2_formats[] = {
/* from Linux 2.6.15 videodev2.h */
{V4L2_PIX_FMT_RGB332, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_RGB555, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_RGB565, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_RGB555X, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_RGB565X, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_BGR24, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_RGB24, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_BGR32, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_RGB32, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_GREY, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_YVU410, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_YVU420, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_YUYV, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_UYVY, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_YUV422P, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_YUV411P, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_Y41P, TRUE, GST_V4L2_RAW},
/* two planes -- one Y, one Cr + Cb interleaved */
{V4L2_PIX_FMT_NV12, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_NV12M, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_NV12MT, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_NV21, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_NV21M, TRUE, GST_V4L2_RAW},
/* The following formats are not defined in the V4L2 specification */
{V4L2_PIX_FMT_YUV410, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_YUV420, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_YYUV, TRUE, GST_V4L2_RAW},
{V4L2_PIX_FMT_HI240, TRUE, GST_V4L2_RAW},
/* see http://www.siliconimaging.com/RGB%20Bayer.htm */
{V4L2_PIX_FMT_SBGGR8, TRUE, GST_V4L2_CODEC},
/* compressed formats */
{V4L2_PIX_FMT_MJPEG, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_JPEG, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_PJPG, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_DV, FALSE, GST_V4L2_TRANSPORT},
{V4L2_PIX_FMT_MPEG, FALSE, GST_V4L2_TRANSPORT},
{V4L2_PIX_FMT_MPEG1, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_MPEG2, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_MPEG4, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_H263, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_H264, FALSE, GST_V4L2_CODEC},
/* VP8 not parseable */
{V4L2_PIX_FMT_VP8, FALSE, GST_V4L2_CODEC | GST_V4L2_NO_PARSE},
/* Vendor-specific formats */
{V4L2_PIX_FMT_WNVA, TRUE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_SN9C10X, TRUE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_PWC1, TRUE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_PWC2, TRUE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_YVYU, TRUE, GST_V4L2_RAW},
};
#define GST_V4L2_FORMAT_COUNT (G_N_ELEMENTS (gst_v4l2_formats))
static struct v4l2_fmtdesc *
gst_v4l2_object_get_format_from_fourcc (GstV4l2Object * v4l2object,
guint32 fourcc)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment