Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix v6.8 renamed symbols #84

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/buffers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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;
}
Expand Down Expand Up @@ -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)
Expand Down
Loading