summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwenole Beauchesne <gbeauchesne@splitted-desktop.com>2009-11-18 10:32:11 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2009-11-18 11:51:11 +0800
commit29dfeb7e59e86f05e46f4c280c4ba0ae8ac0c85f (patch)
treeb4756801d633e558fe45b0ac7c7cee7962ccfaf8
parent7451873c2061ab068d76926db83d8b15575efcad (diff)
downloadlibva-29dfeb7e59e86f05e46f4c280c4ba0ae8ac0c85f.tar.gz
fix subpicture association and deassociation
-rw-r--r--i965_drv_video/i965_drv_video.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/i965_drv_video/i965_drv_video.c b/i965_drv_video/i965_drv_video.c
index 13bb5f8..1dc424d 100644
--- a/i965_drv_video/i965_drv_video.c
+++ b/i965_drv_video/i965_drv_video.c
@@ -293,6 +293,7 @@ i965_CreateSurfaces(VADriverContextP ctx,
surfaces[i] = surfaceID;
obj_surface->status = VASurfaceReady;
+ obj_surface->subpic = VA_INVALID_ID;
obj_surface->width = width;
obj_surface->height = height;
obj_surface->size = SIZE_YUV420(width, height);
@@ -495,22 +496,18 @@ i965_AssociateSubpicture(VADriverContextP ctx,
unsigned int flags)
{
struct i965_driver_data *i965 = i965_driver_data(ctx);
- VAStatus vaStatus = VA_STATUS_SUCCESS;
- /*only ipicture*/
-
- struct object_surface *obj_surface = SURFACE(*target_surfaces);
struct object_subpic *obj_subpic = SUBPIC(subpicture);
+ int i;
- if (NULL == obj_surface) {
- vaStatus = VA_STATUS_ERROR_INVALID_CONFIG;
- return vaStatus;
- }
-
obj_subpic->dstx = dest_x;
obj_subpic->dsty = dest_y;
- obj_surface->subpic = subpicture;
-
+ for (i = 0; i < num_surfaces; i++) {
+ struct object_surface *obj_surface = SURFACE(target_surfaces[i]);
+ if (!obj_surface)
+ return VA_STATUS_ERROR_INVALID_SURFACE;
+ obj_surface->subpic = subpicture;
+ }
return VA_STATUS_SUCCESS;
}
@@ -521,6 +518,16 @@ i965_DeassociateSubpicture(VADriverContextP ctx,
VASurfaceID *target_surfaces,
int num_surfaces)
{
+ struct i965_driver_data *i965 = i965_driver_data(ctx);
+ int i;
+
+ for (i = 0; i < num_surfaces; i++) {
+ struct object_surface *obj_surface = SURFACE(target_surfaces[i]);
+ if (!obj_surface)
+ return VA_STATUS_ERROR_INVALID_SURFACE;
+ if (obj_surface->subpic == subpicture)
+ obj_surface->subpic = VA_INVALID_ID;
+ }
return VA_STATUS_SUCCESS;
}
@@ -1317,7 +1324,7 @@ i965_PutSurface(VADriverContextP ctx,
srcx, srcy, srcw, srch,
destx, desty, destw, desth);
obj_surface = SURFACE(surface);
- if(obj_surface->subpic != 0) {
+ if(obj_surface->subpic != VA_INVALID_ID) {
i965_render_put_subpic(ctx, surface,
srcx, srcy, srcw, srch,
destx, desty, destw, desth);