From ba1bc7c4955ff37c4b54511c33c4a1cad51d779e Mon Sep 17 00:00:00 2001 From: David Rosca Date: Wed, 24 Jul 2024 09:58:02 +0200 Subject: [PATCH] frontends/va: Don't check header type for packed header buffers Applications should not send types that were not enabled when creating config and even if they do it will not cause any unexpected issues. Remove the checks as it is another place that would need to be updated when adding support for new packed header types. Reviewed-By: Sil Vilerino Reviewed-by: Ruijing Dong Part-of: --- src/gallium/frontends/va/picture.c | 31 ++---------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/src/gallium/frontends/va/picture.c b/src/gallium/frontends/va/picture.c index 6951a88ec5d..0a3795a45b7 100644 --- a/src/gallium/frontends/va/picture.c +++ b/src/gallium/frontends/va/picture.c @@ -903,33 +903,12 @@ handleVAEncSliceParameterBufferType(vlVaDriver *drv, vlVaContext *context, vlVaB static VAStatus handleVAEncPackedHeaderParameterBufferType(vlVaContext *context, vlVaBuffer *buf) { - VAStatus status = VA_STATUS_SUCCESS; VAEncPackedHeaderParameterBuffer *param = buf->data; context->packed_header_emulation_bytes = param->has_emulation_bytes; + context->packed_header_type = param->type; - switch (u_reduce_video_profile(context->templat.profile)) { - case PIPE_VIDEO_FORMAT_MPEG4_AVC: - if (param->type == VAEncPackedHeaderSequence) - context->packed_header_type = param->type; - else - status = VA_STATUS_ERROR_UNIMPLEMENTED; - break; - case PIPE_VIDEO_FORMAT_HEVC: - if (param->type == VAEncPackedHeaderSequence) - context->packed_header_type = param->type; - else - status = VA_STATUS_ERROR_UNIMPLEMENTED; - break; - case PIPE_VIDEO_FORMAT_AV1: - context->packed_header_type = param->type; - break; - - default: - return VA_STATUS_ERROR_UNIMPLEMENTED; - } - - return status; + return VA_STATUS_SUCCESS; } static VAStatus @@ -939,16 +918,10 @@ handleVAEncPackedHeaderDataBufferType(vlVaContext *context, vlVaBuffer *buf) switch (u_reduce_video_profile(context->templat.profile)) { case PIPE_VIDEO_FORMAT_MPEG4_AVC: - if (context->packed_header_type != VAEncPackedHeaderSequence) - return VA_STATUS_ERROR_UNIMPLEMENTED; - status = vlVaHandleVAEncPackedHeaderDataBufferTypeH264(context, buf); break; case PIPE_VIDEO_FORMAT_HEVC: - if (context->packed_header_type != VAEncPackedHeaderSequence) - return VA_STATUS_ERROR_UNIMPLEMENTED; - status = vlVaHandleVAEncPackedHeaderDataBufferTypeHEVC(context, buf); break;