diff --git a/src/config.c b/src/config.c index cacb732..36ad4fa 100644 --- a/src/config.c +++ b/src/config.c @@ -106,7 +106,7 @@ VAStatus SunxiCedrusQueryConfigProfiles(VADriverContextP context, unsigned int index = 0; 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)) { profiles[index++] = VAProfileMPEG2Simple; profiles[index++] = VAProfileMPEG2Main; diff --git a/src/context.c b/src/context.c index ab3cf58..b8788ab 100644 --- a/src/context.c +++ b/src/context.c @@ -77,7 +77,7 @@ VAStatus SunxiCedrusCreateContext(VADriverContextP context, switch (config_object->profile) { case VAProfileMPEG2Simple: case VAProfileMPEG2Main: - pixelformat = V4L2_PIX_FMT_MPEG2_FRAME; + pixelformat = V4L2_PIX_FMT_MPEG2_SLICE; break; default: diff --git a/src/mpeg2.c b/src/mpeg2.c index 7729a80..02f18dc 100644 --- a/src/mpeg2.c +++ b/src/mpeg2.c @@ -39,12 +39,10 @@ int mpeg2_fill_picture_parameters(struct sunxi_cedrus_driver_data *driver_data, struct object_surface *surface_object, 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 *backward_reference_surface; - header->type = MPEG2; - header->width = context_object->picture_width; header->height = context_object->picture_height; diff --git a/src/picture.c b/src/picture.c index f9c559b..58ab79b 100644 --- a/src/picture.c +++ b/src/picture.c @@ -171,7 +171,7 @@ VAStatus SunxiCedrusEndPicture(VADriverContextP context, surface_object->mpeg2_header.slice_pos = 0; 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_size = sizeof(surface_object->mpeg2_header); break; @@ -184,7 +184,7 @@ VAStatus SunxiCedrusEndPicture(VADriverContextP context, if (rc < 0) 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) return VA_STATUS_ERROR_OPERATION_FAILED; diff --git a/src/surface.c b/src/surface.c index aef1d23..5e4bf8a 100644 --- a/src/surface.c +++ b/src/surface.c @@ -180,13 +180,13 @@ VAStatus SunxiCedrusSyncSurface(VADriverContextP context, 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) { status = VA_STATUS_ERROR_OPERATION_FAILED; 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) { status = VA_STATUS_ERROR_OPERATION_FAILED; goto error; diff --git a/src/surface.h b/src/surface.h index ea7486d..0773ff0 100644 --- a/src/surface.h +++ b/src/surface.h @@ -48,7 +48,7 @@ struct object_surface { void *destination_data[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; int request_fd;