context: Use object context structure directly instead of abstract type

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
This commit is contained in:
Paul Kocialkowski
2018-04-23 10:04:58 +02:00
parent 5c26862913
commit 6a06b4570b
8 changed files with 17 additions and 19 deletions
+1 -1
View File
@@ -80,7 +80,7 @@ VAStatus sunxi_cedrus_CreateBuffer(VADriverContextP ctx, VAContextID context,
obj_buffer->map_size = 0; obj_buffer->map_size = 0;
if(obj_buffer->type == VASliceDataBufferType) { if(obj_buffer->type == VASliceDataBufferType) {
object_context_p obj_context; struct object_context *obj_context;
obj_context = CONTEXT(context); obj_context = CONTEXT(context);
assert(obj_context); assert(obj_context);
+2 -2
View File
@@ -65,7 +65,7 @@ VAStatus sunxi_cedrus_CreateContext(VADriverContextP ctx, VAConfigID config_id,
} }
int contextID = object_heap_allocate(&driver_data->context_heap); 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) if (NULL == obj_context)
{ {
vaStatus = VA_STATUS_ERROR_ALLOCATION_FAILED; 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) VAStatus sunxi_cedrus_DestroyContext(VADriverContextP ctx, VAContextID context)
{ {
INIT_DRIVER_DATA INIT_DRIVER_DATA
object_context_p obj_context = CONTEXT(context); struct object_context *obj_context = CONTEXT(context);
assert(obj_context); assert(obj_context);
enum v4l2_buf_type type; enum v4l2_buf_type type;
+1 -3
View File
@@ -36,7 +36,7 @@
#define INPUT_BUFFER_MAX_SIZE 131072 #define INPUT_BUFFER_MAX_SIZE 131072
#define INPUT_BUFFERS_NB 6 #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 #define CONTEXT_ID_OFFSET 0x02000000
struct object_context { struct object_context {
@@ -55,8 +55,6 @@ struct object_context {
struct v4l2_ctrl_mpeg4_frame_hdr mpeg4_frame_hdr; 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, VAStatus sunxi_cedrus_CreateContext(VADriverContextP ctx, VAConfigID config_id,
int picture_width, int picture_height, int flag, int picture_width, int picture_height, int flag,
VASurfaceID *render_targets, int num_render_targets, VASurfaceID *render_targets, int num_render_targets,
+2 -2
View File
@@ -40,7 +40,7 @@
*/ */
VAStatus sunxi_cedrus_render_mpeg2_slice_data(VADriverContextP ctx, 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) struct object_buffer *obj_buffer)
{ {
INIT_DRIVER_DATA 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, 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) struct object_buffer *obj_buffer)
{ {
INIT_DRIVER_DATA INIT_DRIVER_DATA
+2 -2
View File
@@ -34,11 +34,11 @@
#include "surface.h" #include "surface.h"
VAStatus sunxi_cedrus_render_mpeg2_slice_data(VADriverContextP ctx, 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); struct object_buffer *obj_buffer);
VAStatus sunxi_cedrus_render_mpeg2_picture_parameter(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); struct object_buffer *obj_buffer);
#endif /* _MPEG2_H_ */ #endif /* _MPEG2_H_ */
+3 -3
View File
@@ -40,7 +40,7 @@
*/ */
VAStatus sunxi_cedrus_render_mpeg4_slice_data(VADriverContextP ctx, 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) struct object_buffer *obj_buffer)
{ {
INIT_DRIVER_DATA 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, 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) struct object_buffer *obj_buffer)
{ {
INIT_DRIVER_DATA 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, 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) struct object_buffer *obj_buffer)
{ {
VASliceParameterBufferMPEG4 *slice_param = (VASliceParameterBufferMPEG4 *)obj_buffer->buffer_data; VASliceParameterBufferMPEG4 *slice_param = (VASliceParameterBufferMPEG4 *)obj_buffer->buffer_data;
+3 -3
View File
@@ -34,15 +34,15 @@
#include "surface.h" #include "surface.h"
VAStatus sunxi_cedrus_render_mpeg4_slice_data(VADriverContextP ctx, 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); struct object_buffer *obj_buffer);
VAStatus sunxi_cedrus_render_mpeg4_picture_parameter(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); struct object_buffer *obj_buffer);
VAStatus sunxi_cedrus_render_mpeg4_slice_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); struct object_buffer *obj_buffer);
#endif /* _MPEG4_H_ */ #endif /* _MPEG4_H_ */
+3 -3
View File
@@ -55,7 +55,7 @@ VAStatus sunxi_cedrus_BeginPicture(VADriverContextP ctx, VAContextID context,
{ {
INIT_DRIVER_DATA INIT_DRIVER_DATA
VAStatus vaStatus = VA_STATUS_SUCCESS; VAStatus vaStatus = VA_STATUS_SUCCESS;
object_context_p obj_context; struct object_context *obj_context;
object_surface_p obj_surface; object_surface_p obj_surface;
obj_context = CONTEXT(context); obj_context = CONTEXT(context);
@@ -85,7 +85,7 @@ VAStatus sunxi_cedrus_RenderPicture(VADriverContextP ctx, VAContextID context,
{ {
INIT_DRIVER_DATA INIT_DRIVER_DATA
VAStatus vaStatus = VA_STATUS_SUCCESS; VAStatus vaStatus = VA_STATUS_SUCCESS;
object_context_p obj_context; struct object_context *obj_context;
object_surface_p obj_surface; object_surface_p obj_surface;
object_config_p obj_config; object_config_p obj_config;
int i; int i;
@@ -144,7 +144,7 @@ VAStatus sunxi_cedrus_EndPicture(VADriverContextP ctx, VAContextID context)
{ {
INIT_DRIVER_DATA INIT_DRIVER_DATA
VAStatus vaStatus = VA_STATUS_SUCCESS; VAStatus vaStatus = VA_STATUS_SUCCESS;
object_context_p obj_context; struct object_context *obj_context;
object_surface_p obj_surface; object_surface_p obj_surface;
struct v4l2_buffer out_buf, cap_buf; struct v4l2_buffer out_buf, cap_buf;
struct v4l2_plane plane[1]; struct v4l2_plane plane[1];