Always clear v4l2_plane before sending them to the kernel
This commit is contained in:
@@ -52,6 +52,8 @@ VAStatus sunxi_cedrus_CreateBuffer(VADriverContextP ctx, VAContextID context,
|
||||
struct v4l2_plane plane[1];
|
||||
object_buffer_p obj_buffer;
|
||||
|
||||
memset(plane, 0, sizeof(struct v4l2_plane));
|
||||
|
||||
/* Validate type */
|
||||
switch (type)
|
||||
{
|
||||
|
||||
@@ -48,6 +48,8 @@ VAStatus sunxi_cedrus_render_mpeg2_slice_data(VADriverContextP ctx,
|
||||
struct v4l2_buffer buf;
|
||||
struct v4l2_plane plane[1];
|
||||
|
||||
memset(plane, 0, sizeof(struct v4l2_plane));
|
||||
|
||||
/* Query */
|
||||
memset(&(buf), 0, sizeof(buf));
|
||||
buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
|
||||
|
||||
@@ -48,6 +48,8 @@ VAStatus sunxi_cedrus_render_mpeg4_slice_data(VADriverContextP ctx,
|
||||
struct v4l2_buffer buf;
|
||||
struct v4l2_plane plane[1];
|
||||
|
||||
memset(plane, 0, sizeof(struct v4l2_plane));
|
||||
|
||||
/* Query */
|
||||
memset(&(buf), 0, sizeof(buf));
|
||||
buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
|
||||
|
||||
@@ -170,6 +170,9 @@ VAStatus sunxi_cedrus_EndPicture(VADriverContextP ctx, VAContextID context)
|
||||
* order the different RenderPicture will be called.
|
||||
*/
|
||||
|
||||
memset(plane, 0, sizeof(struct v4l2_plane));
|
||||
memset(planes, 0, 2 * sizeof(struct v4l2_plane));
|
||||
|
||||
memset(&(out_buf), 0, sizeof(out_buf));
|
||||
out_buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
|
||||
out_buf.memory = V4L2_MEMORY_MMAP;
|
||||
|
||||
+6
-1
@@ -63,6 +63,8 @@ VAStatus sunxi_cedrus_CreateSurfaces(VADriverContextP ctx, int width,
|
||||
struct v4l2_create_buffers create_bufs;
|
||||
struct v4l2_format fmt;
|
||||
|
||||
memset(planes, 0, 2 * sizeof(struct v4l2_plane));
|
||||
|
||||
/* We only support one format */
|
||||
if (VA_RT_FORMAT_YUV420 != format)
|
||||
return VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT;
|
||||
@@ -160,9 +162,13 @@ VAStatus sunxi_cedrus_SyncSurface(VADriverContextP ctx,
|
||||
object_surface_p obj_surface;
|
||||
struct v4l2_buffer buf;
|
||||
struct v4l2_plane plane[1];
|
||||
struct v4l2_plane planes[2];
|
||||
fd_set read_fds;
|
||||
struct timeval tv = {0, 300000};
|
||||
|
||||
memset(plane, 0, sizeof(struct v4l2_plane));
|
||||
memset(planes, 0, 2 * sizeof(struct v4l2_plane));
|
||||
|
||||
obj_surface = SURFACE(render_target);
|
||||
assert(obj_surface);
|
||||
|
||||
@@ -186,7 +192,6 @@ VAStatus sunxi_cedrus_SyncSurface(VADriverContextP ctx,
|
||||
}
|
||||
|
||||
memset(&(buf), 0, sizeof(buf));
|
||||
struct v4l2_plane planes[2];
|
||||
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
|
||||
buf.memory = V4L2_MEMORY_MMAP;
|
||||
buf.index = obj_surface->output_buf_index;
|
||||
|
||||
Reference in New Issue
Block a user