diff --git a/cmd/main.c b/cmd/main.c index 3e69570..bcd39ea 100644 --- a/cmd/main.c +++ b/cmd/main.c @@ -20,11 +20,6 @@ http_method_t http_methods[] = { { NULL, NULL } }; -bool check_streaming() -{ - return http_jpeg_needs_buffer() || http_h264_needs_buffer(); -} - int main(int argc, char *argv[]) { camera_t camera; diff --git a/hw/buffer_list.c b/hw/buffer_list.c index 9e28948..c2851ec 100644 --- a/hw/buffer_list.c +++ b/hw/buffer_list.c @@ -91,6 +91,7 @@ retry: fmt->fmt.pix_mp.field = V4L2_FIELD_ANY; fmt->fmt.pix_mp.num_planes = 1; fmt->fmt.pix_mp.plane_fmt[0].bytesperline = bytesperline; + //fmt->fmt.pix_mp.plane_fmt[0].sizeimage = bytesperline * orig_height; } else { fmt->fmt.pix.colorspace = V4L2_COLORSPACE_RAW; fmt->fmt.pix.width = width; @@ -98,6 +99,7 @@ retry: fmt->fmt.pix.pixelformat = format; fmt->fmt.pix.field = V4L2_FIELD_ANY; fmt->fmt.pix.bytesperline = bytesperline; + //fmt->fmt.pix.sizeimage = bytesperline * orig_height; } E_LOG_DEBUG(buf_list, "Configuring format ..."); @@ -116,7 +118,7 @@ retry: } if (bytesperline > 0 && buf_list->fmt_bytesperline != bytesperline) { - E_LOG_ERROR(buf_list, "Requested bytesperline=%u. Got %ux%u.", + E_LOG_ERROR(buf_list, "Requested bytesperline=%u. Got %u.", bytesperline, buf_list->fmt_bytesperline); } diff --git a/hw/buffer_queue.c b/hw/buffer_queue.c index 9b89a99..464e6ab 100644 --- a/hw/buffer_queue.c +++ b/hw/buffer_queue.c @@ -109,8 +109,9 @@ int buffer_list_enqueue(buffer_list_t *buf_list, buffer_t *dma_buf) if (buf_list->do_mmap) { if (dma_buf->used > buf->length) { - E_LOG_PERROR(buf_list, "The dma_buf (%s) is too long: %zu vs space=%zu", + E_LOG_INFO(buf_list, "The dma_buf (%s) is too long: %zu vs space=%zu", dma_buf->name, dma_buf->used, buf->length); + dma_buf->used = buf->length; } uint64_t before = get_monotonic_time_us(NULL, NULL); diff --git a/hw/links.c b/hw/links.c index ecb37db..a7baf32 100644 --- a/hw/links.c +++ b/hw/links.c @@ -14,13 +14,15 @@ void _update_paused(link_t *all_links) for (int i = n; i-- > 0; ) { link_t *link = &all_links[i]; - bool paused = false; if (!link->capture->capture_list->streaming) { continue; } - if (link->callbacks.check_streaming) { - paused = !link->callbacks.check_streaming(); + + bool paused = true; + + if (link->callbacks.check_streaming && link->callbacks.check_streaming()) { + paused = false; } for (int j = 0; link->outputs[j]; j++) { @@ -34,8 +36,8 @@ void _update_paused(link_t *all_links) } int count_enqueued = buffer_list_count_enqueued(output->output_list); - if (count_enqueued == output->output_list->nbufs) { - paused = true; + if (count_enqueued < output->output_list->nbufs) { + paused = false; } }