mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
v4l2object: Add V4L2_CID_MIN_BUFFERS_FOR_CAPTURE support
https://bugzilla.gnome.org/show_bug.cgi?id=720568
This commit is contained in:
parent
3cf85c9083
commit
d79eea15fa
1 changed files with 9 additions and 0 deletions
|
@ -3146,6 +3146,7 @@ gst_v4l2_object_decide_allocation (GstV4l2Object * obj, GstQuery * query)
|
||||||
GstBufferPool *pool;
|
GstBufferPool *pool;
|
||||||
guint size, min, max;
|
guint size, min, max;
|
||||||
gboolean update;
|
gboolean update;
|
||||||
|
struct v4l2_control ctl = { 0, };
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (obj->element, "decide allocation");
|
GST_DEBUG_OBJECT (obj->element, "decide allocation");
|
||||||
|
|
||||||
|
@ -3173,6 +3174,14 @@ gst_v4l2_object_decide_allocation (GstV4l2Object * obj, GstQuery * query)
|
||||||
min = 2;
|
min = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Certain driver may expose a minimum through controls */
|
||||||
|
ctl.id = V4L2_CID_MIN_BUFFERS_FOR_CAPTURE;
|
||||||
|
if (v4l2_ioctl (obj->video_fd, VIDIOC_G_CTRL, &ctl) >= 0) {
|
||||||
|
GST_DEBUG_OBJECT (obj->element, "driver require a minimum of %d buffers",
|
||||||
|
ctl.value);
|
||||||
|
min += ctl.value;
|
||||||
|
}
|
||||||
|
|
||||||
/* select a pool */
|
/* select a pool */
|
||||||
switch (obj->mode) {
|
switch (obj->mode) {
|
||||||
case GST_V4L2_IO_RW:
|
case GST_V4L2_IO_RW:
|
||||||
|
|
Loading…
Reference in a new issue