From d2357862f836570e8c9d350ec88f83894c2e68ca Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Thu, 19 Jul 2018 14:58:13 +0200 Subject: [PATCH] Rename request_buffer helper to query_buffer Since the V4L2 ioctl is called QUERYBUF, it makes more sense to call the associated function with the same name. Signed-off-by: Paul Kocialkowski --- src/context.c | 6 +++--- src/surface.c | 10 +++++----- src/v4l2.c | 6 +++--- src/v4l2.h | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/context.c b/src/context.c index 8642d71..3c924c8 100644 --- a/src/context.c +++ b/src/context.c @@ -129,9 +129,9 @@ VAStatus RequestCreateContext(VADriverContextP context, VAConfigID config_id, goto error; } - rc = v4l2_request_buffer(driver_data->video_fd, - V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, i, - &length, &offset, 1); + rc = v4l2_query_buffer(driver_data->video_fd, + V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, i, + &length, &offset, 1); if (rc < 0) { status = VA_STATUS_ERROR_ALLOCATION_FAILED; goto error; diff --git a/src/surface.c b/src/surface.c index b74114f..7e0585a 100644 --- a/src/surface.c +++ b/src/surface.c @@ -103,11 +103,11 @@ VAStatus RequestCreateSurfaces2(VADriverContextP context, unsigned int format, if (surface_object == NULL) return VA_STATUS_ERROR_ALLOCATION_FAILED; - rc = v4l2_request_buffer(driver_data->video_fd, - V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, i, - surface_object->destination_map_lengths, - surface_object->destination_map_offsets, - video_format->v4l2_buffers_count); + rc = v4l2_query_buffer(driver_data->video_fd, + V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, i, + surface_object->destination_map_lengths, + surface_object->destination_map_offsets, + video_format->v4l2_buffers_count); if (rc < 0) return VA_STATUS_ERROR_ALLOCATION_FAILED; diff --git a/src/v4l2.c b/src/v4l2.c index 3e53a77..429e158 100644 --- a/src/v4l2.c +++ b/src/v4l2.c @@ -153,9 +153,9 @@ int v4l2_create_buffers(int video_fd, unsigned int type, return 0; } -int v4l2_request_buffer(int video_fd, unsigned int type, unsigned int index, - unsigned int *lengths, unsigned int *offsets, - unsigned int buffers_count) +int v4l2_query_buffer(int video_fd, unsigned int type, unsigned int index, + unsigned int *lengths, unsigned int *offsets, + unsigned int buffers_count) { struct v4l2_plane planes[buffers_count]; struct v4l2_buffer buffer; diff --git a/src/v4l2.h b/src/v4l2.h index 1d28037..83523a5 100644 --- a/src/v4l2.h +++ b/src/v4l2.h @@ -38,9 +38,9 @@ int v4l2_get_format(int video_fd, unsigned int type, unsigned int *width, unsigned int *sizes, unsigned int *planes_count); int v4l2_create_buffers(int video_fd, unsigned int type, unsigned int buffers_count); -int v4l2_request_buffer(int video_fd, unsigned int type, unsigned int index, - unsigned int *lengths, unsigned int *offsets, - unsigned int buffers_count); +int v4l2_query_buffer(int video_fd, unsigned int type, unsigned int index, + unsigned int *lengths, unsigned int *offsets, + unsigned int buffers_count); int v4l2_queue_buffer(int video_fd, int request_fd, unsigned int type, unsigned int index, unsigned int size, unsigned int buffers_count);