From 6a06b4570b2210df5ccb6cb6cd7dbd823c879f21 Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Mon, 23 Apr 2018 10:04:58 +0200 Subject: [PATCH] context: Use object context structure directly instead of abstract type Signed-off-by: Paul Kocialkowski --- src/buffer.c | 2 +- src/context.c | 4 ++-- src/context.h | 4 +--- src/mpeg2.c | 4 ++-- src/mpeg2.h | 4 ++-- src/mpeg4.c | 6 +++--- src/mpeg4.h | 6 +++--- src/picture.c | 6 +++--- 8 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/buffer.c b/src/buffer.c index ef2e598..df6398f 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -80,7 +80,7 @@ VAStatus sunxi_cedrus_CreateBuffer(VADriverContextP ctx, VAContextID context, obj_buffer->map_size = 0; if(obj_buffer->type == VASliceDataBufferType) { - object_context_p obj_context; + struct object_context *obj_context; obj_context = CONTEXT(context); assert(obj_context); diff --git a/src/context.c b/src/context.c index 80772d9..af8c54c 100644 --- a/src/context.c +++ b/src/context.c @@ -65,7 +65,7 @@ VAStatus sunxi_cedrus_CreateContext(VADriverContextP ctx, VAConfigID config_id, } int contextID = object_heap_allocate(&driver_data->context_heap); - object_context_p obj_context = CONTEXT(contextID); + struct object_context *obj_context = CONTEXT(contextID); if (NULL == obj_context) { vaStatus = VA_STATUS_ERROR_ALLOCATION_FAILED; @@ -154,7 +154,7 @@ VAStatus sunxi_cedrus_CreateContext(VADriverContextP ctx, VAConfigID config_id, VAStatus sunxi_cedrus_DestroyContext(VADriverContextP ctx, VAContextID context) { INIT_DRIVER_DATA - object_context_p obj_context = CONTEXT(context); + struct object_context *obj_context = CONTEXT(context); assert(obj_context); enum v4l2_buf_type type; diff --git a/src/context.h b/src/context.h index 550c9db..065ec2a 100644 --- a/src/context.h +++ b/src/context.h @@ -36,7 +36,7 @@ #define INPUT_BUFFER_MAX_SIZE 131072 #define INPUT_BUFFERS_NB 6 -#define CONTEXT(id) ((object_context_p) object_heap_lookup(&driver_data->context_heap, id)) +#define CONTEXT(id) ((struct object_context *) object_heap_lookup(&driver_data->context_heap, id)) #define CONTEXT_ID_OFFSET 0x02000000 struct object_context { @@ -55,8 +55,6 @@ struct object_context { struct v4l2_ctrl_mpeg4_frame_hdr mpeg4_frame_hdr; }; -typedef struct object_context *object_context_p; - VAStatus sunxi_cedrus_CreateContext(VADriverContextP ctx, VAConfigID config_id, int picture_width, int picture_height, int flag, VASurfaceID *render_targets, int num_render_targets, diff --git a/src/mpeg2.c b/src/mpeg2.c index abe500f..8c94f50 100644 --- a/src/mpeg2.c +++ b/src/mpeg2.c @@ -40,7 +40,7 @@ */ VAStatus sunxi_cedrus_render_mpeg2_slice_data(VADriverContextP ctx, - object_context_p obj_context, object_surface_p obj_surface, + struct object_context *obj_context, object_surface_p obj_surface, struct object_buffer *obj_buffer) { INIT_DRIVER_DATA @@ -53,7 +53,7 @@ VAStatus sunxi_cedrus_render_mpeg2_slice_data(VADriverContextP ctx, } VAStatus sunxi_cedrus_render_mpeg2_picture_parameter(VADriverContextP ctx, - object_context_p obj_context, object_surface_p obj_surface, + struct object_context *obj_context, object_surface_p obj_surface, struct object_buffer *obj_buffer) { INIT_DRIVER_DATA diff --git a/src/mpeg2.h b/src/mpeg2.h index e10bd9e..af29653 100644 --- a/src/mpeg2.h +++ b/src/mpeg2.h @@ -34,11 +34,11 @@ #include "surface.h" VAStatus sunxi_cedrus_render_mpeg2_slice_data(VADriverContextP ctx, - object_context_p obj_context, object_surface_p obj_surface, + struct object_context *obj_context, object_surface_p obj_surface, struct object_buffer *obj_buffer); VAStatus sunxi_cedrus_render_mpeg2_picture_parameter(VADriverContextP ctx, - object_context_p obj_context, object_surface_p obj_surface, + struct object_context *obj_context, object_surface_p obj_surface, struct object_buffer *obj_buffer); #endif /* _MPEG2_H_ */ diff --git a/src/mpeg4.c b/src/mpeg4.c index 1c2d391..a8143d2 100644 --- a/src/mpeg4.c +++ b/src/mpeg4.c @@ -40,7 +40,7 @@ */ VAStatus sunxi_cedrus_render_mpeg4_slice_data(VADriverContextP ctx, - object_context_p obj_context, object_surface_p obj_surface, + struct object_context *obj_context, object_surface_p obj_surface, struct object_buffer *obj_buffer) { INIT_DRIVER_DATA @@ -71,7 +71,7 @@ VAStatus sunxi_cedrus_render_mpeg4_slice_data(VADriverContextP ctx, } VAStatus sunxi_cedrus_render_mpeg4_picture_parameter(VADriverContextP ctx, - object_context_p obj_context, object_surface_p obj_surface, + struct object_context *obj_context, object_surface_p obj_surface, struct object_buffer *obj_buffer) { INIT_DRIVER_DATA @@ -122,7 +122,7 @@ VAStatus sunxi_cedrus_render_mpeg4_picture_parameter(VADriverContextP ctx, } VAStatus sunxi_cedrus_render_mpeg4_slice_parameter(VADriverContextP ctx, - object_context_p obj_context, object_surface_p obj_surface, + struct object_context *obj_context, object_surface_p obj_surface, struct object_buffer *obj_buffer) { VASliceParameterBufferMPEG4 *slice_param = (VASliceParameterBufferMPEG4 *)obj_buffer->buffer_data; diff --git a/src/mpeg4.h b/src/mpeg4.h index 2d1576b..d66a1a8 100644 --- a/src/mpeg4.h +++ b/src/mpeg4.h @@ -34,15 +34,15 @@ #include "surface.h" VAStatus sunxi_cedrus_render_mpeg4_slice_data(VADriverContextP ctx, - object_context_p obj_context, object_surface_p obj_surface, + struct object_context *obj_context, object_surface_p obj_surface, struct object_buffer *obj_buffer); VAStatus sunxi_cedrus_render_mpeg4_picture_parameter(VADriverContextP ctx, - object_context_p obj_context, object_surface_p obj_surface, + struct object_context *obj_context, object_surface_p obj_surface, struct object_buffer *obj_buffer); VAStatus sunxi_cedrus_render_mpeg4_slice_parameter(VADriverContextP ctx, - object_context_p obj_context, object_surface_p obj_surface, + struct object_context *obj_context, object_surface_p obj_surface, struct object_buffer *obj_buffer); #endif /* _MPEG4_H_ */ diff --git a/src/picture.c b/src/picture.c index dbc1e2b..9018970 100644 --- a/src/picture.c +++ b/src/picture.c @@ -55,7 +55,7 @@ VAStatus sunxi_cedrus_BeginPicture(VADriverContextP ctx, VAContextID context, { INIT_DRIVER_DATA VAStatus vaStatus = VA_STATUS_SUCCESS; - object_context_p obj_context; + struct object_context *obj_context; object_surface_p obj_surface; obj_context = CONTEXT(context); @@ -85,7 +85,7 @@ VAStatus sunxi_cedrus_RenderPicture(VADriverContextP ctx, VAContextID context, { INIT_DRIVER_DATA VAStatus vaStatus = VA_STATUS_SUCCESS; - object_context_p obj_context; + struct object_context *obj_context; object_surface_p obj_surface; object_config_p obj_config; int i; @@ -144,7 +144,7 @@ VAStatus sunxi_cedrus_EndPicture(VADriverContextP ctx, VAContextID context) { INIT_DRIVER_DATA VAStatus vaStatus = VA_STATUS_SUCCESS; - object_context_p obj_context; + struct object_context *obj_context; object_surface_p obj_surface; struct v4l2_buffer out_buf, cap_buf; struct v4l2_plane plane[1];