WIP
This commit is contained in:
parent
6b846188d2
commit
e7947bf064
@ -157,6 +157,7 @@ int buffer_list_stream(buffer_list_t *buf_list, bool do_on)
|
|||||||
enum v4l2_buf_type type = buf_list->type;
|
enum v4l2_buf_type type = buf_list->type;
|
||||||
|
|
||||||
E_XIOCTL(buf_list, buf_list->device->fd, do_on ? VIDIOC_STREAMON : VIDIOC_STREAMOFF, &type, "Cannot set streaming state");
|
E_XIOCTL(buf_list, buf_list->device->fd, do_on ? VIDIOC_STREAMON : VIDIOC_STREAMOFF, &type, "Cannot set streaming state");
|
||||||
|
buf_list->streaming = do_on;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ typedef struct buffer_list_s {
|
|||||||
|
|
||||||
unsigned fmt_width, fmt_height, fmt_format;
|
unsigned fmt_width, fmt_height, fmt_format;
|
||||||
|
|
||||||
|
bool streaming;
|
||||||
int frames;
|
int frames;
|
||||||
} buffer_list_t;
|
} buffer_list_t;
|
||||||
|
|
||||||
|
14
links.c
14
links.c
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
int _build_fds(link_t *all_links, struct pollfd *fds, link_t **links, buffer_list_t **buf_lists, int max_n)
|
int _build_fds(link_t *all_links, struct pollfd *fds, link_t **links, buffer_list_t **buf_lists, int max_n)
|
||||||
{
|
{
|
||||||
int n;
|
int n = 0;
|
||||||
|
|
||||||
for (int i = 0; all_links[i].capture; i++) {
|
for (int i = 0; all_links[i].capture; i++) {
|
||||||
link_t *link = &all_links[i];
|
link_t *link = &all_links[i];
|
||||||
@ -18,6 +18,9 @@ int _build_fds(link_t *all_links, struct pollfd *fds, link_t **links, buffer_lis
|
|||||||
if (!link->capture->capture_list->do_mmap) {
|
if (!link->capture->capture_list->do_mmap) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!link->capture->capture_list->streaming) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
struct pollfd fd = {link->capture->fd, POLLIN};
|
struct pollfd fd = {link->capture->fd, POLLIN};
|
||||||
fds[n] = fd;
|
fds[n] = fd;
|
||||||
@ -34,6 +37,9 @@ int _build_fds(link_t *all_links, struct pollfd *fds, link_t **links, buffer_lis
|
|||||||
if (output->output_list->do_mmap) {
|
if (output->output_list->do_mmap) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!output->output_list->streaming) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
struct pollfd fd = {output->fd, POLLOUT};
|
struct pollfd fd = {output->fd, POLLOUT};
|
||||||
fds[n] = fd;
|
fds[n] = fd;
|
||||||
@ -92,6 +98,12 @@ int links_stream(link_t *all_links, bool do_stream)
|
|||||||
if (device_stream(all_links[i].capture, true) < 0) {
|
if (device_stream(all_links[i].capture, true) < 0) {
|
||||||
E_LOG_ERROR(all_links[i].capture, "Failed to start streaming");
|
E_LOG_ERROR(all_links[i].capture, "Failed to start streaming");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int j = 0; all_links[i].outputs[j]; j++) {
|
||||||
|
if (device_stream(all_links[i].outputs[j], true) < 0) {
|
||||||
|
E_LOG_ERROR(all_links[i].outputs[j], "Failed to start streaming");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user