From 3f07c8c3212901b8d5a7f6a2d7f8d4e1e44b5957 Mon Sep 17 00:00:00 2001 From: Sil Vilerino Date: Fri, 17 Nov 2023 23:53:46 -0500 Subject: [PATCH] pipe: Add p_video_codec.get_encode_headers for out of band VPS, SPS, PPS Reviewed-by: Ruijing Dong Reviewed-by: Jesse Natalie Part-of: --- src/gallium/include/pipe/p_video_codec.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/gallium/include/pipe/p_video_codec.h b/src/gallium/include/pipe/p_video_codec.h index c3cefcf848d..c94c699e298 100644 --- a/src/gallium/include/pipe/p_video_codec.h +++ b/src/gallium/include/pipe/p_video_codec.h @@ -182,6 +182,22 @@ struct pipe_video_codec void (*update_decoder_target)(struct pipe_video_codec *codec, struct pipe_video_buffer *old, struct pipe_video_buffer *updated); + + /** + * Gets the bitstream headers for a given pipe_picture_desc + * of an encode operation + * + * User passes a buffer and its allocated size and + * driver writes the bitstream headers in the buffer, + * updating the size parameter as well. + * + * Returns 0 on success or an errno error code otherwise. + * such as ENOMEM if the buffer passed was not big enough + */ + int (*get_encode_headers)(struct pipe_video_codec *codec, + struct pipe_picture_desc *picture, + void* bitstream_buf, + unsigned *size); }; /**