diff options
author | Daniel Diaz <ddiaz@ti.com> | 2011-01-28 15:47:50 -0600 |
---|---|---|
committer | Daniel Diaz <ddiaz@ti.com> | 2011-02-22 17:16:57 -0600 |
commit | 1264d9379ac0b690f6948b4822cf0cdf81520bd8 (patch) | |
tree | 2b9951ce97216c2588f7a1395ae2b42c83ca354f | |
parent | Add eclass for gst-plugins-good. (diff) | |
download | pandaboard-1264d9379ac0b690f6948b4822cf0cdf81520bd8.tar.gz pandaboard-1264d9379ac0b690f6948b4822cf0cdf81520bd8.tar.bz2 pandaboard-1264d9379ac0b690f6948b4822cf0cdf81520bd8.zip |
Add ebuild for gst-plugins-good.
This includes TI patches.
Signed-off-by: Daniel Diaz <ddiaz@ti.com>
14 files changed, 1553 insertions, 0 deletions
diff --git a/media-libs/gst-plugins-good/Manifest b/media-libs/gst-plugins-good/Manifest new file mode 100644 index 0000000..6f92a4e --- /dev/null +++ b/media-libs/gst-plugins-good/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-Disable-rotation-code-when-not-found.patch 3484 RMD160 42b0d964871066c9203cdaf8aa79c4a08f8bef33 SHA1 2502fd3e41ecda556868785540d993e45872d7bc SHA256 a7981181b78cbbf2b717d2b09a177859a99f2a75f76f1c146549955d0bc300b9 +DIST gst-plugins-good-0.10.27.tar.bz2 3096221 RMD160 6486fca87a6394577ab1f0a4e94a19b1c3e2ca5e SHA1 49964ad3b8fbee9caa0b3fc437dd9169aafad79d SHA256 a9d801c3d42b456a6ebc0b95f68c44f153f756ec0fbd4877197c469cc67771fa +EBUILD gst-plugins-good-0.10.27_p20110127.ebuild 2912 RMD160 9b8e627d4d2383464f1090c97fc3dd68b9a2c4ba SHA1 f4392e673c6c878c505e2ab33072a54d1d9fd12f SHA256 203dfad6d89aaa3860810d0eefd6d518e0cbe91757542d28519e719e65a11327 diff --git a/media-libs/gst-plugins-good/files/gst-0.10.27-0001-v4l2-fix-handling-of-RGB32-BGR32-formats.patch b/media-libs/gst-plugins-good/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-libs/gst-plugins-good/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-libs/gst-plugins-good/files/gst-0.10.27-0002-v4l2sink-Add-rotation-support.patch b/media-libs/gst-plugins-good/files/gst-0.10.27-0002-v4l2sink-Add-rotation-support.patch new file mode 100644 index 0000000..11b777c --- /dev/null +++ b/media-libs/gst-plugins-good/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-libs/gst-plugins-good/files/gst-0.10.27-0003-v4l2sink-Add-flip-property.patch b/media-libs/gst-plugins-good/files/gst-0.10.27-0003-v4l2sink-Add-flip-property.patch new file mode 100644 index 0000000..9bdfa51 --- /dev/null +++ b/media-libs/gst-plugins-good/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-libs/gst-plugins-good/files/gst-0.10.27-0004-v4l2sink-Add-support-for-omap24xxvout-driver.patch b/media-libs/gst-plugins-good/files/gst-0.10.27-0004-v4l2sink-Add-support-for-omap24xxvout-driver.patch new file mode 100644 index 0000000..38601f8 --- /dev/null +++ b/media-libs/gst-plugins-good/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-libs/gst-plugins-good/files/gst-0.10.27-0005-v4l2sink-Add-support-for-omap_vout-driver.patch b/media-libs/gst-plugins-good/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-libs/gst-plugins-good/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-libs/gst-plugins-good/files/gst-0.10.27-0006-v4l2-increase-v4l2sink-element-rank.patch b/media-libs/gst-plugins-good/files/gst-0.10.27-0006-v4l2-increase-v4l2sink-element-rank.patch new file mode 100644 index 0000000..8f5a21c --- /dev/null +++ b/media-libs/gst-plugins-good/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-libs/gst-plugins-good/files/gst-0.10.27-0007-use-GstQueryBuffers-to-get-buffer-requirements.patch b/media-libs/gst-plugins-good/files/gst-0.10.27-0007-use-GstQueryBuffers-to-get-buffer-requirements.patch new file mode 100644 index 0000000..345f9df --- /dev/null +++ b/media-libs/gst-plugins-good/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-libs/gst-plugins-good/files/gst-0.10.27-0008-add-rowstride-support.patch b/media-libs/gst-plugins-good/files/gst-0.10.27-0008-add-rowstride-support.patch new file mode 100644 index 0000000..f4ff893 --- /dev/null +++ b/media-libs/gst-plugins-good/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-libs/gst-plugins-good/files/gst-0.10.27-0009-use-GstEventCrop-to-get-crop-info.patch b/media-libs/gst-plugins-good/files/gst-0.10.27-0009-use-GstEventCrop-to-get-crop-info.patch new file mode 100644 index 0000000..c5d3197 --- /dev/null +++ b/media-libs/gst-plugins-good/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-libs/gst-plugins-good/files/gst-0.10.27-0010-v4l2-prefer-NV12.patch b/media-libs/gst-plugins-good/files/gst-0.10.27-0010-v4l2-prefer-NV12.patch new file mode 100644 index 0000000..301056a --- /dev/null +++ b/media-libs/gst-plugins-good/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-libs/gst-plugins-good/files/gst-0.10.27-0011-v4l2sink-fix-issue-seen-with-autoconvert.patch b/media-libs/gst-plugins-good/files/gst-0.10.27-0011-v4l2sink-fix-issue-seen-with-autoconvert.patch new file mode 100644 index 0000000..3384de7 --- /dev/null +++ b/media-libs/gst-plugins-good/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-libs/gst-plugins-good/files/gst-0.10.27-0099-v4l2sink-Disable-rotation-code-when-not-found.patch b/media-libs/gst-plugins-good/files/gst-0.10.27-0099-v4l2sink-Disable-rotation-code-when-not-found.patch new file mode 100644 index 0000000..4a2b992 --- /dev/null +++ b/media-libs/gst-plugins-good/files/gst-0.10.27-0099-v4l2sink-Disable-rotation-code-when-not-found.patch @@ -0,0 +1,103 @@ +From 606df19aa1230d0c6081e85d914c866eb7674a5a 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: Disable rotation code when not found. + +Kernel headers might not include support for V4L2 rotation. + +Signed-off-by: Daniel Diaz <ddiaz@ti.com> +--- + sys/v4l2/gstv4l2sink.c | 14 ++++++++++++++ + 1 files changed, 14 insertions(+), 0 deletions(-) + +diff --git a/sys/v4l2/gstv4l2sink.c b/sys/v4l2/gstv4l2sink.c +index ca6ae15..374de88 100644 +--- a/sys/v4l2/gstv4l2sink.c ++++ b/sys/v4l2/gstv4l2sink.c +@@ -255,7 +255,9 @@ static GstFlowReturn gst_v4l2sink_buffer_alloc (GstBaseSink * bsink, + static gboolean gst_v4l2sink_event (GstBaseSink * bsink, GstEvent * event); + static GstFlowReturn gst_v4l2sink_show_frame (GstBaseSink * bsink, + GstBuffer * buf); ++#ifdef V4L2_CID_ROTATE + static void gst_v4l2sink_sync_rotation (GstV4l2Sink * v4l2sink); ++#endif + + static void + gst_v4l2sink_base_init (gpointer g_class) +@@ -342,10 +344,12 @@ 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)); + ++#ifdef V4L2_CID_ROTATE + 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)); ++#endif + + g_object_class_install_property (gobject_class, PROP_FLIP, + g_param_spec_enum ("flip", "Flip State", +@@ -420,7 +424,9 @@ gst_v4l2sink_sync_flip (GstV4l2Sink * v4l2sink) + break; + } + ++#ifdef V4L2_CID_ROTATE + gst_v4l2sink_sync_rotation (v4l2sink); ++#endif + control.id = V4L2_CID_VFLIP; + g_return_if_fail (v4l2_ioctl (fd, VIDIOC_S_CTRL, &control) >= 0); + } +@@ -562,6 +568,7 @@ gst_v4l2sink_sync_crop_fields (GstV4l2Sink * v4l2sink) + } + } + ++#ifdef V4L2_CID_ROTATE + static void + gst_v4l2sink_sync_rotation (GstV4l2Sink * v4l2sink) + { +@@ -575,6 +582,7 @@ gst_v4l2sink_sync_rotation (GstV4l2Sink * v4l2sink) + g_return_if_fail (v4l2_ioctl (fd, VIDIOC_S_CTRL, &control) >= 0); + } + } ++#endif + + + static void +@@ -632,10 +640,12 @@ gst_v4l2sink_set_property (GObject * object, + v4l2sink->crop_fields_set |= RECT_HEIGHT_SET; + gst_v4l2sink_sync_crop_fields (v4l2sink); + break; ++#ifdef V4L2_CID_ROTATE + case PROP_ROTATION: + v4l2sink->rotation = g_value_get_int (value); + gst_v4l2sink_sync_rotation (v4l2sink); + break; ++#endif + case PROP_FLIP: + v4l2sink->flip = g_value_get_enum (value); + gst_v4l2sink_sync_flip (v4l2sink); +@@ -687,9 +697,11 @@ gst_v4l2sink_get_property (GObject * object, + case PROP_CROP_HEIGHT: + g_value_set_uint (value, v4l2sink->crop.height); + break; ++#ifdef V4L2_CID_ROTATE + case PROP_ROTATION: + g_value_set_int (value, v4l2sink->rotation); + break; ++#endif + case PROP_FLIP: + g_value_set_enum (value, v4l2sink->flip); + break; +@@ -715,7 +727,9 @@ gst_v4l2sink_change_state (GstElement * element, GstStateChange transition) + /* open the device */ + if (!gst_v4l2_object_start (v4l2sink->v4l2object)) + return GST_STATE_CHANGE_FAILURE; ++#ifdef V4L2_CID_ROTATE + gst_v4l2sink_sync_rotation (v4l2sink); ++#endif + gst_v4l2sink_sync_flip (v4l2sink); + break; + default: +-- +1.7.1 + diff --git a/media-libs/gst-plugins-good/gst-plugins-good-0.10.27_p20110127.ebuild b/media-libs/gst-plugins-good/gst-plugins-good-0.10.27_p20110127.ebuild new file mode 100644 index 0000000..272f98a --- /dev/null +++ b/media-libs/gst-plugins-good/gst-plugins-good-0.10.27_p20110127.ebuild @@ -0,0 +1,84 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +# order is important, gnome2 after gst-plugins +inherit gst-plugins-good gst-plugins10 gnome2 eutils flag-o-matic libtool + +DESCRIPTION="Set of Good plug-ins for GStreamer" +HOMEPAGE="http://gstreamer.net/" +MY_P=${P%%_*} +SRC_URI="http://gstreamer.freedesktop.org/src/${PN}/${MY_P}.tar.bz2" +S="${WORKDIR}/${MY_P}" + +LICENSE="LGPL-2.1" +KEYWORDS="~alpha ~amd64 arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd" +IUSE="" + +RDEPEND=">=media-libs/gst-plugins-base-0.10.32 + >=media-libs/gstreamer-0.10.32 + >=dev-libs/liboil-0.3.14 + sys-libs/zlib + app-arch/bzip2" +DEPEND="${RDEPEND} + >=sys-devel/gettext-0.11.5 + dev-util/pkgconfig + !<media-libs/gst-plugins-bad-0.10.19" + +# Always enable optional bz2 support for matroska +# Always enable optional zlib support for qtdemux, id3demux and matroska +# Many media files require these to work, as some container headers are often compressed, bug 291154 +GST_PLUGINS_BUILD="bz2 zlib" + +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-Disable-rotation-code-when-not-found.patch +} + +src_compile() { + # gst doesnt handle optimisations well + strip-flags + replace-flags "-O3" "-O2" + filter-flags "-fprefetch-loop-arrays" # see bug 22249 + + gst-plugins-good_src_configure \ + --with-default-audiosink=autoaudiosink \ + --with-default-visualizer=goom + + emake || die "emake failed." +} + +# override eclass +src_install() { + gnome2_src_install +} + +DOCS="AUTHORS ChangeLog NEWS README RELEASE" + +pkg_postinst () { + gnome2_pkg_postinst + + echo + elog "The GStreamer plugins setup has changed quite a bit on Gentoo," + elog "applications now should provide the basic plugins needed." + echo + elog "The new seperate plugins are all named 'gst-plugins-<plugin>'." + elog "To get a listing of currently available plugins execute 'emerge -s gst-plugins-'." + elog "In most cases it shouldn't be needed though to emerge extra plugins." +} + +pkg_postrm() { + gnome2_pkg_postrm +} |