diff --git a/src/buffers.c b/src/buffers.c index 3da36df..54f704a 100644 --- a/src/buffers.c +++ b/src/buffers.c @@ -67,6 +67,12 @@ void akvcam_buffers_buffer_queue(struct vb2_buffer *buffer); int akvcam_buffers_start_streaming(struct vb2_queue *queue, unsigned int count); void akvcam_buffers_stop_streaming(struct vb2_queue *queue); +#if LINUX_VERSION_CODE < KERNEL_VERSION( 6, 8, 0) +#define V4L2_MIN_QUEUED_BUFFERS min_buffers_needed +#else +#define V4L2_MIN_QUEUED_BUFFERS min_queued_buffers +#endif + akvcam_buffers_t akvcam_buffers_new(AKVCAM_RW_MODE rw_mode, enum v4l2_buf_type type) { @@ -89,7 +95,7 @@ akvcam_buffers_t akvcam_buffers_new(AKVCAM_RW_MODE rw_mode, self->queue.mem_ops = &vb2_vmalloc_memops; self->queue.ops = &akvcam_akvcam_buffers_queue_ops; self->queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - self->queue.min_buffers_needed = AKVCAM_BUFFERS_MIN; + self->queue.V4L2_MIN_QUEUED_BUFFERS = AKVCAM_BUFFERS_MIN; return self; } @@ -127,12 +133,12 @@ void akvcam_buffers_set_format(akvcam_buffers_t self, akvcam_format_ct format) size_t akvcam_buffers_count(akvcam_buffers_ct self) { - return self->queue.min_buffers_needed; + return self->queue.V4L2_MIN_QUEUED_BUFFERS; } void akvcam_buffers_set_count(akvcam_buffers_t self, size_t nbuffers) { - self->queue.min_buffers_needed = nbuffers; + self->queue.V4L2_MIN_QUEUED_BUFFERS = nbuffers; } akvcam_frame_t akvcam_buffers_read_frame(akvcam_buffers_t self)