summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Diaz <ddiaz@ti.com>2011-01-28 16:18:14 -0600
committerDaniel Diaz <ddiaz@ti.com>2011-02-22 17:17:35 -0600
commit58f018e97baf251ee35f8c4b0d91b32303e37cd9 (patch)
treef51d6ac49b95c2c054a2a3e50eb8d2d731818ac2
parentAdd ebuild for gst-plugins-good. (diff)
downloadpandaboard-58f018e97baf251ee35f8c4b0d91b32303e37cd9.tar.gz
pandaboard-58f018e97baf251ee35f8c4b0d91b32303e37cd9.tar.bz2
pandaboard-58f018e97baf251ee35f8c4b0d91b32303e37cd9.zip
Add ebuild for gst-plugins-v4l2.
This includes TI patches for v4l2sink. This ebuild requires the modified eclass for gst-plugins-good. Signed-off-by: Daniel Diaz <ddiaz@ti.com>
-rw-r--r--media-plugins/gst-plugins-v4l2/Manifest14
-rw-r--r--media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0001-v4l2-fix-handling-of-RGB32-BGR32-formats.patch53
-rw-r--r--media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0002-v4l2sink-Add-rotation-support.patch128
-rw-r--r--media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0003-v4l2sink-Add-flip-property.patch187
-rw-r--r--media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0004-v4l2sink-Add-support-for-omap24xxvout-driver.patch59
-rw-r--r--media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0005-v4l2sink-Add-support-for-omap_vout-driver.patch34
-rw-r--r--media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0006-v4l2-increase-v4l2sink-element-rank.patch26
-rw-r--r--media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0007-use-GstQueryBuffers-to-get-buffer-requirements.patch97
-rw-r--r--media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0008-add-rowstride-support.patch572
-rw-r--r--media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0009-use-GstEventCrop-to-get-crop-info.patch119
-rw-r--r--media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0010-v4l2-prefer-NV12.patch28
-rw-r--r--media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0011-v4l2sink-fix-issue-seen-with-autoconvert.patch49
-rw-r--r--media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0099-v4l2sink-Define-rotation-if-kernel-header-doesnt.patch27
-rw-r--r--media-plugins/gst-plugins-v4l2/gst-plugins-v4l2-0.10.27_p20110127.ebuild32
14 files changed, 1425 insertions, 0 deletions
diff --git a/media-plugins/gst-plugins-v4l2/Manifest b/media-plugins/gst-plugins-v4l2/Manifest
new file mode 100644
index 0000000..4a10510
--- /dev/null
+++ b/media-plugins/gst-plugins-v4l2/Manifest
@@ -0,0 +1,14 @@
+AUX gst-0.10.27-0001-v4l2-fix-handling-of-RGB32-BGR32-formats.patch 1699 RMD160 ee58e52c89ed3ac10ece5f24b2607461f693abb3 SHA1 5f93921349aa383b9f9a70f1ce62128eda6d9411 SHA256 b99e9322ba836e6de4df144ff5a6454bb4175a84713a9610fce3ff83402f82d5
+AUX gst-0.10.27-0002-v4l2sink-Add-rotation-support.patch 4255 RMD160 fe2024baf7398c83cec0c0adfdd649733a967482 SHA1 483ec498ce795764475b7e486560ae43ac12737c SHA256 08595843b8fddb76661aaec9b3d84791edf72226dc323050ca94ed1aebc49949
+AUX gst-0.10.27-0003-v4l2sink-Add-flip-property.patch 5880 RMD160 1fc14e374dc56b52cc16d189c3b87e0508b323fb SHA1 8475701469ea33dc355a0a030dc20a5d9a2a0e2f SHA256 42864937012aaede7fbd0ebd78b06be6b6326f99a0770ec6ec6ac57426004445
+AUX gst-0.10.27-0004-v4l2sink-Add-support-for-omap24xxvout-driver.patch 2205 RMD160 da01e8eb31d528971113679984e51f9e7d7e0326 SHA1 07ad77fe137d8c4548320f582d3cc88928e943c2 SHA256 7cca5ec0adf3ac20c7a400bf209523c9135cadb9292cbd219b631d588a3800af
+AUX gst-0.10.27-0005-v4l2sink-Add-support-for-omap_vout-driver.patch 1136 RMD160 2ba17fb3194790c60ab297a3cfbde4089575555d SHA1 f18af7103413df180b3eab08c4abe655d7a63ed3 SHA256 fa8486abf8bd9c12d2d29fe3077485e1ca77af9e39ef4a9b48a7d1ea696c2d85
+AUX gst-0.10.27-0006-v4l2-increase-v4l2sink-element-rank.patch 884 RMD160 5e18ee173f9749a46de9a146a4c6e0113f02281d SHA1 1bfab5660c9f5354eb6daed48a965824675bc07a SHA256 1cfcd14afba356fd6c6180b8f1018174e392d9cc9690870f5dd06918ef3454e5
+AUX gst-0.10.27-0007-use-GstQueryBuffers-to-get-buffer-requirements.patch 3392 RMD160 a7a197667a9fd0ca8d47125a8205f58f81e110cb SHA1 b650b0474355775a5bcb5b89090798e226786632 SHA256 5621c6c3c1a4a49c62faeffbe320e76a4c45d5ecf6c3ecb29adbe2eed25c64b4
+AUX gst-0.10.27-0008-add-rowstride-support.patch 20547 RMD160 cb4bf8074160cad277ba5754427a79cf42a139ed SHA1 60ac23640e799e558fce406e650ebe47b27645c4 SHA256 7ba17339344fe2f0b8e665cd1fd41e96c6543f2d38c4eeffbd071c6c2c21d407
+AUX gst-0.10.27-0009-use-GstEventCrop-to-get-crop-info.patch 4209 RMD160 7b827d6d1cb40f10bb25e0dedf8791884bd60bb5 SHA1 f1c47e70898c8480ce25e5ec6c90308c45cb77f7 SHA256 877141058a3662aa6c065003a048908eb5459206dd7d4cd68d46ba51bfd448a8
+AUX gst-0.10.27-0010-v4l2-prefer-NV12.patch 955 RMD160 1f8da679aa6562a8b7838a301dc98767f543ee12 SHA1 0fe801306c6dad176ef78f4269ecf99f6b270cb5 SHA256 2ddf29274b7f7d8b1ac1f2ed68c56485dddb000e82d12288e50b0acc12ffb0ec
+AUX gst-0.10.27-0011-v4l2sink-fix-issue-seen-with-autoconvert.patch 1938 RMD160 edb01fb57a548a6a6af67f016eea16d47337d0e0 SHA1 c80bbe19a4f6ad44967d077e4ee109094b5061bd SHA256 ad26b737d21721882a6c0de9011ac30984450b4ba213dc5045e9dfff9d2180fc
+AUX gst-0.10.27-0099-v4l2sink-Define-rotation-if-kernel-header-doesnt.patch 851 RMD160 547630bebcffaa01a08415f544b05e7bd5131541 SHA1 d98f5524e9da8a54b338d5f97c46036996a47431 SHA256 6f3efdcdbaeb633d240473c192b487166bc56aaad9e49b6b1269a64aef50437f
+DIST gst-plugins-good-0.10.27.tar.bz2 3096221 RMD160 6486fca87a6394577ab1f0a4e94a19b1c3e2ca5e SHA1 49964ad3b8fbee9caa0b3fc437dd9169aafad79d SHA256 a9d801c3d42b456a6ebc0b95f68c44f153f756ec0fbd4877197c469cc67771fa
+EBUILD gst-plugins-v4l2-0.10.27_p20110127.ebuild 1433 RMD160 3bdbf19a55231ee506b86e81e32715e0d1866ccc SHA1 680039bb2a9ddacf9e718c4e3a4adc797158e310 SHA256 cae04719e242406fb8744765010cef913afee37621259deef63e8d3f8973a51c
diff --git a/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0001-v4l2-fix-handling-of-RGB32-BGR32-formats.patch b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0001-v4l2-fix-handling-of-RGB32-BGR32-formats.patch
new file mode 100644
index 0000000..f2d85ef
--- /dev/null
+++ b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0001-v4l2-fix-handling-of-RGB32-BGR32-formats.patch
@@ -0,0 +1,53 @@
+From 194aa8513c02fbfcabf04b45ff4c81bf8a94527f Mon Sep 17 00:00:00 2001
+From: Rob Clark <rob@ti.com>
+Date: Tue, 14 Sep 2010 07:42:50 -0500
+Subject: [PATCH 01/11] v4l2: fix handling of RGB32/BGR32 formats
+
+bpp is 32, but depth is only 24..
+---
+ sys/v4l2/gstv4l2object.c | 12 +++++++-----
+ 1 files changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
+index 7e15489..f5672b5 100644
+--- a/sys/v4l2/gstv4l2object.c
++++ b/sys/v4l2/gstv4l2object.c
+@@ -1132,14 +1132,16 @@ gst_v4l2_object_v4l2fourcc_to_structure (guint32 fourcc)
+ b_mask = 0xff0000;
+ break;
+ case V4L2_PIX_FMT_RGB32:
+- bpp = depth = 32;
++ depth = 24;
++ bpp = 32;
+ endianness = G_BIG_ENDIAN;
+ r_mask = 0xff000000;
+ g_mask = 0x00ff0000;
+ b_mask = 0x0000ff00;
+ break;
+ case V4L2_PIX_FMT_BGR32:
+- bpp = depth = 32;
++ depth = 24;
++ bpp = 32;
+ endianness = G_BIG_ENDIAN;
+ r_mask = 0x000000ff;
+ g_mask = 0x0000ff00;
+@@ -1404,13 +1406,13 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
+ #endif
+ }
+ } else if (!strcmp (mimetype, "video/x-raw-rgb")) {
+- gint depth, endianness, r_mask;
++ gint bpp, endianness, r_mask;
+
+- gst_structure_get_int (structure, "depth", &depth);
++ gst_structure_get_int (structure, "bpp", &bpp);
+ gst_structure_get_int (structure, "endianness", &endianness);
+ gst_structure_get_int (structure, "red_mask", &r_mask);
+
+- switch (depth) {
++ switch (bpp) {
+ case 8:
+ fourcc = V4L2_PIX_FMT_RGB332;
+ break;
+--
+1.7.1
+
diff --git a/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0002-v4l2sink-Add-rotation-support.patch b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0002-v4l2sink-Add-rotation-support.patch
new file mode 100644
index 0000000..11b777c
--- /dev/null
+++ b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0002-v4l2sink-Add-rotation-support.patch
@@ -0,0 +1,128 @@
+From d43a9444fc5f7655a8acd2978039667a04222ba0 Mon Sep 17 00:00:00 2001
+From: Kiran Nataraju <knataraju@ti.com>
+Date: Fri, 27 Aug 2010 09:00:57 +0200
+Subject: [PATCH 02/11] v4l2sink: Add rotation support.
+
+Signed-off-by: Kiran Nataraju <knataraju@ti.com>
+Signed-off-by: Daniel Diaz <ddiaz@ti.com>
+---
+ sys/v4l2/gstv4l2sink.c | 34 ++++++++++++++++++++++++++++++++++
+ sys/v4l2/gstv4l2sink.h | 1 +
+ 2 files changed, 35 insertions(+), 0 deletions(-)
+
+diff --git a/sys/v4l2/gstv4l2sink.c b/sys/v4l2/gstv4l2sink.c
+index aa6785c..5abf915 100644
+--- a/sys/v4l2/gstv4l2sink.c
++++ b/sys/v4l2/gstv4l2sink.c
+@@ -72,6 +72,10 @@ GST_DEBUG_CATEGORY (v4l2sink_debug);
+ #define PROP_DEF_MIN_QUEUED_BUFS 1
+ #define DEFAULT_PROP_DEVICE "/dev/video1"
+
++#define MIN_ROTATION_ANGLE 0
++#define MAX_ROTATION_ANGLE 360
++#define DEFAULT_ROTATION_ANGLE 0
++
+ enum
+ {
+ PROP_0,
+@@ -86,6 +90,7 @@ enum
+ PROP_CROP_LEFT,
+ PROP_CROP_WIDTH,
+ PROP_CROP_HEIGHT,
++ PROP_ROTATION,
+ };
+
+
+@@ -220,6 +225,7 @@ static GstFlowReturn gst_v4l2sink_buffer_alloc (GstBaseSink * bsink,
+ guint64 offset, guint size, GstCaps * caps, GstBuffer ** buf);
+ static GstFlowReturn gst_v4l2sink_show_frame (GstBaseSink * bsink,
+ GstBuffer * buf);
++static void gst_v4l2sink_set_rotation (GstV4l2Sink * v4l2sink);
+
+ static void
+ gst_v4l2sink_base_init (gpointer g_class)
+@@ -306,6 +312,11 @@ gst_v4l2sink_class_init (GstV4l2SinkClass * klass)
+ "The height of the video crop; default is equal to negotiated image height",
+ 0, 0xffffffff, 0, G_PARAM_READWRITE));
+
++ g_object_class_install_property (gobject_class, PROP_ROTATION,
++ g_param_spec_int ("rotation", "Rotation angle",
++ "Rotation angle for the image", MIN_ROTATION_ANGLE,
++ MAX_ROTATION_ANGLE, DEFAULT_ROTATION_ANGLE, G_PARAM_READWRITE));
++
+ basesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_v4l2sink_get_caps);
+ basesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_v4l2sink_set_caps);
+ basesink_class->buffer_alloc = GST_DEBUG_FUNCPTR (gst_v4l2sink_buffer_alloc);
+@@ -336,6 +347,7 @@ gst_v4l2sink_init (GstV4l2Sink * v4l2sink, GstV4l2SinkClass * klass)
+ v4l2sink->overlay_fields_set = 0;
+ v4l2sink->crop_fields_set = 0;
+ v4l2sink->state = 0;
++ v4l2sink->rotation = 0;
+ }
+
+
+@@ -475,6 +487,20 @@ gst_v4l2sink_sync_crop_fields (GstV4l2Sink * v4l2sink)
+ }
+ }
+
++static void
++gst_v4l2sink_set_rotation (GstV4l2Sink * v4l2sink)
++{
++ if (GST_V4L2_IS_OPEN (v4l2sink->v4l2object)) {
++ struct v4l2_control control;
++ gint fd = v4l2sink->v4l2object->video_fd;
++
++ memset (&control, 0x00, sizeof (struct v4l2_control));
++ control.id = V4L2_CID_ROTATE;
++ control.value = v4l2sink->rotation;
++ g_return_if_fail (v4l2_ioctl (fd, VIDIOC_S_CTRL, &control) >= 0);
++ }
++}
++
+
+ static void
+ gst_v4l2sink_set_property (GObject * object,
+@@ -531,6 +557,10 @@ gst_v4l2sink_set_property (GObject * object,
+ v4l2sink->crop_fields_set |= RECT_HEIGHT_SET;
+ gst_v4l2sink_sync_crop_fields (v4l2sink);
+ break;
++ case PROP_ROTATION:
++ v4l2sink->rotation = g_value_get_int (value);
++ gst_v4l2sink_set_rotation (v4l2sink);
++ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+@@ -578,6 +608,9 @@ gst_v4l2sink_get_property (GObject * object,
+ case PROP_CROP_HEIGHT:
+ g_value_set_uint (value, v4l2sink->crop.height);
+ break;
++ case PROP_ROTATION:
++ g_value_set_int (value, v4l2sink->rotation);
++ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+@@ -600,6 +633,7 @@ gst_v4l2sink_change_state (GstElement * element, GstStateChange transition)
+ /* open the device */
+ if (!gst_v4l2_object_start (v4l2sink->v4l2object))
+ return GST_STATE_CHANGE_FAILURE;
++ gst_v4l2sink_set_rotation (v4l2sink);
+ break;
+ default:
+ break;
+diff --git a/sys/v4l2/gstv4l2sink.h b/sys/v4l2/gstv4l2sink.h
+index 8fe8222..1239621 100644
+--- a/sys/v4l2/gstv4l2sink.h
++++ b/sys/v4l2/gstv4l2sink.h
+@@ -75,6 +75,7 @@ struct _GstV4l2Sink {
+ guint8 overlay_fields_set, crop_fields_set;
+
+ guint8 state;
++ gint rotation;
+ };
+
+ struct _GstV4l2SinkClass {
+--
+1.7.1
+
diff --git a/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0003-v4l2sink-Add-flip-property.patch b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0003-v4l2sink-Add-flip-property.patch
new file mode 100644
index 0000000..9bdfa51
--- /dev/null
+++ b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0003-v4l2sink-Add-flip-property.patch
@@ -0,0 +1,187 @@
+From 1381c64fd606d8ab7169eef52386139a4848c439 Mon Sep 17 00:00:00 2001
+From: Kiran Nataraju <knataraju@ti.com>
+Date: Tue, 21 Sep 2010 06:21:23 +0200
+Subject: [PATCH 03/11] v4l2sink: Add flip property.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Kiran Nataraju <knataraju@ti.com>
+Signed-off-by: Daniel Díaz <yosoy@danieldiaz.org>
+---
+ sys/v4l2/gstv4l2sink.c | 88 +++++++++++++++++++++++++++++++++++++++++++++--
+ sys/v4l2/gstv4l2sink.h | 1 +
+ 2 files changed, 85 insertions(+), 4 deletions(-)
+
+diff --git a/sys/v4l2/gstv4l2sink.c b/sys/v4l2/gstv4l2sink.c
+index 5abf915..6163747 100644
+--- a/sys/v4l2/gstv4l2sink.c
++++ b/sys/v4l2/gstv4l2sink.c
+@@ -91,6 +91,7 @@ enum
+ PROP_CROP_WIDTH,
+ PROP_CROP_HEIGHT,
+ PROP_ROTATION,
++ PROP_FLIP,
+ };
+
+
+@@ -129,6 +130,34 @@ gst_v4l2sink_iface_supported (GstImplementsInterface * iface, GType iface_type)
+ return TRUE;
+ }
+
++/*
++ * Flip state
++ */
++enum
++{
++ FLIP_NONE = 0,
++ FLIP_HORIZONTAL = 1,
++ FLIP_VERTICAL = 2,
++};
++
++#define GST_TYPE_V4L2_FLIP (gst_v4l2_flip_get_type ())
++static GType
++gst_v4l2_flip_get_type (void)
++{
++ static GType type = 0;
++
++ if (!type) {
++ static GEnumValue vals[] = {
++ {FLIP_NONE, "No Flip", "none"},
++ {FLIP_HORIZONTAL, "Horizontal Flip", "horiz"},
++ {FLIP_VERTICAL, "Vertical Flip", "vert"},
++ {0, NULL, NULL},
++ };
++ type = g_enum_register_static ("GstV4l2SinkFlip", vals);
++ }
++ return type;
++}
++
+ static void
+ gst_v4l2sink_interface_init (GstImplementsInterfaceClass * klass)
+ {
+@@ -225,7 +254,7 @@ static GstFlowReturn gst_v4l2sink_buffer_alloc (GstBaseSink * bsink,
+ guint64 offset, guint size, GstCaps * caps, GstBuffer ** buf);
+ static GstFlowReturn gst_v4l2sink_show_frame (GstBaseSink * bsink,
+ GstBuffer * buf);
+-static void gst_v4l2sink_set_rotation (GstV4l2Sink * v4l2sink);
++static void gst_v4l2sink_sync_rotation (GstV4l2Sink * v4l2sink);
+
+ static void
+ gst_v4l2sink_base_init (gpointer g_class)
+@@ -317,6 +346,11 @@ gst_v4l2sink_class_init (GstV4l2SinkClass * klass)
+ "Rotation angle for the image", MIN_ROTATION_ANGLE,
+ MAX_ROTATION_ANGLE, DEFAULT_ROTATION_ANGLE, G_PARAM_READWRITE));
+
++ g_object_class_install_property (gobject_class, PROP_FLIP,
++ g_param_spec_enum ("flip", "Flip State",
++ "Flip horizontal/vertical",
++ GST_TYPE_V4L2_FLIP, FLIP_NONE, G_PARAM_READWRITE));
++
+ basesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_v4l2sink_get_caps);
+ basesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_v4l2sink_set_caps);
+ basesink_class->buffer_alloc = GST_DEBUG_FUNCPTR (gst_v4l2sink_buffer_alloc);
+@@ -348,8 +382,46 @@ gst_v4l2sink_init (GstV4l2Sink * v4l2sink, GstV4l2SinkClass * klass)
+ v4l2sink->crop_fields_set = 0;
+ v4l2sink->state = 0;
+ v4l2sink->rotation = 0;
++ v4l2sink->flip = FLIP_NONE;
+ }
+
++static void
++gst_v4l2sink_sync_flip (GstV4l2Sink * v4l2sink)
++{
++ if (GST_V4L2_IS_OPEN (v4l2sink->v4l2object)) {
++ struct v4l2_control control;
++ gint fd = v4l2sink->v4l2object->video_fd;
++
++ memset (&control, 0x00, sizeof (struct v4l2_control));
++
++ switch (v4l2sink->flip) {
++ case FLIP_VERTICAL:
++ v4l2sink->rotation = 0;
++ control.value = 1;
++ break;
++ case FLIP_HORIZONTAL:
++ /* Horizontal Flip = Vertical Flip + 180 rotation */
++ v4l2sink->rotation = 180;
++ control.value = 1;
++ break;
++ case FLIP_NONE:
++ /* In the below switch case logic we need to handle FLIP_NONE
++ * case since the v4l2 driver holds on to the last configured
++ * flip value even after the device file is closed.
++ */
++ control.value = 0;
++ break;
++ default:
++ GST_WARNING_OBJECT (v4l2sink, "Invalid flip property");
++ control.value = 0;
++ break;
++ }
++
++ gst_v4l2sink_sync_rotation (v4l2sink);
++ control.id = V4L2_CID_VFLIP;
++ g_return_if_fail (v4l2_ioctl (fd, VIDIOC_S_CTRL, &control) >= 0);
++ }
++}
+
+ static void
+ gst_v4l2sink_dispose (GObject * object)
+@@ -488,7 +560,7 @@ gst_v4l2sink_sync_crop_fields (GstV4l2Sink * v4l2sink)
+ }
+
+ static void
+-gst_v4l2sink_set_rotation (GstV4l2Sink * v4l2sink)
++gst_v4l2sink_sync_rotation (GstV4l2Sink * v4l2sink)
+ {
+ if (GST_V4L2_IS_OPEN (v4l2sink->v4l2object)) {
+ struct v4l2_control control;
+@@ -559,7 +631,11 @@ gst_v4l2sink_set_property (GObject * object,
+ break;
+ case PROP_ROTATION:
+ v4l2sink->rotation = g_value_get_int (value);
+- gst_v4l2sink_set_rotation (v4l2sink);
++ gst_v4l2sink_sync_rotation (v4l2sink);
++ break;
++ case PROP_FLIP:
++ v4l2sink->flip = g_value_get_enum (value);
++ gst_v4l2sink_sync_flip (v4l2sink);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+@@ -611,6 +687,9 @@ gst_v4l2sink_get_property (GObject * object,
+ case PROP_ROTATION:
+ g_value_set_int (value, v4l2sink->rotation);
+ break;
++ case PROP_FLIP:
++ g_value_set_enum (value, v4l2sink->flip);
++ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+@@ -633,7 +712,8 @@ gst_v4l2sink_change_state (GstElement * element, GstStateChange transition)
+ /* open the device */
+ if (!gst_v4l2_object_start (v4l2sink->v4l2object))
+ return GST_STATE_CHANGE_FAILURE;
+- gst_v4l2sink_set_rotation (v4l2sink);
++ gst_v4l2sink_sync_rotation (v4l2sink);
++ gst_v4l2sink_sync_flip (v4l2sink);
+ break;
+ default:
+ break;
+diff --git a/sys/v4l2/gstv4l2sink.h b/sys/v4l2/gstv4l2sink.h
+index 1239621..907973a 100644
+--- a/sys/v4l2/gstv4l2sink.h
++++ b/sys/v4l2/gstv4l2sink.h
+@@ -76,6 +76,7 @@ struct _GstV4l2Sink {
+
+ guint8 state;
+ gint rotation;
++ gint flip;
+ };
+
+ struct _GstV4l2SinkClass {
+--
+1.7.1
+
diff --git a/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0004-v4l2sink-Add-support-for-omap24xxvout-driver.patch b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0004-v4l2sink-Add-support-for-omap24xxvout-driver.patch
new file mode 100644
index 0000000..38601f8
--- /dev/null
+++ b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0004-v4l2sink-Add-support-for-omap24xxvout-driver.patch
@@ -0,0 +1,59 @@
+From 39de525898eea073c1f2486b99b56ef25b6df289 Mon Sep 17 00:00:00 2001
+From: Rob Clark <rob@ti.com>
+Date: Sun, 4 Apr 2010 06:46:21 -0500
+Subject: [PATCH 04/11] v4l2sink: Add support for omap24xxvout driver
+
+---
+ sys/v4l2/gstv4l2sink.c | 22 +++++++++++++++++++++-
+ 1 files changed, 21 insertions(+), 1 deletions(-)
+
+diff --git a/sys/v4l2/gstv4l2sink.c b/sys/v4l2/gstv4l2sink.c
+index 6163747..4408428 100644
+--- a/sys/v4l2/gstv4l2sink.c
++++ b/sys/v4l2/gstv4l2sink.c
+@@ -888,6 +888,18 @@ gst_v4l2sink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size,
+ /* initialize the buffer pool if not initialized yet (first buffer): */
+ if (G_UNLIKELY (!v4l2sink->pool)) {
+
++ gboolean no_pending_streamon = FALSE;
++ char *driver = (char *) v4l2sink->v4l2object->vcap.driver;
++
++ /* the omap24xxvout driver wants us to start streaming before we
++ * queue the first buffer:
++ */
++ if (!strcmp ("omap24xxvout", driver)) {
++ GST_DEBUG_OBJECT (v4l2sink,
++ "enabling no_pending_streamon hack for omap24xxvout driver");
++ no_pending_streamon = TRUE;
++ }
++
+ /* set_caps() might not be called yet.. so just to make sure: */
+ if (!gst_v4l2sink_set_caps (bsink, caps)) {
+ return GST_FLOW_ERROR;
+@@ -909,7 +921,14 @@ gst_v4l2sink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size,
+ gst_v4l2_xoverlay_prepare_xwindow_id (v4l2sink->v4l2object, TRUE);
+ #endif
+
+- v4l2sink->state = STATE_PENDING_STREAMON;
++ if (no_pending_streamon) {
++ if (!gst_v4l2_object_start_streaming (v4l2sink->v4l2object)) {
++ return GST_FLOW_ERROR;
++ }
++ v4l2sink->state = STATE_STREAMING;
++ } else {
++ v4l2sink->state = STATE_PENDING_STREAMON;
++ }
+
+ GST_INFO_OBJECT (v4l2sink, "outputting buffers via mmap()");
+
+@@ -996,6 +1015,7 @@ gst_v4l2sink_show_frame (GstBaseSink * bsink, GstBuffer * buf)
+ if (!gst_v4l2_buffer_pool_qbuf (v4l2sink->pool, GST_V4L2_BUFFER (buf))) {
+ return GST_FLOW_ERROR;
+ }
++
+ if (v4l2sink->state == STATE_PENDING_STREAMON) {
+ if (!gst_v4l2_object_start_streaming (v4l2sink->v4l2object)) {
+ return GST_FLOW_ERROR;
+--
+1.7.1
+
diff --git a/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0005-v4l2sink-Add-support-for-omap_vout-driver.patch b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0005-v4l2sink-Add-support-for-omap_vout-driver.patch
new file mode 100644
index 0000000..04b67bc
--- /dev/null
+++ b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0005-v4l2sink-Add-support-for-omap_vout-driver.patch
@@ -0,0 +1,34 @@
+From 1fabe36f40e872942c80041225bdbf41db561bea Mon Sep 17 00:00:00 2001
+From: Rob Clark <rob@ti.com>
+Date: Sun, 4 Apr 2010 06:47:55 -0500
+Subject: [PATCH 05/11] v4l2sink: Add support for omap_vout driver
+
+---
+ sys/v4l2/gstv4l2sink.c | 11 +++++++++++
+ 1 files changed, 11 insertions(+), 0 deletions(-)
+
+diff --git a/sys/v4l2/gstv4l2sink.c b/sys/v4l2/gstv4l2sink.c
+index 4408428..66dda8e 100644
+--- a/sys/v4l2/gstv4l2sink.c
++++ b/sys/v4l2/gstv4l2sink.c
+@@ -900,6 +900,17 @@ gst_v4l2sink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size,
+ no_pending_streamon = TRUE;
+ }
+
++ /* workaround for bug in omap_vout driver, when we ask for more
++ * than four buffers:
++ */
++ if (!strcmp ("omap_vout", driver)) {
++ if (v4l2sink->num_buffers > 4) {
++ v4l2sink->num_buffers = 4;
++ GST_DEBUG_OBJECT (v4l2sink,
++ "limiting to 4 buffers to work-around omap_vout driver bug");
++ }
++ }
++
+ /* set_caps() might not be called yet.. so just to make sure: */
+ if (!gst_v4l2sink_set_caps (bsink, caps)) {
+ return GST_FLOW_ERROR;
+--
+1.7.1
+
diff --git a/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0006-v4l2-increase-v4l2sink-element-rank.patch b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0006-v4l2-increase-v4l2sink-element-rank.patch
new file mode 100644
index 0000000..8f5a21c
--- /dev/null
+++ b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0006-v4l2-increase-v4l2sink-element-rank.patch
@@ -0,0 +1,26 @@
+From 14d6f0fac0875981c418ac6577d23eafb5ff3f01 Mon Sep 17 00:00:00 2001
+From: Rob Clark <rob@ti.com>
+Date: Wed, 14 Apr 2010 03:29:20 -0500
+Subject: [PATCH 06/11] v4l2: increase v4l2sink element rank
+
+Increase rank so that it is autoplugged.
+---
+ sys/v4l2/gstv4l2.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/sys/v4l2/gstv4l2.c b/sys/v4l2/gstv4l2.c
+index 4a7056f..cba4157 100644
+--- a/sys/v4l2/gstv4l2.c
++++ b/sys/v4l2/gstv4l2.c
+@@ -55,7 +55,7 @@ plugin_init (GstPlugin * plugin)
+ if (!gst_element_register (plugin, "v4l2src", GST_RANK_PRIMARY,
+ GST_TYPE_V4L2SRC) ||
+ #ifdef HAVE_EXPERIMENTAL
+- !gst_element_register (plugin, "v4l2sink", GST_RANK_NONE,
++ !gst_element_register (plugin, "v4l2sink", GST_RANK_PRIMARY,
+ GST_TYPE_V4L2SINK) ||
+ #endif
+ /* !gst_element_register (plugin, "v4l2jpegsrc", */
+--
+1.7.1
+
diff --git a/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0007-use-GstQueryBuffers-to-get-buffer-requirements.patch b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0007-use-GstQueryBuffers-to-get-buffer-requirements.patch
new file mode 100644
index 0000000..345f9df
--- /dev/null
+++ b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0007-use-GstQueryBuffers-to-get-buffer-requirements.patch
@@ -0,0 +1,97 @@
+From 15c17ea368079fd5de19868af6d9ffad1cb09f3a Mon Sep 17 00:00:00 2001
+From: Rob Clark <rob@ti.com>
+Date: Wed, 19 May 2010 17:33:46 -0500
+Subject: [PATCH 07/11] use GstQueryBuffers to get buffer requirements
+
+---
+ sys/v4l2/gstv4l2sink.c | 40 ++++++++++++++++++++++++++++++++++++++++
+ sys/v4l2/gstv4l2sink.h | 1 +
+ 2 files changed, 41 insertions(+), 0 deletions(-)
+
+diff --git a/sys/v4l2/gstv4l2sink.c b/sys/v4l2/gstv4l2sink.c
+index 66dda8e..12323f7 100644
+--- a/sys/v4l2/gstv4l2sink.c
++++ b/sys/v4l2/gstv4l2sink.c
+@@ -373,6 +373,7 @@ gst_v4l2sink_init (GstV4l2Sink * v4l2sink, GstV4l2SinkClass * klass)
+
+ /* number of buffers requested */
+ v4l2sink->num_buffers = PROP_DEF_QUEUE_SIZE;
++ v4l2sink->num_buffers_can_change = TRUE;
+ v4l2sink->min_queued_bufs = PROP_DEF_MIN_QUEUED_BUFS;
+
+ v4l2sink->probed_caps = NULL;
+@@ -808,6 +809,7 @@ static gboolean
+ gst_v4l2sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
+ {
+ GstV4l2Sink *v4l2sink = GST_V4L2SINK (bsink);
++ GstQuery *query;
+ gint w = 0, h = 0;
+ gboolean interlaced;
+ struct v4l2_fmtdesc *format;
+@@ -855,6 +857,39 @@ gst_v4l2sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
+ return FALSE;
+ }
+
++ /* query to find if anyone upstream using these buffers has any
++ * minimum requirements:
++ */
++ query = gst_query_new_buffers (caps);
++ if (gst_element_query (GST_ELEMENT (v4l2sink), query)) {
++ gint min_buffers, min_width, min_height;
++
++ gst_query_parse_buffers_count (query, &min_buffers);
++
++ /* XXX need to account for some buffers used by queue, etc.. probably
++ * queue should handle query, pass on to sink pad, and then add some
++ * number of buffers to the min, so this value is dynamic depending
++ * on the pipeline?
++ */
++ if (min_buffers != -1) {
++ min_buffers += 3 + v4l2sink->min_queued_bufs;
++ }
++
++ if (min_buffers > v4l2sink->num_buffers) {
++ v4l2sink->num_buffers_can_change = FALSE;
++ v4l2sink->num_buffers = min_buffers;
++ }
++
++ gst_query_parse_buffers_dimensions (query, &min_width, &min_height);
++ if (min_width > w) {
++ w = min_width;
++ }
++ if (min_height > h) {
++ h = min_height;
++ }
++ }
++ gst_query_unref (query);
++
+ if (!gst_v4l2_object_set_format (v4l2sink->v4l2object, format->pixelformat,
+ w, h, interlaced)) {
+ /* error already posted */
+@@ -944,6 +979,11 @@ gst_v4l2sink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size,
+ GST_INFO_OBJECT (v4l2sink, "outputting buffers via mmap()");
+
+ if (v4l2sink->num_buffers != v4l2sink->pool->buffer_count) {
++ if (!v4l2sink->num_buffers_can_change) {
++ GST_WARNING_OBJECT (v4l2sink,
++ "I can't handle a differing number of buffers!!!!");
++ return GST_FLOW_ERROR;
++ }
+ v4l2sink->num_buffers = v4l2sink->pool->buffer_count;
+ g_object_notify (G_OBJECT (v4l2sink), "queue-size");
+ }
+diff --git a/sys/v4l2/gstv4l2sink.h b/sys/v4l2/gstv4l2sink.h
+index 907973a..7649fa1 100644
+--- a/sys/v4l2/gstv4l2sink.h
++++ b/sys/v4l2/gstv4l2sink.h
+@@ -58,6 +58,7 @@ struct _GstV4l2Sink {
+ GstCaps *current_caps; /* the current negotiated caps */
+ GstV4l2BufferPool *pool;
+ guint32 num_buffers;
++ gboolean num_buffers_can_change;
+ guint32 min_queued_bufs;
+
+ gint video_width, video_height; /* original (unscaled) video w/h */
+--
+1.7.1
+
diff --git a/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0008-add-rowstride-support.patch b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0008-add-rowstride-support.patch
new file mode 100644
index 0000000..f4ff893
--- /dev/null
+++ b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0008-add-rowstride-support.patch
@@ -0,0 +1,572 @@
+From a86d0326df31103c2ee38ee1e0c62802a758ef13 Mon Sep 17 00:00:00 2001
+From: Rob Clark <rob@ti.com>
+Date: Fri, 21 May 2010 15:21:32 -0500
+Subject: [PATCH 08/11] add rowstride support
+
+---
+ sys/v4l2/gstv4l2object.c | 141 +++++++++++++++++++++++++++++++++++++---------
+ sys/v4l2/gstv4l2object.h | 6 +-
+ sys/v4l2/gstv4l2sink.c | 61 +++++++++++++-------
+ sys/v4l2/gstv4l2src.c | 28 +++++----
+ 4 files changed, 174 insertions(+), 62 deletions(-)
+
+diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
+index f5672b5..5e34456 100644
+--- a/sys/v4l2/gstv4l2object.c
++++ b/sys/v4l2/gstv4l2object.c
+@@ -1064,16 +1064,23 @@ gst_v4l2_object_get_format_list (GstV4l2Object * v4l2object)
+ return v4l2object->formats;
+ }
+
+-
+-GstStructure *
+-gst_v4l2_object_v4l2fourcc_to_structure (guint32 fourcc)
++/*
++ * gst_v4l2_object_v4l2fourcc_to_structures:
++ * @fourcc: requested format
++ * @structures: an array of at least MAX_STRUCTS_PER_FOURCC to return the
++ * results in
++ *
++ * Returns the number of structures returned via structures
++ */
++gint
++gst_v4l2_object_v4l2fourcc_to_structures (guint32 fourcc,
++ GstStructure ** structures)
+ {
+- GstStructure *structure = NULL;
+-
++ gint count = 0;
+ switch (fourcc) {
+ case V4L2_PIX_FMT_MJPEG: /* Motion-JPEG */
+ case V4L2_PIX_FMT_JPEG: /* JFIF JPEG */
+- structure = gst_structure_new ("image/jpeg", NULL);
++ structures[count++] = gst_structure_new ("image/jpeg", NULL);
+ break;
+ case V4L2_PIX_FMT_RGB332:
+ case V4L2_PIX_FMT_RGB555:
+@@ -1151,17 +1158,25 @@ gst_v4l2_object_v4l2fourcc_to_structure (guint32 fourcc)
+ g_assert_not_reached ();
+ break;
+ }
+- structure = gst_structure_new ("video/x-raw-rgb",
++ structures[count++] = gst_structure_new ("video/x-raw-rgb",
+ "bpp", G_TYPE_INT, bpp,
+ "depth", G_TYPE_INT, depth,
+ "red_mask", G_TYPE_INT, r_mask,
+ "green_mask", G_TYPE_INT, g_mask,
+ "blue_mask", G_TYPE_INT, b_mask,
+ "endianness", G_TYPE_INT, endianness, NULL);
++ structures[count++] = gst_structure_new ("video/x-raw-rgb-strided",
++ "bpp", G_TYPE_INT, bpp,
++ "depth", G_TYPE_INT, depth,
++ "red_mask", G_TYPE_INT, r_mask,
++ "green_mask", G_TYPE_INT, g_mask,
++ "blue_mask", G_TYPE_INT, b_mask,
++ "endianness", G_TYPE_INT, endianness,
++ "rowstride", GST_TYPE_INT_RANGE, 1, G_MAXINT, NULL);
+ break;
+ }
+ case V4L2_PIX_FMT_GREY: /* 8 Greyscale */
+- structure = gst_structure_new ("video/x-raw-gray",
++ structures[count++] = gst_structure_new ("video/x-raw-gray",
+ "bpp", G_TYPE_INT, 8, NULL);
+ break;
+ case V4L2_PIX_FMT_YYUV: /* 16 YUV 4:2:2 */
+@@ -1227,38 +1242,41 @@ gst_v4l2_object_v4l2fourcc_to_structure (guint32 fourcc)
+ g_assert_not_reached ();
+ break;
+ }
+- structure = gst_structure_new ("video/x-raw-yuv",
++ structures[count++] = gst_structure_new ("video/x-raw-yuv",
+ "format", GST_TYPE_FOURCC, fcc, NULL);
++ structures[count++] = gst_structure_new ("video/x-raw-yuv-strided",
++ "format", GST_TYPE_FOURCC, fcc,
++ "rowstride", GST_TYPE_INT_RANGE, 1, G_MAXINT, NULL);
+ break;
+ }
+ case V4L2_PIX_FMT_DV:
+- structure =
++ structures[count++] =
+ gst_structure_new ("video/x-dv", "systemstream", G_TYPE_BOOLEAN, TRUE,
+ NULL);
+ break;
+ case V4L2_PIX_FMT_MPEG: /* MPEG */
+- structure = gst_structure_new ("video/mpegts", NULL);
++ structures[count++] = gst_structure_new ("video/mpegts", NULL);
+ break;
+ case V4L2_PIX_FMT_WNVA: /* Winnov hw compres */
+ break;
+ #ifdef V4L2_PIX_FMT_SBGGR8
+ case V4L2_PIX_FMT_SBGGR8:
+- structure = gst_structure_new ("video/x-raw-bayer", NULL);
++ structures[count++] = gst_structure_new ("video/x-raw-bayer", NULL);
+ break;
+ #endif
+ #ifdef V4L2_PIX_FMT_SN9C10X
+ case V4L2_PIX_FMT_SN9C10X:
+- structure = gst_structure_new ("video/x-sonix", NULL);
++ structures[count++] = gst_structure_new ("video/x-sonix", NULL);
+ break;
+ #endif
+ #ifdef V4L2_PIX_FMT_PWC1
+ case V4L2_PIX_FMT_PWC1:
+- structure = gst_structure_new ("video/x-pwc1", NULL);
++ structures[count++] = gst_structure_new ("video/x-pwc1", NULL);
+ break;
+ #endif
+ #ifdef V4L2_PIX_FMT_PWC2
+ case V4L2_PIX_FMT_PWC2:
+- structure = gst_structure_new ("video/x-pwc2", NULL);
++ structures[count++] = gst_structure_new ("video/x-pwc2", NULL);
+ break;
+ #endif
+ default:
+@@ -1267,7 +1285,7 @@ gst_v4l2_object_v4l2fourcc_to_structure (guint32 fourcc)
+ break;
+ }
+
+- return structure;
++ return count;
+ }
+
+
+@@ -1278,22 +1296,23 @@ gst_v4l2_object_get_all_caps (void)
+ static GstCaps *caps = NULL;
+
+ if (caps == NULL) {
+- GstStructure *structure;
+-
+ guint i;
+
+ caps = gst_caps_new_empty ();
+ for (i = 0; i < GST_V4L2_FORMAT_COUNT; i++) {
+- structure =
+- gst_v4l2_object_v4l2fourcc_to_structure (gst_v4l2_formats[i].format);
+- if (structure) {
++ GstStructure *structures[MAX_STRUCTS_PER_FOURCC];
++ gint count, j;
++ count =
++ gst_v4l2_object_v4l2fourcc_to_structures (gst_v4l2_formats[i].format,
++ structures);
++ for (j = 0; j < count; j++) {
+ if (gst_v4l2_formats[i].dimensions) {
+- gst_structure_set (structure,
++ gst_structure_set (structures[j],
+ "width", GST_TYPE_INT_RANGE, 1, GST_V4L2_MAX_SIZE,
+ "height", GST_TYPE_INT_RANGE, 1, GST_V4L2_MAX_SIZE,
+ "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, 100, 1, NULL);
+ }
+- gst_caps_append_structure (caps, structure);
++ gst_caps_append_structure (caps, structures[j]);
+ }
+ }
+ }
+@@ -1306,12 +1325,14 @@ gst_v4l2_object_get_all_caps (void)
+ * @caps: given input caps
+ * @format: location for the v4l format
+ * @w/@h: location for width and height
++ * @rs: required rowstride in bytes, or 0 if natural stride (based on format
++ * and width) or not-applicable
+ * @fps_n/@fps_d: location for framerate
+ * @size: location for expected size of the frame or 0 if unknown
+ */
+ gboolean
+ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
+- struct v4l2_fmtdesc ** format, gint * w, gint * h,
++ struct v4l2_fmtdesc ** format, gint * w, gint * h, gint * rs,
+ gboolean * interlaced, guint * fps_n, guint * fps_d, guint * size)
+ {
+ GstStructure *structure;
+@@ -1319,10 +1340,12 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
+ guint32 fourcc;
+ const gchar *mimetype;
+ guint outsize;
++ struct v4l2_format fmt = { 0, };
+
+ /* default unknown values */
+ fourcc = 0;
+ outsize = 0;
++ *rs = 0;
+
+ structure = gst_caps_get_structure (caps, 0);
+
+@@ -1351,61 +1374,73 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
+ *fps_n = gst_value_get_fraction_numerator (framerate);
+ *fps_d = gst_value_get_fraction_denominator (framerate);
+
+- if (!strcmp (mimetype, "video/x-raw-yuv")) {
++ if (!strcmp (mimetype, "video/x-raw-yuv") ||
++ !strcmp (mimetype, "video/x-raw-yuv-strided")) {
+ gst_structure_get_fourcc (structure, "format", &fourcc);
+
+ switch (fourcc) {
+ case GST_MAKE_FOURCC ('I', '4', '2', '0'):
+ case GST_MAKE_FOURCC ('I', 'Y', 'U', 'V'):
+ fourcc = V4L2_PIX_FMT_YUV420;
++ *rs = GST_ROUND_UP_4 (*w);
+ outsize = GST_ROUND_UP_4 (*w) * GST_ROUND_UP_2 (*h);
+ outsize += 2 * ((GST_ROUND_UP_8 (*w) / 2) * (GST_ROUND_UP_2 (*h) / 2));
+ break;
+ case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'):
+ fourcc = V4L2_PIX_FMT_YUYV;
++ *rs = GST_ROUND_UP_2 (*w) * 2;
+ outsize = (GST_ROUND_UP_2 (*w) * 2) * *h;
+ break;
+ case GST_MAKE_FOURCC ('Y', '4', '1', 'P'):
+ fourcc = V4L2_PIX_FMT_Y41P;
++ *rs = GST_ROUND_UP_2 (*w) * 2;
+ outsize = (GST_ROUND_UP_2 (*w) * 2) * *h;
+ break;
+ case GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'):
+ fourcc = V4L2_PIX_FMT_UYVY;
++ *rs = GST_ROUND_UP_2 (*w) * 2;
+ outsize = (GST_ROUND_UP_2 (*w) * 2) * *h;
+ break;
+ case GST_MAKE_FOURCC ('Y', 'V', '1', '2'):
+ fourcc = V4L2_PIX_FMT_YVU420;
++ *rs = GST_ROUND_UP_4 (*w);
+ outsize = GST_ROUND_UP_4 (*w) * GST_ROUND_UP_2 (*h);
+ outsize += 2 * ((GST_ROUND_UP_8 (*w) / 2) * (GST_ROUND_UP_2 (*h) / 2));
+ break;
+ case GST_MAKE_FOURCC ('Y', '4', '1', 'B'):
+ fourcc = V4L2_PIX_FMT_YUV411P;
++ *rs = GST_ROUND_UP_4 (*w);
+ outsize = GST_ROUND_UP_4 (*w) * *h;
+ outsize += 2 * ((GST_ROUND_UP_8 (*w) / 4) * *h);
+ break;
+ case GST_MAKE_FOURCC ('Y', '4', '2', 'B'):
+ fourcc = V4L2_PIX_FMT_YUV422P;
++ *rs = GST_ROUND_UP_4 (*w);
+ outsize = GST_ROUND_UP_4 (*w) * *h;
+ outsize += 2 * ((GST_ROUND_UP_8 (*w) / 2) * *h);
+ break;
+ case GST_MAKE_FOURCC ('N', 'V', '1', '2'):
+ fourcc = V4L2_PIX_FMT_NV12;
++ *rs = GST_ROUND_UP_4 (*w);
+ outsize = GST_ROUND_UP_4 (*w) * GST_ROUND_UP_2 (*h);
+ outsize += (GST_ROUND_UP_4 (*w) * *h) / 2;
+ break;
+ case GST_MAKE_FOURCC ('N', 'V', '2', '1'):
+ fourcc = V4L2_PIX_FMT_NV21;
++ *rs = GST_ROUND_UP_4 (*w);
+ outsize = GST_ROUND_UP_4 (*w) * GST_ROUND_UP_2 (*h);
+ outsize += (GST_ROUND_UP_4 (*w) * *h) / 2;
+ break;
+ #ifdef V4L2_PIX_FMT_YVYU
+ case GST_MAKE_FOURCC ('Y', 'V', 'Y', 'U'):
+ fourcc = V4L2_PIX_FMT_YVYU;
++ *rs = GST_ROUND_UP_2 (*w) * 2;
+ outsize = (GST_ROUND_UP_2 (*w) * 2) * *h;
+ break;
+ #endif
+ }
+- } else if (!strcmp (mimetype, "video/x-raw-rgb")) {
++ } else if (!strcmp (mimetype, "video/x-raw-rgb") ||
++ !strcmp (mimetype, "video/x-raw-rgb-strided")) {
+ gint bpp, endianness, r_mask;
+
+ gst_structure_get_int (structure, "bpp", &bpp);
+@@ -1415,20 +1450,25 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
+ switch (bpp) {
+ case 8:
+ fourcc = V4L2_PIX_FMT_RGB332;
++ *rs = *w;
+ break;
+ case 15:
+ fourcc = (endianness == G_LITTLE_ENDIAN) ?
+ V4L2_PIX_FMT_RGB555 : V4L2_PIX_FMT_RGB555X;
++ *rs = 2 * *w;
+ break;
+ case 16:
+ fourcc = (endianness == G_LITTLE_ENDIAN) ?
+ V4L2_PIX_FMT_RGB565 : V4L2_PIX_FMT_RGB565X;
++ *rs = 2 * *w;
+ break;
+ case 24:
+ fourcc = (r_mask == 0xFF) ? V4L2_PIX_FMT_BGR24 : V4L2_PIX_FMT_RGB24;
++ *rs = 3 * *w;
+ break;
+ case 32:
+ fourcc = (r_mask == 0xFF) ? V4L2_PIX_FMT_BGR32 : V4L2_PIX_FMT_RGB32;
++ *rs = 4 * *w;
+ break;
+ }
+ } else if (strcmp (mimetype, "video/x-dv") == 0) {
+@@ -1458,6 +1498,25 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
+ if (fourcc == 0)
+ return FALSE;
+
++ /* check what stride the driver supports */
++ fmt.type = v4l2object->type;
++ fmt.fmt.pix.width = *w;
++ fmt.fmt.pix.height = *h;
++ fmt.fmt.pix.pixelformat = fourcc;
++ fmt.fmt.pix.field = V4L2_FIELD_ANY;
++ fmt.fmt.pix.bytesperline = *rs;
++ if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_TRY_FMT, &fmt) >= 0) {
++ if (fmt.fmt.pix.bytesperline == *rs) {
++ *rs = 0;
++ } else {
++ *rs = fmt.fmt.pix.bytesperline;
++ }
++ GST_INFO_OBJECT (v4l2object->element, "rowstride: %d", *rs);
++ } else {
++ GST_WARNING_OBJECT (v4l2object->element,
++ "VIDIOC_TRY_FMT should not fail.. driver problem?");
++ }
++
+ done:
+ *format = gst_v4l2_object_get_format_from_fourcc (v4l2object, fourcc);
+ *size = outsize;
+@@ -1465,6 +1524,36 @@ done:
+ return TRUE;
+ }
+
++/* Update caps to reflect rowstride that has been requested by the
++ * driver
++ */
++GstCaps *
++gst_v4l2_object_update_rowstride (GstV4l2Object * v4l2object,
++ GstCaps * caps, gint rs)
++{
++ GstStructure *structure;
++ const gchar *mimetype;
++
++ caps = gst_caps_make_writable (caps);
++
++ structure = gst_caps_get_structure (caps, 0);
++ mimetype = gst_structure_get_name (structure);
++
++ if (!strcmp (mimetype, "video/x-raw-yuv")) {
++ mimetype = "video/x-raw-yuv-strided";
++ gst_structure_set_name (structure, mimetype);
++ } else if (!strcmp (mimetype, "video/x-raw-rgb")) {
++ mimetype = "video/x-raw-rgb-strided";
++ gst_structure_set_name (structure, mimetype);
++ }
++
++ if (!strcmp (mimetype, "video/x-raw-yuv-strided") ||
++ !strcmp (mimetype, "video/x-raw-rgb-strided")) {
++ gst_structure_set (structure, "rowstride", G_TYPE_INT, rs, NULL);
++ }
++
++ return caps;
++}
+
+ static gboolean
+ gst_v4l2_object_get_nearest_size (GstV4l2Object * v4l2object,
+diff --git a/sys/v4l2/gstv4l2object.h b/sys/v4l2/gstv4l2object.h
+index a0dd41c..228e7c7 100644
+--- a/sys/v4l2/gstv4l2object.h
++++ b/sys/v4l2/gstv4l2object.h
+@@ -179,15 +179,17 @@ GstCaps* gst_v4l2_object_probe_caps_for_format (GstV4l2Object *v4l2object,
+ const GstStructure * template);
+
+ gboolean gst_v4l2_object_get_caps_info (GstV4l2Object *v4l2object, GstCaps *caps,
+- struct v4l2_fmtdesc **format, gint *w, gint *h,
++ struct v4l2_fmtdesc **format, gint *w, gint *h, gint *rs,
+ gboolean * interlaced, guint *fps_n, guint *fps_d, guint *size);
+
++GstCaps * gst_v4l2_object_update_rowstride (GstV4l2Object * v4l2object, GstCaps * caps, gint rs);
+
+ GSList* gst_v4l2_object_get_format_list (GstV4l2Object *v4l2object);
+
+ GstCaps* gst_v4l2_object_get_all_caps (void);
+
+-GstStructure* gst_v4l2_object_v4l2fourcc_to_structure (guint32 fourcc);
++#define MAX_STRUCTS_PER_FOURCC 2
++gint gst_v4l2_object_v4l2fourcc_to_structures (guint32 fourcc, GstStructure ** structures);
+
+ gboolean gst_v4l2_object_set_format (GstV4l2Object *v4l2object, guint32 pixelformat, guint32 width, guint32 height, gboolean interlaced);
+
+diff --git a/sys/v4l2/gstv4l2sink.c b/sys/v4l2/gstv4l2sink.c
+index 12323f7..a1f78cf 100644
+--- a/sys/v4l2/gstv4l2sink.c
++++ b/sys/v4l2/gstv4l2sink.c
+@@ -776,24 +776,23 @@ gst_v4l2sink_get_caps (GstBaseSink * bsink)
+ for (walk = v4l2sink->v4l2object->formats; walk; walk = walk->next) {
+ struct v4l2_fmtdesc *format;
+
+- GstStructure *template;
++ GstStructure *templates[MAX_STRUCTS_PER_FOURCC];
++ gint count, i;
+
+ format = (struct v4l2_fmtdesc *) walk->data;
+
+- template = gst_v4l2_object_v4l2fourcc_to_structure (format->pixelformat);
++ count = gst_v4l2_object_v4l2fourcc_to_structures (format->pixelformat,
++ templates);
+
+- if (template) {
++ for (i = 0; i < count; i++) {
+ GstCaps *tmp;
+
+- tmp =
+- gst_v4l2_object_probe_caps_for_format (v4l2sink->v4l2object,
+- format->pixelformat, template);
++ tmp = gst_v4l2_object_probe_caps_for_format (v4l2sink->v4l2object,
++ format->pixelformat, templates[i]);
+ if (tmp)
+ gst_caps_append (ret, tmp);
+
+- gst_structure_free (template);
+- } else {
+- GST_DEBUG_OBJECT (v4l2sink, "unknown format %u", format->pixelformat);
++ gst_structure_free (templates[i]);
+ }
+ }
+
+@@ -810,7 +809,7 @@ gst_v4l2sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
+ {
+ GstV4l2Sink *v4l2sink = GST_V4L2SINK (bsink);
+ GstQuery *query;
+- gint w = 0, h = 0;
++ gint w = 0, h = 0, rs = 0;
+ gboolean interlaced;
+ struct v4l2_fmtdesc *format;
+ guint fps_n, fps_d;
+@@ -823,11 +822,36 @@ gst_v4l2sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
+ return FALSE;
+ }
+
++ /* we want our own v4l2 type of fourcc codes */
++ if (!gst_v4l2_object_get_caps_info (v4l2sink->v4l2object, caps,
++ &format, &w, &h, &rs, &interlaced, &fps_n, &fps_d, &size)) {
++ GST_DEBUG_OBJECT (v4l2sink, "can't get capture format from caps %p", caps);
++ return FALSE;
++ }
++
++ if (!format) {
++ GST_DEBUG_OBJECT (v4l2sink, "unrecognized caps!!");
++ return FALSE;
++ }
++
++ /* we need to make our own ref before we potentially update the
++ * caps, to avoid that we release a ref that is not owned by us
++ * when we make the caps writable
++ */
++ caps = gst_caps_ref (caps);
++
++ /* if necessary, update caps for rowstride */
++ if (rs) {
++ caps = gst_v4l2_object_update_rowstride (v4l2sink->v4l2object, caps, rs);
++ GST_DEBUG_OBJECT (v4l2sink, "updated caps: %" GST_PTR_FORMAT, caps);
++ }
++
+ if (v4l2sink->current_caps) {
+ GST_DEBUG_OBJECT (v4l2sink, "already have caps set.. are they equal?");
+ LOG_CAPS (v4l2sink, v4l2sink->current_caps);
+ if (gst_caps_is_equal (v4l2sink->current_caps, caps)) {
+ GST_DEBUG_OBJECT (v4l2sink, "yes they are!");
++ gst_caps_unref (caps);
+ return TRUE;
+ }
+ GST_DEBUG_OBJECT (v4l2sink, "no they aren't!");
+@@ -842,18 +866,7 @@ gst_v4l2sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
+ *
+ */
+ GST_DEBUG_OBJECT (v4l2sink, "warning, changing caps not supported yet");
+- return FALSE;
+- }
+-
+- /* we want our own v4l2 type of fourcc codes */
+- if (!gst_v4l2_object_get_caps_info (v4l2sink->v4l2object, caps,
+- &format, &w, &h, &interlaced, &fps_n, &fps_d, &size)) {
+- GST_DEBUG_OBJECT (v4l2sink, "can't get capture format from caps %p", caps);
+- return FALSE;
+- }
+-
+- if (!format) {
+- GST_DEBUG_OBJECT (v4l2sink, "unrecognized caps!!");
++ gst_caps_unref (caps);
+ return FALSE;
+ }
+
+@@ -893,6 +906,7 @@ gst_v4l2sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
+ if (!gst_v4l2_object_set_format (v4l2sink->v4l2object, format->pixelformat,
+ w, h, interlaced)) {
+ /* error already posted */
++ gst_caps_unref (caps);
+ return FALSE;
+ }
+
+@@ -951,6 +965,9 @@ gst_v4l2sink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size,
+ return GST_FLOW_ERROR;
+ }
+
++ /* caps may have changed in _set_caps() if we need rowstride */
++ caps = v4l2sink->current_caps;
++
+ GST_V4L2_CHECK_OPEN (v4l2sink->v4l2object);
+
+ if (!(v4l2sink->pool = gst_v4l2_buffer_pool_new (GST_ELEMENT (v4l2sink),
+diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c
+index 4a37d35..a9a7787 100644
+--- a/sys/v4l2/gstv4l2src.c
++++ b/sys/v4l2/gstv4l2src.c
+@@ -581,24 +581,23 @@ gst_v4l2src_get_caps (GstBaseSrc * src)
+ for (walk = v4l2src->v4l2object->formats; walk; walk = walk->next) {
+ struct v4l2_fmtdesc *format;
+
+- GstStructure *template;
++ GstStructure *templates[MAX_STRUCTS_PER_FOURCC];
++ gint count, i;
+
+ format = (struct v4l2_fmtdesc *) walk->data;
+
+- template = gst_v4l2_object_v4l2fourcc_to_structure (format->pixelformat);
++ count = gst_v4l2_object_v4l2fourcc_to_structures (format->pixelformat,
++ templates);
+
+- if (template) {
++ for (i = 0; i < count; i++) {
+ GstCaps *tmp;
+
+- tmp =
+- gst_v4l2_object_probe_caps_for_format (v4l2src->v4l2object,
+- format->pixelformat, template);
++ tmp = gst_v4l2_object_probe_caps_for_format (v4l2src->v4l2object,
++ format->pixelformat, templates[i]);
+ if (tmp)
+ gst_caps_append (ret, tmp);
+
+- gst_structure_free (template);
+- } else {
+- GST_DEBUG_OBJECT (v4l2src, "unknown format %u", format->pixelformat);
++ gst_structure_free (templates[i]);
+ }
+ }
+
+@@ -613,7 +612,7 @@ static gboolean
+ gst_v4l2src_set_caps (GstBaseSrc * src, GstCaps * caps)
+ {
+ GstV4l2Src *v4l2src;
+- gint w = 0, h = 0;
++ gint w = 0, h = 0, rs = 0;
+ gboolean interlaced;
+ struct v4l2_fmtdesc *format;
+ guint fps_n, fps_d;
+@@ -635,13 +634,18 @@ gst_v4l2src_set_caps (GstBaseSrc * src, GstCaps * caps)
+ }
+
+ /* we want our own v4l2 type of fourcc codes */
+- if (!gst_v4l2_object_get_caps_info (v4l2src->v4l2object, caps, &format, &w,
+- &h, &interlaced, &fps_n, &fps_d, &size)) {
++ if (!gst_v4l2_object_get_caps_info (v4l2src->v4l2object, caps, &format,
++ &w, &h, &rs, &interlaced, &fps_n, &fps_d, &size)) {
+ GST_INFO_OBJECT (v4l2src,
+ "can't get capture format from caps %" GST_PTR_FORMAT, caps);
+ return FALSE;
+ }
+
++ /* if necessary, update caps for rowstride */
++ if (rs) {
++ caps = gst_v4l2_object_update_rowstride (v4l2src->v4l2object, caps, rs);
++ }
++
+ GST_DEBUG_OBJECT (v4l2src, "trying to set_capture %dx%d at %d/%d fps, "
+ "format %s", w, h, fps_n, fps_d, format->description);
+
+--
+1.7.1
+
diff --git a/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0009-use-GstEventCrop-to-get-crop-info.patch b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0009-use-GstEventCrop-to-get-crop-info.patch
new file mode 100644
index 0000000..c5d3197
--- /dev/null
+++ b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0009-use-GstEventCrop-to-get-crop-info.patch
@@ -0,0 +1,119 @@
+From e7497b9f0c6c88b764d8f95e01197e2a2ea0dd95 Mon Sep 17 00:00:00 2001
+From: Rob Clark <rob@ti.com>
+Date: Tue, 25 May 2010 11:02:45 -0500
+Subject: [PATCH 09/11] use GstEventCrop to get crop info
+
+---
+ sys/v4l2/gstv4l2sink.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 files changed, 62 insertions(+), 1 deletions(-)
+
+diff --git a/sys/v4l2/gstv4l2sink.c b/sys/v4l2/gstv4l2sink.c
+index a1f78cf..feafe7a 100644
+--- a/sys/v4l2/gstv4l2sink.c
++++ b/sys/v4l2/gstv4l2sink.c
+@@ -252,6 +252,7 @@ static GstCaps *gst_v4l2sink_get_caps (GstBaseSink * bsink);
+ static gboolean gst_v4l2sink_set_caps (GstBaseSink * bsink, GstCaps * caps);
+ static GstFlowReturn gst_v4l2sink_buffer_alloc (GstBaseSink * bsink,
+ guint64 offset, guint size, GstCaps * caps, GstBuffer ** buf);
++static gboolean gst_v4l2sink_event (GstBaseSink * bsink, GstEvent * event);
+ static GstFlowReturn gst_v4l2sink_show_frame (GstBaseSink * bsink,
+ GstBuffer * buf);
+ static void gst_v4l2sink_sync_rotation (GstV4l2Sink * v4l2sink);
+@@ -354,6 +355,7 @@ gst_v4l2sink_class_init (GstV4l2SinkClass * klass)
+ basesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_v4l2sink_get_caps);
+ basesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_v4l2sink_set_caps);
+ basesink_class->buffer_alloc = GST_DEBUG_FUNCPTR (gst_v4l2sink_buffer_alloc);
++ basesink_class->event = GST_DEBUG_FUNCPTR (gst_v4l2sink_event);
+ basesink_class->render = GST_DEBUG_FUNCPTR (gst_v4l2sink_show_frame);
+ }
+
+@@ -895,11 +897,22 @@ gst_v4l2sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
+
+ gst_query_parse_buffers_dimensions (query, &min_width, &min_height);
+ if (min_width > w) {
++ v4l2sink->crop.width = w;
++ v4l2sink->crop_fields_set |= RECT_WIDTH_SET;
+ w = min_width;
+ }
+ if (min_height > h) {
++ v4l2sink->crop.height = h;
++ v4l2sink->crop_fields_set |= RECT_HEIGHT_SET;
+ h = min_height;
+ }
++
++ /* clear top/left crop values.. otherwise by default display will try
++ * to center, rather than scale, the image if it is too big to fit on
++ * display
++ */
++ v4l2sink->crop.top = v4l2sink->crop.left = 0;
++ v4l2sink->crop_fields_set |= RECT_TOP_SET | RECT_LEFT_SET;
+ }
+ gst_query_unref (query);
+
+@@ -919,7 +932,13 @@ gst_v4l2sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
+ GST_VIDEO_SINK_WIDTH (v4l2sink) = w;
+ GST_VIDEO_SINK_HEIGHT (v4l2sink) = h;
+
+- v4l2sink->current_caps = gst_caps_ref (caps);
++ /* this needs to go after gst_v4l2_object_set_format() to ensure driver
++ * has proper width/height (so we don't confuse it's error checking by
++ * setting a crop larger than the picture size)
++ */
++ gst_v4l2sink_sync_crop_fields (v4l2sink);
++
++ v4l2sink->current_caps = caps;
+
+ return TRUE;
+ }
+@@ -1023,6 +1042,48 @@ gst_v4l2sink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size,
+ }
+ }
+
++/* called to handle events */
++static gboolean
++gst_v4l2sink_event (GstBaseSink * bsink, GstEvent * event)
++{
++ GstV4l2Sink *v4l2sink = GST_V4L2SINK (bsink);
++ GstEventType type = GST_EVENT_TYPE (event);
++
++ GST_DEBUG_OBJECT (v4l2sink, "event %" GST_PTR_FORMAT, event);
++
++ switch (type) {
++ case GST_EVENT_CROP:{
++ gint top, left, width, height;
++ gst_event_parse_crop (event, &top, &left, &width, &height);
++ if (top >= 0) {
++ v4l2sink->crop.top = top;
++ v4l2sink->crop_fields_set |= RECT_TOP_SET;
++ }
++ if (left >= 0) {
++ v4l2sink->crop.left = left;
++ v4l2sink->crop_fields_set |= RECT_LEFT_SET;
++ }
++ if (width >= 0) {
++ v4l2sink->crop.width = width;
++ v4l2sink->crop_fields_set |= RECT_WIDTH_SET;
++ }
++ if (height >= 0) {
++ v4l2sink->crop.height = height;
++ v4l2sink->crop_fields_set |= RECT_HEIGHT_SET;
++ }
++ gst_v4l2sink_sync_crop_fields (v4l2sink);
++ return TRUE;
++ }
++ default:{
++ if (GST_BASE_SINK_CLASS (parent_class)->event) {
++ return GST_BASE_SINK_CLASS (parent_class)->event (bsink, event);
++ } else {
++ return TRUE;
++ }
++ }
++ }
++}
++
+ /* called after A/V sync to render frame */
+ static GstFlowReturn
+ gst_v4l2sink_show_frame (GstBaseSink * bsink, GstBuffer * buf)
+--
+1.7.1
+
diff --git a/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0010-v4l2-prefer-NV12.patch b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0010-v4l2-prefer-NV12.patch
new file mode 100644
index 0000000..301056a
--- /dev/null
+++ b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0010-v4l2-prefer-NV12.patch
@@ -0,0 +1,28 @@
+From 107c18830342c69229857f968dff33071d07992d Mon Sep 17 00:00:00 2001
+From: Rob Clark <rob@ti.com>
+Date: Tue, 14 Sep 2010 07:44:01 -0500
+Subject: [PATCH 10/11] v4l2: prefer NV12
+
+All else being equal, the buffer sizes are smaller compared to a 422 format
+like YUY2/UYVY.. although ideally rank would come from driver.
+---
+ sys/v4l2/gstv4l2object.c | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
+index 5e34456..644edcf 100644
+--- a/sys/v4l2/gstv4l2object.c
++++ b/sys/v4l2/gstv4l2object.c
+@@ -886,6 +886,9 @@ gst_v4l2_object_format_get_rank (const struct v4l2_fmtdesc *fmt)
+ break;
+
+ case V4L2_PIX_FMT_NV12: /* 12 Y/CbCr 4:2:0 */
++ rank = YUV_BASE_RANK + 11;
++ break;
++
+ case V4L2_PIX_FMT_NV21: /* 12 Y/CrCb 4:2:0 */
+ case V4L2_PIX_FMT_YYUV: /* 16 YUV 4:2:2 */
+ case V4L2_PIX_FMT_HI240: /* 8 8-bit color */
+--
+1.7.1
+
diff --git a/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0011-v4l2sink-fix-issue-seen-with-autoconvert.patch b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0011-v4l2sink-fix-issue-seen-with-autoconvert.patch
new file mode 100644
index 0000000..3384de7
--- /dev/null
+++ b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0011-v4l2sink-fix-issue-seen-with-autoconvert.patch
@@ -0,0 +1,49 @@
+From 4e319948c62aafd5339c38d065fd8dbfa5a09ced Mon Sep 17 00:00:00 2001
+From: Rob Clark <rob@ti.com>
+Date: Thu, 13 Jan 2011 09:43:08 -0600
+Subject: [PATCH 11/11] v4l2sink: fix issue seen with autoconvert
+
+In this scenario _set_caps() will get called earlier than _buffer_alloc()
+so we need to not override the number of buffers in the case that the
+upstream element answers the query about number of requested buffers.
+---
+ sys/v4l2/gstv4l2sink.c | 6 ++++--
+ 1 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/sys/v4l2/gstv4l2sink.c b/sys/v4l2/gstv4l2sink.c
+index feafe7a..ca6ae15 100644
+--- a/sys/v4l2/gstv4l2sink.c
++++ b/sys/v4l2/gstv4l2sink.c
+@@ -881,6 +881,8 @@ gst_v4l2sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
+
+ gst_query_parse_buffers_count (query, &min_buffers);
+
++ GST_DEBUG_OBJECT (v4l2sink, "min_buffers=%d", min_buffers);
++
+ /* XXX need to account for some buffers used by queue, etc.. probably
+ * queue should handle query, pass on to sink pad, and then add some
+ * number of buffers to the min, so this value is dynamic depending
+@@ -888,10 +890,10 @@ gst_v4l2sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
+ */
+ if (min_buffers != -1) {
+ min_buffers += 3 + v4l2sink->min_queued_bufs;
++ v4l2sink->num_buffers_can_change = FALSE;
+ }
+
+ if (min_buffers > v4l2sink->num_buffers) {
+- v4l2sink->num_buffers_can_change = FALSE;
+ v4l2sink->num_buffers = min_buffers;
+ }
+
+@@ -972,7 +974,7 @@ gst_v4l2sink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size,
+ * than four buffers:
+ */
+ if (!strcmp ("omap_vout", driver)) {
+- if (v4l2sink->num_buffers > 4) {
++ if (v4l2sink->num_buffers_can_change && v4l2sink->num_buffers > 4) {
+ v4l2sink->num_buffers = 4;
+ GST_DEBUG_OBJECT (v4l2sink,
+ "limiting to 4 buffers to work-around omap_vout driver bug");
+--
+1.7.1
+
diff --git a/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0099-v4l2sink-Define-rotation-if-kernel-header-doesnt.patch b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0099-v4l2sink-Define-rotation-if-kernel-header-doesnt.patch
new file mode 100644
index 0000000..82917b8
--- /dev/null
+++ b/media-plugins/gst-plugins-v4l2/files/gst-0.10.27-0099-v4l2sink-Define-rotation-if-kernel-header-doesnt.patch
@@ -0,0 +1,27 @@
+From 97e06ec24aa68f94bdd75f02d7026490c6080e96 Mon Sep 17 00:00:00 2001
+From: Daniel Diaz <ddiaz@ti.com>
+Date: Fri, 28 Jan 2011 15:23:26 -0600
+Subject: [PATCH] v4l2sink: Define rotation if kernel header doesn't.
+
+Signed-off-by: Daniel Diaz <ddiaz@ti.com>
+---
+ sys/v4l2/gstv4l2sink.c | 4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/sys/v4l2/gstv4l2sink.c b/sys/v4l2/gstv4l2sink.c
+index ca6ae15..0438de9 100644
+--- a/sys/v4l2/gstv4l2sink.c
++++ b/sys/v4l2/gstv4l2sink.c
+@@ -102,6 +102,10 @@ GST_IMPLEMENT_V4L2_XOVERLAY_METHODS (GstV4l2Sink, gst_v4l2sink);
+ #endif
+ GST_IMPLEMENT_V4L2_VIDORIENT_METHODS (GstV4l2Sink, gst_v4l2sink);
+
++#ifndef V4L2_CID_ROTATE
++# define V4L2_CID_ROTATE (V4L2_CID_BASE+34)
++#endif
++
+ static gboolean
+ gst_v4l2sink_iface_supported (GstImplementsInterface * iface, GType iface_type)
+ {
+--
+1.7.3.4
diff --git a/media-plugins/gst-plugins-v4l2/gst-plugins-v4l2-0.10.27_p20110127.ebuild b/media-plugins/gst-plugins-v4l2/gst-plugins-v4l2-0.10.27_p20110127.ebuild
new file mode 100644
index 0000000..7f93109
--- /dev/null
+++ b/media-plugins/gst-plugins-v4l2/gst-plugins-v4l2-0.10.27_p20110127.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit gst-plugins-good
+
+DESCRIPION="Plug-in to allow capture from video4linux2 (V4L2) devices"
+KEYWORDS="~alpha ~amd64 arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE=""
+
+RDEPEND=">=media-libs/gst-plugins-base-0.10.32_p20110127"
+DEPEND="${RDEPEND}
+ virtual/os-headers"
+
+GST_PLUGINS_BUILD="gst_v4l2"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/gst-0.10.27-0001-v4l2-fix-handling-of-RGB32-BGR32-formats.patch
+ epatch "${FILESDIR}"/gst-0.10.27-0002-v4l2sink-Add-rotation-support.patch
+ epatch "${FILESDIR}"/gst-0.10.27-0003-v4l2sink-Add-flip-property.patch
+ epatch "${FILESDIR}"/gst-0.10.27-0004-v4l2sink-Add-support-for-omap24xxvout-driver.patch
+ epatch "${FILESDIR}"/gst-0.10.27-0005-v4l2sink-Add-support-for-omap_vout-driver.patch
+ epatch "${FILESDIR}"/gst-0.10.27-0006-v4l2-increase-v4l2sink-element-rank.patch
+ epatch "${FILESDIR}"/gst-0.10.27-0007-use-GstQueryBuffers-to-get-buffer-requirements.patch
+ epatch "${FILESDIR}"/gst-0.10.27-0008-add-rowstride-support.patch
+ epatch "${FILESDIR}"/gst-0.10.27-0009-use-GstEventCrop-to-get-crop-info.patch
+ epatch "${FILESDIR}"/gst-0.10.27-0010-v4l2-prefer-NV12.patch
+ epatch "${FILESDIR}"/gst-0.10.27-0011-v4l2sink-fix-issue-seen-with-autoconvert.patch
+ epatch "${FILESDIR}"/gst-0.10.27-0099-v4l2sink-Define-rotation-if-kernel-header-doesnt.patch
+}