109 lines
3.9 KiB
Diff
109 lines
3.9 KiB
Diff
|
From 547ed9cdc5a3094f3d868718f8e81a9efb410773 Mon Sep 17 00:00:00 2001
|
||
|
From: Jia Rong <jia.rong@mediatek.com>
|
||
|
Date: Tue, 19 Sep 2017 09:50:38 +0800
|
||
|
Subject: [PATCH] v4l2: remove get camera link number feature
|
||
|
|
||
|
---
|
||
|
sys/v4l2/gstv4l2bufferpool.c | 8 --------
|
||
|
sys/v4l2/gstv4l2object.c | 27 ++-------------------------
|
||
|
sys/v4l2/gstv4l2object.h | 1 -
|
||
|
3 files changed, 2 insertions(+), 34 deletions(-)
|
||
|
|
||
|
diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c
|
||
|
index 66a7551..135d12b 100644
|
||
|
--- a/sys/v4l2/gstv4l2bufferpool.c
|
||
|
+++ b/sys/v4l2/gstv4l2bufferpool.c
|
||
|
@@ -1216,7 +1216,6 @@ gst_v4l2_buffer_pool_dqbuf (GstV4l2BufferPool * pool, GstBuffer ** buffer)
|
||
|
GstClockTime timestamp;
|
||
|
GstV4l2MemoryGroup *group;
|
||
|
gint i;
|
||
|
- gint *index = NULL;
|
||
|
|
||
|
if ((res = gst_v4l2_buffer_pool_poll (pool)) != GST_FLOW_OK)
|
||
|
goto poll_failed;
|
||
|
@@ -1338,13 +1337,6 @@ gst_v4l2_buffer_pool_dqbuf (GstV4l2BufferPool * pool, GstBuffer ** buffer)
|
||
|
|
||
|
done:
|
||
|
*buffer = outbuf;
|
||
|
- if (obj->link > 1) {
|
||
|
- index = g_slice_new0 (gint);
|
||
|
- *index = group->buffer.index;
|
||
|
- gst_mini_object_set_qdata (GST_MINI_OBJECT (*buffer), GST_MTK_AVM_INDEX,
|
||
|
- index, (GDestroyNotify) gst_destroy_mtk_avm_index);
|
||
|
- GST_INFO("add index=%p *index=%d to *buf %p", index, *index, *buffer);
|
||
|
- }
|
||
|
|
||
|
return GST_FLOW_OK;
|
||
|
|
||
|
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
|
||
|
index 6d10400..d0e94bb 100644
|
||
|
--- a/sys/v4l2/gstv4l2object.c
|
||
|
+++ b/sys/v4l2/gstv4l2object.c
|
||
|
@@ -802,23 +802,7 @@ gst_v4l2_get_driver_min_buffers (GstV4l2Object * v4l2object)
|
||
|
"driver requires a minimum of %d buffers", control.value);
|
||
|
v4l2object->min_buffers = control.value;
|
||
|
} else {
|
||
|
- struct v4l2_streamparm streamparm;
|
||
|
- guint link = 0;
|
||
|
-
|
||
|
- memset (&streamparm, 0x00, sizeof (struct v4l2_streamparm));
|
||
|
- streamparm.type = v4l2object->type;
|
||
|
-
|
||
|
- if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_G_PARM, &streamparm) >= 0) {
|
||
|
- link = streamparm.parm.capture.reserved[0];
|
||
|
- v4l2object->link = v4l2object->link > 0 ? v4l2object->link : link;
|
||
|
- v4l2object->min_buffers = link * 2;
|
||
|
-
|
||
|
- GST_DEBUG_OBJECT (v4l2object->element,
|
||
|
- "%d camera linked. set min_buffers to %d", link, v4l2object->min_buffers);
|
||
|
- } else {
|
||
|
- GST_DEBUG_OBJECT (v4l2object->element, "set min_buffers to 0");
|
||
|
- v4l2object->min_buffers = 0;
|
||
|
- }
|
||
|
+ v4l2object->min_buffers = 0;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@@ -3503,7 +3487,6 @@ gst_v4l2_object_set_format_full (GstV4l2Object * v4l2object, GstCaps * caps,
|
||
|
GST_VIDEO_INFO_FPS_N (&info) =
|
||
|
streamparm.parm.capture.timeperframe.denominator;
|
||
|
GST_VIDEO_INFO_FPS_D (&info) = streamparm.parm.capture.timeperframe.numerator;
|
||
|
- v4l2object->link = streamparm.parm.capture.reserved[0];
|
||
|
|
||
|
if (v4l2object->type == V4L2_BUF_TYPE_VIDEO_CAPTURE
|
||
|
|| v4l2object->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
|
||
|
@@ -4079,17 +4062,11 @@ gst_v4l2_object_decide_allocation (GstV4l2Object * obj, GstQuery * query)
|
||
|
* driver and 1 more, so we don't endup up with everything downstream or
|
||
|
* held by the decoder. */
|
||
|
own_min = min + obj->min_buffers + 1;
|
||
|
- if (obj->link) {
|
||
|
- own_min = obj->min_buffers + obj->link;
|
||
|
- GST_DEBUG_OBJECT (obj->element, "own_min = %d link=%d", own_min, obj->link);
|
||
|
- }
|
||
|
|
||
|
/* If no allocation parameters where provided, allow for a little more
|
||
|
* buffers and enable copy threshold */
|
||
|
if (!update) {
|
||
|
- if (obj->link <= 1) {
|
||
|
- own_min += 3;
|
||
|
- }
|
||
|
+ own_min += 3;
|
||
|
gst_v4l2_buffer_pool_copy_at_threshold (GST_V4L2_BUFFER_POOL (pool),
|
||
|
TRUE);
|
||
|
} else {
|
||
|
diff --git a/sys/v4l2/gstv4l2object.h b/sys/v4l2/gstv4l2object.h
|
||
|
index 8c5cb06..0fca419 100644
|
||
|
--- a/sys/v4l2/gstv4l2object.h
|
||
|
+++ b/sys/v4l2/gstv4l2object.h
|
||
|
@@ -166,7 +166,6 @@ struct _GstV4l2Object {
|
||
|
GstStructure *extra_controls;
|
||
|
gboolean keep_aspect;
|
||
|
GValue *par;
|
||
|
- guint link;
|
||
|
|
||
|
/* X-overlay */
|
||
|
GstV4l2Xv *xv;
|
||
|
--
|
||
|
1.9.1
|
||
|
|