Optimise used buffers
This commit is contained in:
parent
1aec989bbc
commit
eca9c43af7
@ -28,7 +28,7 @@ camera_options_t camera_options = {
|
|||||||
.width = 1920,
|
.width = 1920,
|
||||||
.height = 1080,
|
.height = 1080,
|
||||||
.format = 0,
|
.format = 0,
|
||||||
.nbufs = 4,
|
.nbufs = 3,
|
||||||
.fps = 30,
|
.fps = 30,
|
||||||
.allow_dma = true,
|
.allow_dma = true,
|
||||||
.high_res_factor = 1.0,
|
.high_res_factor = 1.0,
|
||||||
|
24
hw/links.c
24
hw/links.c
@ -173,18 +173,6 @@ int links_step(link_t *all_links, int *timeout_ms)
|
|||||||
buf_list->nbufs,
|
buf_list->nbufs,
|
||||||
buf_list->device->paused);
|
buf_list->device->paused);
|
||||||
|
|
||||||
// feed capture queue
|
|
||||||
if (!buf_list->device->paused && buf_list->do_capture && buf_list->do_mmap) {
|
|
||||||
buffer_t *buf;
|
|
||||||
while (buf = buffer_list_find_slot(buf_list)) {
|
|
||||||
int count_enqueued = buffer_list_count_enqueued(buf_list);
|
|
||||||
if (count_enqueued > 1)
|
|
||||||
break;
|
|
||||||
|
|
||||||
buffer_consumed(buf, "enqueued");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fds[i].revents & POLLIN) {
|
if (fds[i].revents & POLLIN) {
|
||||||
if (links_enqueue_from_source(buf_list, link) < 0) {
|
if (links_enqueue_from_source(buf_list, link) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
@ -207,6 +195,18 @@ int links_step(link_t *all_links, int *timeout_ms)
|
|||||||
E_LOG_INFO(buf_list, "Got an error");
|
E_LOG_INFO(buf_list, "Got an error");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// feed capture queue (two buffers max)
|
||||||
|
if (!buf_list->device->paused && buf_list->do_capture && buf_list->do_mmap) {
|
||||||
|
buffer_t *buf;
|
||||||
|
int count_enqueued = buffer_list_count_enqueued(buf_list);
|
||||||
|
if (count_enqueued > 1)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (buf = buffer_list_find_slot(buf_list)) {
|
||||||
|
buffer_consumed(buf, "enqueued");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user