From 294a6c958adb429ce0523ddd88eff47ef92b328d Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Wed, 25 Apr 2018 11:03:58 +0200 Subject: [PATCH] Use all-caps macros instead of object_heap_lookup (for now) Signed-off-by: Paul Kocialkowski --- src/context.c | 2 +- src/surface.c | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/context.c b/src/context.c index d9b21f2..34db3a9 100644 --- a/src/context.c +++ b/src/context.c @@ -168,7 +168,7 @@ VAStatus SunxiCedrusDestroyContext(VADriverContextP context, struct object_context *context_object; int rc; - context_object = (struct object_context *) object_heap_lookup(&driver_data->context_heap, context_id); + context_object = CONTEXT(context_id); if (context_object == NULL) return VA_STATUS_ERROR_INVALID_CONTEXT; diff --git a/src/surface.c b/src/surface.c index 860d099..238feef 100644 --- a/src/surface.c +++ b/src/surface.c @@ -68,14 +68,12 @@ VAStatus SunxiCedrusCreateSurfaces(VADriverContextP context, int width, for (i = 0; i < surfaces_count; i++) { id = object_heap_allocate(&driver_data->surface_heap); - surface_object = (struct object_surface *) object_heap_lookup(&driver_data->surface_heap, id); + surface_object = SURFACE(id); if (surface_object == NULL) return VA_STATUS_ERROR_ALLOCATION_FAILED; memset(surface_object, 0, sizeof(*surface_object)); - surfaces_ids[i] = id; - rc = v4l2_request_buffer(driver_data->video_fd, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, i, length, offset); if (rc < 0) return VA_STATUS_ERROR_ALLOCATION_FAILED; @@ -115,7 +113,7 @@ VAStatus SunxiCedrusDestroySurfaces(VADriverContextP context, unsigned int i, j; for (i = 0; i < surfaces_count; i++) { - surface_object = (struct object_surface *) object_heap_lookup(&driver_data->surface_heap, surfaces_ids[i]); + surface_object = SURFACE(surfaces_ids[i]); if (surface_object == NULL) return VA_STATUS_ERROR_INVALID_SURFACE; @@ -184,7 +182,7 @@ VAStatus SunxiCedrusQuerySurfaceStatus(VADriverContextP context, (struct sunxi_cedrus_driver_data *) context->pDriverData; struct object_surface *surface_object; - surface_object = (struct object_surface *) object_heap_lookup(&driver_data->surface_heap, surface_id); + surface_object = SURFACE(surface_id); if (surface_object == NULL) return VA_STATUS_ERROR_INVALID_SURFACE;