summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/va/context.c
diff options
context:
space:
mode:
authorBoyuan Zhang <[email protected]>2015-10-23 13:37:48 -0400
committerLeo Liu <[email protected]>2015-10-27 19:09:55 -0400
commitad2752e94b535dbcf01829464431ce242068de53 (patch)
tree5c9ab18610286617550c268b7a0a7279d99c33d9 /src/gallium/state_trackers/va/context.c
parent38c3d7cfc42f00c47f720ab293ad88b9a0f637f2 (diff)
st/va: add VAAPI HEVC decode support
Signed-off-by: Boyuan Zhang <[email protected]> Reviewed-by: Christian König <[email protected]> Reviewed-by: Leo Liu <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/va/context.c')
-rw-r--r--src/gallium/state_trackers/va/context.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c
index 8b003aedaec..5adbe768532 100644
--- a/src/gallium/state_trackers/va/context.c
+++ b/src/gallium/state_trackers/va/context.c
@@ -194,6 +194,21 @@ vlVaCreateContext(VADriverContextP ctx, VAConfigID config_id, int picture_width,
}
}
+ if (u_reduce_video_profile(context->decoder->profile) ==
+ PIPE_VIDEO_FORMAT_HEVC) {
+ context->desc.h265.pps = CALLOC_STRUCT(pipe_h265_pps);
+ if (!context->desc.h265.pps) {
+ FREE(context);
+ return VA_STATUS_ERROR_ALLOCATION_FAILED;
+ }
+ context->desc.h265.pps->sps = CALLOC_STRUCT(pipe_h265_sps);
+ if (!context->desc.h265.pps->sps) {
+ FREE(context->desc.h265.pps);
+ FREE(context);
+ return VA_STATUS_ERROR_ALLOCATION_FAILED;
+ }
+ }
+
context->desc.base.profile = config_id;
*context_id = handle_table_add(drv->htab, context);
@@ -216,6 +231,11 @@ vlVaDestroyContext(VADriverContextP ctx, VAContextID context_id)
FREE(context->desc.h264.pps->sps);
FREE(context->desc.h264.pps);
}
+ if (u_reduce_video_profile(context->decoder->profile) ==
+ PIPE_VIDEO_FORMAT_HEVC) {
+ FREE(context->desc.h265.pps->sps);
+ FREE(context->desc.h265.pps);
+ }
context->decoder->destroy(context->decoder);
FREE(context);
handle_table_remove(drv->htab, context_id);