mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 04:20:08 +01:00
frontends/va: add ability for encoder to output statistics
Signed-off-by: Thong Thai <thong.thai@amd.com> Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19512>
This commit is contained in:
parent
022d03013a
commit
2d1bd619df
1 changed files with 25 additions and 0 deletions
|
|
@ -686,6 +686,27 @@ handleVAEncPackedHeaderDataBufferType(vlVaContext *context, vlVaBuffer *buf)
|
|||
return status;
|
||||
}
|
||||
|
||||
static VAStatus
|
||||
handleVAStatsStatisticsBufferType(VADriverContextP ctx, vlVaContext *context, vlVaBuffer *buf)
|
||||
{
|
||||
if (context->decoder->entrypoint != PIPE_VIDEO_ENTRYPOINT_ENCODE)
|
||||
return VA_STATUS_ERROR_UNIMPLEMENTED;
|
||||
|
||||
vlVaDriver *drv;
|
||||
drv = VL_VA_DRIVER(ctx);
|
||||
|
||||
if (!drv)
|
||||
return VA_STATUS_ERROR_INVALID_CONTEXT;
|
||||
|
||||
if (!buf->derived_surface.resource)
|
||||
buf->derived_surface.resource = pipe_buffer_create(drv->pipe->screen, PIPE_BIND_VERTEX_BUFFER,
|
||||
PIPE_USAGE_STREAM, buf->size);
|
||||
|
||||
context->target->associated_data = buf->derived_surface.resource;
|
||||
|
||||
return VA_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
VAStatus
|
||||
vlVaRenderPicture(VADriverContextP ctx, VAContextID context_id, VABufferID *buffers, int num_buffers)
|
||||
{
|
||||
|
|
@ -781,6 +802,10 @@ vlVaRenderPicture(VADriverContextP ctx, VAContextID context_id, VABufferID *buff
|
|||
handleVAEncPackedHeaderDataBufferType(context, buf);
|
||||
break;
|
||||
|
||||
case VAStatsStatisticsBufferType:
|
||||
handleVAStatsStatisticsBufferType(ctx, context, buf);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue