FFmpeg
Loading...
Searching...
No Matches
vulkan_decode.h File Reference
#include "codec_id.h"
#include "decode.h"
#include "hwaccel_internal.h"
#include "internal.h"
#include "vulkan_video.h"

Go to the source code of this file.

Data Structures

struct  FFVulkanDecodeDescriptor
 
struct  FFVulkanDecodeShared
 
struct  FFVulkanDecodeContext
 
struct  FFVulkanDecodePicture
 

Functions

int ff_vk_decode_init (AVCodecContext *avctx)
 Initialize decoder.
 
int ff_vk_update_thread_context (AVCodecContext *dst, const AVCodecContext *src)
 Synchronize the contexts between 2 threads.
 
int ff_vk_frame_params (AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
 Initialize hw_frames_ctx with the parameters needed to decode the stream using the parameters from avctx.
 
int ff_vk_params_invalidate (AVCodecContext *avctx, int t, const uint8_t *b, uint32_t s)
 Removes current session parameters to recreate them.
 
int ff_vk_decode_prepare_frame (FFVulkanDecodeContext *dec, AVFrame *pic, FFVulkanDecodePicture *vkpic, int is_current, int alloc_dpb)
 Prepare a frame, creates the image view, and sets up the dpb fields.
 
int ff_vk_decode_add_slice (AVCodecContext *avctx, FFVulkanDecodePicture *vp, const uint8_t *data, size_t size, int add_startcode, uint32_t *nb_slices, const uint32_t **offsets)
 Add slice data to frame.
 
int ff_vk_decode_frame (AVCodecContext *avctx, AVFrame *pic, FFVulkanDecodePicture *vp, AVFrame *rpic[], FFVulkanDecodePicture *rvkp[])
 Decode a frame.
 
void ff_vk_decode_free_frame (AVHWDeviceContext *dev_ctx, FFVulkanDecodePicture *vp)
 Free a frame and its state.
 
int ff_vk_decode_create_params (VkVideoSessionParametersKHR **par_ref, void *logctx, FFVulkanDecodeShared *ctx, const VkVideoSessionParametersCreateInfoKHR *session_params_create)
 Create VkVideoSessionParametersKHR wrapped in an AVBufferRef.
 
int ff_vk_decode_uninit (AVCodecContext *avctx)
 Free decoder.
 

Function Documentation

◆ ff_vk_decode_init()

int ff_vk_decode_init ( AVCodecContext * avctx)

◆ ff_vk_update_thread_context()

int ff_vk_update_thread_context ( AVCodecContext * dst,
const AVCodecContext * src )

Synchronize the contexts between 2 threads.

Definition at line 142 of file vulkan_decode.c.

◆ ff_vk_frame_params()

int ff_vk_frame_params ( AVCodecContext * avctx,
AVBufferRef * hw_frames_ctx )

Initialize hw_frames_ctx with the parameters needed to decode the stream using the parameters from avctx.

NOTE: if avctx->internal->hwaccel_priv_data exists, will partially initialize the context.

Definition at line 1083 of file vulkan_decode.c.

◆ ff_vk_params_invalidate()

int ff_vk_params_invalidate ( AVCodecContext * avctx,
int t,
const uint8_t * b,
uint32_t s )

Removes current session parameters to recreate them.

Definition at line 157 of file vulkan_decode.c.

◆ ff_vk_decode_prepare_frame()

int ff_vk_decode_prepare_frame ( FFVulkanDecodeContext * dec,
AVFrame * pic,
FFVulkanDecodePicture * vkpic,
int is_current,
int alloc_dpb )

Prepare a frame, creates the image view, and sets up the dpb fields.

Definition at line 191 of file vulkan_decode.c.

Referenced by vk_av1_fill_pict(), vk_h264_fill_pict(), vk_hevc_fill_pict(), and vk_vp9_fill_pict().

◆ ff_vk_decode_add_slice()

int ff_vk_decode_add_slice ( AVCodecContext * avctx,
FFVulkanDecodePicture * vp,
const uint8_t * data,
size_t size,
int add_startcode,
uint32_t * nb_slices,
const uint32_t ** offsets )

◆ ff_vk_decode_frame()

int ff_vk_decode_frame ( AVCodecContext * avctx,
AVFrame * pic,
FFVulkanDecodePicture * vp,
AVFrame * rpic[],
FFVulkanDecodePicture * rvkp[] )

Decode a frame.

Definition at line 442 of file vulkan_decode.c.

Referenced by vk_av1_end_frame(), vk_h264_end_frame(), vk_hevc_end_frame(), and vk_vp9_end_frame().

◆ ff_vk_decode_free_frame()

◆ ff_vk_decode_create_params()

int ff_vk_decode_create_params ( VkVideoSessionParametersKHR ** par_ref,
void * logctx,
FFVulkanDecodeShared * ctx,
const VkVideoSessionParametersCreateInfoKHR * session_params_create )

Create VkVideoSessionParametersKHR wrapped in an AVBufferRef.

Definition at line 1194 of file vulkan_decode.c.

Referenced by vk_av1_create_params(), vk_h264_create_params(), and vk_hevc_create_params().

◆ ff_vk_decode_uninit()

int ff_vk_decode_uninit ( AVCodecContext * avctx)

Free decoder.

Definition at line 1220 of file vulkan_decode.c.

Referenced by ff_vk_decode_init().