Sync with latest definitions from the Cedrus driver and requests API

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
This commit is contained in:
Paul Kocialkowski
2018-06-18 15:07:59 +02:00
parent c0a3cd8fcd
commit bb73d363a3
6 changed files with 8 additions and 10 deletions
+1 -1
View File
@@ -106,7 +106,7 @@ VAStatus SunxiCedrusQueryConfigProfiles(VADriverContextP context,
unsigned int index = 0; unsigned int index = 0;
bool found; bool found;
found = v4l2_find_format(driver_data->video_fd, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, V4L2_PIX_FMT_MPEG2_FRAME); found = v4l2_find_format(driver_data->video_fd, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, V4L2_PIX_FMT_MPEG2_SLICE);
if (found && index < (SUNXI_CEDRUS_MAX_CONFIG_ATTRIBUTES - 2)) { if (found && index < (SUNXI_CEDRUS_MAX_CONFIG_ATTRIBUTES - 2)) {
profiles[index++] = VAProfileMPEG2Simple; profiles[index++] = VAProfileMPEG2Simple;
profiles[index++] = VAProfileMPEG2Main; profiles[index++] = VAProfileMPEG2Main;
+1 -1
View File
@@ -77,7 +77,7 @@ VAStatus SunxiCedrusCreateContext(VADriverContextP context,
switch (config_object->profile) { switch (config_object->profile) {
case VAProfileMPEG2Simple: case VAProfileMPEG2Simple:
case VAProfileMPEG2Main: case VAProfileMPEG2Main:
pixelformat = V4L2_PIX_FMT_MPEG2_FRAME; pixelformat = V4L2_PIX_FMT_MPEG2_SLICE;
break; break;
default: default:
+1 -3
View File
@@ -39,12 +39,10 @@ int mpeg2_fill_picture_parameters(struct sunxi_cedrus_driver_data *driver_data,
struct object_surface *surface_object, struct object_surface *surface_object,
VAPictureParameterBufferMPEG2 *parameters) VAPictureParameterBufferMPEG2 *parameters)
{ {
struct v4l2_ctrl_mpeg2_frame_hdr *header = &surface_object->mpeg2_header; struct v4l2_ctrl_mpeg2_slice_header *header = &surface_object->mpeg2_header;
struct object_surface *forward_reference_surface; struct object_surface *forward_reference_surface;
struct object_surface *backward_reference_surface; struct object_surface *backward_reference_surface;
header->type = MPEG2;
header->width = context_object->picture_width; header->width = context_object->picture_width;
header->height = context_object->picture_height; header->height = context_object->picture_height;
+2 -2
View File
@@ -171,7 +171,7 @@ VAStatus SunxiCedrusEndPicture(VADriverContextP context,
surface_object->mpeg2_header.slice_pos = 0; surface_object->mpeg2_header.slice_pos = 0;
surface_object->mpeg2_header.slice_len = surface_object->slices_size * 8; surface_object->mpeg2_header.slice_len = surface_object->slices_size * 8;
control_id = V4L2_CID_MPEG_VIDEO_MPEG2_FRAME_HDR; control_id = V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_HEADER;
control_data = &surface_object->mpeg2_header; control_data = &surface_object->mpeg2_header;
control_size = sizeof(surface_object->mpeg2_header); control_size = sizeof(surface_object->mpeg2_header);
break; break;
@@ -184,7 +184,7 @@ VAStatus SunxiCedrusEndPicture(VADriverContextP context,
if (rc < 0) if (rc < 0)
return VA_STATUS_ERROR_OPERATION_FAILED; return VA_STATUS_ERROR_OPERATION_FAILED;
rc = v4l2_queue_buffer(driver_data->video_fd, request_fd, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, surface_object->destination_index, 0); rc = v4l2_queue_buffer(driver_data->video_fd, -1, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, surface_object->destination_index, 0);
if (rc < 0) if (rc < 0)
return VA_STATUS_ERROR_OPERATION_FAILED; return VA_STATUS_ERROR_OPERATION_FAILED;
+2 -2
View File
@@ -180,13 +180,13 @@ VAStatus SunxiCedrusSyncSurface(VADriverContextP context,
goto error; goto error;
} }
rc = v4l2_dequeue_buffer(driver_data->video_fd, request_fd, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, surface_object->source_index); rc = v4l2_dequeue_buffer(driver_data->video_fd, -1, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, surface_object->source_index);
if (rc < 0) { if (rc < 0) {
status = VA_STATUS_ERROR_OPERATION_FAILED; status = VA_STATUS_ERROR_OPERATION_FAILED;
goto error; goto error;
} }
rc = v4l2_dequeue_buffer(driver_data->video_fd, request_fd, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, surface_object->destination_index); rc = v4l2_dequeue_buffer(driver_data->video_fd, -1, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, surface_object->destination_index);
if (rc < 0) { if (rc < 0) {
status = VA_STATUS_ERROR_OPERATION_FAILED; status = VA_STATUS_ERROR_OPERATION_FAILED;
goto error; goto error;
+1 -1
View File
@@ -48,7 +48,7 @@ struct object_surface {
void *destination_data[2]; void *destination_data[2];
unsigned int destination_size[2]; unsigned int destination_size[2];
struct v4l2_ctrl_mpeg2_frame_hdr mpeg2_header; struct v4l2_ctrl_mpeg2_slice_header mpeg2_header;
unsigned int slices_size; unsigned int slices_size;
int request_fd; int request_fd;