summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/va/context.c
diff options
context:
space:
mode:
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);