gst-plugins-good:moved into main for pisi 2.0
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
From 4cd9255f0a8a9e15d81561f00f02d275b5095f70 Mon Sep 17 00:00:00 2001
|
||||
From: Oleksij Rempel (Alexey Fisher) <bug-track@fisher-privat.net>
|
||||
Date: Thu, 01 Mar 2012 13:15:29 +0000
|
||||
Subject: v4l2src: fix v4l2_munmap() for compressed formats
|
||||
|
||||
Make sure we always call munmap() with the same size we called mmap()
|
||||
with before.
|
||||
|
||||
Current v4l2src uses the same structure for VIDIOC_QUERYBUF, VIDIOC_QBUF
|
||||
and v4l2_munmap calls. The problem is that the video buffer size (length)
|
||||
may vary for compressed or emulated bufs. VIDIOC_QBUF will change it if
|
||||
we pass the pointer of a v4l2_buffer. This is why we should avoid using
|
||||
same variable for mmap and video buffers.
|
||||
|
||||
https://bugzilla.gnome.org/show_bug.cgi?id=671126
|
||||
---
|
||||
(limited to 'sys/v4l2')
|
||||
|
||||
diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c
|
||||
index b81c6a4..51419ff 100644
|
||||
--- a/sys/v4l2/gstv4l2bufferpool.c
|
||||
+++ b/sys/v4l2/gstv4l2bufferpool.c
|
||||
@@ -106,9 +106,9 @@ gst_v4l2_buffer_finalize (GstV4l2Buffer * buffer)
|
||||
if (!resuscitated) {
|
||||
GST_LOG_OBJECT (pool->v4l2elem,
|
||||
"buffer %p (data %p, len %u) not recovered, unmapping",
|
||||
- buffer, GST_BUFFER_DATA (buffer), buffer->vbuffer.length);
|
||||
+ buffer, GST_BUFFER_DATA (buffer), buffer->mmap_length);
|
||||
gst_mini_object_unref (GST_MINI_OBJECT (pool));
|
||||
- v4l2_munmap ((void *) GST_BUFFER_DATA (buffer), buffer->vbuffer.length);
|
||||
+ v4l2_munmap ((void *) GST_BUFFER_DATA (buffer), buffer->mmap_length);
|
||||
|
||||
GST_MINI_OBJECT_CLASS (v4l2buffer_parent_class)->finalize (GST_MINI_OBJECT
|
||||
(buffer));
|
||||
@@ -183,6 +183,7 @@ gst_v4l2_buffer_new (GstV4l2BufferPool * pool, guint index, GstCaps * caps)
|
||||
GST_LOG_OBJECT (pool->v4l2elem, " length: %u", ret->vbuffer.length);
|
||||
GST_LOG_OBJECT (pool->v4l2elem, " input: %u", ret->vbuffer.input);
|
||||
|
||||
+ ret->mmap_length = ret->vbuffer.length;
|
||||
data = (guint8 *) v4l2_mmap (0, ret->vbuffer.length,
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED, pool->video_fd,
|
||||
ret->vbuffer.m.offset);
|
||||
diff --git a/sys/v4l2/gstv4l2bufferpool.h b/sys/v4l2/gstv4l2bufferpool.h
|
||||
index caad9ac..36ea323 100644
|
||||
--- a/sys/v4l2/gstv4l2bufferpool.h
|
||||
+++ b/sys/v4l2/gstv4l2bufferpool.h
|
||||
@@ -70,6 +70,9 @@ struct _GstV4l2Buffer {
|
||||
GstBuffer buffer;
|
||||
|
||||
struct v4l2_buffer vbuffer;
|
||||
+ /* warning: the size of mmap buffer and
|
||||
+ * the actual frame-buffer can be different. */
|
||||
+ size_t mmap_length;
|
||||
|
||||
/* FIXME: have GstV4l2Src* instead, as this has GstV4l2BufferPool* */
|
||||
/* FIXME: do we really want to fix this if GstV4l2Buffer/Pool is shared
|
||||
--
|
||||
cgit v0.9.0.2-2-gbebe
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
From fa21c0bb253213c9dc48ce72faaf7090dc8a3554 Mon Sep 17 00:00:00 2001
|
||||
From: Colin Walters <walters@verbum.org>
|
||||
Date: Thu, 2 May 2013 16:16:46 -0400
|
||||
Subject: [PATCH] sys/v4l2: Some blind compilation fixes
|
||||
|
||||
---
|
||||
sys/v4l2/gstv4l2bufferpool.c | 1 -
|
||||
sys/v4l2/v4l2_calls.c | 12 ++++--------
|
||||
2 files changed, 4 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c
|
||||
index a0b4c84..3916815 100644
|
||||
--- a/sys/v4l2/gstv4l2bufferpool.c
|
||||
+++ b/sys/v4l2/gstv4l2bufferpool.c
|
||||
@@ -182,7 +182,6 @@ gst_v4l2_buffer_new (GstV4l2BufferPool * pool, guint index, GstCaps * caps)
|
||||
GST_LOG_OBJECT (pool->v4l2elem, " MMAP offset: %u",
|
||||
ret->vbuffer.m.offset);
|
||||
GST_LOG_OBJECT (pool->v4l2elem, " length: %u", ret->vbuffer.length);
|
||||
- GST_LOG_OBJECT (pool->v4l2elem, " input: %u", ret->vbuffer.input);
|
||||
|
||||
ret->mmap_length = ret->vbuffer.length;
|
||||
data = (guint8 *) v4l2_mmap (0, ret->vbuffer.length,
|
||||
diff --git a/sys/v4l2/v4l2_calls.c b/sys/v4l2/v4l2_calls.c
|
||||
index 309bfb6..ee3ff9f 100644
|
||||
--- a/sys/v4l2/v4l2_calls.c
|
||||
+++ b/sys/v4l2/v4l2_calls.c
|
||||
@@ -53,14 +53,6 @@
|
||||
|
||||
#include "gst/gst-i18n-plugin.h"
|
||||
|
||||
-/* Those are ioctl calls */
|
||||
-#ifndef V4L2_CID_HCENTER
|
||||
-#define V4L2_CID_HCENTER V4L2_CID_HCENTER_DEPRECATED
|
||||
-#endif
|
||||
-#ifndef V4L2_CID_VCENTER
|
||||
-#define V4L2_CID_VCENTER V4L2_CID_VCENTER_DEPRECATED
|
||||
-#endif
|
||||
-
|
||||
GST_DEBUG_CATEGORY_EXTERN (v4l2_debug);
|
||||
#define GST_CAT_DEFAULT v4l2_debug
|
||||
|
||||
@@ -294,8 +286,12 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
|
||||
break;
|
||||
case V4L2_CID_HFLIP:
|
||||
case V4L2_CID_VFLIP:
|
||||
+#ifdef V4L2_CID_HCENTER
|
||||
case V4L2_CID_HCENTER:
|
||||
+#endif
|
||||
+#ifdef V4L2_CID_VCENTER
|
||||
case V4L2_CID_VCENTER:
|
||||
+#endif
|
||||
#ifdef V4L2_CID_PAN_RESET
|
||||
case V4L2_CID_PAN_RESET:
|
||||
#endif
|
||||
--
|
||||
1.7.1
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
From 6f707fcbca2c60aed565247567bafdd168980161 Mon Sep 17 00:00:00 2001
|
||||
From: Tim-Philipp Müller <tim.muller@collabora.co.uk>
|
||||
Date: Sat, 03 Mar 2012 13:04:48 +0000
|
||||
Subject: v4l2: clear DISCONT flag when recycling buffers into the buffer pool
|
||||
|
||||
The base class may have set the DISCONT flag on the first buffer pushed
|
||||
out. We need to clear that when recycling buffers back into the buffer
|
||||
pool, otherwise we constantly push out buffers with the discont flag
|
||||
set, which might upset downstream elements, esp. for compressed
|
||||
formats like mpeg-ts.
|
||||
---
|
||||
(limited to 'sys/v4l2')
|
||||
|
||||
diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c
|
||||
index 51419ff..a0b4c84 100644
|
||||
--- a/sys/v4l2/gstv4l2bufferpool.c
|
||||
+++ b/sys/v4l2/gstv4l2bufferpool.c
|
||||
@@ -98,6 +98,7 @@ gst_v4l2_buffer_finalize (GstV4l2Buffer * buffer)
|
||||
GST_LOG_OBJECT (pool->v4l2elem, "reviving buffer %p, %d", buffer, index);
|
||||
gst_buffer_ref (GST_BUFFER (buffer));
|
||||
GST_BUFFER_SIZE (buffer) = 0;
|
||||
+ GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_DISCONT);
|
||||
pool->buffers[index] = buffer;
|
||||
}
|
||||
|
||||
--
|
||||
cgit v0.9.0.2-2-gbebe
|
||||
@@ -0,0 +1,28 @@
|
||||
--- gst-plugins-good-0.10.31/sys/v4l2/gstv4l2object.c 2011-12-30 14:59:13.000000000 +0100
|
||||
+++ gst-plugins-good-0.10.31.fixed/sys/v4l2/gstv4l2object.c 2012-06-05 23:45:16.670981047 +0200
|
||||
@@ -1583,6 +1583,7 @@
|
||||
|
||||
if (ival.type == V4L2_FRMIVAL_TYPE_DISCRETE) {
|
||||
GValue rate = { 0, };
|
||||
+ guint i;
|
||||
|
||||
g_value_init (&rates, GST_TYPE_LIST);
|
||||
g_value_init (&rate, GST_TYPE_FRACTION);
|
||||
@@ -1602,7 +1603,16 @@
|
||||
|
||||
/* swap to get the framerate */
|
||||
gst_value_set_fraction (&rate, denom, num);
|
||||
- gst_value_list_append_value (&rates, &rate);
|
||||
+ /* avoid duplicate framerates, yes some hw reports duplicates :( */
|
||||
+ for (i = 0; i < gst_value_list_get_size(&rates); i++) {
|
||||
+ const GValue *val = gst_value_list_get_value(&rates, i);
|
||||
+ if (gst_value_compare(val, &rate) == GST_VALUE_EQUAL) {
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ if (i == gst_value_list_get_size(&rates)) {
|
||||
+ gst_value_list_append_value(&rates, &rate);
|
||||
+ }
|
||||
|
||||
ival.index++;
|
||||
} while (v4l2_ioctl (fd, VIDIOC_ENUM_FRAMEINTERVALS, &ival) >= 0);
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
From fefa084bde0850447ca5ed84775c094fcf0b2351 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Fri, 8 Jun 2012 20:38:34 +0200
|
||||
Subject: [PATCH] v4l2object: Don't probe UVC devices for being interlaced
|
||||
|
||||
UVC devices are never interlaced, and doing VIDIOC_TRY_FMT on them
|
||||
causes expensive and slow USB IO, so don't probe them for interlaced.
|
||||
|
||||
This shaves 2 seconds of the startup time of cheese with a Logitech
|
||||
Webcam Pro 9000.
|
||||
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
sys/v4l2/gstv4l2object.c | 16 ++++++++++++----
|
||||
1 file changed, 12 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
|
||||
index 6564b91..ce52547 100644
|
||||
--- a/sys/v4l2/gstv4l2object.c
|
||||
+++ b/sys/v4l2/gstv4l2object.c
|
||||
@@ -1561,10 +1561,18 @@ gst_v4l2_object_probe_caps_for_format_and_size (GstV4l2Object * v4l2object,
|
||||
gint int_width = width;
|
||||
gint int_height = height;
|
||||
|
||||
- /* interlaced detection using VIDIOC_TRY/S_FMT */
|
||||
- if (!gst_v4l2_object_get_nearest_size (v4l2object, pixelformat,
|
||||
- &int_width, &int_height, &interlaced))
|
||||
- return NULL;
|
||||
+ if (!strcmp((char *)v4l2object->vcap.driver, "uvcvideo")) {
|
||||
+ /*
|
||||
+ * UVC devices are never interlaced, and doing VIDIOC_TRY_FMT on them
|
||||
+ * causes expensive and slow USB IO, so don't probe them for interlaced
|
||||
+ */
|
||||
+ interlaced = FALSE;
|
||||
+ } else {
|
||||
+ /* Interlaced detection using VIDIOC_TRY/S_FMT */
|
||||
+ if (!gst_v4l2_object_get_nearest_size (v4l2object, pixelformat,
|
||||
+ &int_width, &int_height, &interlaced))
|
||||
+ return NULL;
|
||||
+ }
|
||||
|
||||
memset (&ival, 0, sizeof (struct v4l2_frmivalenum));
|
||||
ival.index = 0;
|
||||
--
|
||||
1.7.10.2
|
||||
|
||||
Reference in New Issue
Block a user