v4l2videodec: Add more video format.
Add RMVB/VP6/AVS/Sorenson SPARK/DivX support
https://bugzilla.gnome.org/show_bug.cgi?id=752962
UpStream Status: Pending
diff --git a/sys/v4l2/ext/videodev2.h b/sys/v4l2/ext/videodev2.h
index 14685d3..4aab32b 100644
--- a/sys/v4l2/ext/videodev2.h
+++ b/sys/v4l2/ext/videodev2.h
@@ -620,6 +620,11 @@
#define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') /* H264 without start codes */
#define V4L2_PIX_FMT_H264_MVC v4l2_fourcc('M', '2', '6', '4') /* H264 MVC */
#define V4L2_PIX_FMT_HEVC v4l2_fourcc('H', 'E', 'V', 'C') /* H.265 HEVC video */
+#define V4L2_PIX_FMT_RV v4l2_fourcc('R', 'V', '0', '0') /* RV8/9/10 */
+#define V4L2_PIX_FMT_VP6 v4l2_fourcc('V', 'P', '6', '0') /* VP6 */
+#define V4L2_PIX_FMT_AVS v4l2_fourcc('A', 'V', 'S', '0') /* AVS */
+#define V4L2_PIX_FMT_SPK v4l2_fourcc('S', 'P', 'K', '0') /* Sorenson Spark */
+#define V4L2_PIX_FMT_DIVX v4l2_fourcc('D', 'I', 'V', 'X') /* DivX */
#define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */
#define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */
#define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
index 48859ef..d09ec6a 100755
--- a/sys/v4l2/gstv4l2object.c
+++ b/sys/v4l2/gstv4l2object.c
@@ -173,6 +173,11 @@
{V4L2_PIX_FMT_H264_NO_SC, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_H264_MVC, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_HEVC, FALSE, GST_V4L2_CODEC},
+ {V4L2_PIX_FMT_RV, FALSE, GST_V4L2_CODEC},
+ {V4L2_PIX_FMT_VP6, FALSE, GST_V4L2_CODEC},
+ {V4L2_PIX_FMT_AVS, FALSE, GST_V4L2_CODEC},
+ {V4L2_PIX_FMT_SPK, FALSE, GST_V4L2_CODEC},
+ {V4L2_PIX_FMT_DIVX, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_H263, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_MPEG1, FALSE, GST_V4L2_CODEC},
{V4L2_PIX_FMT_MPEG2, FALSE, GST_V4L2_CODEC},
@@ -1458,10 +1463,27 @@
"stream-format", G_TYPE_STRING, "byte-stream", "alignment",
G_TYPE_STRING, "au", NULL);
break;
+ case V4L2_PIX_FMT_RV:
+ structure = gst_structure_new_empty ("video/x-pn-realvideo");
+ break;
+ case V4L2_PIX_FMT_VP6:
+ structure = gst_structure_new_empty ("video/x-vp6-flash");
+ break;
+ case V4L2_PIX_FMT_AVS:
+ structure = gst_structure_new_empty ("video/x-cavs");
+ break;
+ case V4L2_PIX_FMT_SPK:
+ structure = gst_structure_new ("video/x-flash-video",
+ "flvversion", G_TYPE_INT, 1, NULL);
+ break;
+ case V4L2_PIX_FMT_DIVX:
+ structure = gst_structure_new ("video/x-divx",
+ "divxversion", G_TYPE_INT, 3, NULL);
+ break;
case V4L2_PIX_FMT_VC1_ANNEX_G:
case V4L2_PIX_FMT_VC1_ANNEX_L:
structure = gst_structure_new ("video/x-wmv",
- "wmvversion", G_TYPE_INT, 3, "format", G_TYPE_STRING, "WVC1", NULL);
+ "wmvversion", G_TYPE_INT, 3, NULL);
break;
case V4L2_PIX_FMT_VP8:
structure = gst_structure_new_empty ("video/x-vp8");
@@ -1840,6 +1862,24 @@
fourcc = V4L2_PIX_FMT_H264;
} else if (g_str_equal (mimetype, "video/x-h265")) {
fourcc = V4L2_PIX_FMT_HEVC;
+ } else if (g_str_equal (mimetype, "video/x-pn-realvideo")) {
+ fourcc = V4L2_PIX_FMT_RV;
+ } else if (g_str_equal (mimetype, "video/x-vp6-flash")) {
+ fourcc = V4L2_PIX_FMT_VP6;
+ } else if (g_str_equal (mimetype, "video/x-cavs")) {
+ fourcc = V4L2_PIX_FMT_AVS;
+ } else if (g_str_equal (mimetype, "video/x-flash-video")) {
+ fourcc = V4L2_PIX_FMT_SPK;
+ } else if (g_str_equal (mimetype, "video/x-divx")) {
+ fourcc = V4L2_PIX_FMT_DIVX;
+ } else if (g_str_equal (mimetype, "video/x-wmv")) {
+ const gchar *format = gst_structure_get_string (structure, "format");
+ if (format) {
+ if (!g_ascii_strcasecmp (format, "WMV3"))
+ fourcc = V4L2_PIX_FMT_VC1_ANNEX_G;
+ else if (!g_ascii_strcasecmp (format, "WVC1"))
+ fourcc = V4L2_PIX_FMT_VC1_ANNEX_L;
+ }
} else if (g_str_equal (mimetype, "video/x-vp8")) {
fourcc = V4L2_PIX_FMT_VP8;
} else if (g_str_equal (mimetype, "video/x-vp9")) {
diff --git a/sys/v4l2/gstv4l2videodec.c b/sys/v4l2/gstv4l2videodec.c
index b04c163..b0eea9f 100644
--- a/sys/v4l2/gstv4l2videodec.c
+++ b/sys/v4l2/gstv4l2videodec.c
@@ -1155,6 +1155,16 @@
SET_META ("H264");
} else if (gst_structure_has_name (s, "video/x-h265")) {
SET_META ("H265");
+ } else if (gst_structure_has_name (s, "video/x-pn-realvideo")) {
+ SET_META ("RV");
+ } else if (gst_structure_has_name (s, "video/x-vp6-flash")) {
+ SET_META ("VP6");
+ } else if (gst_structure_has_name (s, "video/x-cavs")) {
+ SET_META ("AVS");
+ } else if (gst_structure_has_name (s, "video/x-flash-video")) {
+ SET_META ("SPK");
+ } else if (gst_structure_has_name (s, "video/x-divx")) {
+ SET_META ("DIVX");
} else if (gst_structure_has_name (s, "video/x-wmv")) {
SET_META ("VC1");
} else if (gst_structure_has_name (s, "video/x-vp8")) {